Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazy loading of components #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.24</Version>
<Version>0.0.0.25</Version>
<Description>TemplateGenerator UI compoents.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/FilterNoParentFormItemsList"
@using EasyMicroservices.ServiceContracts
@using EasyMicroservices.UI.BlazorComponents;
@using EasyMicroservices.UI.Cores;
@using EasyMicroservices.UI.TemplateGenerator.Blazor.Pages.FormItems;
Expand All @@ -8,6 +9,7 @@
@using MudBlazor;
@using global::TemplateGenerators.GeneratedServices;
@inject FilterNoParentFormItemsListViewModel viewModel;
@inject NoParentFormItemClient noParentFormItemClient;
@inject IDialogService DialogService
@inject ISnackbar Snackbar

Expand Down Expand Up @@ -41,7 +43,16 @@
<PropertyColumn Property="x => x.Title" Title="@viewModel.GetInnerTranslatedByKey("Title")" />
<TemplateColumn CellClass="d-flex justify-end">
<CellTemplate>
<MudIconButton Size="@Size.Small" Icon="@Icons.Material.Outlined.Edit" OnClick="(arg) => ShowUpdateDialog(context.Item)" />
<MudIconButton Disabled="viewModel.IsBusy" Size="@Size.Small" OnClick="(arg) => ShowUpdateDialog(context.Item)">
@if (viewModel.IsBusy)
{
<MudProgressCircular Class="ms-n1" Size="Size.Small" Indeterminate="true" />
}
else
{
<MudIcon Icon="@Icons.Material.Outlined.Edit"/>
}
</MudIconButton>
<MudIconButton Size="@Size.Small" Icon="@Icons.Material.Outlined.Delete" Color="Color.Error" OnClick="(arg) => ShowDeleteDialog(context.Item)" />
</CellTemplate>
</TemplateColumn>
Expand Down Expand Up @@ -134,8 +145,23 @@

void ShowAddOrUpdateDialog(FormItemContract noParentFormItemContract)
{
addDialog.ShowDialog(() =>
addDialog.ShowDialog(async () =>
{
if (noParentFormItemContract != null)
{
try
{
viewModel.IsBusy = true;
noParentFormItemContract = await noParentFormItemClient.GetByIdAsync(new Int64GetByIdRequestContract()
{
Id = noParentFormItemContract.Id
}).AsCheckedResult(x => x.Result);
}
finally
{
viewModel.IsBusy = false;
}
}
var vm = addOrUpdateFormItemView.ViewModel;
vm.SaveCommand = new TaskRelayCommand(vm, vm.SaveNotParentToService);
vm.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.24</Version>
<Version>0.0.0.25</Version>
<Description>TemplateGenerator view model.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator</PackageTags>
Expand Down
Loading