Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/39475-list-view-export-on-by-default.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
'@objectstack/spec': minor
'@object-ui/plugin-list': minor
Expand All @@ -14,6 +14,6 @@

To keep a view without export, declare `exportOptions: { formats: [] }` on it. To take export off every view of an object, set the object's `userActions.exportCsv: false`.

An `object-grid` page component is not changed: it still offers export only when it declares `exportOptions`.
An `object-grid` page component that names an object reads an absent `exportOptions` the same way: it offers `csv` and `json` by default, and `xlsx` only where it lists it in `formats`. Declare `exportOptions: { formats: [] }` on it to turn its export off.

The upgrade guide carries the change as the semantic entry `list-view-export-on-by-default`.
18 changes: 18 additions & 0 deletions .changeset/39475-object-grid-export-on-by-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@object-ui/plugin-grid': minor
'@object-ui/plugin-list': patch
'@object-ui/plugin-detail': patch
'@object-ui/plugin-designer': patch
'@object-ui/console': patch
---

feat(plugin-grid): an object table that declares no `exportOptions` offers export

Clause-②: no
Metadata-protocol: semantic

An `object-grid` used to draw its Export menu only when it declared `exportOptions`. A grid over an object now reads an absent `exportOptions` the way a list view does: as the empty block, offering the default formats, `csv` and `json`. `xlsx` is offered where the grid lists it in `formats` and the server stream delivers it, as before. A declared block behaves as before, and a grid that names no object still offers export only when it declares the block.

Who may export is unchanged. The permission set's `allowExport` grant reaches the grid through the object's effective `export` operation: a user whose permission sets do not grant it sees no Export entry, and the server refuses the export request. To keep a table without export, declare `exportOptions: { formats: [] }` on it; to take export off every surface of an object, set the object's `userActions.exportCsv: false`.

The platform's own screens that compose a grid declare `exportOptions: { formats: [] }` on the grid they build, so none gains an Export entry: the list page's grid (whose list toolbar keeps the one export door), the enlarged related list tab, the Studio metadata lists, the object manager, the field designer and the console's row-action dev page.
2 changes: 1 addition & 1 deletion content/docs/ui/components/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Namespace `plugin-grid`.
| `keyboardNavigation` | `boolean` | | Arrow-key cell navigation on the WAI-ARIA grid pattern: the grid's data cells take one place in the Tab order instead of one each (a link or button inside a cell keeps its own), and the arrow keys move focus between them (Home / End to the ends of the row, Ctrl+Home / Ctrl+End to the ends of the page). Enter still opens an editable cell, and an edit ended with Enter or Escape returns focus to its cell. Always on when the grid renders editable, because that grid selects a cell first and moves the selection with these keys; a read-only grid keeps every cell its own Tab stop unless this is `true`. |
| `navigation` | `object` | | What a row click does, `{ mode: "drawer" \| "page" \| "new_window" \| "none", … }`; a block written without `mode` opens the drawer. |
| `operations` | `object` | | Toggles for the built-in affordances, `{ create, update, delete, export }`, e.g. `{ delete: false }`. A declared block replaces the default, so an `update` / `delete` it does not name is withheld. |
| `exportOptions` | `object` | | Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. Needs `operations.export` to be reachable from the toolbar. |
| `exportOptions` | `object` | | Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. On a grid that names an object, an absent block offers the default formats, `csv` and `json` (`xlsx` only where `formats` lists it); `formats: []` turns the export off, and a grid that names no object offers export only when it declares the block. Who may export is still the object's export verdict (the `allowExport` grant, through the effective `export` operation, and `userActions.exportCsv`). `operations.export: false` withholds every export entry; `operations.export: true` additionally draws the table's own CSV button. |
| `dataSource` | `object` (`object` data binding) | | Per-element data binding: \{ object, view, filter, sort, limit \}. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it. |

## `object-kanban` [#object-kanban]
Expand Down
2 changes: 1 addition & 1 deletion scripts/sdui-manifest.record.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"source": "built-tree",
"generator": "scripts/gen-sdui-manifest-node.mjs",
"generatedAt": "2026-12-04",
"sha256": "2763ba89195a8b4b3ef121df0f853449645595d77ee9c350490c0bbf0ba07e7e",
"sha256": "5cdb212da496eef4cfc65bf4751871edbd80519986abfd039c759c77366a80e8",
"components": 106,
"inTree": {
"modulesRoot": "ui/apps/console",
Expand Down
2 changes: 1 addition & 1 deletion sdui.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
{
"name": "exportOptions",
"type": "object",
"description": "Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. Needs `operations.export` to be reachable from the toolbar."
"description": "Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. On a grid that names an object, an absent block offers the default formats, `csv` and `json` (`xlsx` only where `formats` lists it); `formats: []` turns the export off, and a grid that names no object offers export only when it declares the block. Who may export is still the object's export verdict (the `allowExport` grant, through the effective `export` operation, and `userActions.exportCsv`). `operations.export: false` withholds every export entry; `operations.export: true` additionally draws the table's own CSV button."
},
{
"name": "dataSource",
Expand Down
21 changes: 21 additions & 0 deletions ui/apps/console/src/dev/DevRowActions.exportOff-39475.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* objectstack#39475 — a grid over an object offers Export unasked. The dev
* row-action page composes three object grids to pin row actions only, so the
* node it builds declares `exportOptions: { formats: [] }` and none of them
* draws an Export entry. The rows are read first, so the absence is of drawn
* grids.
*/
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';

import { DevRowActions } from './DevRowActions';

describe('DevRowActions.exportOff-39475', () => {
it('none of the dev page grids draws an Export entry', () => {
render(<DevRowActions />);
expect(screen.getByTestId('grid-default')).toHaveTextContent('hotcrm-fix-verify');
expect(screen.getByTestId('grid-wide')).toHaveTextContent('hotcrm-fix-verify');
expect(screen.queryAllByRole('button', { name: /^export$/i })).toHaveLength(0);
});
});
3 changes: 3 additions & 0 deletions ui/apps/console/src/dev/DevRowActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function EnvGrid({ maxInlineRowActions }: { maxInlineRowActions?: number }) {
columns: COLUMNS,
data: { provider: 'value', items: ENV_ROWS },
rowActionDefs: ROW_ACTION_DEFS,
// objectstack#39475 — a grid over an object offers export unasked; this
// dev page pins row actions only, so it declares none.
exportOptions: { formats: [] },
...(maxInlineRowActions != null ? { maxInlineRowActions } : {}),
};
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ describe('metadataListGrid (objectstack#36897)', () => {
expect(pageWindow([], 3, 50)).toEqual({ page: 1, rows: [] });
});
});

