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>
</RowTemplate>
<RowEditingTemplate>
<MudSelect Label="Role" @bind-Value="context.Role" Required>
@foreach (var role in availableRoles)
<MudTd>
<MudSelect Label="@T("Role")" @bind-Value="@context.Role" Required="true">
@foreach (var role in ChatRoles.ChatTemplateRoles())
{
<MudSelectItem Value="@role">@role.ToChatTemplateName()</MudSelectItem>
}

View File

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