CompanyCardComponent fixes
This commit is contained in:
parent
e006509e5c
commit
b98bbc18be
|
|
@ -33,8 +33,8 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-6">
|
<div class="col-12 col-md-6">
|
||||||
<h4>Information</h4>
|
<h4>Information</h4>
|
||||||
@RenderDetailsItem("fa-solid fa-user", "Contact Name", companyProfile.FullName)
|
@RenderDetailsItem("fa-solid fa-user", "Contact Name", Company.Profile.Name)
|
||||||
@RenderDetailsItem("fa-solid fa-circle-info", "Description", companyProfile.Description)
|
@RenderDetailsItem("fa-solid fa-circle-info", "Description", Company.Profile.Description ?? string.Empty)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-md-6">
|
<div class="col-12 col-md-6">
|
||||||
|
|
@ -65,23 +65,23 @@
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>@msg</p>
|
<p>@_msg</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Parameter] public Company Company { get; set; }
|
[Parameter] public required Company Company { get; set; }
|
||||||
|
|
||||||
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
[Parameter] public EventCallback<string> DataChanged { get; set; }
|
||||||
|
|
||||||
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
AccordionExpandMode ExpandMode { get; set; } = AccordionExpandMode.SingleOrNone;
|
||||||
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
||||||
|
|
||||||
string msg;
|
string _msg;
|
||||||
private bool isSaveActive = false;
|
private bool _isSaveActive = false;
|
||||||
|
|
||||||
private Profile companyProfile = new Profile();
|
//private Profile _companyProfile = new Profile();
|
||||||
|
|
||||||
void OnPasswordConfirmed(string password)
|
void OnPasswordConfirmed(string password)
|
||||||
{
|
{
|
||||||
|
|
@ -92,21 +92,23 @@
|
||||||
protected async Task ChangeName()
|
protected async Task ChangeName()
|
||||||
{
|
{
|
||||||
|
|
||||||
isSaveActive = false;
|
_isSaveActive = false;
|
||||||
|
|
||||||
|
|
||||||
await DataChanged.InvokeAsync(msg);
|
await DataChanged.InvokeAsync(_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
var CompanyProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Company.ProfileId);
|
//_companyProfile = Company.Profile;
|
||||||
if (CompanyProfiles != null)
|
// var companyProfiles = await AdminSignalRClient.GetByIdAsync<List<Profile>>(SignalRTags.GetProfileById, Company.ProfileId);
|
||||||
{
|
// if (companyProfiles != null)
|
||||||
companyProfile = CompanyProfiles[0];
|
// {
|
||||||
}
|
// _companyProfile = companyProfiles[0];
|
||||||
|
// }
|
||||||
|
|
||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Parameter] public Guid Id { get; set; }
|
[Parameter] public required Guid Id { get; set; }
|
||||||
bool _isUserLoggedIn;
|
|
||||||
int _userType = 0;
|
// bool _isUserLoggedIn;
|
||||||
|
// int _userType = 0;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
//check if Id matches with userproductmapping
|
|
||||||
if (!_sessionService.IsAuthenticated) return;
|
if (!_sessionService.IsAuthenticated) return;
|
||||||
|
|
||||||
var check = _sessionService.User?.UserModelDto.UserProductMappings.Any(x => x.ProductId == Id) ?? false;
|
var check = _sessionService.User?.UserModelDto.UserProductMappings.Any(x => x.ProductId == Id) ?? false;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
ExpandCollapseAction="ExpandCollapseAction"
|
ExpandCollapseAction="ExpandCollapseAction"
|
||||||
AnimationType="LayoutAnimationType.Slide">
|
AnimationType="LayoutAnimationType.Slide">
|
||||||
<Items>
|
<Items>
|
||||||
@foreach (var company in companies)
|
@foreach (var company in _companies)
|
||||||
{
|
{
|
||||||
|
|
||||||
<DxAccordionItem CssClass="" Text=@($"{company.Name}")>
|
<DxAccordionItem CssClass="" Text=@($"{company.Name}")>
|
||||||
|
|
@ -112,14 +112,14 @@
|
||||||
private LoggerClient<MyServiceProviders> _logger = null!;
|
private LoggerClient<MyServiceProviders> _logger = null!;
|
||||||
|
|
||||||
private CompanyGrid _gridCompany = null!;
|
private CompanyGrid _gridCompany = null!;
|
||||||
private List<Company> companies = [];
|
private List<Company> _companies = [];
|
||||||
public List<Company> Companies = [];
|
//public List<Company> Companies = [];
|
||||||
public ServiceProviderWizardModel MyModel = new ServiceProviderWizardModel();
|
public ServiceProviderWizardModel MyModel = new();
|
||||||
|
|
||||||
bool EulaAccepted { get; set; }
|
bool EulaAccepted { get; set; }
|
||||||
bool EulaVisible { get; set; }
|
bool EulaVisible { get; set; }
|
||||||
|
|
||||||
private Guid[] _contextIds = new Guid[0];
|
private readonly Guid[] _contextIds = new Guid[1];
|
||||||
|
|
||||||
void CancelCreateClick()
|
void CancelCreateClick()
|
||||||
{
|
{
|
||||||
|
|
@ -147,33 +147,33 @@
|
||||||
|
|
||||||
void Grid_CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
void Grid_CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.IsNew)
|
if (!e.IsNew) return;
|
||||||
{
|
|
||||||
var newEmployee = (Company)e.EditModel;
|
var newEmployee = (Company)e.EditModel;
|
||||||
newEmployee.Name = "Add a company name";
|
newEmployee.Name = "Add a company name";
|
||||||
newEmployee.OwnerId = SessionService.User!.UserId;
|
newEmployee.OwnerId = SessionService.User!.UserId;
|
||||||
newEmployee.AffiliateId = Guid.NewGuid();
|
newEmployee.AffiliateId = Guid.NewGuid();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
await base.OnInitializedAsync();
|
|
||||||
_logger = new LoggerClient<MyServiceProviders>(LogWriters.ToArray());
|
_logger = new LoggerClient<MyServiceProviders>(LogWriters.ToArray());
|
||||||
var myId = SessionService.User!.UserId;
|
|
||||||
|
|
||||||
_logger.Debug(companies.Count.ToString());
|
var userId = SessionService.User!.UserId;
|
||||||
_contextIds = new Guid[1];
|
_contextIds[0] = userId;
|
||||||
_contextIds[0] = myId;
|
|
||||||
var result = await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesByContextId, myId);
|
_companies = (await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesByContextId, userId))!;
|
||||||
|
|
||||||
|
_logger.Debug($"companies.Count: {_companies.Count}");
|
||||||
|
|
||||||
//await AdminSignalRClient.GetAllIntoAsync<Company>(Companies, SignalRTags.GetCompaniesByContextId, new object[] { myId });
|
//await AdminSignalRClient.GetAllIntoAsync<Company>(Companies, SignalRTags.GetCompaniesByContextId, new object[] { myId });
|
||||||
companies = result;
|
//companies = result;
|
||||||
// ServiceProviderDataService.GetPropertiesByOwnerIdAsync(myId, companyPropertiesByOwner =>
|
// ServiceProviderDataService.GetPropertiesByOwnerIdAsync(myId, companyPropertiesByOwner =>
|
||||||
// {
|
// {
|
||||||
// _logger.DetailConditional($"companyPropertiesByOwner count: {companyPropertiesByOwner?.Count.ToString() ?? "NULL"}");
|
// _logger.DetailConditional($"companyPropertiesByOwner count: {companyPropertiesByOwner?.Count.ToString() ?? "NULL"}");
|
||||||
// }).Forget();
|
// }).Forget();
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColumnChooserButton_Click()
|
void ColumnChooserButton_Click()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue