Repository navigation
Todo
Labels
enhancementNew feature or request
Description
Is your feature request related to a problem? Please describe.
- Many applications start with a request form. Today the only way to add a row is the row modal of the table.
Why this is needed
- A functional administrator who builds an intake application needs a form with a chosen set of fields, in a set order and in steps. Today the only way in is the row modal of the table, which shows every column.
- buildiq parity: the
formpage type (standalone or public, multi-step, per-field validation) is partial in Tables, which only has the row create dialog generated from the columns (section 2 of the feature comparison). The "Forms" widget group has nothing in Tables (section 3). - It depends on the design (Design of the detail page and form page of an application #3434) and on the formats of Formats as subtypes, validated by format definitions #3128. Submitting without an account (Submit a form page without an account #3438) builds on it. Form pages are shown at user review 2, week of 4 January 2027.
Describe the solution you'd like
- A page type that is a form built from the columns of one table. It can have one step or several, validates each field against its column type and format, and creates a row on submit.
Diagram
flowchart LR
M["Menu item of the application"] --> F["Form page<br/>chosen columns of one table"]
F --> S1["Step 1"]
S1 --> V1{"Valid for column type<br/>and format?"}
V1 -- no --> S1
V1 -- yes --> S2["Step 2"]
S2 -- back, input kept --> S1
S2 --> V2{"Valid?"}
V2 -- no --> S2
V2 -- yes --> P["POST api/2/tables/{nodeId}/rows"]
P --> C["Confirmation"]
P --> D["Detail page of the new row"]
Acceptance Criteria
- The form page belongs to one table and lists a chosen subset of its columns, in a chosen order.
- Fields can be grouped into steps; the user can go back without losing input.
- Each field is validated against its column type and format before the next step.
- On submit one row is created, and the page shows a confirmation or opens the row.
- Unit tests for the validation, a Playwright spec for a two-step form.
- Writes: the submit goes through the existing row create route, which declares
#[RequirePermission](create) on the table, and creating or changing the form page goes through the page routes, which declare manage on the application (context). The service checks the same right before it writes (as agreed on UUIDs for rows #3093 and in the review of feat(contexts): give applications a menu with its own API #3135). A test runs every write as a reader and expects 403, or 404 where the reader may not know the object exists. - The form configuration (columns, order, steps) is stored as JSON in a text column of the page, like widget
settingstoday, never in the database JSON column type (as agreed on Grid pages in applications (frontend) #3099). - If the page needs a new column for it: nullable, backfilled, then NOT NULL; no empty-string defaults, since Oracle stores
''as NULL (as raised on Technical name for tables and applications, CRUD routes by application and table #3094); the version inappinfo/info.xmlis bumped with the migration (as raised on feat(rows): add persistent UUIDv7 identifiers to rows #3229). - Deleting the table deletes its form pages in the same transaction, and deleting a column removes it from the forms that list it. A repair step that runs once after the upgrade removes leftovers, not a recurring cleanup job (as agreed on Grid pages in applications (data model and API) #3100).
- Steps use
NcStepper(feat(NcStepper): add stepper component nextcloud-libraries/nextcloud-vue#9162, merged); fields use the same inputs as the row modal, and the submit button uses a checkmark, not a save icon. - Usable at 360 px wide: nothing cut off, no horizontal scroll of the page. Every action works by keyboard.
Components
- CnFormPage (adapt, week 46): the form page type. It already submits to a configured endpoint; in Tables that is the row create route of the bound table. Its remote visibility rules are the only OpenRegister calls and stay out, as this issue leaves
visibleWhenout.
Out of scope
- Submitting without an account: Submit a form page without an account #3438.
- Editing an existing row: the detail page (Detail page type for one row #3435).
- Fields that show or hide on a condition (buildiq's
visibleWhen): not planned for this issue. - Proposed slicing, one PR each in landing order: the form page type with one step, then steps, then validation by format (after Formats as subtypes, validated by format definitions #3128).
Describe alternatives you've considered
Questions for maintainers
- A form as a page type of its own, or a form widget on a grid page? We would go with a page type, because the public link of Submit a form page without an account #3438 needs its own page address and buildiq models the form as a page.
- The steps: stored as JSON in a text column of the page, or as their own entities in a new table? We would go with JSON in a text column, because steps are only ever read with their page.
- After a submit: a confirmation text, or open the new row? We would go with a confirmation by default, and opening the row as an option per form, because many people who fill in a form cannot read the table.
Additional context
Linking to other objects
- The issue adds a page of type form to an application and creates one row per submit.
- Today: a row created here can be the target of a relation column in another table (one way) and can hold a URL in a link column. It has no reference URL, so it cannot be previewed in Talk or Text. Links to mails or Deck cards have no upstream issue; Link a row to objects in other apps: mails, Deck cards, files, rows of other tables #3468 proposes them.
- What this issue must do: give the form page a slug like other pages (
page_<id>, Technical name for tables and applications, CRUD routes by application and table #3094), so a manifest and a later reference provider can name it. Return the new row's id (ids in everyday routes, as agreed on UUIDs for rows #3093), so a link can be made right after the submit, for example to the mail the request came in with. When the form holds a relation column, its picker offers only rows of the target table the user can read.
Relevant files:
Related issues
- Formats as subtypes, validated by format definitions #3128
- depends on the design (Design of the detail page and form page of an application #3434), the formats of Formats as subtypes, validated by format definitions #3128 for format validation
- UUIDs for rows #3093
- Technical name for tables and applications, CRUD routes by application and table #3094
- links between rows and other apps (Link a row to objects in other apps: mails, Deck cards, files, rows of other tables #3468)
Drafted with AI assistance from the project plan; @remko48 reviews it. Part of #3419.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity