Improve admin candidate modal UX and add clip menu visibility toggle
- Widen AdminCandidateEditorModal to size lg for better readability - Rename "Clip-Compilation" section to "Clip / Compilation", update copy to reflect single clips too, drop upload hint and Clip-Plattform field, rename label to "Link" - Fix NativeSelect dropdown clipping inside overflow-y-auto modals by teleporting the menu to body with fixed positioning, flip-up logic, and dynamic maxHeight capped to viewport - Add ClipAdminMenuVisible setting (backend domain, contracts, endpoint, migration) with matching frontend types, defaults, form wiring, and toggle in the Clip-Workflow modal — hides the Clips nav item from the admin sidebar when disabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,26 @@ public static partial class SeedDataBootstrapper
|
||||
settings.RiskRulesJson = RiskRuleSettings.Serialize(RiskRuleSettings.Defaults);
|
||||
}
|
||||
|
||||
if (!HasValidWorkflowRules(settings.WorkflowRulesJson))
|
||||
{
|
||||
settings.WorkflowRulesJson = WorkflowRuleSettings.Serialize(WorkflowRuleSettings.Defaults);
|
||||
}
|
||||
|
||||
if (!HasValidNominationLinkBlacklist(settings.NominationLinkBlacklistJson))
|
||||
{
|
||||
settings.NominationLinkBlacklistJson = NominationLinkBlacklistSettings.Serialize(NominationLinkBlacklistSettings.Defaults);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(settings.ClipSubmissionDisabledMessage))
|
||||
{
|
||||
settings.ClipSubmissionDisabledMessage = "Clip-Einreichungen sind aktuell geschlossen.";
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(settings.ShowactApplicationDisabledMessage))
|
||||
{
|
||||
settings.ShowactApplicationDisabledMessage = "Showact-Bewerbungen sind aktuell geschlossen.";
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(settings.ImprintContent))
|
||||
{
|
||||
settings.ImprintContent = SeedCatalog.DefaultImprintContent;
|
||||
@@ -55,6 +75,16 @@ public static partial class SeedDataBootstrapper
|
||||
{
|
||||
settings.SponsorsContent = SeedCatalog.DefaultSponsorsContent;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(settings.ShowactsUrl))
|
||||
{
|
||||
settings.ShowactsUrl = "https://vtuber-star-awards.de/showacts";
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(settings.ShowactsContent))
|
||||
{
|
||||
settings.ShowactsContent = "Informationen zu Showact-Bewerbungen, Ablauf und Kontakt fuer die Award-Show.";
|
||||
}
|
||||
}
|
||||
|
||||
private static bool HasValidSiteArray(string? json, params string[] requiredKeys)
|
||||
@@ -87,4 +117,30 @@ public static partial class SeedDataBootstrapper
|
||||
|
||||
private static bool HasValidRiskRules(string? json) =>
|
||||
RiskRuleSettings.Read(new Backend.Domain.SiteSettings { RiskRulesJson = json ?? string.Empty }).Length == RiskRuleSettings.Defaults.Length;
|
||||
|
||||
private static bool HasValidWorkflowRules(string? json) =>
|
||||
WorkflowRuleSettings.Read(new Backend.Domain.SiteSettings { WorkflowRulesJson = json ?? string.Empty }).Length == WorkflowRuleSettings.Defaults.Length;
|
||||
|
||||
private static bool HasValidNominationLinkBlacklist(string? json)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var document = JsonDocument.Parse(json);
|
||||
return document.RootElement.ValueKind == JsonValueKind.Array
|
||||
&& document.RootElement.EnumerateArray().Any(item =>
|
||||
item.ValueKind == JsonValueKind.Object
|
||||
&& item.TryGetProperty("Url", out var url)
|
||||
&& url.ValueKind == JsonValueKind.String
|
||||
&& !string.IsNullOrWhiteSpace(url.GetString()));
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user