Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/24142-settings-organization-noun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@objectstack/service-settings': patch
---

Clause-②: no

fix(service-settings): the Setup settings pages name the organization or the environment where they said "workspace"

- **What changed.** The built-in settings manifests and their en, zh-CN, ja-JP and es-ES bundles no longer say "workspace" (工作区, ワークスペース, espacio de trabajo). Each string now uses the noun for what the setting belongs to:
- **Organization** (组织 / 組織 / organización): the Branding name field, now **Organization name**, and the Branding description; the Company legal-name help; the Feature Flags description. These settings are stored once per organization.
- **Environment** (环境 / 環境 / entorno): the Provider section of Mail and of SMS. These settings are stored once for the running instance.
- Authentication, New user membership: the help now names the explicit act as **creating an organization**.
- **Unchanged:** every setting key, including `branding.workspace_name` and its `OS_BRANDING_WORKSPACE_NAME` override; stored values; the Settings hub `category` values; the keys and shape of the translation bundles; and the exports. Only the text a reader sees changed.
2 changes: 1 addition & 1 deletion packages/services/service-settings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ the following built-in manifests are pre-registered out of the box:
|----------------|-----------------------------|---------------------------------------------|
| `mail` | `EmailServicePlugin` | SMTP / Resend / Postmark + `mail/test` |
| `storage` | `StorageServicePlugin` | Local FS / S3 + encrypted secret + `storage/test` |
| `branding` | (built-in fallback) | Workspace name, logo, accent colour |
| `branding` | (built-in fallback) | Organization name, logo, accent colour |
| `feature_flags`| (built-in fallback) | Opt-in experimental features |

## License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const manifest = {
{ value: 'invite-only', label: 'Invitation only — never join automatically' },
],
description:
'Automatic binds every new user to this deployment\'s default organization. Invitation only grants membership solely through an explicit act — creating a workspace, accepting an invitation, being added by an admin, or SSO just-in-time provisioning. Applies to the backfill of pre-existing member-less users too.',
'Automatic binds every new user to this deployment\'s default organization. Invitation only grants membership solely through an explicit act — creating an organization, accepting an invitation, being added by an admin, or SSO just-in-time provisioning. Applies to the backfill of pre-existing member-less users too.',
},

