Apply spellchecking to the instance name field

This commit is contained in:
tsommer committed 2024-06-01 20:00:17 +02:00
1 parent f7d0cfa102
commit db3379b4eb
2 files changed
+6

No files matched your search

@@ -14,6 +14,7 @@
AdornmentIcon="@Icons.Material.Filled.Lightbulb"
AdornmentColor="Color.Info"
Validation="@this.ValidatingInstanceName"
UserAttributes="@INSTANCE_NAME_ATTRIBUTES"
/>
@* ReSharper disable once CSharpWarnings::CS8974 *@
@@ -56,6 +56,8 @@ public partial class ProviderDialog : ComponentBase
[Inject]
private IJSRuntime JsRuntime { get; set; } = null!;
private static readonly Dictionary<string, object?> INSTANCE_NAME_ATTRIBUTES = new();
/// <summary>
/// The list of used instance names. We need this to check for uniqueness.
/// </summary>
@@ -76,6 +78,9 @@ public partial class ProviderDialog : ComponentBase
protected override async Task OnInitializedAsync()
{
// Configure the spellchecking for the instance name input:
this.SettingsManager.InjectSpellchecking(INSTANCE_NAME_ATTRIBUTES);
// Load the used instance names:
this.UsedInstanceNames = this.SettingsManager.ConfigurationData.Providers.Select(x => x.InstanceName.ToLowerInvariant()).ToList();