Skip to content

Commit

Permalink
Merge pull request #6 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
fix get title when its empty
  • Loading branch information
Ali-YousefiTelori authored Dec 28, 2023
2 parents 9ab8c7f + 21ec9a5 commit 245015b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
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.3</Version>
<Version>0.0.0.4</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 @@ -38,7 +38,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.3</Version>
<Version>0.0.0.4</Version>
<Description>TemplateGenerator view model.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core,templategenerator,generator,template,form,formgenerator</PackageTags>
Expand All @@ -21,6 +21,7 @@
<ItemGroup>
<PackageReference Include="EasyMicroservices.TemplateGeneratorMicroservice.Clients" Version="0.0.0.18" />
<PackageReference Include="EasyMicroservices.UI.Cores.Mvvm" Version="0.0.0.13" />
<PackageReference Include="EasyMicroservices.Utilities" Version="0.0.0.13" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using EasyMicroservices.UI.Cores;
using EasyMicroservices.UI.Cores.Commands;
using System.Collections.ObjectModel;
using System.Text;
using System.Text.Json;
using System.Windows.Input;
using TemplateGenerators.GeneratedServices;
Expand Down Expand Up @@ -112,6 +113,13 @@ public string DefaultValue
}
}

public string GetTitle(FormItemContract formItemContract)
{
if (formItemContract.Title.IsNullOrEmpty())
return formItemContract.PrimaryFormItem?.Title ?? GetLanguage("NoName!");
return formItemContract.Title;
}

FormItemContract GetContract()
{
return new FormItemContract()
Expand Down

0 comments on commit 245015b

Please sign in to comment.