Skip to content

Commit 920bc12

Browse files
fix(plugin-approvals,plugin-security): the approval request actions name the request in their success copy, and Explain access names the principal as a person (#23202)
Fixes #23157 Clause-②: no — server-authored strings (the approval request actions' success copy and explain's principal sentence) name the record and the person; no published schema, translation key or export moves. Server-authored strings that the console renders verbatim now name what and who they are about. This is family card #23157, a member of objectui#12308 (classes 2 and 5). It covers the card's rows 1 and 2, plus the same-family rows the seat's claim amendment added for the patch round. ## Row 1 and its family: every request action's success toast names the request Every action on `sys_approval_request` in `packages/plugins/plugin-approvals/src/sys-approval-request.object.ts` had a bare-verb `successMessage`. Each now interpolates `${result.request.record_title}`. Approve and Reject reuse the inbox row's inline wording (objectui's `inlineApproved` and `inlineRejected`). | action | route (all `type: 'api'`, POST) | service method | was | now | |---|---|---|---|---| | `approval_approve` | `…/requests/ID/approve` | `decide()` | `Approved.` | `Approved "TITLE"` | | `approval_reject` | `…/requests/ID/reject` | `decide()` | `Rejected.` | `Rejected "TITLE"` | | `approval_reassign` | `…/requests/ID/reassign` | `reassign()` | `Reassigned.` | `Reassigned "TITLE"` | | `approval_send_back` | `…/requests/ID/revise` | `sendBack()` | `Sent back for revision.` | `Sent "TITLE" back for revision` | | `approval_request_info` | `…/requests/ID/request-info` | `requestInfo()` | `Information requested.` | `Information requested on "TITLE"` | | `approval_remind` | `…/requests/ID/remind` | `remind()` | `Reminder sent.` | `Reminder sent for "TITLE"` | | `approval_recall` | `…/requests/ID/recall` | `recall()` | `Recalled.` | `Recalled "TITLE"` | | `approval_resubmit` | `…/requests/ID/resubmit` | `resubmit()` | `Resubmitted.` | `Resubmitted "TITLE"` | | `approval_comment` | `…/requests/ID/comment` | `comment()` | `Reply posted.` | `Reply posted on "TITLE"` | `TITLE` stands for the `${result.request.record_title}` token. The zh-CN, ja-JP and es-ES values of the same nine keys are updated in step, and each carries the same token. Reject reuses objectui's own `inlineRejected` translations. No translation key is added, and the en bundle equals the source. ## Row 2 and its family: Explain access names people, not raw ids The principal layer's `detail` in `explain-engine.ts` used to open with `Principal 1cnVm… holds position(s) …`. It now opens with `Principal Dev Admin (admin@objectos.ai; id 1cnVm…) holds position(s) …`. Three other users in the same layer are named the same way: - the on-behalf-of delegator, in all three arms of that clause; - the user an ADR-0091 D3 delegated position came from, in the clause (`approver from Grace Hopper (grace@…; id usr_…) until …`); - that same user in the position's contributor attribution (`delegation from Grace Hopper (…) until …`). The module-private helper `personOf` reads each user row with `ql.findOne('sys_user', …)` under the **asker's** context: the caller, or the explained principal on a self-explanation. It reads each distinct delegating user once. Every data middleware applies, so the sentence names only what the asker's own read returns: - When the read returns no row, the asker gets the bare id the sentence always carried. - When field-level security masks a field, that field stays out. - When the read throws or the engine has no `findOne`, the sentence falls back to the bare id. The name is presentation only and never feeds a verdict. The decision's `principal` object is unchanged. Only the principal layer's `detail` expression and its contributor attribution changed, plus the declared helper and its reads. `isRlsDenySentinel`, its docblock and PR #23179's lines are untouched. **Ruling-A pin change, accepted by the seat (claim amendment on the card).** Two askers can now be shown different names for the same principal. `explain-asker-gate.test.ts` compares whole decisions across askers, and its 9 comparisons now go through `apartFromPrincipalPerson`, which sets aside only the person segment of the principal sentence. The record story that ruling A governs is still compared in full. Only the principal's person label is set aside, read through each asker's own door, consistent with ruling A's "by the read access of whoever ASKED". ## Measurements: what each route answers Every route answers its service method's result unwrapped (`res.json(out)` in `rest-server.ts`'s `decisionRoute`, the recall route, `flowMoveRoute` and `threadRoute`). Each method returns `request` from `readBackRequest()`, which reaches `loadRequest()` and then `enrichRows()`, where `record_title` is set. The console's `apiHandler` hands a body with no `data` key to the runner as `result.data`. Measured live on fresh showcase boots of this branch (my own random port, torn down after). Each row shows the answer's keys and `request.record_title`: - **approve:** `decision, finalized, request, resumed, runId`. `INV-1006` (finalized) and `EXP-2001` (still pending). - **reject:** `decision, finalized, request, resumed, runId`. `EXP-DEMO`. - **reassign:** `request`. `EXP-2001`. - **revise (send back):** `request, resumed, runId`. `Compliance Audit`, status `returned`. This request was opened by raising a project budget, which runs `showcase_budget_approval` and its revise edge. The invoice flow answered 400 because its node has no `revise` out-edge. - **resubmit:** `request, resumed, runId`. `Compliance Audit`. - **request-info:** `request`. `INV-1012`. - **remind:** `notified, request`. `INV-1012`. - **recall:** `request, resumed, runId`. `Compliance Audit`, status `recalled`. - **comment:** `request`. `INV-1012`. **Not changed: none.** Every one of the nine routes carries `request.record_title`, so no copy was left as it was and no route answer was widened. `GET /api/v1/meta/object/sys_approval_request` served the approve copy in en and zh-CN. Explain was measured live as the admin: - "Me": `Principal Dev Admin (admin@objectos.ai; id …) holds position(s) [platform_admin, …]`. - Explaining `usr_showcase_auditor_demo`: `Principal Ada Auditor (demo) (auditor.demo@example.com; id usr_showcase_auditor_demo) holds …`. ## Pins - `plugin-approvals/src/approval-service.test.ts` has 12 cells. Each action's copy is filled from that action's real service answer through `${result.PATH}`, and every token must resolve: - approve: finalizing, still pending, and named from the payload snapshot when the record's row is gone; - one cell each for reject, reassign, send back, request info, remind, recall, resubmit and reply; - a check that every declared action's copy reads `${result.*}`. - `plugin-approvals/src/translations/success-copy-names-request-i18n.test.ts` (renamed from the round-1 approve-only file) checks all nine actions. Every source copy must carry `${result.request.record_title}`, every locale must carry the same tokens, en must equal the source, and no other locale may echo the English source. - `plugin-security/src/explain-principal-person.test.ts` has 16 cells and uses the real `SecurityPlugin` over a real `ObjectQL` and better-sqlite3. Each asker's own `sys_user` read is armed first, and each cell asserts the sentence that read licenses. - **Principal:** named for the directory admin, the principal itself and system. The masked admin gets the name and never the email. **Control:** the blind admin gets the bare id, and the whole decision contains neither the name nor the email. - **D10 delegator:** both people named, only one named, or neither, as the intersected read returns. A delegator that does not exist is named by its id. - **ADR-0091 D3 delegated position:** a real `sys_user_position` row with `delegated_from` set. The directory admin gets Grace named in the clause and in the attribution. The masked admin gets the name only. **Control:** the blind admin gets `from usr_pp_grace` in both, and the whole decision contains neither Grace's name nor her email. ## Negative-pin ablations Each ablation was committed first and run through `scripts/ablation-replace.mjs`, with an EXIT/INT/TERM trap that restores the file. Every leg proved its restore by blob hash against HEAD with an empty `git diff HEAD`. Each subject resolves through relative `src` imports, so no `dist/` leg was needed. - **A1:** the old principal sentence. 5 cells failed and the controls held: `expected 'Principal usr_pp_ada holds position(s…' to match /^Principal Ada Lovelace \(ada@example…/`. - **A2:** the old on-behalf-of clause. 2 cells failed: `expected 'Principal Release Bot (bot@example.te…' to contain 'Acting on behalf of Grace Hopper (gra…'`. - **C1:** the delegated-position user printed raw again (`delegatorOf = (from) => from`). 2 cells failed and the blind control held: `expected 'Principal Lin Delegate (lin@example.t…' to contain '1 position(s) held via delegation (AD…'`. - **B1:** approve's source copy back to `Approved.`. 7 cells failed. - **B2:** the zh-CN approve value back to `已通过。`. 1 cell failed. - **D1:** reject's source copy back to `Rejected.`. 5 cells failed: `reject: names the record` failed with `expected 'Rejected.' to be 'Rejected "Acme Renewal"'`, and the token checks failed with `approval_reject.successMessage: expected [] to deeply equal [ '${result.request.record_title}' ]`. - **D2:** the ja-JP recall value back to `取り下げました。`. 1 cell failed: `ja-JP approval_recall.successMessage tokens: expected [] to deeply equal [ '${result.request.record_title}' ]`. ## Local verification at HEAD dd9bb74 - **Full package suites, under the shared lock:** - `@objectstack/plugin-security`: 194 files and 4012 tests passed, 45 skipped. - `@objectstack/plugin-approvals`: 74 files and 1051 tests passed. - **Typecheck:** both packages' `typecheck` scripts pass, and the test-typecheck ledgers held. - **Derived gates:** `dispatch-gates --commands` derived 66 families from this branch's changed files, all run, with the results recorded in the dev report. `--ran` reconciled. - **Lint, narrowed:** eslint ran over the 10 changed TS files only, with 0 errors and 0 warnings. The population is eslint's own `**/*.{ts,…}` config, and the count comes from `--format json`. The narrowing excludes nothing: this config enables no type-aware linting (no `parserOptions.project`), so the diff cannot move a verdict on an untouched file. - **Main:** `origin/main` moved during the round, but not on any file this PR touches, and PR #23179 is still open. No merge was needed. - **Left to CI:** the type-check lanes, Test Core, Build Core and dogfood jobs. ## Acceptance notes - **Residual in the toasts:** a target with no resolvable title (no display-field value, and no name, title, subject or label in the snapshot) would toast with an empty title, for example `Approved ""`. The inbox's inline path falls back to the formatted record id there, and the token grammar has no fallback operator. Every request measured carried a title. - **Cosmetic:** a display name that itself ends in parentheses reads `Ada Auditor (demo) (auditor.demo@example.com; id …)`. - **Cost:** each explanation makes one more `sys_user` read per distinct person named, and one more in the nested read pass when a by-id write is explained for a row the principal cannot read. --- _Generated by [Claude Code](https://claude.ai/code/session_01FzQy26KznSa5j2gnf3AzsE)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 08b38cb commit 920bc12

11 files changed

Lines changed: 660 additions & 54 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
"@objectstack/plugin-approvals": patch
3+
"@objectstack/plugin-security": patch
4+
---
5+
6+
fix: the approval request actions' success toasts name the request, and Explain access names the principal as a person
7+
8+
Clause-②: no
9+
10+
Server-authored strings that the console renders verbatim now name what and who they are about.
11+
12+
- `@objectstack/plugin-approvals`: every action on `sys_approval_request` had a bare-verb `successMessage` (`Approved.`, `Rejected.`, `Reassigned.` and so on). Each now names the request through `${result.request.record_title}`. Each action's route answers `{ request, … }` with the read-back request and its display enrichment, so `record_title` is the title the inbox shows: the target record's display field, else its payload snapshot. The new copies:
13+
- Approve and Reject use the inbox row's inline wording: `Approved "TITLE"` and `Rejected "TITLE"`.
14+
- The others read `Reassigned "TITLE"`, `Sent "TITLE" back for revision`, `Information requested on "TITLE"`, `Reminder sent for "TITLE"`, `Recalled "TITLE"`, `Resubmitted "TITLE"` and `Reply posted on "TITLE"`.
15+
16+
The zh-CN, ja-JP and es-ES values of the same keys carry the same token. No key, route or response shape changes.
17+
- `@objectstack/plugin-security`: the explain engine's principal layer said `Principal USER_ID holds position(s) …`. It now names the person first and the id second, for example `Principal Ada Lovelace (ada@example.com; id usr_1) holds position(s) …`. Three other users in the same layer are named the same way:
18+
- an on-behalf-of delegator;
19+
- the user an ADR-0091 D3 delegated position came from, in the clause;
20+
- that same user in the position's contributor attribution (`delegation from …`).
21+
22+
Each user row is read with the asker's own context, so row-level and field-level security apply. An asker whose read returns no row gets the bare id, as before, and a field its read masks is left out. As a result, two askers can now be shown different names for the same user. The decision's `principal` object and every verdict are unchanged.

‎packages/plugins/plugin-approvals/src/approval-service.test.ts‎

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,132 @@ describe('ApprovalService (node era)', () => {
12881288
expect(rows[0].record_title).toBe('Snapshot Title');
12891289
});
12901290

1291+
// [#23157] Every request action is `type: 'api'` against a route that
1292+
// answers its service method's result verbatim, and each of those results
1293+
// carries `request`, the read-back row with its display enrichment. Each
1294+
// action's success copy interpolates `${result.*}` over that answer (the
1295+
// scope `ActionSchema.successMessage` declares), so the toast names the
1296+
// request only while the answer carries the title the copy reads.
1297+
describe('each request action\'s success copy, filled from its route\'s answer', () => {
1298+
const copyOf = (name: string): string =>
1299+
((SysApprovalRequest as any).actions as any[]).find((a) => a.name === name).successMessage;
1300+
/** The copy's `${result.<path>}` tokens, each filled from the answer; an unresolved path reads as ''. */
1301+
const fill = (copy: string, result: unknown): { text: string; unresolved: string[] } => {
1302+
const unresolved: string[] = [];
1303+
const text = copy.replace(/\$\{result\.([\w.]+)\}/g, (_m, path: string) => {
1304+
const v = path.split('.').reduce<any>((acc, k) => (acc == null ? undefined : acc[k]), result);
1305+
if (v == null || String(v) === '') unresolved.push(path);
1306+
return v == null ? '' : String(v);
1307+
});
1308+
return { text, unresolved };
1309+
};
1310+
const named = (action: string, answer: unknown): string => {
1311+
const { text, unresolved } = fill(copyOf(action), answer);
1312+
expect(unresolved, `${action}: every token resolves on the answer`).toEqual([]);
1313+
return text;
1314+
};
1315+
/** The id of the request an ordinary open answers (never an auto-outcome in these cells). */
1316+
const openRequestId = async (...args: Parameters<ApprovalService['openNodeRequest']>): Promise<string> =>
1317+
((await svc.openNodeRequest(...args)) as { id: string }).id;
1318+
/** A flow whose approval node declares the `revise` out-edge send-back needs (#3823). */
1319+
const REVISE_FLOW = {
1320+
name: 'deal_approval',
1321+
nodes: [
1322+
{ id: 'approve_step', type: 'approval' },
1323+
{ id: 'wait_revision', type: APPROVAL_REVISE_NODE_TYPE },
1324+
],
1325+
edges: [{ id: 'e_rev', source: 'approve_step', target: 'wait_revision', label: 'revise' }],
1326+
};
1327+
1328+
beforeEach(() => {
1329+
engine._tables['opportunity'] = [{ id: 'opp1', name: 'Acme Renewal', amount: 100 }];
1330+
svc.attachAutomation({
1331+
async resume() { /* resumed */ },
1332+
async cancelRun() { /* handed back */ },
1333+
async getFlow() { return REVISE_FLOW; },
1334+
} as any);
1335+
});
1336+
1337+
it('reads the answer: every action\'s copy carries a `${result.*}` token', () => {
1338+
for (const a of (SysApprovalRequest as any).actions as any[]) {
1339+
expect(a.successMessage, `${a.name}.successMessage`).toMatch(/\$\{result\.[\w.]+\}/);
1340+
}
1341+
});
1342+
1343+
it('approve, finalizing: the toast names the record, the way the inbox row\'s inline Approve does', async () => {
1344+
const id = await openRequestId(openInput(['u9']), CTX);
1345+
const out = await svc.decide(id, { decision: 'approve', actorId: 'u9' }, SYS);
1346+
expect(out.finalized).toBe(true);
1347+
expect(named('approval_approve', out)).toBe('Approved "Acme Renewal"');
1348+
});
1349+
1350+
it('approve, leaving the step waiting on others: still names the record', async () => {
1351+
const id = await openRequestId(openInput(['u1', 'u2'], {}, { behavior: 'unanimous' }), CTX);
1352+
const out = await svc.decide(id, { decision: 'approve', actorId: 'u1' }, SYS);
1353+
expect(out.finalized).toBe(false);
1354+
expect(named('approval_approve', out)).toBe('Approved "Acme Renewal"');
1355+
});
1356+
1357+
it('approve, on a record whose row is gone: named from the payload snapshot, as the inbox names it', async () => {
1358+
engine._tables['opportunity'] = [];
1359+
const id = await openRequestId(openInput(['u9'], { record: { id: 'opp1', name: 'Snapshot Title', amount: 1 } }), CTX);
1360+
const out = await svc.decide(id, { decision: 'approve', actorId: 'u9' }, SYS);
1361+
expect(named('approval_approve', out)).toBe('Approved "Snapshot Title"');
1362+
});
1363+
1364+
it('reject: names the record, the way the inbox row\'s inline Reject does', async () => {
1365+
const id = await openRequestId(openInput(['u9']), CTX);
1366+
const out = await svc.decide(id, { decision: 'reject', actorId: 'u9' }, SYS);
1367+
expect(out.request.status).toBe('rejected');
1368+
expect(named('approval_reject', out)).toBe('Rejected "Acme Renewal"');
1369+
});
1370+
1371+
it('reassign: names the record', async () => {
1372+
const id = await openRequestId(openInput(['u9']), CTX);
1373+
const out = await svc.reassign(id, { actorId: 'u9', to: 'u7' }, asUser('u9'));
1374+
expect(named('approval_reassign', out)).toBe('Reassigned "Acme Renewal"');
1375+
});
1376+
1377+
it('send back for revision: names the record', async () => {
1378+
const id = await openRequestId(openInput(['u9']), CTX);
1379+
const out = await svc.sendBack(id, { actorId: 'u9', comment: 'split the lines' }, asUser('u9'));
1380+
expect(out.request.status).toBe('returned');
1381+
expect(named('approval_send_back', out)).toBe('Sent "Acme Renewal" back for revision');
1382+
});
1383+
1384+
it('request information: names the record', async () => {
1385+
const id = await openRequestId(openInput(['u9']), CTX);
1386+
const out = await svc.requestInfo(id, { actorId: 'u9', comment: 'which cost centre?' }, asUser('u9'));
1387+
expect(named('approval_request_info', out)).toBe('Information requested on "Acme Renewal"');
1388+
});
1389+
1390+
it('remind: names the record', async () => {
1391+
const id = await openRequestId(openInput(['u9']), CTX);
1392+
const out = await svc.remind(id, { actorId: 'u1' }, CTX);
1393+
expect(named('approval_remind', out)).toBe('Reminder sent for "Acme Renewal"');
1394+
});
1395+
1396+
it('recall: names the record', async () => {
1397+
const id = await openRequestId(openInput(['u9']), CTX);
1398+
const out = await svc.recall(id, { actorId: 'u1' }, CTX);
1399+
expect(out.request.status).toBe('recalled');
1400+
expect(named('approval_recall', out)).toBe('Recalled "Acme Renewal"');
1401+
});
1402+
1403+
it('resubmit: names the record', async () => {
1404+
const id = await openRequestId(openInput(['u9']), CTX);
1405+
await svc.sendBack(id, { actorId: 'u9', comment: 'split the lines' }, asUser('u9'));
1406+
const out = await svc.resubmit(id, { actorId: 'u1', comment: 'split' }, CTX);
1407+
expect(named('approval_resubmit', out)).toBe('Resubmitted "Acme Renewal"');
1408+
});
1409+
1410+
it('reply: names the record', async () => {
1411+
const id = await openRequestId(openInput(['u9']), CTX);
1412+
const out = await svc.comment(id, { actorId: 'u1', comment: 'attached the receipt' }, CTX);
1413+
expect(named('approval_comment', out)).toBe('Reply posted on "Acme Renewal"');
1414+
});
1415+
});
1416+
12911417
it('enrichment resolves lookup foreign keys in the payload to record titles', async () => {
12921418
(engine as any).getSchema = (name: string) =>
12931419
name === 'opportunity'

‎packages/plugins/plugin-approvals/src/sys-approval-request.object.ts‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,15 @@ export const SysApprovalRequest = ObjectSchema.create({
471471
'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' +
472472
' || has(record.viewer) && has(record.viewer.can_override) && record.viewer.can_override == true',
473473
locations: ['record_section', 'list_item'],
474-
successMessage: 'Approved.',
474+
// Names what was approved, in the inbox's inline Approve wording. The
475+
// decide route answers `ApprovalDecisionResult`, whose `request` is the
476+
// read-back row with its display enrichment, so `record_title` is the
477+
// same title the inbox row shows (the target record's display field,
478+
// else its payload snapshot). `${result.*}` is the success copy's
479+
// declared scope on a `type: 'api'` action: the route's own response.
480+
// Every action below names the request the same way: each of their
481+
// routes answers `{ request, … }` with that same read-back row.
482+
successMessage: 'Approved "${result.request.record_title}"',
475483
refreshAfter: true,
476484
},
477485
{
@@ -501,7 +509,7 @@ export const SysApprovalRequest = ObjectSchema.create({
501509
'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' +
502510
' || has(record.viewer) && has(record.viewer.can_override) && record.viewer.can_override == true',
503511
locations: ['record_section', 'list_item'],
504-
successMessage: 'Rejected.',
512+
successMessage: 'Rejected "${result.request.record_title}"',
505513
refreshAfter: true,
506514
},
507515
{
@@ -524,7 +532,7 @@ export const SysApprovalRequest = ObjectSchema.create({
524532
'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' +
525533
' || has(record.viewer) && has(record.viewer.can_override) && record.viewer.can_override == true',
526534
locations: ['record_section'],
527-
successMessage: 'Reassigned.',
535+
successMessage: 'Reassigned "${result.request.record_title}"',
528536
refreshAfter: true,
529537
},
530538

@@ -544,7 +552,7 @@ export const SysApprovalRequest = ObjectSchema.create({
544552
],
545553
visible: 'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true',
546554
locations: ['record_section'],
547-
successMessage: 'Sent back for revision.',
555+
successMessage: 'Sent "${result.request.record_title}" back for revision',
548556
refreshAfter: true,
549557
},
550558
{
@@ -559,7 +567,7 @@ export const SysApprovalRequest = ObjectSchema.create({
559567
],
560568
visible: 'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true',
561569
locations: ['record_section'],
562-
successMessage: 'Information requested.',
570+
successMessage: 'Information requested on "${result.request.record_title}"',
563571
refreshAfter: true,
564572
},
565573

@@ -586,7 +594,7 @@ export const SysApprovalRequest = ObjectSchema.create({
586594
],
587595
visible: 'has(record.status) && record.status == "pending" && has(record.viewer) && has(record.viewer.is_submitter) && record.viewer.is_submitter == true',
588596
locations: ['record_section'],
589-
successMessage: 'Reminder sent.',
597+
successMessage: 'Reminder sent for "${result.request.record_title}"',
590598
refreshAfter: true,
591599
},
592600
{
@@ -628,7 +636,7 @@ export const SysApprovalRequest = ObjectSchema.create({
628636
' && has(record.viewer) && has(record.viewer.is_submitter) && record.viewer.is_submitter == true' +
629637
' || has(record.viewer) && has(record.viewer.can_override) && record.viewer.can_override == true',
630638
locations: ['record_section'],
631-
successMessage: 'Recalled.',
639+
successMessage: 'Recalled "${result.request.record_title}"',
632640
refreshAfter: true,
633641
},
634642
{
@@ -643,7 +651,7 @@ export const SysApprovalRequest = ObjectSchema.create({
643651
],
644652
visible: 'has(record.status) && record.status == "returned" && has(record.viewer) && has(record.viewer.is_submitter) && record.viewer.is_submitter == true',
645653
locations: ['record_section'],
646-
successMessage: 'Resubmitted.',
654+
successMessage: 'Resubmitted "${result.request.record_title}"',
647655
refreshAfter: true,
648656
},
649657

@@ -691,7 +699,7 @@ export const SysApprovalRequest = ObjectSchema.create({
691699
' || has(record.status) && record.status == "pending"' +
692700
' && has(record.viewer) && has(record.viewer.is_submitter) && record.viewer.is_submitter == true',
693701
locations: ['record_section'],
694-
successMessage: 'Reply posted.',
702+
successMessage: 'Reply posted on "${result.request.record_title}"',
695703
refreshAfter: true,
696704
},
697705
],

‎packages/plugins/plugin-approvals/src/translations/en.objects.generated.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
125125
approval_approve: {
126126
label: "Approve",
127127
description: "Approve this request? Your approval is recorded, and the request moves on once this step has the approvals it requires.",
128-
successMessage: "Approved.",
128+
successMessage: "Approved \"${result.request.record_title}\"",
129129
params: {
130130
comment: {
131131
label: "Comment"
@@ -138,7 +138,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
138138
approval_reject: {
139139
label: "Reject",
140140
description: "Reject this request? A rejection is final for every approver.",
141-
successMessage: "Rejected.",
141+
successMessage: "Rejected \"${result.request.record_title}\"",
142142
params: {
143143
comment: {
144144
label: "Comment"
@@ -150,7 +150,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
150150
},
151151
approval_reassign: {
152152
label: "Reassign",
153-
successMessage: "Reassigned.",
153+
successMessage: "Reassigned \"${result.request.record_title}\"",
154154
params: {
155155
to: {
156156
label: "New approver",
@@ -163,7 +163,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
163163
},
164164
approval_send_back: {
165165
label: "Send back",
166-
successMessage: "Sent back for revision.",
166+
successMessage: "Sent \"${result.request.record_title}\" back for revision",
167167
params: {
168168
comment: {
169169
label: "Reason"
@@ -172,7 +172,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
172172
},
173173
approval_request_info: {
174174
label: "Request info",
175-
successMessage: "Information requested.",
175+
successMessage: "Information requested on \"${result.request.record_title}\"",
176176
params: {
177177
comment: {
178178
label: "What do you need?"
@@ -181,7 +181,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
181181
},
182182
approval_remind: {
183183
label: "Send reminder",
184-
successMessage: "Reminder sent.",
184+
successMessage: "Reminder sent for \"${result.request.record_title}\"",
185185
params: {
186186
comment: {
187187
label: "Note"
@@ -191,7 +191,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
191191
approval_recall: {
192192
label: "Recall",
193193
description: "Recall this request? Approvers can no longer act on it and the record is unlocked.",
194-
successMessage: "Recalled.",
194+
successMessage: "Recalled \"${result.request.record_title}\"",
195195
params: {
196196
comment: {
197197
label: "Comment"
@@ -200,7 +200,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
200200
},
201201
approval_resubmit: {
202202
label: "Resubmit",
203-
successMessage: "Resubmitted.",
203+
successMessage: "Resubmitted \"${result.request.record_title}\"",
204204
params: {
205205
comment: {
206206
label: "What changed?"
@@ -209,7 +209,7 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
209209
},
210210
approval_comment: {
211211
label: "Reply",
212-
successMessage: "Reply posted.",
212+
successMessage: "Reply posted on \"${result.request.record_title}\"",
213213
params: {
214214
comment: {
215215
label: "Comment"

0 commit comments

Comments
 (0)