diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5a86f21..85a8351 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -37,8 +37,8 @@ module.exports = { ], rules: { "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], - "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }], + "@typescript-eslint/no-explicit-any": "off", "arrow-body-style": ["warn", "as-needed"], curly: ["error", "multi-line"], "no-console": "off", diff --git a/src/routes/dashboard.tsx b/src/routes/dashboard.tsx index 38675c8..0915384 100644 --- a/src/routes/dashboard.tsx +++ b/src/routes/dashboard.tsx @@ -421,7 +421,7 @@ function normalizeSidebarKey(value: string): string { return key; } -function resolveRuntimeSidebarKeys(runtimeSidebar: string[]): string[] { +function _resolveRuntimeSidebarKeys(runtimeSidebar: string[]): string[] { if (!runtimeSidebar || runtimeSidebar.length === 0) return []; return runtimeSidebar.map(item => normalizeSidebarKey(item)); } @@ -599,6 +599,15 @@ function mergeSidebar( : []), ]); merged = merged.filter((item) => restricted.has(item.trim().toLowerCase())); + + // Safety guarantee: a user who has a pending verification must always see + // "Verification" in their sidebar, even when the admin's runtime config + // for this role omits it (e.g. runtime config was set before the + // wizard feature was added). Without this, the user has no way to track + // the status of their registration submission. + if (!merged.some((item) => normalizeSidebarKey(item) === "verification")) { + merged = ["Verification", ...merged]; + } } return merged; }