diff --git a/.changeset/34795-studio-permissions-wording.md b/.changeset/34795-studio-permissions-wording.md new file mode 100644 index 00000000000..31ef8cd4a0a --- /dev/null +++ b/.changeset/34795-studio-permissions-wording.md @@ -0,0 +1,22 @@ +--- +'@object-ui/app-shell': patch +'@object-ui/i18n': patch +'@object-ui/console': patch +--- + +feat(studio): the permissions page speaks business wording; the bulk buttons show on every row + +Clause-②: no +Metadata-protocol: none + +Studio's permissions page now reads in the words an app builder uses, in zh-CN and in English. It changes wording and presentation only; the permission model, the suggestion and confirmation mechanism (ADR-0090 D5/D9) and every request are the same. + +- **The default-grant banner is one sentence.** When an app's member permission set is accepted for everyone, the banner reads "所有成员默认拥有这个权限集,新加入的人也会自动拥有。" ("Every member has this permission set by default, and new members get it automatically."). Its button reads "取消默认授予" ("Stop granting by default") instead of "撤销" ("Revoke"), and it makes the same call. The pending, not-in-force, dismissed and guest lines say the same thing in the same tone. None of them names the Everyone or Guest position. +- **The open set's title is "app · set label".** The set's machine name moves to the title's tooltip, and the provenance, default and lock labels move to the line under the title. The rail row shows the set's label, with the machine name as its tooltip. +- **Plain terms.** "记录共享模型(OWD)" ("Record sharing (OWD)") is now "谁能看到哪些记录" ("Who can see which records"). The values read "只有负责人能看 / 所有人能看 / 所有人都能看和改" ("Only the owner can see / Everyone can see / Everyone can see and edit"), and "受父级控制 → {master}" reads "跟随所属的{master}" ("Follows its {master}"). The stored `sharingModel` values do not change. The tabs read "对象权限 / 系统功能 / 数据范围规则 / 菜单可见" ("Object permissions / System features / Record scope rules / Menu visibility"). +- **The bulk buttons show on every row**, not only on the row under the pointer, as "全选 · 只读 · 清空" ("All · Read only · None"), then the CRUD set as a fourth button ("增删改查", "Read & write"). Each button writes what All / R / None / CRUD wrote before. The footnote that explained the hidden buttons is gone. +- **An object row shows the object's label**, in the matrix and in the package's "who can see which records" overview. Its machine name is the tooltip. The record-visibility chip stays on one line now that its labels are longer. + +The Draft Changes publish refusal now points to "Settings → Who can see which records" (all 11 language packs), since the old "Settings → Record sharing" label no longer exists. + +Setup's permission-set page reads some of the same strings, so it changes too: the bulk buttons' labels, the sharing values, and the record-scope-rules, menu-visibility and system-features headings. Its layout does not change. diff --git a/docs/qa/platform-checklist/areas/studio-authoring.json b/docs/qa/platform-checklist/areas/studio-authoring.json index 19a496c8eb3..c5d30bbd60a 100644 --- a/docs/qa/platform-checklist/areas/studio-authoring.json +++ b/docs/qa/platform-checklist/areas/studio-authoring.json @@ -955,7 +955,7 @@ "title": "Permission-matrix editor UX: field-filter + bulk apply to EXACTLY the visible fields, and the Bulk column never clips at narrow widths", "since": "v16", "status": "active", - "revision": 11, + "revision": 12, "priority": "P2", "surface": "mixed", "personas": ["admin"], @@ -1016,7 +1016,7 @@ { "clause": "the read-only gate holds: a read-only set hides Save, offers no field bulk at all and no operating object-row bulk, and disables every checkbox; the read-only badge names WHICH gate holds", "oracle": "screenshot", - "verify": "on the read-only set Save is absent, every checkbox is disabled, the field bulk buttons (Read-only all / Write all / Clear) are absent — not merely disabled (PermissionMatrixEditor.tsx FieldsSubTable renders them only while writable; QA run #26715 read them absent in read-only Studio) — and the object row's bulk, which appears only on hover or keyboard focus (engine.studio.access.bulkHint), is disabled when it appears; an operating bulk control is the FAIL. The badge names the gate that holds; the console distinguishes FOUR (objectui PermissionMatrixEditor.tsx at the pin): the package gate (engine.studio.pkg.readonly — Studio on a read-only package), the artifact gate (perm.readOnly.artifact, 'Read-only (this set is provided by a code package)' — a set a code package ships, in the metadata admin), the wall (perm.readOnly.walled — the security catalog under isolated/group tenancy) and the type gate (perm.readOnly — a type with no runtime write channel). On a stock boot only the package and artifact gates are reachable — the wall needs a walled tenancy posture and the type gate a permission type with no write channel, which stock does not have — so score those two on the packaged showcase_contributor set (Studio Access and the metadata admin) and record the other two as not reachable on stock. A badge that blames the wrong gate is the FAIL", + "verify": "on the read-only set Save is absent, every checkbox is disabled, the field bulk buttons (Read-only all / Write all / Clear) are absent — not merely disabled (PermissionMatrixEditor.tsx FieldsSubTable renders them only while writable; QA run #26715 read them absent in read-only Studio) — and every object row draws its bulk strip, every button of which is disabled in read-only Studio; an operating bulk control is the FAIL. The badge names the gate that holds; the console distinguishes FOUR (objectui PermissionMatrixEditor.tsx at the pin): the package gate (engine.studio.pkg.readonly — Studio on a read-only package), the artifact gate (perm.readOnly.artifact, 'Read-only (this set is provided by a code package)' — a set a code package ships, in the metadata admin), the wall (perm.readOnly.walled — the security catalog under isolated/group tenancy) and the type gate (perm.readOnly — a type with no runtime write channel). On a stock boot only the package and artifact gates are reachable — the wall needs a walled tenancy posture and the type gate a permission type with no write channel, which stock does not have — so score those two on the packaged showcase_contributor set (Studio Access and the metadata admin) and record the other two as not reachable on stock. A badge that blames the wrong gate is the FAIL", "evidence": "the read-only screenshot" }, { @@ -1096,6 +1096,12 @@ "date": "2026-11-04", "change": "steps[3] and acceptance[3].clause corrected from QA run #29893 (W5-STUDIO, at 589049b0): after Clear a field falls back to the object's grant (data-field-rule=\"inherited\"), not to a read-only default; the verify (keys absent from the saved map) is unchanged. Read at base f68b47ca", "ref": "#29906" + }, + { + "revision": 12, + "date": "2026-11-17", + "change": "acceptance[5].verify re-read for #34795 (PR #34914): every object row now draws its bulk strip, so the verify no longer says the strip appears only on hover or keyboard focus or cites engine.studio.access.bulkHint (that key is removed). It says every row draws the strip and every button in it is disabled in read-only Studio. The FAIL condition, an operating bulk control, is unchanged. Wording only; no clause weakened", + "ref": "#34795" } ] }, diff --git a/ui/e2e/permission-field-panel-scroll.spec.ts b/ui/e2e/permission-field-panel-scroll.spec.ts index 80ff3e19b9e..c4bf89237b2 100644 --- a/ui/e2e/permission-field-panel-scroll.spec.ts +++ b/ui/e2e/permission-field-panel-scroll.spec.ts @@ -277,7 +277,11 @@ async function mount(page: Page, c: Case): Promise { }, c); await page.addScriptTag({ content: bundle, type: 'module' }); const compiled = new Set(); - const expand = page.getByRole('button', { name: new RegExp(`^Project\\W*${OBJECT}\\W*$`) }); + // The Studio row names the object by its label alone, the machine name being + // the button's tooltip (objectstack#34795); the environment table still + // prints the name beside the label. + const name = c.host === 'studio' ? /^Project$/ : new RegExp(`^Project\\W*${OBJECT}\\W*$`); + const expand = page.getByRole('button', { name }); await expand.waitFor({ state: 'attached', timeout: 30_000 }); await styleUntilStable(page, compiled); await expand.click(); diff --git a/ui/packages/app-shell/src/preview/DraftChangesPanel.tsx b/ui/packages/app-shell/src/preview/DraftChangesPanel.tsx index 1f099038351..738b36bb8e3 100644 --- a/ui/packages/app-shell/src/preview/DraftChangesPanel.tsx +++ b/ui/packages/app-shell/src/preview/DraftChangesPanel.tsx @@ -2078,7 +2078,7 @@ export function DraftChangesPanel({