/**
* objectstack#39475 — a grid over an object offers Export unasked; a Studio
* metadata list is a platform screen, so the node it builds declares no
* export format and the grid draws no Export (`plugin-grid`'s
* `ObjectGrid.exportDefaultOn-39475` pins what `formats: []` draws).
*/
describe('metadataListGrid.exportOff-39475', () => {
it('the metadata list grid node declares exportOptions with no formats', () => {
const g = metadataListGridSchema('flow', COLUMNS, sortKeyOf, 50) as any;
expect(g.objectName).toBe('metadata_list_flow');
expect(g.exportOptions).toEqual({ formats: [] });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export function metadataListGridSchema(
resizable: false,
reorderableColumns: false,
pagination: { pageSize },
// objectstack#39475 — a grid over an object offers export unasked; a
// metadata list is a platform screen, so it declares none.
exportOptions: { formats: [] },
};
}

Expand Down
3 changes: 3 additions & 0 deletions ui/packages/plugin-designer/src/FieldDesigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ export function FieldDesigner({
searchableFields: ['name', 'label', 'description'],
showSearch: true,
operations: readOnly ? undefined : { create: true, update: true, delete: true },
// objectstack#39475 — a grid over an object offers export unasked; this
// designer table is a platform screen, so it declares none.
exportOptions: { formats: [] },
}), [gridColumns, readOnly]);

// Handlers
Expand Down
3 changes: 3 additions & 0 deletions ui/packages/plugin-designer/src/ObjectManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export function ObjectManager({
searchableFields: ['name', 'label', 'description'],
showSearch: true,
operations: readOnly ? undefined : { create: true, update: true, delete: true },
// objectstack#39475 — a grid over an object offers export unasked; this
// designer table is a platform screen, so it declares none.
exportOptions: { formats: [] },
}), [gridColumns, readOnly]);

// Handlers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,18 @@ describe('objectui#8674 · the system field draws no delete action', () => {
expect(await rowKebab(CUSTOM.name)).toEqual({ edit: false, delete: false, trigger: false });
});
});

/**
* objectstack#39475 — a grid over an object offers Export unasked; the field
* designer is a platform screen, so its grid node declares
* `exportOptions: { formats: [] }` and the real grid draws no Export. The rows
* are read first, so the absence is of a drawn grid.
*/
describe('FieldDesigner.gridExportOff-39475', () => {
it('the field designer grid draws no Export entry', async () => {
renderDesigner();
await settle();
expect(screen.getByText(CUSTOM.name)).toBeInTheDocument();
expect(screen.queryByRole('button', { name: /^export$/i })).toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,17 @@ describe('objectui#9219 · the system object draws no delete action', () => {
expect(await rowKebab(CUSTOM.name)).toEqual({ edit: false, delete: false, trigger: false });
});
});

/**
* objectstack#39475 — a grid over an object offers Export unasked; the object
* manager is a platform screen, so its grid node declares
* `exportOptions: { formats: [] }` and the real grid draws no Export. The rows
* are read first, so the absence is of a drawn grid.
*/
describe('ObjectManager.gridExportOff-39475', () => {
it('the object manager grid draws no Export entry', async () => {
renderManager();
await waitFor(() => expect(screen.getByText(CUSTOM.name)).toBeInTheDocument());
expect(screen.queryByRole('button', { name: /^export$/i })).toBeNull();
});
});
4 changes: 4 additions & 0 deletions ui/packages/plugin-detail/src/RelatedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3843,6 +3843,10 @@ export const RelatedList: React.FC<RelatedListProps> = ({
),
showSearch: false,
showPagination: false,
// objectstack#39475 — a grid over an object offers export unasked;
// this list's own toolbar keeps the related list's export door, so
// the grid draws none.
exportOptions: { formats: [] },
// objectstack#35892 — cell editing as on the list page
// (objectstack#35683): where the reader may edit the child object.
...(tabList ? { editable: tabInlineEdit } : {}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,19 @@ describe('the related table leads with the record name when no columns are decla
expect(h.schema.columns).toEqual(['code', 'amount']);
});
});

/**
* objectstack#39475 — a grid over an object offers Export unasked; the
* enlarged related tab keeps its export door in its own toolbar, so the grid
* node it builds declares no export format and the grid draws no second
* Export (`plugin-grid`'s `ObjectGrid.exportDefaultOn-39475` pins what
* `formats: []` draws).
*/
describe('RelatedList.enlargedGridExportOff-39475', () => {
it('the enlarged tab hands object-grid exportOptions with no formats', async () => {
renderList();
await waitFor(() => expect(h.schema?.type).toBe('object-grid'));
expect(h.schema.objectName).toBe('opportunity');
expect(h.schema.exportOptions).toEqual({ formats: [] });
});
});
Loading
Loading