Inline availableRoles in ChatTemplateDialog for simplicity

This commit is contained in:
Thorsten Sommer 2025-05-24 18:26:34 +02:00
parent 15e3c56875
commit 93c5db8f98
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 3 additions and 3 deletions

View File

@ -113,8 +113,9 @@
</MudTd> </MudTd>
</RowTemplate> </RowTemplate>
<RowEditingTemplate> <RowEditingTemplate>
<MudSelect Label="Role" @bind-Value="context.Role" Required> <MudTd>
@foreach (var role in availableRoles) <MudSelect Label="@T("Role")" @bind-Value="@context.Role" Required="true">
@foreach (var role in ChatRoles.ChatTemplateRoles())
{ {
<MudSelectItem Value="@role">@role.ToChatTemplateName()</MudSelectItem> <MudSelectItem Value="@role">@role.ToChatTemplateName()</MudSelectItem>
} }

View File

@ -63,7 +63,6 @@ public partial class ChatTemplateDialog : MSGComponentBase
private bool isInlineEditOnGoing; private bool isInlineEditOnGoing;
private ContentBlock messageEntryBeforeEdit; private ContentBlock messageEntryBeforeEdit;
private readonly IEnumerable<ChatRole> availableRoles = ChatRoles.ChatTemplateRoles().ToArray();
// We get the form reference from Blazor code to validate it manually: // We get the form reference from Blazor code to validate it manually:
private MudForm form = null!; private MudForm form = null!;