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

fix bug #7

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 @@ -16,10 +16,11 @@
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
string baseAddress = "http://localhost:1050";

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped(sp => new FormClient("http://localhost:1050", sp.GetService<HttpClient>()));
builder.Services.AddScoped(sp => new NoParentFormItemClient("http://localhost:1050", sp.GetService<HttpClient>()));
builder.Services.AddScoped(sp => new FormClient(baseAddress, sp.GetService<HttpClient>()));
builder.Services.AddScoped(sp => new NoParentFormItemClient(baseAddress, sp.GetService<HttpClient>()));

builder.Services.AddTransient<FilterFormsListViewModel>();
builder.Services.AddTransient<AddOrUpdateFormViewModel>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.4</Version>
<Version>0.0.0.5</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
Expand Up @@ -24,7 +24,7 @@
</ToolBarContent>
<Columns>
<PropertyColumn Property="x => x.Index" Title="@viewModel.GetLanguage("Index")" />
<PropertyColumn Property="x => x.Title" Title="@viewModel.GetLanguage("Title")" />
<PropertyColumn Property="x => viewModel.GetTitle(x)" Title="@viewModel.GetLanguage("Title")" />
<PropertyColumn Property="x => x.Type" />
<TemplateColumn CellClass="d-flex justify-end">
<CellTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.4</Version>
<Version>0.0.0.5</Version>
<Description>TemplateGenerator view model.</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
Expand Up @@ -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;

Expand Down Expand Up @@ -102,7 +103,14 @@
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()

Check warning on line 113 in src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs

View workflow job for this annotation

GitHub Actions / os-tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 113 in src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs

View workflow job for this annotation

GitHub Actions / os-tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 113 in src/CSharp/Cores/EasyMicroservices.UI.TemplateGenerator.ViewModels/ViewModels/Forms/AddOrUpdateFormViewModel.cs

View workflow job for this annotation

GitHub Actions / os-tests

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{

}
Expand Down
Loading