From 479139a5b30bf525eaebc8a8e90327ea1b8213cc Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 20 Feb 2026 12:18:56 +0100 Subject: [PATCH] Lock individual items for better UX --- .../Components/ConfigurationMultiSelect.razor | 18 ++++++++++++++++-- .../ConfigurationMultiSelect.razor.cs | 14 ++++++++++++++ .../Components/Settings/SettingsPanelApp.razor | 2 +- .../Settings/SettingsPanelApp.razor.cs | 11 +++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor b/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor index 6d9d7b89..069ab067 100644 --- a/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor +++ b/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor @@ -14,8 +14,22 @@ SelectedValuesChanged="@this.OptionChanged"> @foreach (var data in this.Data) { - - @data.Name + var isLockedValue = this.IsLockedValue(data.Value); + + @if (isLockedValue) + { + + @* MudTooltip.RootStyle is set as a workaround for issue -> https://github.com/MudBlazor/MudBlazor/issues/10882 *@ + + + + @data.Name + + } + else + { + @data.Name + } } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor.cs b/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor.cs index 1c5df8b8..e924b4fd 100644 --- a/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor.cs +++ b/app/MindWork AI Studio/Components/ConfigurationMultiSelect.razor.cs @@ -27,6 +27,12 @@ public partial class ConfigurationMultiSelect : ConfigurationBaseCore /// [Parameter] public Action> SelectionUpdate { get; set; } = _ => { }; + + /// + /// Determines whether a specific item is locked by a configuration plugin. + /// + [Parameter] + public Func IsItemLocked { get; set; } = _ => false; #region Overrides of ConfigurationBase @@ -62,4 +68,12 @@ public partial class ConfigurationMultiSelect : ConfigurationBaseCore return string.Format(T("You have selected {0} preview features."), selectedValues.Count); } + + private bool IsLockedValue(TData value) => this.IsItemLocked(value); + + private string LockedTooltip() => + this.T( + "This feature is managed by your organization and has therefore been disabled.", + typeof(ConfigurationBase).Namespace, + nameof(ConfigurationBase)); } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor index 373ae70e..cbc33d79 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor @@ -25,7 +25,7 @@ var availablePreviewFeatures = ConfigurationSelectDataFactory.GetPreviewFeaturesData(this.SettingsManager).ToList(); if (availablePreviewFeatures.Count > 0) { - + } } diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs index d0166e40..70b6d24a 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs @@ -40,6 +40,17 @@ public partial class SettingsPanelApp : SettingsPanelBase return []; } + private bool IsPluginContributedPreviewFeature(PreviewFeatures feature) + { + if (feature.IsReleased()) + return false; + + if (!ManagedConfiguration.TryGet(x => x.App, x => x.EnabledPreviewFeatures, out var meta) || !meta.HasPluginContribution) + return false; + + return meta.PluginContribution.Contains(feature); + } + private HashSet GetSelectedPreviewFeatures() { var enabled = this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures.Where(x => !x.IsReleased()).ToHashSet();