// [#11768] Audience posture (#11739, epic #11723) — who may BECOME a user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export const brandingSettingsManifest: SettingsManifest = {
version: 1,
label: 'Branding',
icon: 'Palette',
description: 'Workspace name, logo, and accent colour.',
description: 'Organization name, logo, and accent colour.',
scope: 'tenant',
readPermission: 'setup.access',
writePermission: 'setup.write',
category: 'Workspace',
order: 5,
specifiers: [
{ type: 'group', id: 'identity', label: 'Identity', required: false },
{ type: 'text', key: 'workspace_name', label: 'Workspace name', required: true,
{ type: 'text', key: 'workspace_name', label: 'Organization name', required: true,
default: 'ObjectStack', minLength: 1, maxLength: 60 },
{ type: 'email', key: 'support_email', label: 'Support email', required: false,
description: 'Example: support@example.com' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const companySettingsManifest: SettingsManifest = {
{ type: 'group', id: 'identity', label: 'Identity', required: false },
{
type: 'text', key: 'legal_name', label: 'Legal name', required: false,
description: 'Registered legal name of the organization (may differ from the workspace name).',
description: 'Registered legal name of the organization (may differ from the organization name set under Branding).',
maxLength: 200,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const featureFlagsSettingsManifest: SettingsManifest = {
version: 1,
label: 'Feature Flags',
icon: 'FlaskConical',
description: 'Toggle experimental and beta features for this workspace.',
description: 'Toggle experimental and beta features for this organization.',
scope: 'tenant',
readPermission: 'setup.access',
writePermission: 'setup.write',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const manifest = {
order: 10,
specifiers: [
{ type: 'group', id: 'provider', label: 'Provider', required: false,
description: 'Choose how this workspace sends outbound email.' },
description: 'Choose how this environment sends outbound email.' },

// See PROVIDER_OPTIONS above — the option list is a contract with
// @objectstack/plugin-email, not a wish list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const manifest = {
order: 11,
specifiers: [
{ type: 'group', id: 'provider', label: 'Provider', required: false,
description: 'Choose how this workspace sends outbound SMS.' },
description: 'Choose how this environment sends outbound SMS.' },

// ⚠️ This options table is a CONTRACT, not a menu of aspirations: every
// value here must be one `@objectstack/service-sms` can actually build a
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

/**
* 「工作区」 is retired from what a reader sees on the Setup settings pages.
*
* The maintainer's ruling (cloud ruling record 6229029648): one noun, 「组织」,
* for the thing members and billing belong to, and 「环境」 for the running
* instance. "Workspace" named both, so it names neither.
*
* ## Which noun a string takes — the manifest's own `scope` decides
*
* The same manifests are read on the control plane and in a tenant
* environment, and nothing in a manifest tells the two planes apart. Nothing
* has to: the noun follows the storage `scope` the manifest already declares,
* and that scope means the same thing on both planes, because one
* `SettingsService` stores both.
*
* - `tenant` — one row per ORGANIZATION (`sys_setting`'s identity is
* `(organization_id, namespace, key, scope, user_id)`;
* `settings-organization-isolation.pin.test.ts`). Branding, company and
* feature flags say "organization".
* - `global` — one row for the running instance. Mail and SMS say
* "environment", the noun the auth page's audience copy already uses.
*
* ## What is pinned
*
* Every user-facing STRING of every built-in manifest, and every VALUE of
* every shipped locale bundle, is free of the retired noun in all four
* locales' spellings. Keys are not copy and keep their spelling: the storage
* key `workspace_name`, the `OS_BRANDING_WORKSPACE_NAME` override derived from
* it, and the hub `category` value (see {@link NOT_COPY}).
*/

import { describe, it, expect } from 'vitest';
import type { SettingsManifest } from '@objectstack/spec/system';
import * as manifestsModule from './manifests/index.js';
import { builtinSettingsManifests } from './manifests/index.js';
import { en, zhCN, jaJP, esES } from './translations/index.js';

const manifests = Object.values(manifestsModule).filter(
(v): v is SettingsManifest =>
!!v &&
typeof v === 'object' &&
'namespace' in v &&
Array.isArray((v as SettingsManifest).specifiers),
);

const BUNDLES: Array<[string, object]> = [
['en', en],
['zh-CN', zhCN],
['ja-JP', jaJP],
['es-ES', esES],
];

/**
* The retired noun, one spelling per locale. The English one matches the WORD
* only: a neighbouring letter, digit or underscore makes it part of an
* identifier, so `workspace_name` and `OS_BRANDING_WORKSPACE_NAME` named in
* prose are keys, not the noun.
*/
const RETIRED: ReadonlyArray<readonly [string, RegExp]> = [
['workspace', /(?<![A-Za-z0-9_])workspaces?(?![A-Za-z0-9_])/i],
['工作区', /工作区/],
['ワークスペース', /ワークスペース/],
['espacio de trabajo', /espacios? de trabajo/i],
];

function retiredIn(text: string): string[] {
return RETIRED.filter(([, re]) => re.test(text)).map(([name]) => name);
}

/**
* Manifest properties a machine reads, never a person: identifiers, storage
* keys, stored values, permissions, expressions and handler wiring. Every
* OTHER string in a manifest is walked, so a copy field added later is covered
* without editing this list.
*
* `category` is here because it is a lookup KEY, not copy: the console reads
* `console.settingsHub.categories.<category>` and translates the section
* header itself, in its own bundles. Renaming the value would move the
* console's key, not this package's copy.
*/
const NOT_COPY: ReadonlySet<string> = new Set([
'namespace', 'key', 'id', 'childNamespace', 'replacedBy', 'category',
'value', 'default', 'icon', 'type', 'scope', 'availableScopes',
'readPermission', 'writePermission', 'featureFlag', 'visible', 'pattern',
'valueDomain', 'bannerSeverity',
// handler wiring (`action_button`); its `confirmText` stays copy.
'kind', 'method', 'url', 'body', 'name', 'params', 'target',
]);

/** Every string under `node`, with its path; `skip` names properties not descended. */
function stringsUnder(node: unknown, path: string, skip: ReadonlySet<string>): Array<[string, string]> {
if (typeof node === 'string') return [[path, node]];
if (Array.isArray(node)) return node.flatMap((v, i) => stringsUnder(v, `${path}.${i}`, skip));
if (node && typeof node === 'object') {
return Object.entries(node).flatMap(([k, v]) => (skip.has(k) ? [] : stringsUnder(v, `${path}.${k}`, skip)));
}
return [];
}

const NOTHING: ReadonlySet<string> = new Set();

describe('the retired noun: no settings manifest or bundle says workspace / 工作区', () => {
it('the detector flags the noun in each locale and passes identifiers', () => {
for (const noun of ['Workspace name', 'for this workspace.', 'Workspaces', '此工作区', 'このワークスペース', 'este espacio de trabajo']) {
expect(retiredIn(noun), noun).not.toEqual([]);
}
for (const key of ['workspace_name', '`workspace_name`', 'OS_BRANDING_WORKSPACE_NAME', 'Organization name', '组织名称', '環境']) {
expect(retiredIn(key), key).toEqual([]);
}
});

it('walks every built-in manifest', () => {
expect(manifests.length).toBeGreaterThanOrEqual(10);
for (const m of builtinSettingsManifests) expect(manifests).toContain(m);
});

for (const m of manifests) {
it(`settings.${m.namespace}: no user-facing manifest string carries it`, () => {
const strings = stringsUnder(m, m.namespace, NOT_COPY);
const seen = new Set(strings.map(([p]) => p));
// Non-vacuity: the walk reaches the manifest's label and every
// specifier's label and option labels, so NOT_COPY swallowed no copy.
expect(seen.has(`${m.namespace}.label`)).toBe(true);
m.specifiers.forEach((s, i) => {
if (typeof s.label === 'string') expect(seen.has(`${m.namespace}.specifiers.${i}.label`)).toBe(true);
(s.options ?? []).forEach((o, j) => {
if (typeof o.label === 'string') {
expect(seen.has(`${m.namespace}.specifiers.${i}.options.${j}.label`)).toBe(true);
}
});
});
const hits = strings.flatMap(([p, v]) => retiredIn(v).map((noun) => `${p} (${noun}): ${v}`));
expect(hits, `the retired noun in manifest copy:\n${hits.join('\n')}`).toEqual([]);
});
}

for (const [locale, data] of BUNDLES) {
it(`${locale}: no bundle value carries it`, () => {
const strings = stringsUnder(data, locale, NOTHING);
// Non-vacuity: values are walked by their path, keys never as text —
// the storage key `workspace_name` is a path segment here, not a value.
expect(strings.length).toBeGreaterThan(100);
expect(strings.map(([p]) => p)).toContain(`${locale}.settings.branding.keys.workspace_name.label`);
const hits = strings.flatMap(([p, v]) => retiredIn(v).map((noun) => `${p} (${noun}): ${v}`));
expect(hits, `the retired noun in ${locale} copy:\n${hits.join('\n')}`).toEqual([]);
});
}
});
12 changes: 6 additions & 6 deletions packages/services/service-settings/src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const en: PlatformTranslationData = {
title: 'Mail Delivery',
description: 'SMTP and transactional email provider configuration.',
groups: {
provider: { title: 'Provider', description: 'Choose how this workspace sends outbound email.' },
provider: { title: 'Provider', description: 'Choose how this environment sends outbound email.' },
smtp: { title: 'SMTP' },
api_key: { title: 'API key' },
from_address: { title: 'From address' },
Expand Down Expand Up @@ -64,13 +64,13 @@ export const en: PlatformTranslationData = {

branding: {
title: 'Branding',
description: 'Workspace name, logo, and accent colour.',
description: 'Organization name, logo, and accent colour.',
groups: {
identity: { title: 'Identity' },
appearance: { title: 'Appearance' },
},
keys: {
workspace_name: { label: 'Workspace name' },
workspace_name: { label: 'Organization name' },
support_email: { label: 'Support email', help: 'Example: support@example.com' },
theme_mode: {
label: 'Default theme',
Expand All @@ -90,7 +90,7 @@ export const en: PlatformTranslationData = {
contact: { title: 'Contact' },
},
keys: {
legal_name: { label: 'Legal name', help: 'Registered legal name (may differ from the workspace name).' },
legal_name: { label: 'Legal name', help: 'Registered legal name (may differ from the organization name set under Branding).' },
registration_number: { label: 'Registration number', help: 'Company registration / incorporation number (e.g. EIN).' },
tax_id: { label: 'Tax / VAT ID', help: 'Shown on invoices (e.g. VAT, GST, ABN).' },
address_line1: { label: 'Address line 1' },
Expand Down Expand Up @@ -158,7 +158,7 @@ export const en: PlatformTranslationData = {
require_email_verification: { label: 'Require email verification' },
membership_policy: {
label: 'New user membership',
help: 'Automatic binds every new user to the default organization. Invitation only grants membership solely through an explicit act — creating a workspace, accepting an invitation, an admin adding them, or SSO just-in-time provisioning.',
help: 'Automatic binds every new user to the default organization. Invitation only grants membership solely through an explicit act — creating an organization, accepting an invitation, an admin adding them, or SSO just-in-time provisioning.',
options: {
auto: 'Join the default organization automatically',
'invite-only': 'Invitation only — never join automatically',
Expand Down Expand Up @@ -202,7 +202,7 @@ export const en: PlatformTranslationData = {

feature_flags: {
title: 'Feature Flags',
description: 'Toggle experimental and beta features for this workspace.',
description: 'Toggle experimental and beta features for this organization.',
groups: {
productivity: { title: 'Productivity' },
collaboration: { title: 'Collaboration' },
Expand Down
14 changes: 7 additions & 7 deletions packages/services/service-settings/src/translations/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const esES: PlatformTranslationData = {
title: 'Envío de correo',
description: 'Configuración de SMTP y del proveedor de correo transaccional.',
groups: {
provider: { title: 'Proveedor', description: 'Elige cómo envía correo saliente este espacio de trabajo.' },
provider: { title: 'Proveedor', description: 'Elige cómo envía correo saliente este entorno.' },
smtp: { title: 'SMTP' },
api_key: { title: 'Clave de API' },
from_address: { title: 'Dirección de remitente' },
Expand Down Expand Up @@ -60,13 +60,13 @@ export const esES: PlatformTranslationData = {

branding: {
title: 'Marca',
description: 'Nombre del espacio de trabajo, logotipo y color de acento.',
description: 'Nombre de la organización, logotipo y color de acento.',
groups: {
identity: { title: 'Identidad' },
appearance: { title: 'Apariencia' },
},
keys: {
workspace_name: { label: 'Nombre del espacio de trabajo' },
workspace_name: { label: 'Nombre de la organización' },
support_email: { label: 'Correo de soporte', help: 'Ejemplo: support@example.com' },
theme_mode: {
label: 'Tema predeterminado',
Expand Down Expand Up @@ -129,7 +129,7 @@ export const esES: PlatformTranslationData = {
require_email_verification: { label: 'Requerir verificación de correo' },
membership_policy: {
label: 'Pertenencia de los usuarios nuevos',
help: 'La opción automática vincula cada usuario nuevo a la organización predeterminada del despliegue. «Solo por invitación» concede la pertenencia únicamente mediante un acto explícito: crear un espacio de trabajo, aceptar una invitación, que un administrador lo añada o el aprovisionamiento just-in-time por SSO.',
help: 'La opción automática vincula cada usuario nuevo a la organización predeterminada del despliegue. «Solo por invitación» concede la pertenencia únicamente mediante un acto explícito: crear una organización, aceptar una invitación, que un administrador lo añada o el aprovisionamiento just-in-time por SSO.',
options: {
auto: 'Unirse automáticamente a la organización predeterminada',
'invite-only': 'Solo por invitación: nunca se une automáticamente',
Expand Down Expand Up @@ -251,7 +251,7 @@ export const esES: PlatformTranslationData = {
title: 'Envío de SMS',
description: 'Configuración del proveedor de SMS para inicio de sesión con OTP, invitaciones y notificaciones.',
groups: {
provider: { title: 'Proveedor', description: 'Elige cómo envía este espacio de trabajo los SMS salientes.' },
provider: { title: 'Proveedor', description: 'Elige cómo envía este entorno los SMS salientes.' },
aliyun: { title: 'Aliyun SMS' },
twilio: { title: 'Twilio' },
limits: { title: 'Límites de gasto', description: 'Limita el volumen de SMS salientes del despliegue. El SMS es un canal de pago y cada envío cuesta dinero real.' },
Expand Down Expand Up @@ -292,7 +292,7 @@ export const esES: PlatformTranslationData = {
contact: { title: 'Contacto' },
},
keys: {
legal_name: { label: 'Razón social', help: 'Nombre legal registrado de la organización (puede diferir del nombre del espacio de trabajo).' },
legal_name: { label: 'Razón social', help: 'Nombre legal registrado de la organización (puede diferir del nombre de la organización indicado en Marca).' },
registration_number: { label: 'Número de registro', help: 'Número de registro / constitución de la empresa (p. ej. EIN, n.º de sociedad).' },
tax_id: { label: 'ID fiscal / IVA', help: 'Identificador fiscal que aparece en las facturas (p. ej. IVA, GST, ABN).' },
address_line1: { label: 'Dirección línea 1' },
Expand Down Expand Up @@ -326,7 +326,7 @@ export const esES: PlatformTranslationData = {

feature_flags: {
title: 'Indicadores de función',
description: 'Activa funciones experimentales y en beta para este espacio de trabajo.',
description: 'Activa funciones experimentales y en beta para esta organización.',
groups: {
productivity: { title: 'Productividad' },
collaboration: { title: 'Colaboración' },
Expand Down
Loading
Loading