Skip to content

Add cxdevforms — dynamic forms extension for SAP Commerce Cloud - #55

Open
bechte wants to merge 16 commits into
developfrom
feature/cxdevforms
Open

bechte wants to merge 16 commits into
developfrom
feature/cxdevforms

Conversation

@bechte

@bechte bechte commented Sep 23, 2026

Copy link
Copy Markdown
Member

Introduces a new custom extension providing configurable, multi-step form definitions with Backoffice administration, a service/facade layer, and an OCC API.

Data model

  • New DynamicForms type group: DynamicForm, DynamicFormStep, DynamicFormField, DynamicFormFieldValue, DynamicFormSubmission
  • Ordered, localized steps to group fields into multi-page forms
  • Conditional child fields via selectable values, including nested dependencies
  • Field-level validation metadata (min/max length, min/max value, required, hidden, default value, etc.)

Backoffice administration

  • New CX DEV Tools → Forms navigation node for managing forms, steps, fields and selectable values
  • Creation wizards with auto-generated IDs and form-scoped step pickers
  • Interactive, WYSIWYG-style live preview of the rendered form directly in the Fields tab, including drag-and-drop reordering, inline create/edit/delete, and step management
  • Permission-aware preview actions (create/change/delete rights respected)
  • Read-only submissions view grouped by step, with metadata and raw JSON tabs

OCC API

  • GET /forms and GET /forms/{id} with BASIC/DEFAULT/FULL field sets
  • POST /forms/{id}/submissions to accept and validate form answers, with structured 422 error responses
  • Swagger-documented via the Dynamic Forms tag

Form submissions

  • Server-side validation against the stored definition (types, constraints, conditional visibility)
  • Submissions persisted with a definition snapshot so later edits don't corrupt historical data
  • DynamicFormSubmissionCreatedEvent for downstream integration
  • Optional, opt-in email notification listener using Thymeleaf templates (not registered by default)
  • PASSWORD answers rejected; FILE uploads rejected unless a project supplies its own validator

Other

  • German and English Backoffice labels and localization
  • Unit tests covering validation, HTTP contracts/localization, persistence, snapshots and email behavior
  • README rewritten with full setup, data model, API and upgrade documentation

bechte and others added 16 commits September 21, 2026 10:47
…move

Fields shown only when a parent FieldValue is selected could not be
reordered in the form preview - drag-and-drop and the move buttons were
disabled for any field with a parentFieldValue. Fields can now be moved
like any other field.

Moving a field (via drag-and-drop or the move buttons) past a step
boundary now reassigns the field's step to match its new position, so
it actually becomes part of that step instead of only changing its
visual position while keeping the old step reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Empty steps were skipped entirely in the preview. Every configured
DynamicFormStep is now always rendered with its heading; steps with
no visible fields show an empty-state placeholder row, which also
accepts drag-and-drop to assign a field into that step.

Move Up/Down at a step boundary now first only reassigns the field to
the neighboring step while keeping its relative order; a further click
then reorders it within that step. Regular drag-and-drop onto an
existing field keeps its previous immediate reposition-and-reassign
behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Document DynamicFormStep (missing from the data model tables), the
interactive Backoffice form preview renderer with its drag-and-drop
and step-boundary behavior, and the recent wizard refinements. Also
fixes a stale relation/typecode row that no longer matches items.xml.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- DynamicFormField editor: new "Visibility" tab grouping hidden and
  parentFieldValue (with an explanatory description), separate from
  the Step tab.
- DynamicForm creation wizard: drop the Steps/Fields wizard pages -
  their part-of collections cannot be created before the form itself
  is persisted, so they only ever failed there; both remain fully
  editable from the form editor afterwards.
- Fix the DynamicFormField wizard's step reference restriction: the
  editor-parameter belongs in the wz: namespace (not editorArea:)
  when nested in a wz:property, and the templating placeholder is
  always {parentObject.<attr>} regardless of the wizard's own
  property-list root name.
- Hide id (UUID-prefilled) in the DynamicFormStep and
  DynamicFormFieldValue wizards too.
- FormFieldType/FormType wizards: add the icon field inherited from
  EnumerationValue.
- Rename the Form/Field reference list columns and reorder the
  DynamicFormStep list view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The preview's inline styles used fixed hex colors, so the rendered
form preview would not adapt to a non-default Backoffice theme. Every
color now references the semantically closest --bo-*/--sap* theming
variable (container background/border, list row divider, required
marker, secondary label text, step heading) instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Derive the explorer tree's level-shading colors from the active
  Backoffice theme (--bo-container-background mixed with
  --bo-highlight-color per level via color-mix()) instead of fixed
  hex values, so they adapt to non-default/dark themes.
- Also register the tree node icon for the side navigation rail
  (.yw-treeCellInner), a separate widget from the expanded explorer
  tree (div.yw-explorerTree) that was missing the icon when the
  navigation panel is collapsed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant