Added enterprise settings to hide vision and changelog

This commit is contained in:
Dominic Neuburg 2026-07-14 20:48:21 +02:00
parent 5dc6282908
commit 92cbc14b6d
6 changed files with 58 additions and 12 deletions

View File

@ -39,14 +39,20 @@
</ExpansionPanel>
}
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.EventNote" HeaderText="@T("Last Changelog")" IsExpanded="@this.IsPanelExpanded(PANEL_ID_LAST_CHANGELOG)" ExpandedChanged="@(isExpanded => this.SetPanelExpanded(PANEL_ID_LAST_CHANGELOG, isExpanded))">
<MudMarkdown Value="@this.LastChangeContent" Props="Markdown.DefaultConfig" MarkdownPipeline="Markdown.SAFE_MARKDOWN_PIPELINE"/>
</ExpansionPanel>
@if (this.SettingsManager.ConfigurationData.App.ShowLastChangelog)
{
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.EventNote" HeaderText="@T("Last Changelog")" IsExpanded="@this.IsPanelExpanded(PANEL_ID_LAST_CHANGELOG)" ExpandedChanged="@(isExpanded => this.SetPanelExpanded(PANEL_ID_LAST_CHANGELOG, isExpanded))">
<MudMarkdown Value="@this.LastChangeContent" Props="Markdown.DefaultConfig" MarkdownPipeline="Markdown.SAFE_MARKDOWN_PIPELINE"/>
</ExpansionPanel>
}
@if (this.SettingsManager.ConfigurationData.App.ShowVision)
{
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Lightbulb" HeaderText="@T("Vision")" IsExpanded="@this.IsPanelExpanded(PANEL_ID_VISION)" ExpandedChanged="@(isExpanded => this.SetPanelExpanded(PANEL_ID_VISION, isExpanded))">
<Vision/>
</ExpansionPanel>
}
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Lightbulb" HeaderText="@T("Vision")" IsExpanded="@this.IsPanelExpanded(PANEL_ID_VISION)" ExpandedChanged="@(isExpanded => this.SetPanelExpanded(PANEL_ID_VISION, isExpanded))">
<Vision/>
</ExpansionPanel>
@if (this.SettingsManager.ConfigurationData.App.ShowQuickStartGuide)
{
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.RocketLaunch" HeaderText="@T("Quick Start Guide")" IsExpanded="@this.IsPanelExpanded(PANEL_ID_QUICK_START_GUIDE)" ExpandedChanged="@(isExpanded => this.SetPanelExpanded(PANEL_ID_QUICK_START_GUIDE, isExpanded))">

View File

@ -108,9 +108,19 @@ public partial class Home : MSGComponentBase
return PANEL_ID_BUILT_IN_INTRODUCTION;
var firstIntroduction = this.introductions.FirstOrDefault();
return firstIntroduction is not null
? IntroductionPanelId(firstIntroduction)
: PANEL_ID_LAST_CHANGELOG;
if (firstIntroduction is not null)
return IntroductionPanelId(firstIntroduction);
if (this.SettingsManager.ConfigurationData.App.ShowLastChangelog)
return PANEL_ID_LAST_CHANGELOG;
if (this.SettingsManager.ConfigurationData.App.ShowVision)
return PANEL_ID_VISION;
if (this.SettingsManager.ConfigurationData.App.ShowQuickStartGuide)
return PANEL_ID_QUICK_START_GUIDE;
return string.Empty;
}
private void EnsureDefaultExpandedPanel()

View File

@ -226,6 +226,12 @@ CONFIG["SETTINGS"] = {}
-- Configure whether the built-in introduction is shown on the welcome page.
-- CONFIG["SETTINGS"]["DataApp.ShowIntroduction"] = false
-- Configure whether the last changelog is shown on the welcome page.
-- CONFIG["SETTINGS"]["DataApp.ShowLastChangelog"] = false
-- Configure whether the vision panel is shown on the welcome page.
-- CONFIG["SETTINGS"]["DataApp.ShowVision"] = false
-- Configure the user permission to add providers:
-- CONFIG["SETTINGS"]["DataApp.AllowUserToAddProvider"] = false

View File

@ -67,6 +67,16 @@ public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = n
/// </summary>
public bool ShowQuickStartGuide { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowQuickStartGuide, true);
/// <summary>
/// Should the last changelog be visible on the home page?
/// </summary>
public bool ShowLastChangelog { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowLastChangelog, true);
/// <summary>
/// Should the vision panel be visible on the home page?
/// </summary>
public bool ShowVision { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowVision, true);
/// <summary>
/// The visibility setting for previews features.
/// </summary>

View File

@ -169,7 +169,13 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
// Config: show quick start guide on the home page?
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.ShowQuickStartGuide, this.Id, settingsTable, dryRun);
// Config: show last changelog on the home page?
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.ShowLastChangelog, this.Id, settingsTable, dryRun);
// Config: show vision panel on the home page?
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.ShowVision, this.Id, settingsTable, dryRun);
// Config: allow the user to add providers?
ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.AllowUserToAddProvider, this.Id, settingsTable, dryRun);

View File

@ -249,7 +249,15 @@ public static partial class PluginFactory
// Check for the quick start guide visibility:
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.ShowQuickStartGuide, AVAILABLE_PLUGINS))
wasConfigurationChanged = true;
// Check for the last changelog visibility:
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.ShowLastChangelog, AVAILABLE_PLUGINS))
wasConfigurationChanged = true;
// Check for the vision panel visibility:
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.ShowVision, AVAILABLE_PLUGINS))
wasConfigurationChanged = true;
// Check for users allowed to added providers:
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.AllowUserToAddProvider, AVAILABLE_PLUGINS))
wasConfigurationChanged = true;