diff --git a/docs/en/docs-params.json b/docs/en/docs-params.json index c15e60c8cb..83ff94e566 100644 --- a/docs/en/docs-params.json +++ b/docs/en/docs-params.json @@ -45,7 +45,7 @@ "MudBlazor": "MudBlazor" }, "dependsOn": { - "UI": ["Blazor", "BlazorServer", "BlazorWebApp"] + "UI": ["Blazor", "BlazorServer", "BlazorWebApp", "MAUIBlazor"] } } ] diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentParameterDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentParameterDto.cs index 0c1df753c0..9bd3c0aefd 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentParameterDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/DocumentParameterDto.cs @@ -10,12 +10,6 @@ namespace Volo.Docs.Documents public Dictionary Values { get; set; } - /// - /// Conditional visibility: this parameter is shown only when the keyed parameter's - /// current value is one of the listed values. - /// Example: "DependsOn": { "UI": [ "Blazor", "BlazorServer", "BlazorWebApp" ] } - /// An empty dictionary means the parameter is always shown. - /// - public Dictionary> DependsOn { get; set; } = new Dictionary>(); + public Dictionary> DependsOn { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index 60dc0fd57f..a68298a431 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -475,8 +475,6 @@
@{ - // Filter the parameters that should actually be shown (after applying DependsOn rules) - // before computing the grid layout, otherwise hidden parameters would still occupy a column slot. var visibleParameters = Model.DocumentPreferences?.Parameters? .Where(p => Model.IsParameterVisible(p)) .ToList() ?? new List(); @@ -498,7 +496,6 @@ var count = visibleParameters.Count; var rowCount = count / maxCellCount + (count % maxCellCount > 0 ? 1 : 0); var cellSize = 12 / (count > maxCellCount ? maxCellCount : count); - // Last row may have fewer items than maxCellCount; size them to fill the row width. var lastRowCellCount = count - (rowCount - 1) * maxCellCount; var latestCellSize = 12 / lastRowCellCount; diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 995b9e603f..6eb3c02a8c 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -99,12 +99,6 @@ namespace Volo.Docs.Pages.Documents.Project return IsParameterVisibleGiven(parameter, UserPreferences); } - // Per-rule semantics for a (parameter, current selection) context: - // - rule.Value == null : malformed list, skip the rule (fail-open) - // - key not in current document : rule references an unknown parameter, skip (fail-open) - // - rule.Value.Count == 0 : explicit empty allow-list, hide the parameter (author intent: "never show") - // - selected value not in allow-list: hide - // - selected value in allow-list : pass this rule protected virtual bool IsParameterVisibleGiven(DocumentParameterDto parameter, IReadOnlyDictionary selectedValues) { if (parameter.DependsOn == null || parameter.DependsOn.Count == 0) @@ -883,9 +877,6 @@ namespace Volo.Docs.Pages.Documents.Project AlternativeOptionLinkQueries = CollectAlternativeOptionLinksRecursively(0, new Dictionary()); } - // Generates all parameter combinations as query strings, but skips parameters whose DependsOn rules - // aren't satisfied by the partially-built selection. This avoids producing nonsensical combinations - // (e.g. UI=MVC&BlazorUI=MudBlazor when BlazorUI depends on UI ∈ {Blazor, BlazorServer, BlazorWebApp}). private List CollectAlternativeOptionLinksRecursively(int index, Dictionary selected) { if (index >= DocumentPreferences.Parameters.Count) @@ -895,8 +886,6 @@ namespace Volo.Docs.Pages.Documents.Project var option = DocumentPreferences.Parameters[index]; - // If this parameter is hidden in the current selection context, omit it from the query - // and continue with the next parameter (no Cartesian fan-out for this option). if (!IsParameterVisibleGiven(option, selected)) { return CollectAlternativeOptionLinksRecursively(index + 1, selected);