Skip to content

Commit

Permalink
Merge pull request #7 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
Ali-YousefiTelori authored Dec 28, 2023
2 parents 245015b + 939420f commit c336ff4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
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,6 +103,13 @@ T GetCurrentProperty<T>(Func<FormContract, T> 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()

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.

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 / build-test-prep-push

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 / build-test-prep-push

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

0 comments on commit c336ff4

Please sign in to comment.