diff --git a/AGENTS.md b/AGENTS.md index e6cd762..fb67e28 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,7 +28,8 @@ yarn preview # Build and start production server ### Code Quality ```bash -yarn lint # Run ESLint +yarn lint # Run ESLint (currently fails under Next 16 CLI; use eslint command below) +./node_modules/.bin/eslint . --no-eslintrc --config .eslintrc.json --resolve-plugins-relative-to . # Run ESLint directly (ignore parent configs) yarn typecheck # TypeScript type checking yarn format # Format code with Prettier ``` @@ -246,6 +247,7 @@ MUST NOT: - No @/ imports inside packages - Never "fix" libraries by polluting the app - Always run `yarn lint` and `yarn typecheck` before completing tasks +- If `yarn lint` fails with "Invalid project directory .../lint" (Next 16 CLI), use `./node_modules/.bin/eslint .` instead --- diff --git a/mcp/testing.md b/mcp/testing.md index b2f7d45..8c9995b 100644 --- a/mcp/testing.md +++ b/mcp/testing.md @@ -4,7 +4,8 @@ Required: -- yarn lint +- yarn lint (currently fails under Next 16 CLI; use eslint command below) +- ./node_modules/.bin/eslint . --no-eslintrc --config .eslintrc.json --resolve-plugins-relative-to . - yarn typecheck - yarn build diff --git a/src/modules/extensions/builtin/user-center/account/MfaSetupPanel.tsx b/src/modules/extensions/builtin/user-center/account/MfaSetupPanel.tsx index 1012c14..8f4ae65 100644 --- a/src/modules/extensions/builtin/user-center/account/MfaSetupPanel.tsx +++ b/src/modules/extensions/builtin/user-center/account/MfaSetupPanel.tsx @@ -96,7 +96,11 @@ function formatTimestamp(value?: string) { return date.toLocaleString() } -export default function MfaSetupPanel() { +type MfaSetupPanelProps = { + showSummary?: boolean +} + +export default function MfaSetupPanel({ showSummary = true }: MfaSetupPanelProps) { const { language } = useLanguage() const copy = translations[language].userCenter.mfa const router = useRouter() @@ -435,6 +439,9 @@ export default function MfaSetupPanel() { }, []) if (!user) { + if (!showSummary) { + return null + } return (

{copy.title}

@@ -451,42 +458,44 @@ export default function MfaSetupPanel() { return ( <> - -
-
-
-

{copy.title}

-

{copy.summary.description}

-
-
-
{copy.summary.statusLabel}
-
{statusLabel}
-
-
-
{copy.status.issuedAt}
-
{formatTimestamp(displayStatus?.totpSecretIssuedAt)}
-
-
-
{copy.status.confirmedAt}
-
{formatTimestamp(displayStatus?.totpConfirmedAt)}
-
-
-
-
- - {requiresSetup ? ( -

{copy.lockedMessage}

- ) : null} + {showSummary ? ( + +
+
+
+

{copy.title}

+

{copy.summary.description}

+
+
+
{copy.summary.statusLabel}
+
{statusLabel}
+
+
+
{copy.status.issuedAt}
+
{formatTimestamp(displayStatus?.totpSecretIssuedAt)}
+
+
+
{copy.status.confirmedAt}
+
{formatTimestamp(displayStatus?.totpConfirmedAt)}
+
+
+
+
+ + {requiresSetup ? ( +

{copy.lockedMessage}

+ ) : null} +
-
- + + ) : null} {isDialogOpen ? (
{copy.uuidNote}

- {requiresSetup ? ( + {!hideMfaMainPrompt && requiresSetup ? (

{copy.lockBanner.title}

{copy.lockBanner.body}

@@ -180,21 +184,24 @@ export default function UserOverview() {

{copy.cards.email.description}

- -
-
-

{copy.cards.mfa.label}

-

{mfaStatusLabel}

-

{copy.cards.mfa.description}

+ {!hideMfaMainPrompt ? ( + +
+
+

{copy.cards.mfa.label}

+

{mfaStatusLabel}

+

{copy.cards.mfa.description}

+
+ + {copy.cards.mfa.action} +
- - {copy.cards.mfa.action} - -
- + + ) : null} +
) diff --git a/src/modules/extensions/builtin/user-center/routes/account.tsx b/src/modules/extensions/builtin/user-center/routes/account.tsx index f5b983c..cd48917 100644 --- a/src/modules/extensions/builtin/user-center/routes/account.tsx +++ b/src/modules/extensions/builtin/user-center/routes/account.tsx @@ -5,8 +5,8 @@ import UserOverview from '../components/UserOverview' export default function UserCenterAccountRoute() { return (
- - + +
)