Skip to content

Add stored form data management UI and backend support#17

Merged
ericof merged 6 commits into
mainfrom
issue-16
Jun 18, 2026
Merged

Add stored form data management UI and backend support#17
ericof merged 6 commits into
mainfrom
issue-16

Conversation

@ericof

@ericof ericof commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Adds frontend support to manage the submissions stored by a form block's Store data action, plus the backend refactor that underpins it.

In the form block editor you can now toggle between Show Form and Show Data; the data view lists every stored submission in a sortable, paginated table and lets you:

  • see the number of stored submissions,
  • export them to CSV, and
  • clear them.

Frontend

  • New DataTable component (components/DataTable/) split into focused pieces: orchestrator, useStoredFormData hook, presentational DataTableActions / DataTableGrid / DataTablePagination, and a Cells renderer.
  • Pure, unit-tested helpers in helpers/datatable.ts (column ordering, item selection, field metadata) with vitest coverage; added a vitest.config.ts so the package's self-referential imports resolve in tests.
  • Registered the ReactTable loadable and added the @tanstack/react-table dependency.
  • Wired the data view into the SchemaForm block edit view via a Show Form / Show Data toggle.

Backend

  • Refactored FormDataStore: extracted the schema-field and record builders into utils/datamanager.py with type hints and TypedDict definitions (types.py), cached the request block_id, and added a total_records_in_block helper — covered by new unit tests.
  • Removed the redundant legacy FormSerializer block serializer; SchemaFormBlockSerializer already handles captcha props, attachments limit and default_ field stripping for schemaForm blocks.

Other

  • Updated the i18n message catalogs (backend plone.formblock and frontend volto).

Closes #16

ericof added 5 commits June 17, 2026 14:46
Register the ReactTable loadable and add the @tanstack/react-table
dependency, then add a DataTable component that lists the submissions
stored by the form block, exports them to CSV and clears them. Column
ordering, cell rendering and item selection live in pure helpers with
vitest unit tests.

Refs #16
Add a Show Form / Show Data toggle to the form block edit view that
renders the DataTable when the block stores submissions.

Refs #16
Extract the schema-field and record builders out of FormDataStore into
utils/datamanager.py, add type hints and TypedDict definitions in
types.py, cache the request block_id, and add a total_records_in_block
helper. Cover the new helpers with unit tests.

Refs #16
Drop the FormSerializer block serializer and its subscriber
registrations; SchemaFormBlockSerializer already handles captcha props,
attachments limit and default_ field stripping for schemaForm blocks.
@ericof ericof requested a review from sneridagh June 17, 2026 17:57

@sneridagh sneridagh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM a few comments in the frontend side. I did not review the backend in depth though.

Comment thread frontend/packages/volto-form-block/src/config/settings.ts
Comment thread frontend/packages/volto-form-block/vitest.config.ts Outdated
Base the addon's vitest config on @plone/volto's shared config (jsdom,
plugins, projects) and layer the local @plone/volto-form-block source
aliases and core fs.allow path on top, so component tests run with the
same setup as core.
@ericof ericof merged commit f16cfb9 into main Jun 18, 2026
23 checks passed
@ericof ericof deleted the issue-16 branch June 18, 2026 12:34
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.

Improve handling of data stored with StoreFormProcessor

2 participants