From c9b9f70b81c22caa1cdddd7eadad1fb30eb11164 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 28 Dec 2023 19:34:27 +0330 Subject: [PATCH 1/2] fix bug --- .../Program.cs | 6 ++++-- .../EasyMicroservices.UI.TemplateGenerator.Blazor.csproj | 2 +- .../Pages/Forms/AddOrUpdateForm.razor | 2 +- ...syMicroservices.UI.TemplateGenerator.ViewModels.csproj | 2 +- .../ViewModels/Forms/AddOrUpdateFormViewModel.cs | 8 ++++++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs index f1d9d1e..5541de9 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs @@ -16,10 +16,12 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); +//string baseAddress = "http://localhost:1050"; +string baseAddress = "http://templategenerator.adahmsay.ir"; builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -builder.Services.AddScoped(sp => new FormClient("http://localhost:1050", sp.GetService())); -builder.Services.AddScoped(sp => new NoParentFormItemClient("http://localhost:1050", sp.GetService())); +builder.Services.AddScoped(sp => new FormClient(baseAddress, sp.GetService())); +builder.Services.AddScoped(sp => new NoParentFormItemClient(baseAddress, sp.GetService())); builder.Services.AddTransient(); builder.Services.AddTransient(); 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 4ebf3ae..18cec40 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 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 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/Forms/AddOrUpdateForm.razor b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor index b174782..44a5666 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor/Pages/Forms/AddOrUpdateForm.razor @@ -24,7 +24,7 @@ - + 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 44ecdec..38514fa 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 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 TemplateGenerator view model. EasyMicroservices@gmail.com component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator diff --git a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs index 31b6510..1fd53e6 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs @@ -2,6 +2,7 @@ using EasyMicroservices.UI.Cores; using EasyMicroservices.UI.Cores.Commands; using System.Collections.ObjectModel; +using System.Text; using System.Windows.Input; using TemplateGenerators.GeneratedServices; @@ -102,6 +103,13 @@ T GetCurrentProperty(Func func) return UpdateFormContract == null ? default : func(UpdateFormContract); } + public string GetTitle(FormItemContract formItemContract) + { + if (formItemContract.Title.IsNullOrEmpty()) + return formItemContract.PrimaryFormItem?.Title ?? GetLanguage("NoName!"); + return formItemContract.Title; + } + public async Task LoadConfig() { From 939420f21ff0c27ddc8983b8a6f151712877996d Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 28 Dec 2023 19:34:41 +0330 Subject: [PATCH 2/2] clean --- .../Program.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs index 5541de9..b8f1093 100644 --- a/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs +++ b/src/CSharp/Blazor/EasyMicroservices.UI.TemplateGenerator.Blazor.TestUI/Program.cs @@ -16,8 +16,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); -//string baseAddress = "http://localhost:1050"; -string baseAddress = "http://templategenerator.adahmsay.ir"; +string baseAddress = "http://localhost:1050"; builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new FormClient(baseAddress, sp.GetService()));