Overview

Work on recent issues has identified evolving needs for our current implementation of the form components:

  1. #3487484: Save page data form values in application state with support for undo/redo
    • Form element behaviors (data saving, validation etc.) needs to change based on context.
  2. #3486888: Implement Storybook
    • Form elements need to be available as purely presentational components, decoupled from business logic, for efficient UI development.
  3. #3483267: [exploratory] PoC of Preact+Tailwind components editable via CodeMirror
    • Form elements need to be available as purely presentational components, decoupled from business logic, to be used at other parts of the application — e.g. UI for defining props in JavaScript components.

Proposed resolution

Render each form component (ui/src/components/form/) by another component that wraps it in the `InputBehaviors` HOC. Prefix the name of these new components with `Drupal`.

This was proposed and agreed upon (without implementation details) in #3487484: Save page data form values in application state with support for undo/redo. Implementation was already done there, but moving into its own issue to reduce complexity for code reviews.

See MR description for proposed implementation details.

User interface changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

balintbrews’s picture

bnjmnm’s picture

Assigned: bnjmnm » balintbrews
Status: Needs review » Needs work

One small change requested in the MR then I think it is good to go.

balintbrews’s picture

Assigned: balintbrews » bnjmnm
Status: Needs work » Needs review
bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Status: Needs review » Reviewed & tested by the community

RTBC'd and code-approved. Needs some other codeownder signoffs in the MR before it can be merged.

  • bnjmnm committed ab90b775 on 0.x authored by balintbrews
    Issue #3491265 by balintbrews, bnjmnm: Split form components into `...
bnjmnm’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.