You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e60936
Browse filesBrowse the repository at this point in the historyBrowse files
feat(console): the record page reads the data lock from its one payload request (ADR-0162 item 4)
Re-applies the record-page half held back from #38994. Edit and Delete
read the data layer's lock (`dataLock`), which the page payload now
carries (`dataLock: true` on `POST /data/:object/:id/page`), so a closed
record is greyed and worded as closed without a second request. Reads
the hook sends itself (the edit dialog over a list, a refresh after a
change) keep asking `GET /data/:object/:id/lock`.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhKEbEnW8pwZRgK2gJ
fix(console): a closed record's page reads as closed, not as in approval, from the page's one request
8
+
9
+
Clause-②: no
10
+
Metadata-protocol: none
11
+
12
+
The record page now reads the data layer's lock for its Edit and Delete, and words the reason from its `lockReason`. It asks for that lock in the request it already sends when it opens (`POST /api/v1/data/{object}/{id}/page` with `dataLock: true`), so opening a record page is still one request. It no longer asks the approvals lock read for these affordances; the approvals panel and the header's approval tag keep reading it.
13
+
14
+
- A closed record (`lockReason: 'closed_state'`, its own state or its master's) shows Edit greyed with "This record is closed, so it can't be changed.", a "Closed" chip, and no Delete, for either `lockSource`. Its master-detail lines offer no New, Edit or Delete. A record that is closed and also held by an approval reads as closed.
15
+
- A record held by an approval behaves as before: its own approval keeps Delete, and a line of a held master does not.
16
+
- The answer is read above the caller's field permissions, so a reader who may not see the state field still gets the closed wording, and the page shows neither the field nor its value.
17
+
- When nothing on screen is a record page, the edit dialog opened over a list reads the record's lock through `GET /api/v1/data/{object}/{id}/lock` next to its approvals reads. The record page does the same when it re-reads after the record changes. Over its record page, the dialog reuses the page's answer and sends nothing.
18
+
-`RecordPagePayload` (`@object-ui/types`) declares the payload's `dataLock` part.
19
+
- New strings `detail.lockedClosed` and `detail.lockedClosedTooltip` in every console locale.
0 commit comments