{t('preview.changes.securityBlockWhere', { - defaultValue: 'Fix it on the object under Settings → Record sharing, then publish again.', + defaultValue: 'Fix it on the object under Settings → Who can see which records, then publish again.', })}

diff --git a/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityLink.test.tsx b/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityLink.test.tsx index bccbf78d8c2..e797ddbfaba 100644 --- a/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityLink.test.tsx +++ b/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityLink.test.tsx @@ -101,6 +101,6 @@ describe('DraftChangesPanel — reaching the object the publish door refuses (ob // And what #5418 shipped is intact: the item is still named, and the // sentence still says where to fix it. expect(block.textContent).toContain('object/crmext_visit'); - expect(block.textContent).toMatch(/Settings → Record sharing/); + expect(block.textContent).toMatch(/Settings → Who can see which records/); }); }); diff --git a/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityProblems.test.tsx b/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityProblems.test.tsx index c7f5878f350..3af1f21b564 100644 --- a/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityProblems.test.tsx +++ b/ui/packages/app-shell/src/preview/__tests__/DraftChangesPanel.securityProblems.test.tsx @@ -82,7 +82,7 @@ describe('DraftChangesPanel — pre-publish security posture (objectui#5418)', ( // language (`SECURITY_RULE_TEXT`), not the ADR paragraph. expect(block.textContent).toMatch(/sharingModel/); // And where to go, which the toast never said. - expect(block.textContent).toMatch(/Settings → Record sharing/); + expect(block.textContent).toMatch(/Settings → Who can see which records/); }); it('reports without blocking — the server door stays the authority', async () => { diff --git a/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.stateVocabulary-29705.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.stateVocabulary-29705.test.tsx index 2cd99092aea..4c8e7512138 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.stateVocabulary-29705.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.stateVocabulary-29705.test.tsx @@ -288,14 +288,14 @@ describe('Access: sharing settings in zh carry no English doublet or bare OWD (o }); it('the matrix column and the explain rule name the sharing model in Chinese', () => { - expect(ZH['engine.studio.access.colOwd']).toBe('记录共享模型'); + expect(ZH['engine.studio.access.colOwd']).toBe('谁能看到哪些记录'); expect(ZH['engine.studio.access.explain.ruleKind.owd_baseline']).toMatch(/^\p{Script=Han}/u); // The prose that names the Private option names it the way the picker does. expect(ZH['engine.studio.settings.sharingDescUnset']).not.toMatch(/Private/u); expect(ZH['engine.studio.data.owdHint']).not.toMatch(/Private/u); - // en is untouched. - expect(EN['perm.owd.private']).toBe('Private'); - expect(EN['engine.studio.access.colOwd']).toBe('OWD'); + // en names them in plain words too (objectstack#34795). + expect(EN['perm.owd.private']).toBe('Only the owner can see'); + expect(EN['engine.studio.access.colOwd']).toBe('Who can see which records'); }); }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.artifactTier.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.artifactTier.test.tsx index 8b64ca9625a..7a4fcd9343d 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.artifactTier.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.artifactTier.test.tsx @@ -51,6 +51,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, render, screen, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -185,7 +189,7 @@ describe('PermissionMatrixEditPage — the ARTIFACT tier locks an env-scope over expect(screen.getByLabelText('a_account Read')).toBeDisabled(); for (const box of screen.getAllByRole('checkbox')) expect(box).toBeDisabled(); const row = screen.getByText('Account').closest('tr')!; - for (const n of ['R', 'CRUD', 'All', 'None']) { + for (const n of ['Read only', 'Read & write', 'All', 'None']) { expect(within(row).getByRole('button', { name: n })).toBeDisabled(); } }); @@ -276,7 +280,7 @@ describe('PermissionMatrixEditPage — MUST NOT CHANGE: what the artifact tier m expect(screen.queryByRole('button', { name: /^Save$/ })).toBeNull(); expect(screen.getByLabelText('a_account Read')).toBeEnabled(); const row = screen.getByText('Account').closest('tr')!; - for (const n of ['R', 'CRUD', 'All', 'None']) { + for (const n of ['Read only', 'Read & write', 'All', 'None']) { expect(within(row).getByRole('button', { name: n })).toBeEnabled(); } expect(lockBadge()).toBeNull(); @@ -399,7 +403,7 @@ describe('PermissionMatrixEditPage — the artifact verdict asks ADR-0010 proven expect(screen.getByRole('button', { name: /^Save$/ })).toBeEnabled(); expect(screen.getByLabelText('a_account Read')).toBeEnabled(); const row = screen.getByText('Account').closest('tr')!; - for (const n of ['R', 'CRUD', 'All', 'None']) { + for (const n of ['Read only', 'Read & write', 'All', 'None']) { expect(within(row).getByRole('button', { name: n })).toBeEnabled(); } expect(lockBadge()).toBeNull(); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.bulkMergeKeys.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.bulkMergeKeys.test.tsx index 61bcce22fa0..518350de8a6 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.bulkMergeKeys.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.bulkMergeKeys.test.tsx @@ -50,6 +50,10 @@ */ import { describe, it, expect, vi, afterEach } from 'vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { render, screen, cleanup, fireEvent, waitFor, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -193,7 +197,7 @@ describe('PermissionMatrixEditor · bulk buttons vs unmodelled keys (objectui#66 }, }); - fireEvent.click(bulkButton('a_account', 'CRUD')); + fireEvent.click(bulkButton('a_account', 'Read & write')); const payload = await save(server); const row = payload.objects.a_account; @@ -221,7 +225,7 @@ describe('PermissionMatrixEditor · bulk buttons vs unmodelled keys (objectui#66 }, }); - fireEvent.click(bulkButton('a_account', 'R')); + fireEvent.click(bulkButton('a_account', 'Read only')); const payload = await save(server); const row = payload.objects.a_account; diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.columnHeaders-29729.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.columnHeaders-29729.test.tsx index 9ad71e2d2e8..5b5c0aec911 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.columnHeaders-29729.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.columnHeaders-29729.test.tsx @@ -24,6 +24,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import * as React from 'react'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, render, screen, within } from '@testing-library/react'; @@ -138,12 +142,12 @@ describe("Setup's sharing-model chip reads through the catalogue (objectstack#29 it('zh names the sharing model in Chinese, with no bare OWD', async () => { mount('zh', 'setup'); const chip = await screen.findByText(/^记录共享模型:/u, undefined, { timeout: 8000 }); - expect(chip.textContent).toBe('记录共享模型:私有(默认)'); + expect(chip.textContent).toBe('记录共享模型:只有负责人能看(默认)'); expect(chip.textContent).not.toMatch(/OWD/u); }); it('CONTROL — en keeps "OWD {value}"', async () => { mount('en', 'setup'); - expect(await screen.findByText('OWD Private (default)')).toBeInTheDocument(); + expect(await screen.findByText('OWD Only the owner can see (default)')).toBeInTheDocument(); }); }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.exportColumn-26885.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.exportColumn-26885.test.tsx index c9a2a0b7a0c..563c9917f30 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.exportColumn-26885.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.exportColumn-26885.test.tsx @@ -20,6 +20,10 @@ */ import { describe, it, expect, vi, afterEach } from 'vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { render, screen, cleanup, fireEvent, waitFor, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -161,7 +165,7 @@ describe('the bulk buttons leave Export as it is (objectstack#26885)', () => { }); }); - for (const label of ['R', 'CRUD', 'All']) { + for (const label of ['Read only', 'Read & write', 'All']) { it(`"${label}" keeps a granted Export ticked`, async () => { const server = await renderSet({ crm_case: { allowRead: true, allowExport: true } }); fireEvent.click(bulk(label)); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.gridChrome-27866.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.gridChrome-27866.test.tsx index c656aa67cc0..5dd4adbaaaa 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.gridChrome-27866.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.gridChrome-27866.test.tsx @@ -16,6 +16,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -88,8 +92,11 @@ async function renderPage(studio = false) { await screen.findByRole('button', { name: objectButton('a_project') }, { timeout: 5000 }); } -/** An object row's expand button: its label, then its API name. */ -const objectButton = (name: string) => new RegExp(`^${name === 'a_project' ? 'Project' : 'Task'}\\W*${name}\\W*$`); +/** + * An object row's expand button: its label, then its API name — on the Studio + * Objects tab the label alone, the API name its tooltip (objectstack#34795). + */ +const objectButton = (name: string) => new RegExp(`^${name === 'a_project' ? 'Project' : 'Task'}(\\W*${name}\\W*)?$`); async function expand() { fireEvent.click(screen.getByRole('button', { name: objectButton('a_project') })); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.objectGrantInherited-27010.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.objectGrantInherited-27010.test.tsx index f4bcefdf746..83dbc839214 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.objectGrantInherited-27010.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.objectGrantInherited-27010.test.tsx @@ -14,6 +14,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -257,7 +261,7 @@ describe('every object-row control writes only what the admin sees change (objec it('the R shortcut on an inherited row merges from the `*` entry; None writes an empty entry of its own', async () => { const server = await renderSet({ '*': { ...CRUD, allowExport: true } }); const projectRow = rowOf('a_project'); - fireEvent.click(within(projectRow).getByRole('button', { name: 'R' })); + fireEvent.click(within(projectRow).getByRole('button', { name: 'Read only' })); const taskRow = rowOf('a_task'); fireEvent.click(within(taskRow).getByRole('button', { name: 'None' })); // On screen: a_task now draws its own empty entry, nothing checked. diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.packageDoorFacets.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.packageDoorFacets.test.tsx index 1c7027f8051..9b36ae5e137 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.packageDoorFacets.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.packageDoorFacets.test.tsx @@ -21,6 +21,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -135,7 +139,7 @@ function openFacet(title: string) { * through the real facet editors — the card's reproduction, minus the browser. */ async function authorEveryFacet() { - openFacet('Row-Level Security'); + openFacet('Record Scope Rules'); fireEvent.click(await screen.findByRole('button', { name: /Add policy/ })); fireEvent.change(await screen.findByPlaceholderText('Policy name'), { target: { value: 'qa_st2_rls' }, @@ -145,7 +149,7 @@ async function authorEveryFacet() { }); fireEvent.change(screen.getByPlaceholderText(USING_PLACEHOLDER), { target: { value: USING } }); - openFacet('Tab Visibility'); + openFacet('Menu Visibility'); // The visibility picker is the shared Select (objectui#11865): open it and pick, as a user does. fireEvent.keyDown(await screen.findByTestId('tab-visibility-a_account'), { key: 'ArrowDown' }); fireEvent.click(within(await screen.findByRole('listbox')).getByRole('option', { name: 'Hidden' })); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.readonly.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.readonly.test.tsx index 3ee88e115c9..0c3683a2fca 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.readonly.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.readonly.test.tsx @@ -49,6 +49,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -176,7 +180,7 @@ describe('PermissionMatrixEditPage — read-only package gate (host readOnly)', } // …and so are the row bulk-set buttons. const row = screen.getByText('Account').closest('tr')!; - for (const name of ['R', 'CRUD', 'All', 'None']) { + for (const name of ['Read only', 'Read & write', 'All', 'None']) { expect(within(row).getByRole('button', { name })).toBeDisabled(); } @@ -265,7 +269,7 @@ describe('PermissionMatrixEditPage — type-level gate keeps its own wording', ( // Row bulk-set buttons are live too — `writable` drives all of them. const row = screen.getByText('Account').closest('tr')!; - for (const name of ['R', 'CRUD', 'All', 'None']) { + for (const name of ['Read only', 'Read & write', 'All', 'None']) { expect(within(row).getByRole('button', { name })).toBeEnabled(); } diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx index 2f9815f6afb..857742e7866 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx @@ -131,7 +131,7 @@ async function openPackageDoor(server: Server) { , ); await screen.findByText('a_account'); - fireEvent.click(screen.getByRole('button', { name: /Row-Level Security/ })); + fireEvent.click(screen.getByRole('button', { name: /Record Scope Rules/ })); fireEvent.click(await screen.findByRole('button', { name: /Add policy/ })); } diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.scope.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.scope.test.tsx index 93d56b9fadd..8dfc93e7d2d 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.scope.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.scope.test.tsx @@ -17,6 +17,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, @@ -255,9 +259,9 @@ describe('PermissionMatrixEditor — private posture badge (ADR-0066 ④)', () = await screen.findByText('Account'); // An authored OWD renders its value… const accountRow = screen.getByText('Account').closest('tr')!; - expect(accountRow.textContent).toContain('OWD Public read'); + expect(accountRow.textContent).toContain('OWD Everyone can see'); // …an unset OWD renders the fail-closed D1 default. const contactRow = screen.getByText('a_contact').closest('tr')!; - expect(contactRow.textContent).toContain('OWD Private (default)'); + expect(contactRow.textContent).toContain('OWD Only the owner can see (default)'); }); }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdict-26858.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdict-26858.test.tsx index 09ebf5c1be3..bbaea513391 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdict-26858.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdict-26858.test.tsx @@ -15,6 +15,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -96,7 +100,7 @@ async function openPackageDoor(server: Server) { , ); await screen.findByText('a_account'); - fireEvent.click(screen.getByRole('button', { name: /Row-Level Security/ })); + fireEvent.click(screen.getByRole('button', { name: /Record Scope Rules/ })); } const policy = (using: string) => ({ diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdictHold-27482.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdictHold-27482.test.tsx index 254bc93c609..773abfb9692 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdictHold-27482.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdictHold-27482.test.tsx @@ -14,6 +14,10 @@ */ import '@testing-library/jest-dom/vitest'; +// The source under test reaches these through dynamic imports: their first load is paid at collection. +import '@objectstack/formula'; +import '@objectstack/lint'; +import '@objectstack/spec/identity'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -112,7 +116,7 @@ async function openPackageDoor(server: Server) { , ); await screen.findByText('a_account'); - fireEvent.click(screen.getByRole('button', { name: /Row-Level Security/ })); + fireEvent.click(screen.getByRole('button', { name: /Record Scope Rules/ })); } const edit = (placeholder: string, value: string) => diff --git a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx index ec1c853867f..39dba908e62 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx @@ -105,7 +105,6 @@ import { import { useDraftAutoSave, type DraftSend } from '../studio-design/useDraftAutoSave.js'; // objectui#12456 — the Studio Access pillar's presentation draws the shared item header. import { StudioItemHeader, StudioTab } from '../studio-design/StudioItemHeader.js'; -import { STUDIO_KIND_CHIP } from '../studio-design/studio-tokens.js'; import type { CustomizationMarkKind } from '../studio-design/customizationMarks.js'; import { useDisplayLocale } from '@object-ui/i18n'; import { @@ -535,6 +534,11 @@ export interface PermissionStudioChrome { chips?: React.ReactNode; /** Before History in the header's actions (the pillar's Explain access). */ actions?: React.ReactNode; + /** + * objectstack#34795 — the open app's name. The header's title reads + * "app · set label"; without it, the set's label alone. + */ + appLabel?: string; /** * objectstack#32774 — told, for the set `name` this editor shows, the * package the clone door must name to copy it (`holdingPackage` of the @@ -2308,26 +2312,35 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved, const chipButton = 'inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground'; const facetTab = chrome.tab === 'rls' || chrome.tab === 'tabs' || chrome.tab === 'admin' ? chrome.tab : null; + // objectstack#34795 — the title is "app · set label", in the title row + // alone, so it is not cut: the set's machine name is the title's tooltip, + // and the provenance, default and lock labels are the line under it. + const setLabel = headerLabel || name; + const studioTitle = chrome.appLabel ? `${chrome.appLabel} · ${setLabel}` : setLabel; return (
- {/* The provenance chip in the artboard's kind-chip look; same - test id and the same answer as the page's badge. */} - + title={studioTitle} + titleProps={{ title: name, 'data-testid': 'perm-studio-title' }} + note={ + + {/* Same test id and the same answer as the page's badge. */} + {shippedByPackage ? t('perm.badge.package') : t('perm.badge.custom')} - {!!draft.isDefault && {t('perm.badge.default')}} + {!!draft.isDefault && ( + <> + + {t('perm.badge.default')} + + )} {/* A host-locked package says so in the pillar's note; the other gates (type, artifact, wall) keep their own badge. */} {!readOnly && lockBadgeEl} - + } meta={meta} actions={ @@ -2442,11 +2455,6 @@ export function PermissionMatrixEditPage({ type, name, packageId, onDraftSaved, onOpenOwd={onOpenOwd} /> - {writable && ( -

- {t('engine.studio.access.bulkHint')} -

- )}