Skip to content

[Task] Replace placeholder text with graceful error state in EditFieldDrawer for unregistered field types #9539

Description

@Strikerprv

Background

When a BasicField enum value has no corresponding case in the MemoFieldDrawerContent method switch statement, the drawer silently falls through to the default branch and renders raw dev placeholder text (TODO: Insert field options here) visible to any admin user.

Image

Goal

The edit drawer never shows raw placeholder text to users — unhandled field types either render the correct Edit component or fail with a clear, user-facing error state.

Acceptance Criteria

  • The default branch in MemoFieldDrawerContent method no longer renders <div>TODO: Insert field options here</div>
  • Unhandled field types display a meaningful error state (inline message or toast) instead of placeholder text
  • A TypeScript exhaustive check (const _exhaustiveCheck: never = field.fieldType) is added so missing case entries are caught at compile time
  • tsc --noEmit fails when a new BasicField value is added without a corresponding case
  • Tests added covering the unregistered field type error path

Notes

Affected file: apps/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/EditFieldDrawer.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions