Skip to content

Commit d4e0e40

Browse files
committed
test(cli): keep contributed nav labels in the app's pack, which carries the required app label
Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent a2557ce commit d4e0e40

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎packages/cli/test/i18n-contributed-nav-coverage.test.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,26 @@ const CONTRIBUTED_NAV_ZH = { nav_case: { label: '工单' }, grp_knowledge: { lab
7979
const without = (labels: Record<string, unknown>, id?: string) =>
8080
Object.fromEntries(Object.entries(labels).filter(([key]) => key !== id));
8181

82-
/** The app package carries the app's own labels; the module, the labels of what it contributes. */
82+
/**
83+
* The app package's pack carries every navigation label, the contributed ones
84+
* included — the layout HotCRM's packs were measured in (#18203). A pack's
85+
* `apps.APP` entry requires the app's own `label`, so a module could ship the
86+
* contributed labels itself only by restating it.
87+
*/
8388
function stacks(drop?: string) {
8489
const appStack = defineStack({
8590
manifest: appManifest,
8691
objects: [object('cnv_account', 'Account')],
8792
apps: [app],
8893
i18n: I18N,
89-
translations: [{ 'zh-CN': { apps: { cnv_desk: { label: '服务台', navigation: without(OWN_NAV_ZH, drop) } } } }],
94+
translations: [{
95+
'zh-CN': { apps: { cnv_desk: { label: '服务台', navigation: without({ ...OWN_NAV_ZH, ...CONTRIBUTED_NAV_ZH }, drop) } } },
96+
}],
9097
} as any);
9198
const svcStack = defineStack({
9299
manifest: svcManifest,
93100
objects: [object('cnv_case', 'Case'), object('cnv_article', 'Article')],
94101
i18n: I18N,
95-
translations: [{ 'zh-CN': { apps: { cnv_desk: { navigation: without(CONTRIBUTED_NAV_ZH, drop) } } } }],
96102
} as any);
97103
return { appStack, svcStack };
98104
}

0 commit comments

Comments
 (0)