From 2c3ae61e099736fb431f24edc9c442bf9ac1cb39 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 18 Jan 2024 00:22:31 +0330 Subject: [PATCH] Add support for EffectiveVariableName --- ...services.UI.TemplateGenerator.Blazor.csproj | 2 +- .../Pages/Actions/AddOrUpdateEventAction.razor | 2 ++ .../Pages/Actions/EventActionsList.razor | 2 -- .../FilterNoParentFormItemsList.razor | 18 ++++++++++-------- ...ices.UI.TemplateGenerator.ViewModels.csproj | 4 ++-- .../Actions/AddOrUpdateEventActionViewModel.cs | 13 +++++++++++++ 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj index db0ac5d..a1a70e4 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.csproj @@ -4,7 +4,7 @@ net6.0;net7.0;net8.0 EasyMicroservices true - 0.0.0.31 + 0.0.0.32 TemplateGenerator UI compoents. EasyMicroservices@gmail.com component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/AddOrUpdateEventAction.razor b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/AddOrUpdateEventAction.razor index 0b8efb9..eb39e9b 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/AddOrUpdateEventAction.razor +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/AddOrUpdateEventAction.razor @@ -12,6 +12,8 @@ + diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/EventActionsList.razor b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/EventActionsList.razor index 9e98821..4484a19 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/EventActionsList.razor +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Actions/EventActionsList.razor @@ -94,12 +94,10 @@ return Task.FromResult((MessageContract)true); }, async () => { - Console.WriteLine($"{item.ActionId}-{item.FormItemId}"); var actions = await AddOrUpdateEventActionView.ActionsView.ViewModel.OnGetActionsComplete(); AddOrUpdateEventActionView.ViewModel.SelectedAction = actions.FirstOrDefault(x => x.Id == item.ActionId); var formItems = await AddOrUpdateEventActionView.FormItemsView.ViewModel.OnGetFormItemsComplete(); AddOrUpdateEventActionView.ViewModel.SelectedFormItem = formItems.FirstOrDefault(x => x.Id == item.FormItemId); - Console.WriteLine($"Selected: {AddOrUpdateEventActionView.ViewModel.SelectedAction?.Id}-{AddOrUpdateEventActionView.ViewModel.SelectedFormItem?.Id}"); AddOrUpdateEventActionView.ViewModel.SelectForUpdate(item); StateHasChanged(); }); diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/NoParentFormItems/FilterNoParentFormItemsList.razor b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/NoParentFormItems/FilterNoParentFormItemsList.razor index 4150211..19019de 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/NoParentFormItems/FilterNoParentFormItemsList.razor +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/NoParentFormItems/FilterNoParentFormItemsList.razor @@ -19,14 +19,16 @@ - @viewModel.GetInnerTranslatedByKey("NoParentFormItems") - + + @viewModel.GetInnerTranslatedByKey("NoParentFormItems") + + - - - - @if (viewModel.IsBusy) + + + + @if (viewModel.IsBusy) { @viewModel.GetInnerTranslatedByKey("Processing") @@ -50,7 +52,7 @@ } else { - + } diff --git a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj index 31bc5a7..9e2d1d8 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj +++ b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/EasyMicroservices.UI.TemplateGenerator.ViewModels.csproj @@ -4,7 +4,7 @@ net6.0;net7.0;net8.0 EasyMicroservices true - 0.0.0.31 + 0.0.0.32 TemplateGenerator view model. EasyMicroservices@gmail.com component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator @@ -19,7 +19,7 @@ - + diff --git a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs index 66a8dd2..88bbba8 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Actions/AddOrUpdateEventActionViewModel.cs @@ -13,6 +13,17 @@ public AddOrUpdateEventActionViewModel() public EventActionsListViewModel EventActionsListViewModel { get; set; } + string _EffectiveVariableName; + public string EffectiveVariableName + { + get => _EffectiveVariableName; + set + { + _EffectiveVariableName = value; + OnPropertyChanged(nameof(EffectiveVariableName)); + } + } + ActionContract _SelectedAction; public ActionContract SelectedAction { @@ -70,6 +81,7 @@ public void Clear() public void SelectForUpdate(FormItemEventActionContract update) { + EffectiveVariableName = update?.InfluencedToVariableName; EventActionsListViewModel.Children.Clear(); foreach (var item in update.Children) { @@ -92,6 +104,7 @@ public FormItemEventActionContract GetEventAction() Action = SelectedAction, ActionId = SelectedAction.Id, FormItemId = SelectedFormItem?.Id, + InfluencedToVariableName = EffectiveVariableName, Children = EventActionsListViewModel.Children.ToList(), }; }