|
|
|
@ -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<string, string> selectedValues) |
|
|
|
{ |
|
|
|
if (parameter.DependsOn == null || parameter.DependsOn.Count == 0) |
|
|
|
@ -883,9 +877,6 @@ namespace Volo.Docs.Pages.Documents.Project |
|
|
|
AlternativeOptionLinkQueries = CollectAlternativeOptionLinksRecursively(0, new Dictionary<string, string>()); |
|
|
|
} |
|
|
|
|
|
|
|
// 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<string> CollectAlternativeOptionLinksRecursively(int index, Dictionary<string, string> 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); |
|
|
|
|