Skip to content

Commit

Permalink
add ActiveUserSession
Browse files Browse the repository at this point in the history
  • Loading branch information
neozhu committed Nov 14, 2024
1 parent 787a446 commit 676b0bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Templatemap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private static string createMudTdHeaderDefinition(IntellisenseObject classObject
output.Append($" <div class=\"d-flex flex-column\">\r\n");
if (classObject.Properties.Where(x => x.Type.IsKnownType == true && x.Name == defaultfieldName.First()).Any())
{
output.Append($" <MudText Typo=\"Typo.body2\">@context.Item.Name</MudText>\r\n");
output.Append($" <MudText Typo=\"Typo.body1\">@context.Item.Name</MudText>\r\n");
}
if (classObject.Properties.Where(x => x.Type.IsKnownType == true && x.Name == defaultfieldName.Last()).Any())
{
Expand Down Expand Up @@ -526,7 +526,7 @@ private static string createMudFormFieldDefinition(IntellisenseObject classObjec
case "string" when property.Name.Equals("Description", StringComparison.OrdinalIgnoreCase):
output.Append($"<MudItem xs=\"12\" md=\"6\"> \r\n");
output.Append(" ");
output.Append($" <MudTextField Label=\"@L[model.GetMemberDescription(x=>x.{property.Name})]\" Lines=\"3\" For=\"@(() => model.{property.Name})\" @bind-Value=\"model.{property.Name}\"></MudTextField>\r\n");
output.Append($" <MudTextField Label=\"@L[model.GetMemberDescription(x=>x.{property.Name})]\" For=\"@(() => model.{property.Name})\" @bind-Value=\"model.{property.Name}\"></MudTextField>\r\n");
output.Append(" ");
output.Append($"</MudItem> \r\n");
break;
Expand Down
3 changes: 3 additions & 0 deletions src/Templates/Pages/.edit.razor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@using CleanArchitecture.Blazor.Application.Features.{nameofPlural}.Commands.Update
@using CleanArchitecture.Blazor.Application.Features.{nameofPlural}.Mappers
@using CleanArchitecture.Blazor.Application.Features.{nameofPlural}.Queries.GetById
@using CleanArchitecture.Blazor.Server.UI.Components.Fusion

@inherits MudComponentBase
@inject IValidationService Validator
@inject IStringLocalizer<{nameofPlural}> L
Expand All @@ -18,6 +20,7 @@
</CardHeaderContent>
</MudCardHeader>
<MudCardContent>
<ActiveUserSession PageComponent="@($"{nameof(Edit{itemname})}/{ model.Id }")" />
<MudForm Model="@model" @ref="@_form" Validation="@(Validator.ValidateValue(model))">
<MudGrid Spacing="2">
{mudFormFieldDefinition}
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/Pages/.razor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<MudStack Row AlignItems="AlignItems.Start">
<MudIcon Icon="@Icons.Material.Filled.Window" Size="Size.Large" />
<MudStack Spacing="0">
<MudText Typo="Typo.caption" Class="mb-2">@Title</MudText>
<MudText Typo="Typo.subtitle2" Class="mb-2">@Title</MudText>
<MudEnumSelect Style="min-width:120px" TEnum="{itemname}ListView" ValueChanged="OnChangedListView" Value="Query.ListView" Dense="true" Label="@L["List View"]">
</MudEnumSelect>
</MudStack>
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/Pages/Components/.formdialog.razor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
private bool _saving = false;
private bool _savingnew = false;
[CascadingParameter]
MudDialogInstance MudDialog { get; set; } = default!;
IMudDialogInstance MudDialog { get; set; } = default!;
AddEdit{itemname}CommandValidator _modelValidator = new ();
[EditorRequired] [Parameter] public AddEdit{itemname}Command model { get; set; } = null!;
async Task Submit()
Expand Down

0 comments on commit 676b0bd

Please sign in to comment.