Skip to content

Commit ef85740

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-55xl05
Claude-Session: https://claude.ai/code/session_01Utp6CYhXPs8bHjwTVjozM9 Co-authored-by: Claude <noreply@anthropic.com>
2 parents 41289b4 + da7c559 commit ef85740

65 files changed

Lines changed: 1763 additions & 20 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/platform-objects': patch
4+
'@objectstack/plugin-security': patch
5+
'@objectstack/cli': patch
6+
---
7+
8+
feat(platform-objects): an organization sets how many decimal places each standard unit of measure displays with (`sys_standard_unit_setting`, ADR-0158 U6)
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
An organization administrator can now give any standard unit of measure (UN/ECE Recommendation 20 codes such as `KGM` or `H87`) its own display decimal places, for example 3 for grams at a jeweller or 0 for kilograms at a gravel yard. The value lives in the new organization-owned object `sys_standard_unit_setting` (Setup → Configuration → Standard Unit Settings): one row per standard code, `decimal_places` a whole number from 0 to 12. Deleting the row clears the setting. The organization's own units keep their decimal places on their own `sys_unit` row.
14+
15+
- Every member reads the settings (`member_default`, read only); organization administrators and owners create, edit and delete them (`organization_admin`). External members get no read, as with `sys_unit`.
16+
- `organization_id` is injected and stamped on every row. Under the `isolated` tenancy posture the tenant wall (ADR-0095 D1) confines every read and write to the caller's organization, so another organization's setting is never read. As with every organization-owned object (ADR-0105 D1), the `single` posture raises no wall, and the `group` posture walls by membership, so a member of several organizations can read each one's settings.
17+
- Every set, change and clear is written to `sys_audit_log`, with field history on both columns.
18+
- The value is a display default only (ADR-0158 L4): a field's own `scale` stays the storage ceiling, and nothing is rounded at write by it. No reader ships in this change; the quantity display card (#35490) will read it.
19+
- Like an exchange rate, a setting is a record the organization owns, so an organization delete is refused (`DELETE_RESTRICTED`) until its settings are deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): the record-tabs rename in the design mode decides "source language" from the served `sourceLocale`, not the default locale
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
「Configure tabs」 lets a tab be renamed only in the app's source language, where the name written is the source label. It used to decide that by comparing the reader's language with the deployment's default locale. It now reads the source language `GET /i18n/locales` serves (`sourceLocale`, the default locale where none is served), the same reading the app menu's rename takes. On a deployment whose default locale differs from its source language, a reader in the default locale no longer writes a tab name as the source label, and a reader in the source language can rename again.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): the marketplace Versions panel marks a code-plugin version where the install would be refused
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
The widening is additive: two new keys, `marketplace.detail.notInstallableHosted` and `marketplace.detail.notInstallableHostedReason`, in every locale of the `marketplace` namespace pack that `@object-ui/i18n` publishes through `./namespaces/marketplace`. No props or other exports change.
12+
13+
A package's detail page listed every approved version the same way, so a code-plugin version (served with `contains_code: true`) gave no sign that installing it from a hosted environment is refused with 422 `CODE_PLUGIN_UNSUPPORTED`. On a runtime with no install-local surface, where the page installs through the control plane's door (a hosted environment's console, and the control plane's own console), each code-plugin version now carries a muted "Not installable on hosted" badge (zh: 托管环境无法安装) and one line naming the way out: hosted environments do not run code plugins, so install it on a self-hosted or Enterprise runtime. A self-hosted runtime that installs through its own install-local door marks nothing, and a metadata version is never marked.

