Main Pages — Routing, Naming Conventions & Common Pitfalls¶
Part of: Main Pages guide See also: Checklist | RPC Service
Routing¶
Both files below must be updated for the new page to appear in the WebUI and be accessible via the navigation bar. Missing either one is the most common cause of “my page doesn’t show up.”
data-cy Naming Convention¶
Follow the project’s kebab-case naming convention for test attributes:
{page-name}-button-{action} → my-entities-button-add
{page-name}-button-{action} → my-entities-button-delete
{page-name}-button-{action} → my-entities-button-refresh
{page-name}-kebab → my-entities-kebab
{page-name}-kebab-{action} → my-entities-kebab-some-action
{page-name}-modal-error → my-entities-modal-error
search → search (always just "search")
See cypress/README.md for the full naming guide.
Post-Generation Validation¶
After generating a new main page, run the following checks to catch formatting issues, lint violations, and unused exports before committing:
npx prettier --write . # Fix code formatting
npm run lint # ESLint (max-warnings threshold)
npm run knip # Detect unused files, exports, and dependencies
These are the same checks that run in CI, so catching them locally avoids failed pipelines.
Common Pitfalls¶
Forgetting to register the route: The page won’t render if not added to both
AppRoutes.tsxandNavRoutes.ts.Missing
entryType: If usinguseSearchEntriesMutation, theentryTypemust exist inGenericPayload’s union type and be handled in the mutation’s switch logic.Wrong
pathnameinuseUpdateRoute: Must exactly match the route key inNavRoutes.ts.Not calling
refetch()on mount: Include theuseEffect(() => { dataResponse.refetch(); }, [])pattern to ensure fresh data.Primary key mismatch: The
pk/nameAttrinMainTableandBulkSelectorPrepmust match the actual field name in the data type (e.g."cn","uid","fqdn","idnsname").