feat(ui): make query-presets editable from the form view#15657
feat(ui): make query-presets editable from the form view#15657GermanJablo wants to merge 15 commits intomainfrom
Conversation
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
|
|
||
| export type WhereBuilderProps = { | ||
| readonly collectionPluralLabel: SanitizedCollectionConfig['labels']['plural'] | ||
| readonly collectionPluralLabel?: SanitizedCollectionConfig['labels']['plural'] |
There was a problem hiding this comment.
Optional so the preset form can omit it; we derive it from getEntityConfig in form mode (see index.tsx).
| await expect(whereFieldContent).toBeVisible() | ||
| await expect(whereFieldContent).toContainText('No where query') | ||
| // Verify the Where field is visible (empty state: "Add Filter" or "No filters set") | ||
| const whereField = editModal.locator('.query-preset-where-field') |
There was a problem hiding this comment.
Assertions updated for editable WhereBuilder: we check for the builder and empty state instead of read-only ‘No where query’.
| // Verify the Columns field is visible and has 4 selected pills (same as default columns in list view) | ||
| const columnsField = editModal.locator('.query-preset-columns-field') | ||
| await expect(columnsField).toBeVisible() | ||
| await expect(columnsField.locator('.pill-selector__pill--selected')).toHaveCount(4) |
There was a problem hiding this comment.
A small UX improvement: now the columns that appear by default are the same as those that should appear by default in list view according to the Payload config.
| await expect(groupByField.locator('.group-by-builder')).toBeVisible() | ||
| await expect(groupByField).toContainText('Text') | ||
| await expect(groupByField).toContainText('ascending') | ||
| await expect(groupByField).toContainText(/ascending/i) |
There was a problem hiding this comment.
In the groupBy builder, "Ascending" is capitalized, hence the change
Right now the only way to create/edit a preset is from the list view (build the query there, then “Save as preset”). The preset document form uses read-only admin components for where, columns, and groupBy. This PR replace those with a WhereBuilder (and similar for columns/groupBy) so presets can be created and edited directly in the document form, without depending on the list view.
Before
Screen.Recording.2026-02-18.at.11.48.04.mov
After
Screen.Recording.2026-02-17.at.18.15.34.mov