‎packages/cli/src/utils/organization-ownership-inventory.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,11 @@ export const ORGANIZATION_OWNERSHIP_INVENTORY: readonly InventoryEntry[] = [
860860
// organization's administrators author its own units; the platform ships no
861861
// row, and no parent row anchors a unit.
862862
{ object: 'sys_unit', census: PMAIN, fate: 'attribution', citation: `${CENSUS_MAIN} (in reach, added since the first census); ${D10_SINGLE}`, anchors: [] },
863+
// Standard unit settings (`@objectstack/platform-objects`, ADR-0158 U6 and
864+
// Open item 10): an organization's administrators set the display decimal
865+
// places of a standard unit; the platform ships no row, and no parent row
866+
// anchors a setting.
867+
{ object: 'sys_standard_unit_setting', census: PMAIN, fate: 'attribution', citation: `${CENSUS_MAIN} (in reach, added since the first census); ${D10_SINGLE}`, anchors: [] },
863868
// Tasks and notes (`@objectstack/platform-objects` `work/`): members write
864869
// them, and the organization column is stamped from the writing context; no
865870
// parent row anchors a task or a note (step 1 links neither to a record).

‎packages/cli/test/connect-agent-both-halves-wire.pin.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,15 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
283283
// +2, `group_apps` and `nav_packages`; 37 until #33933 moved the
284284
// Knowledge entry, `nav_settings_knowledge`, to
285285
// `@objectstack/service-knowledge`, which contributes it only where the
286-
// knowledge service is mounted.)
286+
// knowledge service is mounted; 36 until the Standard Unit Settings
287+
// entry, `nav_standard_unit_settings`, joined Configuration, ADR-0158
288+
// Open item 10.)
287289
// `nav_settings_branding` is not among them, and not because of a
288290
// tenancy wall (this harness boots none): since #24766 it is
289291
// contributed by `@objectstack/service-settings` together with the
290292
// `branding` namespace, offered only where no organization wall stands,
291293
// and this harness composes platform-objects and the MCP bundle alone.
292-
expect(allowedIds).toHaveLength(36);
294+
expect(allowedIds).toHaveLength(37);
293295
expect(allowedIds).toContain('nav_packages');
294296
expect(groupChildren(setupAllowed.body?.item, 'group_apps')).toEqual(['nav_packages']);
295297
expect(allowedIds).toContain('nav_public_forms');
@@ -300,6 +302,7 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
300302
expect(allowedIds).not.toContain('nav_settings_knowledge');
301303
expect(allowedIds).toContain('nav_recycle_bin');
302304
expect(allowedIds).toContain('nav_units_of_measure');
305+
expect(allowedIds).toContain('nav_standard_unit_settings');
303306
expect(allowedIds).not.toContain('nav_settings_branding');
304307
// The two per-user stores are reached from the User record page, not
305308
// from Setup's menu (#23803).
@@ -322,8 +325,8 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
322325
expect(withAccountHalf.statusCode).toBe(200);
323326
expect(withoutAccountHalf.statusCode).toBe(200);
324327
expect(navIds(withAccountHalf.body?.item)).toEqual(navIds(withoutAccountHalf.body?.item));
325-
// 36: the composition the count in the test above states.
326-
expect(navIds(withAccountHalf.body?.item)).toHaveLength(36);
328+
// 37: the composition the count in the test above states.
329+
expect(navIds(withAccountHalf.body?.item)).toHaveLength(37);
327330

328331
// The mechanism behind the invariance, asserted rather than assumed:
329332
// the bundle aims exactly one contribution at `setup` and one at

‎packages/platform-objects/scripts/i18n-extract.config.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ import {
204204
SysMigration,
205205
SysExchangeRate,
206206
SysUnit,
207+
SysStandardUnitSetting,
207208
SysWorkCalendar,
208209
SysWorkCalendarException,
209210
} from '../src/system/index.js';
@@ -368,6 +369,7 @@ const config: ObjectStackDefinition = defineStack({
368369
SysMigration,
369370
SysExchangeRate,
370371
SysUnit,
372+
SysStandardUnitSetting,
371373
SysWorkCalendar,
372374
SysWorkCalendarException,
373375
SysTask,

‎packages/platform-objects/src/apps/setup-nav.contributions.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ export const SETUP_NAV_CONTRIBUTIONS: NavigationContribution[] = [
159159
// `requiredPermissions`: the object grant decides (every member reads,
160160
// organization admins write), and Setup itself already needs `setup.access`.
161161
{ id: 'nav_units_of_measure', type: 'object', label: 'Units of Measure', objectName: 'sys_unit', viewName: 'all_units', icon: 'ruler' },
162+
// [ADR-0158 U6, Open item 10] The decimal places each standard unit
163+
// displays with in the organization, next to the organization's own
164+
// units. No `requiredPermissions`, for the same reason as the entry above.
165+
{ id: 'nav_standard_unit_settings', type: 'object', label: 'Standard Unit Settings', objectName: 'sys_standard_unit_setting', viewName: 'all_settings', icon: 'ruler' },
162166
// [ADR-0157 D1, D3] Working calendars and their holidays, beside the
163167
// other organization reference data Localization governs. The exceptions
164168
// get their own entry because their list page is the import door for a

‎packages/platform-objects/src/apps/translations/ar.objects.generated.ts‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4505,6 +4505,42 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
45054505
}
45064506
}
45074507
},
4508+
sys_standard_unit_setting: {
4509+
label: "Standard Unit Setting",
4510+
pluralLabel: "Standard Unit Settings",
4511+
description: "How many decimal places a quantity in a standard unit of measure (KGM, H87, …) displays with in this organization — one row per standard unit the organization has set.",
4512+
fields: {
4513+
id: {
4514+
label: "ID"
4515+
},
4516+
code: {
4517+
label: "Standard Unit",
4518+
help: "The standard unit code (UN/ECE Recommendation 20) in exact uppercase, for example KGM for kilogram, GRM for gram or H87 for piece. The organization's own units carry their decimal places on the unit itself, under Units of Measure. The code cannot be changed after the setting is created."
4519+
},
4520+
decimal_places: {
4521+
label: "Decimal Places",
4522+
help: "How many decimal places a quantity in this unit displays with by default. It never rounds a stored value, and a field's own decimal places still limit what is stored and shown. Delete the setting to clear it."
4523+
}
4524+
},
4525+
_views: {
4526+
all_settings: {
4527+
label: "All",
4528+
description: "Decimal places a quantity in a standard unit displays with in this organization. A field's own decimal places still limit what is stored and shown.",
4529+
emptyState: {
4530+
title: "No standard unit settings yet",
4531+
message: "Standard units display with the decimal places of the field that holds the quantity. Add a setting to give a standard unit, such as grams or kilograms, its own number of decimal places."
4532+
}
4533+
}
4534+
},
4535+
_validations: {
4536+
standard_unit_setting_code_standard: {
4537+
message: "Enter a standard unit code in exact uppercase, for example KGM or H87. An organization's own unit carries its decimal places on the unit itself, under Units of Measure."
4538+
},
4539+
standard_unit_setting_code_immutable: {
4540+
message: "A setting's unit cannot be changed after it is created. Delete it and add a setting for the other unit instead."
4541+
}
4542+
}
4543+
},
45084544
sys_work_calendar: {
45094545
label: "تقويم العمل",
45104546
pluralLabel: "تقويمات العمل",

‎packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
123123
"objects.sys_sso_provider._actions.register_sso_provider.params.tokenEndpoint.label": "7cba958c95cef146",
124124
"objects.sys_sso_provider.fields.sign_out_of_idp.help": "ab8ff5fce3001c81",
125125
"objects.sys_sso_provider.fields.sign_out_of_idp.label": "212587b8191bb91b",
126+
"objects.sys_standard_unit_setting._validations.standard_unit_setting_code_immutable.message": "30dca7b5af0102a7",
127+
"objects.sys_standard_unit_setting._validations.standard_unit_setting_code_standard.message": "b8d744ecf7e2fd14",
128+
"objects.sys_standard_unit_setting._views.all_settings.description": "b2c6e313dfbaab6f",
129+
"objects.sys_standard_unit_setting._views.all_settings.emptyState.message": "4973c431bef4fb16",
130+
"objects.sys_standard_unit_setting._views.all_settings.emptyState.title": "c744be790895b52b",
131+
"objects.sys_standard_unit_setting._views.all_settings.label": "6d6f653f8264ab17",
132+
"objects.sys_standard_unit_setting.description": "8be70d71b4824c8a",
133+
"objects.sys_standard_unit_setting.fields.code.help": "171e0116c9d1a103",
134+
"objects.sys_standard_unit_setting.fields.code.label": "8101f71ea11455f1",
135+
"objects.sys_standard_unit_setting.fields.decimal_places.help": "8f87ae85775e6bb4",
136+
"objects.sys_standard_unit_setting.fields.decimal_places.label": "c376c70ccdda79b3",
137+
"objects.sys_standard_unit_setting.fields.id.label": "00b0385c9c152888",
138+
"objects.sys_standard_unit_setting.label": "97ace8a464552c96",
139+
"objects.sys_standard_unit_setting.pluralLabel": "507e2db8f56dcaf0",
126140
"objects.sys_unit._validations.unit_code_immutable.message": "c8ce340a53339ba2",
127141
"objects.sys_unit._validations.unit_code_organization_namespace.message": "a1feea8fefab1228",
128142
"objects.sys_unit._validations.unit_dimension_immutable.message": "b12c97027d369d60",

‎packages/platform-objects/src/apps/translations/ar.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const ar: TranslationData = {
9595
nav_settings_localization: { label: 'الترجمة والإعدادات المحلية' },
9696
nav_exchange_rates: { label: 'أسعار الصرف' },
9797
nav_units_of_measure: { label: 'وحدات القياس' },
98+
nav_standard_unit_settings: { label: 'إعدادات الوحدات القياسية' },
9899
nav_work_calendars: { label: 'تقويمات العمل' },
99100
nav_work_calendar_exceptions: { label: 'استثناءات التقويم' },
100101
nav_settings_company: { label: 'الشركة' },

0 commit comments

Comments
 (0)