diff --git a/.changeset/39045-invite-mail-notice.md b/.changeset/39045-invite-mail-notice.md new file mode 100644 index 00000000000..844bd51057b --- /dev/null +++ b/.changeset/39045-invite-mail-notice.md @@ -0,0 +1,19 @@ +--- +'@objectstack/spec': patch +'@objectstack/platform-objects': patch +'@object-ui/core': patch +'@object-ui/types': patch +'@object-ui/i18n': patch +'@object-ui/react': patch +'@object-ui/components': patch +'@object-ui/app-shell': patch +--- + +feat(console): an action's confirm and param dialogs draw its declared `notices`; the invite dialogs warn before submit when this server delivers no mail + +Clause-②: yes (widening) +Metadata-protocol: none + +- **The console draws `notices`.** The dialog an action opens before it runs (the confirm dialog of a param-less action with `confirmText`, or the param dialog of an action with `params`; an action with both draws them in the param dialog only) shows each declared notice between its title and its description, while the notice's `visible` holds against the record the action runs against, the signed-in user and `features`. `severity` picks the tone and the icon (`info` when omitted). `title` and `body` read the translation bundle at `objects.._actions..notices..*` first, then the authored text. A condition that cannot be evaluated draws nothing and is reported once in the browser console, naming the action and the notice. The four action renderers forward the key to the runner. +- **Invite User and Resend Invitation warn first.** The four `invite_user` actions (`sys_user`, `sys_member`, `sys_invitation`, `sys_organization`) and `sys_invitation.resend_invitation` declare `mail_not_delivered`, a warning drawn while the server reports `features.emailDelivery` not true: no email will go out, who can still accept (an invitee whose social or SSO sign-in verifies the address), and that a platform administrator creates the account for anyone else. The invitation is still created, and the toast after it still reports the `link_only` outcome. Translated in all ten shipped locales. +- **The feature registry books notice reads.** `PublicAuthFeatureEntry` gains optional `noticePaths` (`.actions..notices.`) for notices whose condition reads a flag; a notice gates nothing, so it is booked apart from `gatedInputs`. `emailDelivery` books the five invite notices. The platform-objects guard checks both directions: every booked path is a declared notice reading the flag, and every `features.*` read in a notice condition is booked. diff --git a/content/docs/protocol/objectui/actions.mdx b/content/docs/protocol/objectui/actions.mdx index da4e6d0af65..2b36d395c58 100644 --- a/content/docs/protocol/objectui/actions.mdx +++ b/content/docs/protocol/objectui/actions.mdx @@ -568,8 +568,6 @@ cancelText: Keep invitation ### Warning before submit: `notices` -> **Planned.** The key parses, translates and is checked at build time, but the console's dialogs do not draw it yet. An author who writes it today sees no notice in the dialog. - Some actions need to tell the user something before they click, and only when a condition holds: no mail is delivered on this deployment, so the invitation will not reach anyone by email; this quote is past its expiry. `description` says the same thing every time. `notices` says it when it applies. ```yaml @@ -585,15 +583,17 @@ notices: severity: warning title: No email will be sent body: This deployment does not deliver mail. Only an invitee who signs in with a social or SSO account that verifies the address can accept. - visible: features.emailDelivery != true + visible: has(features.emailDelivery) && features.emailDelivery != true ``` - **`record:alert`'s vocabulary.** Each notice takes the record page banner's field names: `severity` (`info`, `warning`, `error` or `success`, the same closed set; omitted, the console draws `info`), `title`, `body`, and `visible` for its condition. The banner's `icon`, `action`, `dismissible` and `dismissKey` are not declared here, and each is refused with a sentence that says why. - **Plain text.** `title` and `body` are `I18nLabel`s: a plain string or an inline locale map, never blank, with no markup, link, button or `${…}` template. A notice declares at least one of the two. - **Named, so each has a stable translation key.** The map key is a snake_case notice name, and the text is translated at `objects.._actions..notices..title` and `.body` (`globalActions..notices..*` for an action with no `objectName`). A translation keyed to a notice the action does not declare is reported by `os validate` (`translation-target-unknown`). Several notices are drawn in the order they are declared. - **The condition is the action's own.** `visible` takes the shape of the action's `visible` (a boolean, a CEL string or a `{ dialect, source }` envelope) and reads the same scope: the record the surface holds, the signed-in user and `features`. It does not see the values typed into the dialog. Omit it to draw the notice whenever the dialog opens. `os validate` checks it as it checks the action's `visible`. -- **Either pre-run dialog.** The confirm dialog of a param-less action with `confirmText` and the param dialog of an action with a non-empty `params` draw the notices above the description. An action that declares neither opens no dialog, so `notices` there is refused at parse. +- **Either pre-run dialog.** The confirm dialog of a param-less action with `confirmText` and the param dialog of an action with a non-empty `params` draw the notices between the title and the description. An action with both draws them in the param dialog only. An action that declares neither opens no dialog, so `notices` there is refused at parse. +- **A condition that cannot be evaluated draws nothing.** The console reports it once in the browser console, naming the action and the notice. Reading a `features` flag the host has not received is such a fault, so guard it with `has()` as above when the notice should stay out of the dialog until the flag is known. - **Display only.** The action's endpoint, its `outcome` answer and its outcome copy are the same with or without a notice. A notice that is wrong or not drawn misleads the reader and gates nothing. +- The platform's four **Invite User** actions and **Resend Invitation** declare `mail_not_delivered`, drawn while the deployment delivers no mail (`features.emailDelivery`). - `alerts` and `warnings` are refused with a rename to `notices`. ### Showing a server read before submit: `preflight` diff --git a/packages/platform-objects/src/apps/translations/ar.objects.generated.ts b/packages/platform-objects/src/apps/translations/ar.objects.generated.ts index fa77a07d485..1052b674e3a 100644 --- a/packages/platform-objects/src/apps/translations/ar.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.objects.generated.ts @@ -161,6 +161,12 @@ export const arObjects: NonNullable = { sent: "أُرسلت الدعوة إلى {{ result.email }}", link_only: "أُنشئت دعوة لـ {{ result.email }}. البريد غير مُهيَّأ على هذا الخادم، لذا لم تُرسَل أي رسالة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." }, + notices: { + mail_not_delivered: { + title: "البريد غير مُهيَّأ على هذا الخادم", + body: "لن تُرسَل أي رسالة، لذا لن يعلم المدعو بهذه الدعوة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." + } + }, params: { role: { helpText: "المالك: تحكم كامل في المؤسسة، بما في ذلك حذفها.\nالمسؤول: يدير الأعضاء والدعوات والفرق وإعدادات المؤسسة.\nالمسؤول المفوَّض: يدعو الأشخاص ويضعهم فقط حيث فوّضه المسؤول بذلك.\nالعضو: يعمل في تطبيقات المؤسسة بالوصول الذي تمنحه مجموعات أذوناته.\nالخارجي: شخص من خارج المؤسسة، مثل مورّد أو عميل، لا يرى إلا ما تتم مشاركته معه.", @@ -725,6 +731,12 @@ export const arObjects: NonNullable = { sent: "أُرسلت الدعوة إلى {{ result.email }}", link_only: "أُنشئت دعوة لـ {{ result.email }}. البريد غير مُهيَّأ على هذا الخادم، لذا لم تُرسَل أي رسالة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." }, + notices: { + mail_not_delivered: { + title: "البريد غير مُهيَّأ على هذا الخادم", + body: "لن تُرسَل أي رسالة، لذا لن يعلم المدعو بهذه الدعوة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." + } + }, params: { role: { helpText: "المالك: تحكم كامل في المؤسسة، بما في ذلك حذفها.\nالمسؤول: يدير الأعضاء والدعوات والفرق وإعدادات المؤسسة.\nالمسؤول المفوَّض: يدعو الأشخاص ويضعهم فقط حيث فوّضه المسؤول بذلك.\nالعضو: يعمل في تطبيقات المؤسسة بالوصول الذي تمنحه مجموعات أذوناته.\nالخارجي: شخص من خارج المؤسسة، مثل مورّد أو عميل، لا يرى إلا ما تتم مشاركته معه.", @@ -831,6 +843,12 @@ export const arObjects: NonNullable = { sent: "أُرسلت الدعوة إلى {{ result.email }}", link_only: "أُنشئت دعوة لـ {{ result.email }}. البريد غير مُهيَّأ على هذا الخادم، لذا لم تُرسَل أي رسالة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." }, + notices: { + mail_not_delivered: { + title: "البريد غير مُهيَّأ على هذا الخادم", + body: "لن تُرسَل أي رسالة، لذا لن يعلم المدعو بهذه الدعوة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." + } + }, params: { role: { helpText: "المالك: تحكم كامل في المؤسسة، بما في ذلك حذفها.\nالمسؤول: يدير الأعضاء والدعوات والفرق وإعدادات المؤسسة.\nالمسؤول المفوَّض: يدعو الأشخاص ويضعهم فقط حيث فوّضه المسؤول بذلك.\nالعضو: يعمل في تطبيقات المؤسسة بالوصول الذي تمنحه مجموعات أذوناته.\nالخارجي: شخص من خارج المؤسسة، مثل مورّد أو عميل، لا يرى إلا ما تتم مشاركته معه.", @@ -983,6 +1001,12 @@ export const arObjects: NonNullable = { sent: "أُرسلت الدعوة إلى {{ result.email }}", link_only: "أُنشئت دعوة لـ {{ result.email }}. البريد غير مُهيَّأ على هذا الخادم، لذا لم تُرسَل أي رسالة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." }, + notices: { + mail_not_delivered: { + title: "البريد غير مُهيَّأ على هذا الخادم", + body: "لن تُرسَل أي رسالة، لذا لن يعلم المدعو بهذه الدعوة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." + } + }, params: { role: { helpText: "المالك: تحكم كامل في المؤسسة، بما في ذلك حذفها.\nالمسؤول: يدير الأعضاء والدعوات والفرق وإعدادات المؤسسة.\nالمسؤول المفوَّض: يدعو الأشخاص ويضعهم فقط حيث فوّضه المسؤول بذلك.\nالعضو: يعمل في تطبيقات المؤسسة بالوصول الذي تمنحه مجموعات أذوناته.\nالخارجي: شخص من خارج المؤسسة، مثل مورّد أو عميل، لا يرى إلا ما تتم مشاركته معه.", @@ -1009,6 +1033,12 @@ export const arObjects: NonNullable = { outcomeMessages: { sent: "أُعيد إرسال الدعوة إلى {{ result.email }}", link_only: "جُدِّدت الدعوة لـ {{ result.email }}. البريد غير مُهيَّأ على هذا الخادم، لذا لم تُرسَل أي رسالة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." + }, + notices: { + mail_not_delivered: { + title: "البريد غير مُهيَّأ على هذا الخادم", + body: "لن تُرسَل أي رسالة، لذا لن يعلم المدعو بهذه الدعوة. يتطلب قبول الدعوة عنوان بريد إلكتروني موثَّقًا: من دون البريد، لا يستطيع القبول إلا مدعو يوثّق تسجيلُ دخوله الاجتماعي أو عبر SSO عنوانَه. لأي شخص آخر، ينشئ مسؤول المنصة الحساب." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/de.objects.generated.ts b/packages/platform-objects/src/apps/translations/de.objects.generated.ts index 25f4734db52..f9f79eb1bf8 100644 --- a/packages/platform-objects/src/apps/translations/de.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.objects.generated.ts @@ -161,6 +161,12 @@ export const deObjects: NonNullable = { sent: "Einladung an {{ result.email }} gesendet", link_only: "Einladung für {{ result.email }} erstellt. Auf diesem Server ist kein E-Mail-Versand konfiguriert, daher wurde keine E-Mail gesendet. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." }, + notices: { + mail_not_delivered: { + title: "Auf diesem Server ist kein E-Mail-Versand konfiguriert", + body: "Es wird keine E-Mail gesendet, die eingeladene Person erfährt also nichts von dieser Einladung. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." + } + }, params: { role: { helpText: "Eigentümer: volle Kontrolle über die Organisation, einschließlich ihres Löschens.\nAdministrator: verwaltet Mitglieder, Einladungen, Teams und Organisationseinstellungen.\nDelegierter Administrator: lädt Personen ein und ordnet sie nur dort zu, wo ein Administrator dies delegiert hat.\nMitglied: arbeitet in den Apps der Organisation mit dem Zugriff, den seine Berechtigungssätze gewähren.\nExtern: jemand außerhalb der Organisation, etwa ein Lieferant oder Kunde, der nur sieht, was mit ihm geteilt wird.", @@ -725,6 +731,12 @@ export const deObjects: NonNullable = { sent: "Einladung an {{ result.email }} gesendet", link_only: "Einladung für {{ result.email }} erstellt. Auf diesem Server ist kein E-Mail-Versand konfiguriert, daher wurde keine E-Mail gesendet. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." }, + notices: { + mail_not_delivered: { + title: "Auf diesem Server ist kein E-Mail-Versand konfiguriert", + body: "Es wird keine E-Mail gesendet, die eingeladene Person erfährt also nichts von dieser Einladung. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." + } + }, params: { role: { helpText: "Eigentümer: volle Kontrolle über die Organisation, einschließlich ihres Löschens.\nAdministrator: verwaltet Mitglieder, Einladungen, Teams und Organisationseinstellungen.\nDelegierter Administrator: lädt Personen ein und ordnet sie nur dort zu, wo ein Administrator dies delegiert hat.\nMitglied: arbeitet in den Apps der Organisation mit dem Zugriff, den seine Berechtigungssätze gewähren.\nExtern: jemand außerhalb der Organisation, etwa ein Lieferant oder Kunde, der nur sieht, was mit ihm geteilt wird.", @@ -831,6 +843,12 @@ export const deObjects: NonNullable = { sent: "Einladung an {{ result.email }} gesendet", link_only: "Einladung für {{ result.email }} erstellt. Auf diesem Server ist kein E-Mail-Versand konfiguriert, daher wurde keine E-Mail gesendet. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." }, + notices: { + mail_not_delivered: { + title: "Auf diesem Server ist kein E-Mail-Versand konfiguriert", + body: "Es wird keine E-Mail gesendet, die eingeladene Person erfährt also nichts von dieser Einladung. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." + } + }, params: { role: { helpText: "Eigentümer: volle Kontrolle über die Organisation, einschließlich ihres Löschens.\nAdministrator: verwaltet Mitglieder, Einladungen, Teams und Organisationseinstellungen.\nDelegierter Administrator: lädt Personen ein und ordnet sie nur dort zu, wo ein Administrator dies delegiert hat.\nMitglied: arbeitet in den Apps der Organisation mit dem Zugriff, den seine Berechtigungssätze gewähren.\nExtern: jemand außerhalb der Organisation, etwa ein Lieferant oder Kunde, der nur sieht, was mit ihm geteilt wird.", @@ -983,6 +1001,12 @@ export const deObjects: NonNullable = { sent: "Einladung an {{ result.email }} gesendet", link_only: "Einladung für {{ result.email }} erstellt. Auf diesem Server ist kein E-Mail-Versand konfiguriert, daher wurde keine E-Mail gesendet. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." }, + notices: { + mail_not_delivered: { + title: "Auf diesem Server ist kein E-Mail-Versand konfiguriert", + body: "Es wird keine E-Mail gesendet, die eingeladene Person erfährt also nichts von dieser Einladung. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." + } + }, params: { role: { helpText: "Eigentümer: volle Kontrolle über die Organisation, einschließlich ihres Löschens.\nAdministrator: verwaltet Mitglieder, Einladungen, Teams und Organisationseinstellungen.\nDelegierter Administrator: lädt Personen ein und ordnet sie nur dort zu, wo ein Administrator dies delegiert hat.\nMitglied: arbeitet in den Apps der Organisation mit dem Zugriff, den seine Berechtigungssätze gewähren.\nExtern: jemand außerhalb der Organisation, etwa ein Lieferant oder Kunde, der nur sieht, was mit ihm geteilt wird.", @@ -1009,6 +1033,12 @@ export const deObjects: NonNullable = { outcomeMessages: { sent: "Einladung erneut an {{ result.email }} gesendet", link_only: "Einladung für {{ result.email }} verlängert. Auf diesem Server ist kein E-Mail-Versand konfiguriert, daher wurde keine E-Mail gesendet. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." + }, + notices: { + mail_not_delivered: { + title: "Auf diesem Server ist kein E-Mail-Versand konfiguriert", + body: "Es wird keine E-Mail gesendet, die eingeladene Person erfährt also nichts von dieser Einladung. Zum Annehmen ist eine bestätigte E-Mail-Adresse nötig: Ohne E-Mail-Versand kann nur eine eingeladene Person annehmen, deren Social- oder SSO-Anmeldung die Adresse bestätigt. Für alle anderen legt ein Plattformadministrator das Konto an." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/en.objects.generated.ts b/packages/platform-objects/src/apps/translations/en.objects.generated.ts index fa19585cf85..7c841c162a7 100644 --- a/packages/platform-objects/src/apps/translations/en.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/en.objects.generated.ts @@ -161,6 +161,12 @@ export const enObjects: NonNullable = { sent: "Invitation sent to {{ result.email }}", link_only: "Invitation created for {{ result.email }}. Mail is not configured on this server, so no email went out. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." }, + notices: { + mail_not_delivered: { + title: "Mail is not configured on this server", + body: "No email will go out, so the invitee will not be told about this invitation. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." + } + }, params: { role: { helpText: "Owner: full control of the organization, including deleting it.\nAdmin: manages members, invitations, teams and organization settings.\nDelegated Admin: invites people and places them only where an administrator has delegated that.\nMember: works in the organization's apps with the access their permission sets give.\nExternal: someone from outside the organization, such as a supplier or customer, who sees only what is shared with them.", @@ -725,6 +731,12 @@ export const enObjects: NonNullable = { sent: "Invitation sent to {{ result.email }}", link_only: "Invitation created for {{ result.email }}. Mail is not configured on this server, so no email went out. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." }, + notices: { + mail_not_delivered: { + title: "Mail is not configured on this server", + body: "No email will go out, so the invitee will not be told about this invitation. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." + } + }, params: { role: { helpText: "Owner: full control of the organization, including deleting it.\nAdmin: manages members, invitations, teams and organization settings.\nDelegated Admin: invites people and places them only where an administrator has delegated that.\nMember: works in the organization's apps with the access their permission sets give.\nExternal: someone from outside the organization, such as a supplier or customer, who sees only what is shared with them.", @@ -831,6 +843,12 @@ export const enObjects: NonNullable = { sent: "Invitation sent to {{ result.email }}", link_only: "Invitation created for {{ result.email }}. Mail is not configured on this server, so no email went out. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." }, + notices: { + mail_not_delivered: { + title: "Mail is not configured on this server", + body: "No email will go out, so the invitee will not be told about this invitation. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." + } + }, params: { role: { helpText: "Owner: full control of the organization, including deleting it.\nAdmin: manages members, invitations, teams and organization settings.\nDelegated Admin: invites people and places them only where an administrator has delegated that.\nMember: works in the organization's apps with the access their permission sets give.\nExternal: someone from outside the organization, such as a supplier or customer, who sees only what is shared with them.", @@ -983,6 +1001,12 @@ export const enObjects: NonNullable = { sent: "Invitation sent to {{ result.email }}", link_only: "Invitation created for {{ result.email }}. Mail is not configured on this server, so no email went out. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." }, + notices: { + mail_not_delivered: { + title: "Mail is not configured on this server", + body: "No email will go out, so the invitee will not be told about this invitation. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." + } + }, params: { role: { helpText: "Owner: full control of the organization, including deleting it.\nAdmin: manages members, invitations, teams and organization settings.\nDelegated Admin: invites people and places them only where an administrator has delegated that.\nMember: works in the organization's apps with the access their permission sets give.\nExternal: someone from outside the organization, such as a supplier or customer, who sees only what is shared with them.", @@ -1009,6 +1033,12 @@ export const enObjects: NonNullable = { outcomeMessages: { sent: "Invitation resent to {{ result.email }}", link_only: "Invitation renewed for {{ result.email }}. Mail is not configured on this server, so no email went out. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." + }, + notices: { + mail_not_delivered: { + title: "Mail is not configured on this server", + body: "No email will go out, so the invitee will not be told about this invitation. Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in verifies the address can accept. For anyone else, a platform administrator creates the account." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts b/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts index 4d42655556f..10090476a25 100644 --- a/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts @@ -161,6 +161,12 @@ export const esESObjects: NonNullable = { sent: "Invitación enviada a {{ result.email }}", link_only: "Invitación creada para {{ result.email }}. El correo no está configurado en este servidor, así que no ha salido ningún mensaje. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." }, + notices: { + mail_not_delivered: { + title: "El correo no está configurado en este servidor", + body: "No saldrá ningún mensaje, así que el invitado no sabrá de esta invitación. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." + } + }, params: { role: { helpText: "Propietario: control total de la organización, incluida su eliminación.\nAdministrador: gestiona los miembros, las invitaciones, los equipos y la configuración de la organización.\nAdministrador delegado: invita a personas y solo las ubica donde un administrador se lo ha delegado.\nMiembro: trabaja en las aplicaciones de la organización con el acceso que le dan sus conjuntos de permisos.\nExterno: alguien ajeno a la organización, como un proveedor o un cliente, que solo ve lo que se comparte con él.", @@ -725,6 +731,12 @@ export const esESObjects: NonNullable = { sent: "Invitación enviada a {{ result.email }}", link_only: "Invitación creada para {{ result.email }}. El correo no está configurado en este servidor, así que no ha salido ningún mensaje. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." }, + notices: { + mail_not_delivered: { + title: "El correo no está configurado en este servidor", + body: "No saldrá ningún mensaje, así que el invitado no sabrá de esta invitación. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." + } + }, params: { role: { helpText: "Propietario: control total de la organización, incluida su eliminación.\nAdministrador: gestiona los miembros, las invitaciones, los equipos y la configuración de la organización.\nAdministrador delegado: invita a personas y solo las ubica donde un administrador se lo ha delegado.\nMiembro: trabaja en las aplicaciones de la organización con el acceso que le dan sus conjuntos de permisos.\nExterno: alguien ajeno a la organización, como un proveedor o un cliente, que solo ve lo que se comparte con él.", @@ -831,6 +843,12 @@ export const esESObjects: NonNullable = { sent: "Invitación enviada a {{ result.email }}", link_only: "Invitación creada para {{ result.email }}. El correo no está configurado en este servidor, así que no ha salido ningún mensaje. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." }, + notices: { + mail_not_delivered: { + title: "El correo no está configurado en este servidor", + body: "No saldrá ningún mensaje, así que el invitado no sabrá de esta invitación. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." + } + }, params: { role: { helpText: "Propietario: control total de la organización, incluida su eliminación.\nAdministrador: gestiona los miembros, las invitaciones, los equipos y la configuración de la organización.\nAdministrador delegado: invita a personas y solo las ubica donde un administrador se lo ha delegado.\nMiembro: trabaja en las aplicaciones de la organización con el acceso que le dan sus conjuntos de permisos.\nExterno: alguien ajeno a la organización, como un proveedor o un cliente, que solo ve lo que se comparte con él.", @@ -983,6 +1001,12 @@ export const esESObjects: NonNullable = { sent: "Invitación enviada a {{ result.email }}", link_only: "Invitación creada para {{ result.email }}. El correo no está configurado en este servidor, así que no ha salido ningún mensaje. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." }, + notices: { + mail_not_delivered: { + title: "El correo no está configurado en este servidor", + body: "No saldrá ningún mensaje, así que el invitado no sabrá de esta invitación. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." + } + }, params: { role: { helpText: "Propietario: control total de la organización, incluida su eliminación.\nAdministrador: gestiona los miembros, las invitaciones, los equipos y la configuración de la organización.\nAdministrador delegado: invita a personas y solo las ubica donde un administrador se lo ha delegado.\nMiembro: trabaja en las aplicaciones de la organización con el acceso que le dan sus conjuntos de permisos.\nExterno: alguien ajeno a la organización, como un proveedor o un cliente, que solo ve lo que se comparte con él.", @@ -1009,6 +1033,12 @@ export const esESObjects: NonNullable = { outcomeMessages: { sent: "Invitación reenviada a {{ result.email }}", link_only: "Invitación renovada para {{ result.email }}. El correo no está configurado en este servidor, así que no ha salido ningún mensaje. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." + }, + notices: { + mail_not_delivered: { + title: "El correo no está configurado en este servidor", + body: "No saldrá ningún mensaje, así que el invitado no sabrá de esta invitación. Para aceptar hace falta una dirección de correo verificada: sin correo, solo puede aceptar un invitado cuyo inicio de sesión social o SSO verifique la dirección. Para cualquier otra persona, un administrador de la plataforma crea la cuenta." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/fr.objects.generated.ts b/packages/platform-objects/src/apps/translations/fr.objects.generated.ts index 18496e91df1..9a480d00ef2 100644 --- a/packages/platform-objects/src/apps/translations/fr.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.objects.generated.ts @@ -161,6 +161,12 @@ export const frObjects: NonNullable = { sent: "Invitation envoyée à {{ result.email }}", link_only: "Invitation créée pour {{ result.email }}. L’envoi d’e-mails n’est pas configuré sur ce serveur, aucun e-mail n’a donc été envoyé. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." }, + notices: { + mail_not_delivered: { + title: "L’envoi d’e-mails n’est pas configuré sur ce serveur", + body: "Aucun e-mail ne sera envoyé : l’invité ne sera donc pas informé de cette invitation. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." + } + }, params: { role: { helpText: "Propriétaire : contrôle total de l’organisation, y compris sa suppression.\nAdministrateur : gère les membres, les invitations, les équipes et les paramètres de l’organisation.\nAdministrateur délégué : invite des personnes et les place uniquement là où un administrateur le lui a délégué.\nMembre : travaille dans les applications de l’organisation avec l’accès que lui donnent ses ensembles d’autorisations.\nExterne : une personne extérieure à l’organisation, comme un fournisseur ou un client, qui ne voit que ce qui est partagé avec elle.", @@ -725,6 +731,12 @@ export const frObjects: NonNullable = { sent: "Invitation envoyée à {{ result.email }}", link_only: "Invitation créée pour {{ result.email }}. L’envoi d’e-mails n’est pas configuré sur ce serveur, aucun e-mail n’a donc été envoyé. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." }, + notices: { + mail_not_delivered: { + title: "L’envoi d’e-mails n’est pas configuré sur ce serveur", + body: "Aucun e-mail ne sera envoyé : l’invité ne sera donc pas informé de cette invitation. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." + } + }, params: { role: { helpText: "Propriétaire : contrôle total de l’organisation, y compris sa suppression.\nAdministrateur : gère les membres, les invitations, les équipes et les paramètres de l’organisation.\nAdministrateur délégué : invite des personnes et les place uniquement là où un administrateur le lui a délégué.\nMembre : travaille dans les applications de l’organisation avec l’accès que lui donnent ses ensembles d’autorisations.\nExterne : une personne extérieure à l’organisation, comme un fournisseur ou un client, qui ne voit que ce qui est partagé avec elle.", @@ -831,6 +843,12 @@ export const frObjects: NonNullable = { sent: "Invitation envoyée à {{ result.email }}", link_only: "Invitation créée pour {{ result.email }}. L’envoi d’e-mails n’est pas configuré sur ce serveur, aucun e-mail n’a donc été envoyé. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." }, + notices: { + mail_not_delivered: { + title: "L’envoi d’e-mails n’est pas configuré sur ce serveur", + body: "Aucun e-mail ne sera envoyé : l’invité ne sera donc pas informé de cette invitation. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." + } + }, params: { role: { helpText: "Propriétaire : contrôle total de l’organisation, y compris sa suppression.\nAdministrateur : gère les membres, les invitations, les équipes et les paramètres de l’organisation.\nAdministrateur délégué : invite des personnes et les place uniquement là où un administrateur le lui a délégué.\nMembre : travaille dans les applications de l’organisation avec l’accès que lui donnent ses ensembles d’autorisations.\nExterne : une personne extérieure à l’organisation, comme un fournisseur ou un client, qui ne voit que ce qui est partagé avec elle.", @@ -983,6 +1001,12 @@ export const frObjects: NonNullable = { sent: "Invitation envoyée à {{ result.email }}", link_only: "Invitation créée pour {{ result.email }}. L’envoi d’e-mails n’est pas configuré sur ce serveur, aucun e-mail n’a donc été envoyé. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." }, + notices: { + mail_not_delivered: { + title: "L’envoi d’e-mails n’est pas configuré sur ce serveur", + body: "Aucun e-mail ne sera envoyé : l’invité ne sera donc pas informé de cette invitation. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." + } + }, params: { role: { helpText: "Propriétaire : contrôle total de l’organisation, y compris sa suppression.\nAdministrateur : gère les membres, les invitations, les équipes et les paramètres de l’organisation.\nAdministrateur délégué : invite des personnes et les place uniquement là où un administrateur le lui a délégué.\nMembre : travaille dans les applications de l’organisation avec l’accès que lui donnent ses ensembles d’autorisations.\nExterne : une personne extérieure à l’organisation, comme un fournisseur ou un client, qui ne voit que ce qui est partagé avec elle.", @@ -1009,6 +1033,12 @@ export const frObjects: NonNullable = { outcomeMessages: { sent: "Invitation renvoyée à {{ result.email }}", link_only: "Invitation renouvelée pour {{ result.email }}. L’envoi d’e-mails n’est pas configuré sur ce serveur, aucun e-mail n’a donc été envoyé. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." + }, + notices: { + mail_not_delivered: { + title: "L’envoi d’e-mails n’est pas configuré sur ce serveur", + body: "Aucun e-mail ne sera envoyé : l’invité ne sera donc pas informé de cette invitation. L’acceptation exige une adresse e-mail vérifiée : sans e-mail, seul un invité dont la connexion sociale ou SSO vérifie l’adresse peut accepter. Pour toute autre personne, un administrateur de la plateforme crée le compte." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts b/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts index 19454821d63..009ecf9b60a 100644 --- a/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts @@ -161,6 +161,12 @@ export const jaJPObjects: NonNullable = { sent: "{{ result.email }} に招待を送信しました", link_only: "{{ result.email }} の招待を作成しました。このサーバーではメールが設定されていないため、メールは配信されていません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" }, + notices: { + mail_not_delivered: { + title: "このサーバーではメールが設定されていません", + body: "メールは送信されないため、招待者にはこの招待が通知されません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" + } + }, params: { role: { helpText: "所有者:組織を完全に管理でき、組織の削除もできます。\n管理者:メンバー、招待、チーム、組織の設定を管理します。\n委任管理者:ユーザーを招待し、管理者から委任された範囲にのみ配置できます。\nメンバー:権限セットで付与されたアクセス権で組織のアプリを利用します。\n外部メンバー:仕入先や顧客など組織外のユーザーで、共有されたものだけを閲覧できます。", @@ -725,6 +731,12 @@ export const jaJPObjects: NonNullable = { sent: "{{ result.email }} に招待を送信しました", link_only: "{{ result.email }} の招待を作成しました。このサーバーではメールが設定されていないため、メールは配信されていません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" }, + notices: { + mail_not_delivered: { + title: "このサーバーではメールが設定されていません", + body: "メールは送信されないため、招待者にはこの招待が通知されません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" + } + }, params: { role: { helpText: "所有者:組織を完全に管理でき、組織の削除もできます。\n管理者:メンバー、招待、チーム、組織の設定を管理します。\n委任管理者:ユーザーを招待し、管理者から委任された範囲にのみ配置できます。\nメンバー:権限セットで付与されたアクセス権で組織のアプリを利用します。\n外部メンバー:仕入先や顧客など組織外のユーザーで、共有されたものだけを閲覧できます。", @@ -831,6 +843,12 @@ export const jaJPObjects: NonNullable = { sent: "{{ result.email }} に招待を送信しました", link_only: "{{ result.email }} の招待を作成しました。このサーバーではメールが設定されていないため、メールは配信されていません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" }, + notices: { + mail_not_delivered: { + title: "このサーバーではメールが設定されていません", + body: "メールは送信されないため、招待者にはこの招待が通知されません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" + } + }, params: { role: { helpText: "所有者:組織を完全に管理でき、組織の削除もできます。\n管理者:メンバー、招待、チーム、組織の設定を管理します。\n委任管理者:ユーザーを招待し、管理者から委任された範囲にのみ配置できます。\nメンバー:権限セットで付与されたアクセス権で組織のアプリを利用します。\n外部メンバー:仕入先や顧客など組織外のユーザーで、共有されたものだけを閲覧できます。", @@ -983,6 +1001,12 @@ export const jaJPObjects: NonNullable = { sent: "{{ result.email }} に招待を送信しました", link_only: "{{ result.email }} の招待を作成しました。このサーバーではメールが設定されていないため、メールは配信されていません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" }, + notices: { + mail_not_delivered: { + title: "このサーバーではメールが設定されていません", + body: "メールは送信されないため、招待者にはこの招待が通知されません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" + } + }, params: { role: { helpText: "所有者:組織を完全に管理でき、組織の削除もできます。\n管理者:メンバー、招待、チーム、組織の設定を管理します。\n委任管理者:ユーザーを招待し、管理者から委任された範囲にのみ配置できます。\nメンバー:権限セットで付与されたアクセス権で組織のアプリを利用します。\n外部メンバー:仕入先や顧客など組織外のユーザーで、共有されたものだけを閲覧できます。", @@ -1009,6 +1033,12 @@ export const jaJPObjects: NonNullable = { outcomeMessages: { sent: "{{ result.email }} に招待を再送しました", link_only: "{{ result.email }} の招待を更新しました。このサーバーではメールが設定されていないため、メールは配信されていません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" + }, + notices: { + mail_not_delivered: { + title: "このサーバーではメールが設定されていません", + body: "メールは送信されないため、招待者にはこの招待が通知されません。招待の承諾には確認済みのメールアドレスが必要です。メールがない場合、承諾できるのはソーシャルまたは SSO サインインでアドレスが確認される招待者だけです。それ以外の方は、プラットフォーム管理者がアカウントを作成してください。" + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/ko.objects.generated.ts b/packages/platform-objects/src/apps/translations/ko.objects.generated.ts index 8cb6505a5a2..128cb0471d0 100644 --- a/packages/platform-objects/src/apps/translations/ko.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.objects.generated.ts @@ -161,6 +161,12 @@ export const koObjects: NonNullable = { sent: "{{ result.email }}에게 초대를 보냄", link_only: "{{ result.email }}에 대한 초대를 만들었습니다. 이 서버에는 메일이 구성되어 있지 않아 이메일은 발송되지 않았습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." }, + notices: { + mail_not_delivered: { + title: "이 서버에는 메일이 구성되어 있지 않습니다", + body: "이메일이 발송되지 않으므로 초대 대상자는 이 초대를 알 수 없습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." + } + }, params: { role: { helpText: "소유자: 조직 삭제를 포함해 조직을 완전히 제어합니다.\n관리자: 구성원, 초대, 팀, 조직 설정을 관리합니다.\n위임된 관리자: 사람을 초대하고, 관리자가 위임한 곳에만 배치합니다.\n구성원: 권한 세트가 부여하는 액세스로 조직의 앱에서 작업합니다.\n외부: 공급업체나 고객처럼 조직 외부의 사람으로, 자신과 공유된 것만 봅니다.", @@ -725,6 +731,12 @@ export const koObjects: NonNullable = { sent: "{{ result.email }}에게 초대를 보냄", link_only: "{{ result.email }}에 대한 초대를 만들었습니다. 이 서버에는 메일이 구성되어 있지 않아 이메일은 발송되지 않았습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." }, + notices: { + mail_not_delivered: { + title: "이 서버에는 메일이 구성되어 있지 않습니다", + body: "이메일이 발송되지 않으므로 초대 대상자는 이 초대를 알 수 없습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." + } + }, params: { role: { helpText: "소유자: 조직 삭제를 포함해 조직을 완전히 제어합니다.\n관리자: 구성원, 초대, 팀, 조직 설정을 관리합니다.\n위임된 관리자: 사람을 초대하고, 관리자가 위임한 곳에만 배치합니다.\n구성원: 권한 세트가 부여하는 액세스로 조직의 앱에서 작업합니다.\n외부: 공급업체나 고객처럼 조직 외부의 사람으로, 자신과 공유된 것만 봅니다.", @@ -831,6 +843,12 @@ export const koObjects: NonNullable = { sent: "{{ result.email }}에게 초대를 보냄", link_only: "{{ result.email }}에 대한 초대를 만들었습니다. 이 서버에는 메일이 구성되어 있지 않아 이메일은 발송되지 않았습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." }, + notices: { + mail_not_delivered: { + title: "이 서버에는 메일이 구성되어 있지 않습니다", + body: "이메일이 발송되지 않으므로 초대 대상자는 이 초대를 알 수 없습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." + } + }, params: { role: { helpText: "소유자: 조직 삭제를 포함해 조직을 완전히 제어합니다.\n관리자: 구성원, 초대, 팀, 조직 설정을 관리합니다.\n위임된 관리자: 사람을 초대하고, 관리자가 위임한 곳에만 배치합니다.\n구성원: 권한 세트가 부여하는 액세스로 조직의 앱에서 작업합니다.\n외부: 공급업체나 고객처럼 조직 외부의 사람으로, 자신과 공유된 것만 봅니다.", @@ -983,6 +1001,12 @@ export const koObjects: NonNullable = { sent: "{{ result.email }}에게 초대를 보냄", link_only: "{{ result.email }}에 대한 초대를 만들었습니다. 이 서버에는 메일이 구성되어 있지 않아 이메일은 발송되지 않았습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." }, + notices: { + mail_not_delivered: { + title: "이 서버에는 메일이 구성되어 있지 않습니다", + body: "이메일이 발송되지 않으므로 초대 대상자는 이 초대를 알 수 없습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." + } + }, params: { role: { helpText: "소유자: 조직 삭제를 포함해 조직을 완전히 제어합니다.\n관리자: 구성원, 초대, 팀, 조직 설정을 관리합니다.\n위임된 관리자: 사람을 초대하고, 관리자가 위임한 곳에만 배치합니다.\n구성원: 권한 세트가 부여하는 액세스로 조직의 앱에서 작업합니다.\n외부: 공급업체나 고객처럼 조직 외부의 사람으로, 자신과 공유된 것만 봅니다.", @@ -1009,6 +1033,12 @@ export const koObjects: NonNullable = { outcomeMessages: { sent: "{{ result.email }}에게 초대를 다시 보냄", link_only: "{{ result.email }}에 대한 초대를 갱신했습니다. 이 서버에는 메일이 구성되어 있지 않아 이메일은 발송되지 않았습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." + }, + notices: { + mail_not_delivered: { + title: "이 서버에는 메일이 구성되어 있지 않습니다", + body: "이메일이 발송되지 않으므로 초대 대상자는 이 초대를 알 수 없습니다. 초대를 수락하려면 인증된 이메일 주소가 필요합니다. 메일이 없으면 소셜 또는 SSO 로그인으로 주소가 인증되는 초대 대상자만 수락할 수 있습니다. 그 밖의 사람은 플랫폼 관리자가 계정을 만들어야 합니다." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts index 92280891fdc..6bdbfbaff02 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.objects.generated.ts @@ -161,6 +161,12 @@ export const ptBRObjects: NonNullable = { sent: "Convite enviado para {{ result.email }}", link_only: "Convite criado para {{ result.email }}. O e-mail não está configurado neste servidor, portanto nenhuma mensagem foi enviada. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." }, + notices: { + mail_not_delivered: { + title: "O e-mail não está configurado neste servidor", + body: "Nenhuma mensagem será enviada, então o convidado não saberá deste convite. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." + } + }, params: { role: { helpText: "Proprietário: controle total da organização, inclusive excluí-la.\nAdministrador: gerencia membros, convites, equipes e as configurações da organização.\nAdministrador delegado: convida pessoas e as coloca somente onde um administrador delegou isso.\nMembro: trabalha nos apps da organização com o acesso que seus conjuntos de permissões concedem.\nExterno: alguém de fora da organização, como um fornecedor ou cliente, que vê apenas o que é compartilhado com ele.", @@ -725,6 +731,12 @@ export const ptBRObjects: NonNullable = { sent: "Convite enviado para {{ result.email }}", link_only: "Convite criado para {{ result.email }}. O e-mail não está configurado neste servidor, portanto nenhuma mensagem foi enviada. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." }, + notices: { + mail_not_delivered: { + title: "O e-mail não está configurado neste servidor", + body: "Nenhuma mensagem será enviada, então o convidado não saberá deste convite. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." + } + }, params: { role: { helpText: "Proprietário: controle total da organização, inclusive excluí-la.\nAdministrador: gerencia membros, convites, equipes e as configurações da organização.\nAdministrador delegado: convida pessoas e as coloca somente onde um administrador delegou isso.\nMembro: trabalha nos apps da organização com o acesso que seus conjuntos de permissões concedem.\nExterno: alguém de fora da organização, como um fornecedor ou cliente, que vê apenas o que é compartilhado com ele.", @@ -831,6 +843,12 @@ export const ptBRObjects: NonNullable = { sent: "Convite enviado para {{ result.email }}", link_only: "Convite criado para {{ result.email }}. O e-mail não está configurado neste servidor, portanto nenhuma mensagem foi enviada. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." }, + notices: { + mail_not_delivered: { + title: "O e-mail não está configurado neste servidor", + body: "Nenhuma mensagem será enviada, então o convidado não saberá deste convite. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." + } + }, params: { role: { helpText: "Proprietário: controle total da organização, inclusive excluí-la.\nAdministrador: gerencia membros, convites, equipes e as configurações da organização.\nAdministrador delegado: convida pessoas e as coloca somente onde um administrador delegou isso.\nMembro: trabalha nos apps da organização com o acesso que seus conjuntos de permissões concedem.\nExterno: alguém de fora da organização, como um fornecedor ou cliente, que vê apenas o que é compartilhado com ele.", @@ -983,6 +1001,12 @@ export const ptBRObjects: NonNullable = { sent: "Convite enviado para {{ result.email }}", link_only: "Convite criado para {{ result.email }}. O e-mail não está configurado neste servidor, portanto nenhuma mensagem foi enviada. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." }, + notices: { + mail_not_delivered: { + title: "O e-mail não está configurado neste servidor", + body: "Nenhuma mensagem será enviada, então o convidado não saberá deste convite. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." + } + }, params: { role: { helpText: "Proprietário: controle total da organização, inclusive excluí-la.\nAdministrador: gerencia membros, convites, equipes e as configurações da organização.\nAdministrador delegado: convida pessoas e as coloca somente onde um administrador delegou isso.\nMembro: trabalha nos apps da organização com o acesso que seus conjuntos de permissões concedem.\nExterno: alguém de fora da organização, como um fornecedor ou cliente, que vê apenas o que é compartilhado com ele.", @@ -1009,6 +1033,12 @@ export const ptBRObjects: NonNullable = { outcomeMessages: { sent: "Convite reenviado para {{ result.email }}", link_only: "Convite renovado para {{ result.email }}. O e-mail não está configurado neste servidor, portanto nenhuma mensagem foi enviada. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." + }, + notices: { + mail_not_delivered: { + title: "O e-mail não está configurado neste servidor", + body: "Nenhuma mensagem será enviada, então o convidado não saberá deste convite. Aceitar exige um endereço de e-mail verificado: sem e-mail, só pode aceitar um convidado cujo login social ou SSO verifique o endereço. Para qualquer outra pessoa, um administrador da plataforma cria a conta." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/ru.objects.generated.ts b/packages/platform-objects/src/apps/translations/ru.objects.generated.ts index ae8dd7ee6d6..6da1856256f 100644 --- a/packages/platform-objects/src/apps/translations/ru.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.objects.generated.ts @@ -161,6 +161,12 @@ export const ruObjects: NonNullable = { sent: "Приглашение отправлено на {{ result.email }}", link_only: "Приглашение для {{ result.email }} создано. Почта на этом сервере не настроена, поэтому письмо не отправлено. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." }, + notices: { + mail_not_delivered: { + title: "Почта на этом сервере не настроена", + body: "Письмо не будет отправлено, поэтому приглашённый не узнает об этом приглашении. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." + } + }, params: { role: { helpText: "Владелец: полный контроль над организацией, включая её удаление.\nАдминистратор: управляет участниками, приглашениями, командами и настройками организации.\nДелегированный администратор: приглашает людей и размещает их только там, где это делегировал администратор.\nУчастник: работает в приложениях организации с доступом, который дают его наборы разрешений.\nВнешний: человек вне организации, например поставщик или клиент, который видит только то, чем с ним поделились.", @@ -725,6 +731,12 @@ export const ruObjects: NonNullable = { sent: "Приглашение отправлено на {{ result.email }}", link_only: "Приглашение для {{ result.email }} создано. Почта на этом сервере не настроена, поэтому письмо не отправлено. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." }, + notices: { + mail_not_delivered: { + title: "Почта на этом сервере не настроена", + body: "Письмо не будет отправлено, поэтому приглашённый не узнает об этом приглашении. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." + } + }, params: { role: { helpText: "Владелец: полный контроль над организацией, включая её удаление.\nАдминистратор: управляет участниками, приглашениями, командами и настройками организации.\nДелегированный администратор: приглашает людей и размещает их только там, где это делегировал администратор.\nУчастник: работает в приложениях организации с доступом, который дают его наборы разрешений.\nВнешний: человек вне организации, например поставщик или клиент, который видит только то, чем с ним поделились.", @@ -831,6 +843,12 @@ export const ruObjects: NonNullable = { sent: "Приглашение отправлено на {{ result.email }}", link_only: "Приглашение для {{ result.email }} создано. Почта на этом сервере не настроена, поэтому письмо не отправлено. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." }, + notices: { + mail_not_delivered: { + title: "Почта на этом сервере не настроена", + body: "Письмо не будет отправлено, поэтому приглашённый не узнает об этом приглашении. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." + } + }, params: { role: { helpText: "Владелец: полный контроль над организацией, включая её удаление.\nАдминистратор: управляет участниками, приглашениями, командами и настройками организации.\nДелегированный администратор: приглашает людей и размещает их только там, где это делегировал администратор.\nУчастник: работает в приложениях организации с доступом, который дают его наборы разрешений.\nВнешний: человек вне организации, например поставщик или клиент, который видит только то, чем с ним поделились.", @@ -983,6 +1001,12 @@ export const ruObjects: NonNullable = { sent: "Приглашение отправлено на {{ result.email }}", link_only: "Приглашение для {{ result.email }} создано. Почта на этом сервере не настроена, поэтому письмо не отправлено. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." }, + notices: { + mail_not_delivered: { + title: "Почта на этом сервере не настроена", + body: "Письмо не будет отправлено, поэтому приглашённый не узнает об этом приглашении. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." + } + }, params: { role: { helpText: "Владелец: полный контроль над организацией, включая её удаление.\nАдминистратор: управляет участниками, приглашениями, командами и настройками организации.\nДелегированный администратор: приглашает людей и размещает их только там, где это делегировал администратор.\nУчастник: работает в приложениях организации с доступом, который дают его наборы разрешений.\nВнешний: человек вне организации, например поставщик или клиент, который видит только то, чем с ним поделились.", @@ -1009,6 +1033,12 @@ export const ruObjects: NonNullable = { outcomeMessages: { sent: "Приглашение повторно отправлено на {{ result.email }}", link_only: "Приглашение для {{ result.email }} продлено. Почта на этом сервере не настроена, поэтому письмо не отправлено. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." + }, + notices: { + mail_not_delivered: { + title: "Почта на этом сервере не настроена", + body: "Письмо не будет отправлено, поэтому приглашённый не узнает об этом приглашении. Для принятия нужен подтверждённый адрес электронной почты: без почты принять приглашение может только приглашённый, чей вход через соцсеть или SSO подтверждает адрес. Для всех остальных учётную запись создаёт администратор платформы." + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts b/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts index ac587e1d129..df24ec89967 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts @@ -161,6 +161,12 @@ export const zhCNObjects: NonNullable = { sent: "已向 {{ result.email }} 发送邀请", link_only: "已为 {{ result.email }} 创建邀请。此服务器未配置邮件,因此没有发出任何邮件。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" }, + notices: { + mail_not_delivered: { + title: "此服务器未配置邮件", + body: "不会发出任何邮件,因此受邀人不会收到这份邀请的通知。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" + } + }, params: { role: { helpText: "所有者:完全控制组织,包括删除组织。\n管理员:管理成员、邀请、团队和组织设置。\n受托管理员:可以邀请人员,并且只能将其安排到管理员已委托的范围内。\n成员:使用组织的应用,访问权限由其权限集决定。\n外部成员:来自组织外部的人员(如供应商或客户),只能看到与其共享的内容。", @@ -725,6 +731,12 @@ export const zhCNObjects: NonNullable = { sent: "已向 {{ result.email }} 发送邀请", link_only: "已为 {{ result.email }} 创建邀请。此服务器未配置邮件,因此没有发出任何邮件。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" }, + notices: { + mail_not_delivered: { + title: "此服务器未配置邮件", + body: "不会发出任何邮件,因此受邀人不会收到这份邀请的通知。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" + } + }, params: { role: { helpText: "所有者:完全控制组织,包括删除组织。\n管理员:管理成员、邀请、团队和组织设置。\n受托管理员:可以邀请人员,并且只能将其安排到管理员已委托的范围内。\n成员:使用组织的应用,访问权限由其权限集决定。\n外部成员:来自组织外部的人员(如供应商或客户),只能看到与其共享的内容。", @@ -831,6 +843,12 @@ export const zhCNObjects: NonNullable = { sent: "已向 {{ result.email }} 发送邀请", link_only: "已为 {{ result.email }} 创建邀请。此服务器未配置邮件,因此没有发出任何邮件。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" }, + notices: { + mail_not_delivered: { + title: "此服务器未配置邮件", + body: "不会发出任何邮件,因此受邀人不会收到这份邀请的通知。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" + } + }, params: { role: { helpText: "所有者:完全控制组织,包括删除组织。\n管理员:管理成员、邀请、团队和组织设置。\n受托管理员:可以邀请人员,并且只能将其安排到管理员已委托的范围内。\n成员:使用组织的应用,访问权限由其权限集决定。\n外部成员:来自组织外部的人员(如供应商或客户),只能看到与其共享的内容。", @@ -983,6 +1001,12 @@ export const zhCNObjects: NonNullable = { sent: "已向 {{ result.email }} 发送邀请", link_only: "已为 {{ result.email }} 创建邀请。此服务器未配置邮件,因此没有发出任何邮件。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" }, + notices: { + mail_not_delivered: { + title: "此服务器未配置邮件", + body: "不会发出任何邮件,因此受邀人不会收到这份邀请的通知。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" + } + }, params: { role: { helpText: "所有者:完全控制组织,包括删除组织。\n管理员:管理成员、邀请、团队和组织设置。\n受托管理员:可以邀请人员,并且只能将其安排到管理员已委托的范围内。\n成员:使用组织的应用,访问权限由其权限集决定。\n外部成员:来自组织外部的人员(如供应商或客户),只能看到与其共享的内容。", @@ -1009,6 +1033,12 @@ export const zhCNObjects: NonNullable = { outcomeMessages: { sent: "已向 {{ result.email }} 重新发送邀请", link_only: "已为 {{ result.email }} 续期邀请。此服务器未配置邮件,因此没有发出任何邮件。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" + }, + notices: { + mail_not_delivered: { + title: "此服务器未配置邮件", + body: "不会发出任何邮件,因此受邀人不会收到这份邀请的通知。接受邀请需要已验证的邮箱地址:没有邮件时,只有通过社交或 SSO 登录且地址已被验证的受邀人才能接受。其他人请由平台管理员为其创建账号。" + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts index e252d2ec67b..f49a0687437 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.objects.generated.ts @@ -161,6 +161,12 @@ export const zhHantObjects: NonNullable = { sent: "已向 {{ result.email }} 傳送邀請", link_only: "已為 {{ result.email }} 建立邀請。此伺服器未設定郵件,因此沒有發出任何郵件。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" }, + notices: { + mail_not_delivered: { + title: "此伺服器未設定郵件", + body: "不會發出任何郵件,因此受邀者不會收到這份邀請的通知。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" + } + }, params: { role: { helpText: "擁有者:完全控制組織,包括刪除組織。\n管理員:管理成員、邀請、團隊和組織設定。\n受託管理員:可以邀請人員,並且只能將其安排到管理員已委託的範圍內。\n成員:使用組織的應用程式,存取權限由其權限集決定。\n外部成員:來自組織外部的人員(如供應商或客戶),只能看到與其共用的內容。", @@ -725,6 +731,12 @@ export const zhHantObjects: NonNullable = { sent: "已向 {{ result.email }} 傳送邀請", link_only: "已為 {{ result.email }} 建立邀請。此伺服器未設定郵件,因此沒有發出任何郵件。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" }, + notices: { + mail_not_delivered: { + title: "此伺服器未設定郵件", + body: "不會發出任何郵件,因此受邀者不會收到這份邀請的通知。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" + } + }, params: { role: { helpText: "擁有者:完全控制組織,包括刪除組織。\n管理員:管理成員、邀請、團隊和組織設定。\n受託管理員:可以邀請人員,並且只能將其安排到管理員已委託的範圍內。\n成員:使用組織的應用程式,存取權限由其權限集決定。\n外部成員:來自組織外部的人員(如供應商或客戶),只能看到與其共用的內容。", @@ -831,6 +843,12 @@ export const zhHantObjects: NonNullable = { sent: "已向 {{ result.email }} 傳送邀請", link_only: "已為 {{ result.email }} 建立邀請。此伺服器未設定郵件,因此沒有發出任何郵件。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" }, + notices: { + mail_not_delivered: { + title: "此伺服器未設定郵件", + body: "不會發出任何郵件,因此受邀者不會收到這份邀請的通知。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" + } + }, params: { role: { helpText: "擁有者:完全控制組織,包括刪除組織。\n管理員:管理成員、邀請、團隊和組織設定。\n受託管理員:可以邀請人員,並且只能將其安排到管理員已委託的範圍內。\n成員:使用組織的應用程式,存取權限由其權限集決定。\n外部成員:來自組織外部的人員(如供應商或客戶),只能看到與其共用的內容。", @@ -983,6 +1001,12 @@ export const zhHantObjects: NonNullable = { sent: "已向 {{ result.email }} 傳送邀請", link_only: "已為 {{ result.email }} 建立邀請。此伺服器未設定郵件,因此沒有發出任何郵件。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" }, + notices: { + mail_not_delivered: { + title: "此伺服器未設定郵件", + body: "不會發出任何郵件,因此受邀者不會收到這份邀請的通知。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" + } + }, params: { role: { helpText: "擁有者:完全控制組織,包括刪除組織。\n管理員:管理成員、邀請、團隊和組織設定。\n受託管理員:可以邀請人員,並且只能將其安排到管理員已委託的範圍內。\n成員:使用組織的應用程式,存取權限由其權限集決定。\n外部成員:來自組織外部的人員(如供應商或客戶),只能看到與其共用的內容。", @@ -1009,6 +1033,12 @@ export const zhHantObjects: NonNullable = { outcomeMessages: { sent: "已向 {{ result.email }} 重新發送邀請", link_only: "已為 {{ result.email }} 續期邀請。此伺服器未設定郵件,因此沒有發出任何郵件。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" + }, + notices: { + mail_not_delivered: { + title: "此伺服器未設定郵件", + body: "不會發出任何郵件,因此受邀者不會收到這份邀請的通知。接受邀請需要已驗證的電子郵件地址:沒有郵件時,只有透過社群或 SSO 登入且地址已被驗證的受邀者才能接受。其他人請由平台管理員為其建立帳號。" + } } }, copy_invitation_link: { diff --git a/packages/platform-objects/src/feature-gate-guard.test.ts b/packages/platform-objects/src/feature-gate-guard.test.ts index 858b061277c..76d0a7480e9 100644 --- a/packages/platform-objects/src/feature-gate-guard.test.ts +++ b/packages/platform-objects/src/feature-gate-guard.test.ts @@ -30,6 +30,13 @@ * `requiresFeature` is lowered there, booked as `.fieldGroups.`, * and walked in both directions like an action. * + * An action notice's `visible` is the fourth site (#39045): a notice gates + * nothing, so a flag its condition reads is booked in the flag's + * `noticePaths`, not `gatedInputs`, and walked in both directions (every + * booked path is a declared notice reading the flag; every `features.*` read + * in a notice condition is booked). The invite actions' mail notice also pins + * its exact condition, since "reads the flag" alone would pass an inverted one. + * * Scope notes: objects that moved to capability plugins per ADR-0029 K2 * (plugin-security / plugin-sharing / plugin-audit / service-realtime / * plugin-webhooks) are outside this package and this guard; none of them @@ -51,7 +58,8 @@ import * as metadata from './metadata/index.js'; import * as system from './system/index.js'; type AnyParam = { name?: string; field?: string; visible?: { source?: string } }; -type AnyAction = { name?: string; visible?: { source?: string }; params?: AnyParam[] }; +type AnyNotice = { visible?: { source?: string } | boolean }; +type AnyAction = { name?: string; visible?: { source?: string }; params?: AnyParam[]; notices?: Record }; type AnyGroup = { key?: string; visibleWhen?: { source?: string } }; type AnyObject = { name?: string; actions?: AnyAction[]; fieldGroups?: AnyGroup[] }; @@ -214,6 +222,67 @@ describe('feature-gate completeness guard (#2874)', () => { }); }); + // A notice (`ActionSchema.notices`) gates nothing, so a flag its condition + // reads is booked in the flag's `noticePaths`, not `gatedInputs`. Both + // directions, as for inputs: every booked path is a declared notice whose + // condition reads the flag, and every `features.*` read in a notice + // condition is booked. + describe('notices: noticePaths and notice conditions agree', () => { + const noticeSource = (path: string): string | undefined => { + const match = /^([a-z0-9_]+)\.actions\.([a-z0-9_]+)\.notices\.([a-z0-9_]+)$/.exec(path); + expect(match, `path grammar: ${path}`).not.toBeNull(); + const [, objectName, actionName, noticeName] = match!; + const action = (objectsByName.get(objectName)?.actions ?? []).find((a) => a.name === actionName); + expect(action, `action exists: ${path}`).toBeDefined(); + const notice = action!.notices?.[noticeName]; + expect(notice, `notice exists: ${path}`).toBeDefined(); + return typeof notice!.visible === 'object' ? notice!.visible.source : undefined; + }; + const booked = flagEntries.flatMap(([flag, entry]) => + ((entry as { noticePaths?: readonly string[] }).noticePaths ?? []).map((path): [string, string] => [path, flag]), + ); + const read: Array<[string, string]> = []; + for (const [objectName, object] of objectsByName) { + for (const action of object.actions ?? []) { + for (const [noticeName, notice] of Object.entries(action.notices ?? {})) { + const source = typeof notice.visible === 'object' ? notice.visible.source : undefined; + // One row per (notice, flag): `has(features.x) && features.x != true` reads x twice. + const flags = new Set([...(source ?? '').matchAll(/features\.([A-Za-z0-9_]+)/g)].map((m) => m[1])); + for (const flag of flags) { + read.push([`${objectName}.actions.${action.name}.notices.${noticeName}`, flag]); + } + } + } + } + + it('finds the booked notices and the notice reads (guards the walker itself)', () => { + expect(booked.length).toBeGreaterThan(0); + expect(read.length).toBeGreaterThan(0); + }); + + it.each(booked)('%s reads features.%s', (path, flag) => { + const source = noticeSource(path); + expect(source, `${path} has a visible condition`).toBeDefined(); + expect(source!, `${path}: "${source}" reads features.${flag}`).toMatch(new RegExp(`features\\.${flag}\\b`)); + }); + + // "Reads the flag" would pass an inverted condition or a dropped `has()`: + // the mail notice is drawn only while the host HAS the flag and it is not + // true (absent flag: not drawn, and not a fail-closed fault either). + it.each((PUBLIC_AUTH_FEATURES.emailDelivery as { noticePaths?: readonly string[] }).noticePaths ?? [])( + '%s is drawn exactly while the received emailDelivery flag is not true', + (path) => { + expect(noticeSource(path)).toBe('has(features.emailDelivery) && features.emailDelivery != true'); + }, + ); + + it.each(read)('%s reads registered flag %s and is booked in its noticePaths', (path, flag) => { + const entry = (PUBLIC_AUTH_FEATURES as Record)[flag]; + expect(entry, `features.${flag} is a registry flag`).toBeDefined(); + expect(entry.noticePaths ?? [], `${path} is booked in ${flag}.noticePaths`).toContain(path); + }); + }); + describe('the conjunct matcher the forward rows use', () => { const gate = 'features.cloudManaged != true'; it.each([ diff --git a/packages/platform-objects/src/identity/invite-outcome-messages.ts b/packages/platform-objects/src/identity/invite-outcome-messages.ts index eeee1393262..ab7ccc5ad56 100644 --- a/packages/platform-objects/src/identity/invite-outcome-messages.ts +++ b/packages/platform-objects/src/identity/invite-outcome-messages.ts @@ -41,3 +41,30 @@ export const RESEND_INVITATION_OUTCOME_MESSAGES = { + 'Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in ' + 'verifies the address can accept. For anyone else, a platform administrator creates the account.', } as const; + +/** + * [#39045, ruling A] The notice the invite dialogs draw BEFORE submit + * (`ActionSchema.notices`), on a deployment that delivers no mail: the four + * `invite_user` mirrors and `sys_invitation.resend_invitation`, one spelling + * so one translation serves each. The `link_only` copy above says what + * happened after the fact; this says it before the click, under the same + * rules: it never says an email will be sent, and it never hands the admin + * Copy Invite Link as the way in. + * + * `features.emailDelivery` is the flag the auth config serves, true only when + * the wired email service reports itself configured (`isEmailDeliveryLive`). + * The `has()` conjunct keeps the notice out of a dialog whose host has not + * received the flag: the notice is drawn only on a deployment that said it + * delivers no mail. + */ +export const MAIL_NOT_DELIVERED_NOTICES = { + mail_not_delivered: { + severity: 'warning', + title: 'Mail is not configured on this server', + body: + 'No email will go out, so the invitee will not be told about this invitation. ' + + 'Accepting needs a verified email address: without mail, only an invitee whose social or SSO sign-in ' + + 'verifies the address can accept. For anyone else, a platform administrator creates the account.', + visible: 'has(features.emailDelivery) && features.emailDelivery != true', + }, +} as const; diff --git a/packages/platform-objects/src/identity/sys-invitation.object.ts b/packages/platform-objects/src/identity/sys-invitation.object.ts index 3a94612e98c..8f00ad02f90 100644 --- a/packages/platform-objects/src/identity/sys-invitation.object.ts +++ b/packages/platform-objects/src/identity/sys-invitation.object.ts @@ -8,7 +8,7 @@ import { InvitationStatus, MEMBERSHIP_ROLE_MEMBER, } from '@objectstack/spec/identity'; -import { INVITE_USER_OUTCOME_MESSAGES, RESEND_INVITATION_OUTCOME_MESSAGES } from './invite-outcome-messages.js'; +import { INVITE_USER_OUTCOME_MESSAGES, RESEND_INVITATION_OUTCOME_MESSAGES, MAIL_NOT_DELIVERED_NOTICES } from './invite-outcome-messages.js'; import { MEMBERSHIP_ROLE_PARAM_HELP } from './membership-role-help.js'; /** @@ -107,6 +107,9 @@ export const SysInvitation = ObjectSchema.create({ // or `link_only` when this deployment does not deliver mail. The // `successMessage` above stays the fallback for an answer without one. outcomeMessages: { ...INVITE_USER_OUTCOME_MESSAGES }, + // [#39045] Warns before submit on a deployment that delivers no mail; the + // copy and its rules sit beside the outcome copy above. + notices: { ...MAIL_NOT_DELIVERED_NOTICES }, refreshAfter: true, params: [ { field: 'email', required: true }, @@ -184,6 +187,9 @@ export const SysInvitation = ObjectSchema.create({ successMessage: 'Invitation resent', // [#27843] A resend answers the same delivery `outcome` as an invite. outcomeMessages: { ...RESEND_INVITATION_OUTCOME_MESSAGES }, + // [#39045] Warns before submit on a deployment that delivers no mail; the + // copy and its rules sit beside the outcome copy above. + notices: { ...MAIL_NOT_DELIVERED_NOTICES }, refreshAfter: true, // Both seeded from the row, so every list view that offers this action // projects `email` and `role` (`invitation-screens-copy.test.ts`). diff --git a/packages/platform-objects/src/identity/sys-member.object.ts b/packages/platform-objects/src/identity/sys-member.object.ts index 1a75866255a..46b1cc9872c 100644 --- a/packages/platform-objects/src/identity/sys-member.object.ts +++ b/packages/platform-objects/src/identity/sys-member.object.ts @@ -8,7 +8,7 @@ import { INVITATION_ROLE_OPTIONS, MEMBERSHIP_ROLE_MEMBER, } from '@objectstack/spec/identity'; -import { INVITE_USER_OUTCOME_MESSAGES } from './invite-outcome-messages.js'; +import { INVITE_USER_OUTCOME_MESSAGES, MAIL_NOT_DELIVERED_NOTICES } from './invite-outcome-messages.js'; import { MEMBERSHIP_ROLE_PARAM_HELP } from './membership-role-help.js'; /** @@ -119,6 +119,9 @@ export const SysMember = ObjectSchema.create({ // or `link_only` when this deployment does not deliver mail. The // `successMessage` above stays the fallback for an answer without one. outcomeMessages: { ...INVITE_USER_OUTCOME_MESSAGES }, + // [#39045] Warns before submit on a deployment that delivers no mail; the + // copy and its rules sit beside the outcome copy above. + notices: { ...MAIL_NOT_DELIVERED_NOTICES }, refreshAfter: true, params: [ { field: 'email', objectOverride: 'sys_invitation', required: true }, diff --git a/packages/platform-objects/src/identity/sys-organization.object.ts b/packages/platform-objects/src/identity/sys-organization.object.ts index d8f45505c5f..2a340803345 100644 --- a/packages/platform-objects/src/identity/sys-organization.object.ts +++ b/packages/platform-objects/src/identity/sys-organization.object.ts @@ -2,7 +2,7 @@ import { ObjectSchema, Field } from '@objectstack/spec/data'; import { INVITATION_ROLE_OPTIONS } from '@objectstack/spec/identity'; -import { INVITE_USER_OUTCOME_MESSAGES } from './invite-outcome-messages.js'; +import { INVITE_USER_OUTCOME_MESSAGES, MAIL_NOT_DELIVERED_NOTICES } from './invite-outcome-messages.js'; import { MEMBERSHIP_ROLE_PARAM_HELP } from './membership-role-help.js'; /** @@ -211,6 +211,9 @@ export const SysOrganization = ObjectSchema.create({ // or `link_only` when this deployment does not deliver mail. The // `successMessage` above stays the fallback for an answer without one. outcomeMessages: { ...INVITE_USER_OUTCOME_MESSAGES }, + // [#39045] Warns before submit on a deployment that delivers no mail; the + // copy and its rules sit beside the outcome copy above. + notices: { ...MAIL_NOT_DELIVERED_NOTICES }, refreshAfter: true, params: [ // ⚠️ Neither `email` nor `role` is a field of sys_organization, so diff --git a/packages/platform-objects/src/identity/sys-user.object.ts b/packages/platform-objects/src/identity/sys-user.object.ts index a38a6bf4c24..10ed4373349 100644 --- a/packages/platform-objects/src/identity/sys-user.object.ts +++ b/packages/platform-objects/src/identity/sys-user.object.ts @@ -5,7 +5,7 @@ import { PLATFORM_ADMIN_USERS_GATE } from './platform-admin-action-gate.js'; import { INVITATION_ROLE_OPTIONS, MEMBERSHIP_ROLE_ADMIN, MEMBERSHIP_ROLE_OWNER, mapMembershipRole, } from '@objectstack/spec/identity'; -import { INVITE_USER_OUTCOME_MESSAGES } from './invite-outcome-messages.js'; +import { INVITE_USER_OUTCOME_MESSAGES, MAIL_NOT_DELIVERED_NOTICES } from './invite-outcome-messages.js'; import { MEMBERSHIP_ROLE_PARAM_HELP } from './membership-role-help.js'; /** @@ -166,6 +166,9 @@ export const SysUser = ObjectSchema.create({ // or `link_only` when this deployment does not deliver mail. The // `successMessage` above stays the fallback for an answer without one. outcomeMessages: { ...INVITE_USER_OUTCOME_MESSAGES }, + // [#39045] Warns before submit on a deployment that delivers no mail; the + // copy and its rules sit beside the outcome copy above. + notices: { ...MAIL_NOT_DELIVERED_NOTICES }, refreshAfter: true, params: [ { field: 'email', required: true }, diff --git a/packages/spec/liveness/action.json b/packages/spec/liveness/action.json index 741e07e329f..881c43b3a95 100644 --- a/packages/spec/liveness/action.json +++ b/packages/spec/liveness/action.json @@ -31,36 +31,35 @@ "note": "LIVE since #28879 (the console half of #28519). An action that asks first or collects `params` names its dialog's dismiss button (\"Keep invitation\" beside \"Cancel Invitation\"): the confirm dialog and the param dialog draw the translated or authored `cancelText` and fall back to \"Cancel\" when the action declares none. `sys_invitation`'s `cancel_invitation` is the first consumer. The Studio action form offers the key (`action.metadata-form.ts`). `authorWarn` / `authorHint` were dropped in the same edit (a warned `live` row reds this gate)." }, "notices": { - "status": "planned", - "verifiedAt": "2026-12-02", - "authorWarn": true, - "authorHint": "Keep it, but nothing draws it yet: no console reads an action's `notices`, so its confirm and param dialogs show no notice until the console's two action dialogs read the key.", - "evidence": "packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: a map of snake_case notice names to `record:alert`'s vocabulary — `severity` from packages/spec/src/ui/alert-severity.ts#AlertSeveritySchema, `title` / `body` plain I18nLabels, at least one, never blank, and `visible` in the action's own condition shape); packages/spec/src/ui/action.zod.ts#notices (only on an action that declares `confirmText` or a non-empty `params`, `declaresNoticesWithoutDialog`); packages/spec/src/system/i18n-resolver.ts#translateAction overlays each declared notice's translated `objects.{o}._actions.{a}.notices.{n}.title` / `.body` (or `globalActions.{a}.notices.{n}.*`) through packages/spec/src/system/i18n-action-notices.ts#overlayActionNotices; packages/spec/src/system/translation.zod.ts declares the translation slot; packages/lint/src/i18n-walk.ts extracts the slots (packages/lint/src/i18n-walk-action-notices.ts#actionNoticeTranslationSlots); packages/lint/src/validate-translation-references.ts#checkActionNotices refuses a translation keyed to an undeclared notice; packages/lint/src/validate-expressions.ts checks each notice's `visible` in the `record` scope the action's own `visible` is checked in.", - "note": "PLANNED until the console half of #39045 lands (spec PR first, console card second, the #27944 split). The framework half is live, but no renderer reads the key yet: ui/packages/app-shell/src/views/ActionParamDialog.tsx and ui/packages/app-shell/src/views/ActionConfirmDialog.tsx draw no notice, and ui/packages/core/src/actions/ActionRunner.ts#ActionDef does not declare the key. `authorWarn` is set because an author who writes the key today sees nothing in the dialog. The console PR flips this row to `live` with its read points, and drops `authorWarn` / `authorHint` in that same edit (a warned `live` row reds this gate).", + "status": "live", + "verifiedAt": "2026-12-03", + "evidenceScope": "in-repo", + "evidence": "ui/packages/react/src/hooks/useActionTextLocalizer.ts#localizeActionNotices (the confirm path: each notice's `title` / `body` from the bundle's `objects.{o}._actions.{a}.notices.{n}.*`, or `globalActions.{a}.notices.{n}.*`, through ui/packages/i18n/src/useObjectLabel.ts#actionNoticeText, then the authored `I18nLabel` collapsed to the active language); ui/packages/core/src/actions/ActionRunner.ts#ActionDef (the key derived from the spec) and ui/packages/core/src/actions/ActionRunner.ts#dialogNotices (the notices in declared order with the dispatch's record, handed to the confirm handler as `options.notices` for a param-less action and to the param-collection handler as its `notices` argument otherwise); ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx#paramCollectionHandler and ui/packages/app-shell/src/views/RecordDetailView.tsx#paramCollectionHandler (the param path, resolved through ui/packages/app-shell/src/views/ActionDialogNotices.tsx#localizeDialogNotices); ui/packages/app-shell/src/views/ActionDialogNotices.tsx#visibleDialogNotices (each `visible` judged against the record and the host predicate scope, fail-closed and reported) and ui/packages/app-shell/src/views/ActionDialogNotices.tsx#ActionDialogNoticeList (draws `severity`'s tone and icon, `title`, `body`), mounted between the title and the description by ui/packages/app-shell/src/views/ActionConfirmDialog.tsx and ui/packages/app-shell/src/views/ActionParamDialog.tsx; ui/packages/components/src/renderers/action/action-button.tsx, ui/packages/components/src/renderers/action/action-icon.tsx, ui/packages/components/src/renderers/action/action-group.tsx, ui/packages/components/src/renderers/action/action-menu.tsx (the four action renderers forward it to the runner). Framework: packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: a map of snake_case notice names to `record:alert`'s vocabulary — `severity` from packages/spec/src/ui/alert-severity.ts#AlertSeveritySchema, `title` / `body` plain I18nLabels, at least one, never blank, and `visible` in the action's own condition shape); packages/spec/src/ui/action.zod.ts#notices (only on an action that declares `confirmText` or a non-empty `params`, `declaresNoticesWithoutDialog`); packages/spec/src/system/i18n-resolver.ts#translateAction overlays each declared notice's translated `objects.{o}._actions.{a}.notices.{n}.title` / `.body` (or `globalActions.{a}.notices.{n}.*`) through packages/spec/src/system/i18n-action-notices.ts#overlayActionNotices; packages/spec/src/system/translation.zod.ts declares the translation slot; packages/lint/src/i18n-walk.ts extracts the slots (packages/lint/src/i18n-walk-action-notices.ts#actionNoticeTranslationSlots); packages/lint/src/validate-translation-references.ts#checkActionNotices refuses a translation keyed to an undeclared notice; packages/lint/src/validate-expressions.ts checks each notice's `visible` in the `record` scope the action's own `visible` is checked in.", + "note": "LIVE since the console half of #39045. An action's confirm or param dialog draws its declared notices between the title and the description, each while its condition holds; a condition that cannot be evaluated draws nothing and is reported. The platform's four `invite_user` mirrors and `sys_invitation.resend_invitation` declare `mail_not_delivered`, drawn while `features.emailDelivery` is not true. `authorWarn` / `authorHint` were dropped in the same edit (a warned `live` row reds this gate).", "children": { "severity": { - "status": "planned", - "verifiedAt": "2026-12-02", - "evidence": "packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: `record:alert`'s closed set, packages/spec/src/ui/alert-severity.ts#AlertSeveritySchema, no default)", - "note": "Planned with its container `notices`: drawn by no dialog until the console half of #39045 reads the key." + "status": "live", + "verifiedAt": "2026-12-03", + "evidence": "ui/packages/app-shell/src/views/ActionDialogNotices.tsx#ActionDialogNoticeList (the tone and the icon, through ui/packages/components/src/notifications/severity.ts#notificationSeverityStyle; `info` when omitted); packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: `record:alert`'s closed set, packages/spec/src/ui/alert-severity.ts#AlertSeveritySchema, no default)", + "note": "Live with its container `notices`." }, "title": { - "status": "planned", - "verifiedAt": "2026-12-02", - "evidence": "packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: a plain I18nLabel, never blank, at least one of `title` / `body`; overlaid by packages/spec/src/system/i18n-action-notices.ts#overlayActionNotices)", - "note": "Planned with its container `notices`: drawn by no dialog until the console half of #39045 reads the key." + "status": "live", + "verifiedAt": "2026-12-03", + "evidence": "ui/packages/app-shell/src/views/ActionDialogNotices.tsx#ActionDialogNoticeList (drawn as the notice's first line; resolved by ui/packages/i18n/src/useObjectLabel.ts#actionNoticeText); packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: a plain I18nLabel, never blank, at least one of `title` / `body`; overlaid by packages/spec/src/system/i18n-action-notices.ts#overlayActionNotices)", + "note": "Live with its container `notices`." }, "body": { - "status": "planned", - "verifiedAt": "2026-12-02", - "evidence": "packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: a plain I18nLabel, never blank, at least one of `title` / `body`; overlaid by packages/spec/src/system/i18n-action-notices.ts#overlayActionNotices)", - "note": "Planned with its container `notices`: drawn by no dialog until the console half of #39045 reads the key." + "status": "live", + "verifiedAt": "2026-12-03", + "evidence": "ui/packages/app-shell/src/views/ActionDialogNotices.tsx#ActionDialogNoticeList (drawn under the title; resolved by ui/packages/i18n/src/useObjectLabel.ts#actionNoticeText); packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: a plain I18nLabel, never blank, at least one of `title` / `body`; overlaid by packages/spec/src/system/i18n-action-notices.ts#overlayActionNotices)", + "note": "Live with its container `notices`." }, "visible": { - "status": "planned", - "verifiedAt": "2026-12-02", - "evidence": "packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: the action's own condition shape, handed in from packages/spec/src/ui/action.zod.ts; checked in the `record` scope by packages/lint/src/validate-expressions.ts)", - "note": "Planned with its container `notices`: drawn by no dialog until the console half of #39045 reads the key." + "status": "live", + "verifiedAt": "2026-12-03", + "evidence": "ui/packages/app-shell/src/views/ActionDialogNotices.tsx#visibleDialogNotices (judged against the dispatch's record and the host predicate scope; fail-closed); packages/spec/src/ui/action-notices.ts#actionNoticeSchema (the parse: the action's own condition shape, handed in from packages/spec/src/ui/action.zod.ts; checked in the `record` scope by packages/lint/src/validate-expressions.ts)", + "note": "Live with its container `notices`." } } }, diff --git a/packages/spec/liveness/state-counts/action.md b/packages/spec/liveness/state-counts/action.md index 45bf317bf21..db952de1b65 100644 --- a/packages/spec/liveness/state-counts/action.md +++ b/packages/spec/liveness/state-counts/action.md @@ -12,4 +12,4 @@ committed anywhere: `check:liveness` sums the shards when it reads them. | Type | live | exp | elsewhere | dead | planned | classified | |---|---|---|---|---|---|---| -| `action` | 88 | 0 | 0 | 1 | 6 | 95 | +| `action` | 92 | 0 | 0 | 1 | 2 | 95 | diff --git a/packages/spec/src/kernel/public-auth-features.test.ts b/packages/spec/src/kernel/public-auth-features.test.ts index e364c0ce7ed..d5f40499587 100644 --- a/packages/spec/src/kernel/public-auth-features.test.ts +++ b/packages/spec/src/kernel/public-auth-features.test.ts @@ -7,6 +7,7 @@ import { PUBLIC_AUTH_FEATURE_NAMES, featureGatePredicate, lowerRequiresFeature, + type PublicAuthFeatureEntry, } from './public-auth-features'; // Registry invariants (#2874 P0). The key-set ≡ getPublicConfig().features @@ -68,6 +69,18 @@ describe('PUBLIC_AUTH_FEATURES registry', () => { } }); + it('noticePaths follow the .actions..notices. grammar', () => { + const PATH = /^[a-z][a-z0-9_]*\.actions\.[a-z][a-z0-9_]*\.notices\.[a-z][a-z0-9_]*$/; + const booked = entries.flatMap(([name, entry]) => + ((entry as PublicAuthFeatureEntry).noticePaths ?? []).map((path) => [name, path] as const)); + // The invite actions' mail notice is booked today; a walker that finds + // none would make the loop below vacuous. + expect(booked.length).toBeGreaterThan(0); + for (const [name, path] of booked) { + expect(path, `${name}: ${path}`).toMatch(PATH); + } + }); + it('status-surface flags never gate inputs', () => { for (const [, entry] of entries) { if (entry.surface === 'status') expect(entry.gatedInputs).toBeUndefined(); diff --git a/packages/spec/src/kernel/public-auth-features.ts b/packages/spec/src/kernel/public-auth-features.ts index 7cf16c203cd..3aa949b2486 100644 --- a/packages/spec/src/kernel/public-auth-features.ts +++ b/packages/spec/src/kernel/public-auth-features.ts @@ -39,7 +39,10 @@ import type { z } from 'zod'; * every path in `gatedInputs` must resolve to an input whose `visible` * carries the matching predicate as one of its `&&` conjuncts (a param path * resolves to the FIRST param on that name or field), and every - * `features.*` reference in a `visible` predicate must be booked here. + * `features.*` reference in a `visible` predicate must be booked here; the + * same two directions for action notices: every path in `noticePaths` must + * resolve to a declared notice whose `visible` reads the flag, and every + * `features.*` read in a notice condition must be booked there. * * This module is deliberately **import-free** (type-only zod import aside) so * schema modules can depend on it file-directly without cycle risk, and it @@ -58,6 +61,11 @@ import type { z } from 'zod'; * shell, e.g. the create-organization form) reads the flag straight off * `/auth/config` (no spec metadata in between). Not `login`, whose readers * are the sign-in pages, and not `crud`, which goes through spec predicates. + * + * The surface names where the flag is consumed as a capability. A flag on any + * surface may ALSO be read by an authored action notice's condition, booked in + * `noticePaths`: a notice is display only and gates nothing, so that read does + * not move the flag to `crud` (see `emailDelivery`). */ export type PublicAuthFeatureSurface = 'crud' | 'login' | 'status' | 'shell'; @@ -102,6 +110,17 @@ export type PublicAuthFeatureEntry = { gatedInputs?: readonly string[]; /** Required when `gatedInputs` is absent — why no spec input needs gating. */ exempt?: { reason: string }; + /** + * Action notices (`ActionSchema.notices`) whose `visible` condition reads + * this flag. Path grammar: `.actions..notices.`. + * A notice gates nothing (it is drawn or not in the dialog the action opens + * before it runs), so it is booked here rather than in `gatedInputs`, and a + * flag read by notices alone keeps its `exempt` reason. The platform-objects + * completeness guard resolves each path to a declared notice whose + * condition reads the flag, and asserts every `features.*` read in a notice + * condition is booked here. Independent of `gatedInputs` / `exempt`. + */ + noticePaths?: readonly string[]; /** Audit notes: login-surface consumption sites, known gaps, follow-ups. */ notes?: string; }; @@ -337,13 +356,28 @@ export const PUBLIC_AUTH_FEATURES = { semantics: 'opt-in', exempt: { reason: - 'Login-surface only: tells the forgot-password page whether a reset ' + + 'Gates no input. Tells the forgot-password page whether a reset ' + 'link can be emailed on this deployment, so its success screen does ' + - 'not say a link was sent when no mail leaves. True only when the wired ' + - 'email service reports itself configured; no email service and the ' + - 'stock log transport keep it off. Describes the deployment, never an ' + - 'address: the reset request answers known and unknown addresses alike.', + 'not say a link was sent when no mail leaves. The invite dialogs\' ' + + 'notice that no email will go out reads it in its condition ' + + '(noticePaths), which is display only. True only when the wired email service reports itself ' + + 'configured; no email service and the stock log transport keep it ' + + 'off. Describes the deployment, never an address: the reset request ' + + 'answers known and unknown addresses alike.', }, + // [#39045, ruling A] The invite actions warn before submit when no mail + // is delivered; their notice reads the flag negatively, guarded by `has()`. + noticePaths: [ + 'sys_user.actions.invite_user.notices.mail_not_delivered', + 'sys_member.actions.invite_user.notices.mail_not_delivered', + 'sys_invitation.actions.invite_user.notices.mail_not_delivered', + 'sys_invitation.actions.resend_invitation.notices.mail_not_delivered', + 'sys_organization.actions.invite_user.notices.mail_not_delivered', + ], + notes: + 'Read straight off /auth/config by objectui\'s forgot-password page ' + + '(login surface), and by the invite actions\' notices in authored ' + + 'metadata, judged in the action dialogs\' predicate scope.', }, developerEditionCreate: { surface: 'shell', diff --git a/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx b/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx index a177d3337d7..f0e8619465d 100644 --- a/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx +++ b/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx @@ -31,6 +31,7 @@ import { toast } from 'sonner'; import type { ActionContext, ActionDef, + ActionDialogNotices, ActionParamDef, ActionResult, ConfirmationHandler, @@ -45,6 +46,7 @@ import { useActionModal } from './useActionModal.js'; import { ActionConfirmDialog, type ConfirmDialogState } from '../views/ActionConfirmDialog.js'; import { ActionParamDialog, type ParamDialogState } from '../views/ActionParamDialog.js'; import { resolveParamDialogCompanion } from '../views/actionDialogCompanion.js'; +import { localizeDialogNotices } from '../views/ActionDialogNotices.js'; import { ActionResultDialog, type ResultDialogState } from '../views/ActionResultDialog.js'; import { FlowRunner, type ScreenSpec } from '../views/FlowRunner.js'; import { FlowRefusalNotice, type FlowRefusalState } from '../views/FlowRefusalNotice.js'; @@ -177,7 +179,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // `requiredPermissions` action closed on exactly the deployments this // doctrine exists to protect (objectui#4656). const { systemPermissions } = usePermissions(); - const { fieldLabel, fieldOptionLabel, actionParamText, actionParamOptionLabel, actionDescription, actionSubmitText, actionCancelText, actionResultDialog, actionPreflight } = useObjectLabel(); + const { fieldLabel, fieldOptionLabel, actionParamText, actionParamOptionLabel, actionDescription, actionSubmitText, actionCancelText, actionNoticeText, actionResultDialog, actionPreflight } = useObjectLabel(); // Entitlement 403s render as a dialog, not a toast — its copy is localized // here rather than taken from the server (objectui#2458 / cloud#959). // `language` also resolves inline per-locale action-param labels below, and @@ -274,7 +276,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // whole function under the compiler — every other read below is a declared // `ActionDef` field, and the one that was not is the reason objectui#4282 // backed the narrowing out. - const paramCollectionHandler = useCallback((params: ActionParamDef[], action?: ConsoleActionDispatch, interpolate?: (text: string) => string, run?: Parameters[3], interpolateRead?: Parameters[4]) => { + const paramCollectionHandler = useCallback((params: ActionParamDef[], action?: ConsoleActionDispatch, interpolate?: (text: string) => string, run?: Parameters[3], interpolateRead?: Parameters[4], notices?: ActionDialogNotices) => { return new Promise | null>((resolve) => { void (async () => { // ⭐ Ask the store for the object type BEFORE resolving (`6cc910b6d`). // `ensureType` is idempotent and answers from cache in a microtask once @@ -358,6 +360,14 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // The dismiss button's label (`cancelText`), resolved the same way. // Absent, the dialog keeps its default "Cancel". const cancelText = actionCancelText(objForI18n, action?.name, pickLocalized(action?.cancelText, language) || undefined); + // The action's declared notices (`ActionSchema.notices`), in declared + // order: each `title` / `body` reads the bundle's + // `_actions..notices..*` first, then the authored text. + const localizedNotices = localizeDialogNotices( + notices, + (notice, attr, fallback) => actionNoticeText(objForI18n, action?.name, notice, attr, fallback), + language, + ); setParamState({ open: true, params: localized, @@ -374,6 +384,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons : declaredDescription, submitText, cancelText, + ...(localizedNotices ? { notices: localizedNotices } : {}), interpolate, resolve, // The runner's `run`, so Confirm runs the action from inside the @@ -394,7 +405,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons }), }); })(); }); - }, [objectName, objectDef, objects, metadata, fieldLabel, fieldOptionLabel, actionParamText, actionParamOptionLabel, actionSubmitText, actionCancelText, actionPreflight, language]); + }, [objectName, objectDef, objects, metadata, fieldLabel, fieldOptionLabel, actionParamText, actionParamOptionLabel, actionSubmitText, actionCancelText, actionNoticeText, actionPreflight, language]); const currentUser = user ? { id: user.id, name: user.name, avatar: user.image, isPlatformAdmin: (user as any)?.isPlatformAdmin ?? false, systemPermissions } diff --git a/ui/packages/app-shell/src/views/ActionConfirmDialog.tsx b/ui/packages/app-shell/src/views/ActionConfirmDialog.tsx index 0890b5f2745..8cf898ed8c4 100644 --- a/ui/packages/app-shell/src/views/ActionConfirmDialog.tsx +++ b/ui/packages/app-shell/src/views/ActionConfirmDialog.tsx @@ -27,6 +27,7 @@ import { } from '@object-ui/components'; import { useObjectTranslation } from '@object-ui/i18n'; import { useActionDialogReturnFocus } from './actionDialogReturnFocus.js'; +import { ActionDialogNoticeList } from './ActionDialogNotices.js'; export interface ConfirmDialogState { open: boolean; @@ -62,6 +63,8 @@ export function ActionConfirmDialog({ state, onOpenChange }: ActionConfirmDialog {state.options?.title || t('actionConfirm.title')} + {/* The action's declared notices, above the question (`ActionSchema.notices`). */} + {state.message} diff --git a/ui/packages/app-shell/src/views/ActionDialogNotices.notices-39045.test.tsx b/ui/packages/app-shell/src/views/ActionDialogNotices.notices-39045.test.tsx new file mode 100644 index 00000000000..c8fe089ae30 --- /dev/null +++ b/ui/packages/app-shell/src/views/ActionDialogNotices.notices-39045.test.tsx @@ -0,0 +1,184 @@ +/** + * ObjectUI + * Copyright (c) 2024-present ObjectStack Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * objectstack#39045 — an action's declared `notices` (`ActionSchema.notices`) + * are drawn in the dialog it opens before it runs, between the title and the + * description, each while its condition holds against the dispatch's record + * and the host predicate scope. Fail-closed and loud: a condition that cannot + * be evaluated draws nothing and says so. The runner half (which dialog gets + * them, with which record) is `ActionRunner.dialogNotices-39045.test.ts`. + */ +import { describe, it, expect, vi, afterEach } from 'vitest'; +import { render, screen, within } from '@testing-library/react'; +import type { ActionDialogNotices, ActionParamDef } from '@object-ui/core'; +import { PredicateScopeProvider } from '@object-ui/react'; +import { ActionConfirmDialog } from './ActionConfirmDialog'; +import { ActionParamDialog } from './ActionParamDialog'; +import { localizeDialogNotices, visibleDialogNotices } from './ActionDialogNotices'; + +const MAIL_CONDITION = 'has(features.emailDelivery) && features.emailDelivery != true'; + +function mailNotice(extra: Partial = {}): ActionDialogNotices { + return { + notices: [{ + name: 'mail_not_delivered', + severity: 'warning', + title: 'Mail is not configured on this server', + body: 'No email will go out.', + visible: MAIL_CONDITION, + }], + ...extra, + }; +} + +afterEach(() => { + vi.restoreAllMocks(); +}); + +describe('visibleDialogNotices — which notices hold (objectstack#39045)', () => { + it('draws the mail notice while the deployment says it delivers no mail', () => { + expect(visibleDialogNotices(mailNotice(), { features: { emailDelivery: false } }).map((n) => n.name)) + .toEqual(['mail_not_delivered']); + }); + + it('CONTROL: not while mail is delivered', () => { + expect(visibleDialogNotices(mailNotice(), { features: { emailDelivery: true } })).toEqual([]); + }); + + it('not while the host has not received the flag (the `has()` conjunct)', () => { + expect(visibleDialogNotices(mailNotice(), { features: {} })).toEqual([]); + }); + + it('no condition draws the notice; a boolean is its own verdict', () => { + const notices: ActionDialogNotices = { + notices: [{ name: 'always', body: 'a' }, { name: 'never', body: 'b', visible: false }, { name: 'yes', body: 'c', visible: true }], + }; + expect(visibleDialogNotices(notices, {}).map((n) => n.name)).toEqual(['always', 'yes']); + }); + + it('reads the dispatch\'s record as `record`', () => { + const notices: ActionDialogNotices = { + notices: [{ name: 'expired', body: 'This quote has expired.', visible: "record.status == 'expired'" }], + record: { id: 'q1', status: 'expired' }, + }; + expect(visibleDialogNotices(notices, {}).map((n) => n.name)).toEqual(['expired']); + expect(visibleDialogNotices({ ...notices, record: { id: 'q2', status: 'open' } }, {})).toEqual([]); + }); + + it('fail-closed and loud: a condition that cannot be evaluated draws nothing and is reported', () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}); + const notices: ActionDialogNotices = { + notices: [{ name: 'broken', body: 'x', visible: 'features.emailDelivery != true' }], + }; + expect(visibleDialogNotices(notices, { features: {} }, 'Invite User')).toEqual([]); + expect(warn).toHaveBeenCalled(); + expect(warn.mock.calls.flat().join(' ')).toContain('notice "broken" of action "Invite User"'); + }); + + it('keeps the declared order', () => { + const notices: ActionDialogNotices = { + notices: [{ name: 'b_first', body: '1' }, { name: 'a_second', body: '2' }], + }; + expect(visibleDialogNotices(notices, {}).map((n) => n.name)).toEqual(['b_first', 'a_second']); + }); +}); + +describe('localizeDialogNotices — the param dialog\'s copy (objectstack#39045)', () => { + it('reads the bundle at the notice\'s name first, then the authored text, in declared order', () => { + const resolve = vi.fn((notice: string, attr: 'title' | 'body', fallback?: string) => + notice === 'mail_not_delivered' && attr === 'title' ? '服务器未配置邮件' : fallback); + const localized = localizeDialogNotices(mailNotice({ record: { id: 'u1' } }), resolve, 'zh-CN'); + expect(localized).toEqual({ + notices: [{ + name: 'mail_not_delivered', + severity: 'warning', + title: '服务器未配置邮件', + body: 'No email will go out.', + visible: MAIL_CONDITION, + }], + record: { id: 'u1' }, + }); + }); + + it('collapses an inline locale map before the bundle sees it', () => { + const resolve = vi.fn((_n: string, _a: 'title' | 'body', fallback?: string) => fallback); + const localized = localizeDialogNotices( + { notices: [{ name: 'n', body: { en: 'English', 'zh-CN': '中文' } }] }, + resolve, + 'zh-CN', + ); + expect(resolve).toHaveBeenCalledWith('n', 'body', '中文'); + expect(localized?.notices[0].body).toBe('中文'); + }); + + it('nothing to draw answers undefined', () => { + expect(localizeDialogNotices(undefined, () => undefined, 'en')).toBeUndefined(); + expect(localizeDialogNotices({ notices: [] }, () => undefined, 'en')).toBeUndefined(); + }); +}); + +function withFeatures(features: Record, ui: React.ReactElement) { + return render({ui}); +} + +describe('the two dialogs draw the notices above the description (objectstack#39045)', () => { + it('the confirm dialog, while mail is off', async () => { + withFeatures({ emailDelivery: false }, ( + {}} + /> + )); + const region = await screen.findByTestId('action-dialog-notices'); + const notice = within(region).getByText('Mail is not configured on this server').closest('[data-notice]'); + expect(notice?.getAttribute('data-notice')).toBe('mail_not_delivered'); + expect(notice?.getAttribute('data-severity')).toBe('warning'); + expect(within(region).getByText('No email will go out.')).toBeTruthy(); + // Above the question. + const question = screen.getByText('Resend the invitation?'); + expect(region.compareDocumentPosition(question) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); + }); + + it('CONTROL: the confirm dialog draws none while mail is on', async () => { + withFeatures({ emailDelivery: true }, ( + {}} + /> + )); + expect(await screen.findByText('Resend the invitation?')).toBeTruthy(); + expect(screen.queryByTestId('action-dialog-notices')).toBeNull(); + }); + + const EMAIL: ActionParamDef[] = [{ name: 'email', label: 'Email', type: 'text' }]; + + it('the param dialog, while mail is off, above the description', async () => { + withFeatures({ emailDelivery: false }, ( + {}} + /> + )); + const region = await screen.findByTestId('action-dialog-notices'); + expect(within(region).getByText('Mail is not configured on this server')).toBeTruthy(); + const description = screen.getByText('Invite someone by email address.'); + expect(region.compareDocumentPosition(description) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); + }); + + it('CONTROL: the param dialog draws none while mail is on, and none when the action declares none', async () => { + withFeatures({ emailDelivery: true }, ( + {}} + /> + )); + expect(await screen.findByText('Invite User')).toBeTruthy(); + expect(screen.queryByTestId('action-dialog-notices')).toBeNull(); + }); +}); diff --git a/ui/packages/app-shell/src/views/ActionDialogNotices.tsx b/ui/packages/app-shell/src/views/ActionDialogNotices.tsx new file mode 100644 index 00000000000..1d26b549c1e --- /dev/null +++ b/ui/packages/app-shell/src/views/ActionDialogNotices.tsx @@ -0,0 +1,129 @@ +/** + * The notices an action declares (`@objectstack/spec` `ActionSchema.notices`), + * drawn in the dialog the action opens before it runs — its confirm dialog + * or its param dialog — between the title and the description, each while its + * `visible` condition holds. + * + * The vocabulary is `record:alert`'s: `severity` picks the tone and the icon + * (the notification surfaces' one severity table), `title` and `body` are + * plain text, and `visible` is judged against the record the dispatch runs + * against plus the host predicate scope (`features`, the signed-in user) — + * the scope the action's own `visible` reads. A notice is display only: it + * gates nothing, and Confirm runs the action whether or not one is drawn. + * + * ## Fail-closed, and loud + * + * A notice whose condition cannot be evaluated (unparseable source, an unbound + * identifier, a key the scope does not carry) is NOT drawn, and the fault is + * reported once with the action and notice named. A notice says something + * about this deployment or this record; drawn on a condition nobody could + * judge, it can state the opposite of the truth, while a notice left out is + * the dialog as it was before the key existed. Silent is not an option either + * way (the standing rule `filterVisibleParams` cites). + */ + +import { cn, notificationSeverityStyle } from '@object-ui/components'; +import type { ActionDialogNotice, ActionDialogNotices } from '@object-ui/core'; +import { evalRowPredicate, hasDeclaredPredicate } from '@object-ui/core'; +import { pickLocalized, useObjectTranslation } from '@object-ui/i18n'; +import { localizeActionNotices, usePredicateScope } from '@object-ui/react'; + +/** + * The runner's notices with each `title` / `body` resolved for the param + * dialog, in declared order: `resolve` is the bundle lookup at the notice's + * name (`useObjectLabel().actionNoticeText`, bound to the action's key object + * and name by the caller), then the authored `I18nLabel` collapsed to + * `language`. Shared by the console's two param-collection handlers + * (`useConsoleActionRuntime`, `RecordDetailView`), so they cannot drift. + * `undefined` when there is nothing to draw. + */ +export function localizeDialogNotices( + notices: ActionDialogNotices | undefined, + resolve: (notice: string, attr: 'title' | 'body', fallback: string | undefined) => string | undefined, + language: string, +): ActionDialogNotices | undefined { + if (!notices || notices.notices.length === 0) return undefined; + const byName = localizeActionNotices( + Object.fromEntries(notices.notices.map((notice) => [notice.name, notice])), + resolve, + language, + ); + return { + ...notices, + notices: notices.notices.map((notice) => ({ ...(byName[notice.name] as ActionDialogNotice), name: notice.name })), + }; +} + +/** + * The notices to draw, in declared order: those whose `visible` holds against + * the dispatch's record and the host predicate `scope`. Pure and exported so + * the judgement is unit-testable without a dialog. + * + * No declared condition draws the notice; a boolean is its own verdict; any + * other value is evaluated, fail-closed and reported (see the module header). + * With no record the scope is the host scope alone (`rowless`), as for the + * param dialog's own `visible` gates. + */ +export function visibleDialogNotices( + notices: ActionDialogNotices | undefined, + scope: Record, + actionLabel?: string, +): ActionDialogNotice[] { + if (!notices) return []; + const record = notices.record; + return notices.notices.filter((notice) => { + const raw: unknown = notice.visible; + if (!hasDeclaredPredicate(raw)) return true; + if (typeof raw === 'boolean') return raw; + return evalRowPredicate(raw as never, record ?? null, { + fallback: false, + scope, + rowless: record === undefined, + warnOnError: true, + label: actionLabel + ? `notice "${notice.name}" of action "${actionLabel}"` + : `notice "${notice.name}"`, + }); + }); +} + +export interface ActionDialogNoticeListProps { + /** The action's notices and the dispatch's record, as the runner hands them. */ + notices?: ActionDialogNotices; + /** The action's label, so a condition fault names the action. */ + actionLabel?: string; + className?: string; +} + +/** The drawn notices, or nothing when none holds. */ +export function ActionDialogNoticeList({ notices, actionLabel, className }: ActionDialogNoticeListProps) { + const scope = usePredicateScope(); + const { language } = useObjectTranslation(); + const shown = visibleDialogNotices(notices, scope, actionLabel); + if (shown.length === 0) return null; + return ( +
+ {shown.map((notice) => { + const title = pickLocalized(notice.title, language); + const body = pickLocalized(notice.body, language); + const severity = notice.severity ?? 'info'; + const { Icon, tone, iconTone } = notificationSeverityStyle(severity); + return ( +
+
+ ); + })} +
+ ); +} diff --git a/ui/packages/app-shell/src/views/ActionParamDialog.tsx b/ui/packages/app-shell/src/views/ActionParamDialog.tsx index 482f6d0f564..9bd11c0a615 100644 --- a/ui/packages/app-shell/src/views/ActionParamDialog.tsx +++ b/ui/packages/app-shell/src/views/ActionParamDialog.tsx @@ -110,7 +110,7 @@ import { import { ChevronDown, Loader2, Lock } from 'lucide-react'; import { useObjectTranslation, pickLocalized } from '@object-ui/i18n'; import { RefusalMessage } from '../components/RefusalMessage.js'; -import type { ActionParamDef, ActionResult, ParamCollectionHandler } from '@object-ui/core'; +import type { ActionDialogNotices, ActionParamDef, ActionResult, ParamCollectionHandler } from '@object-ui/core'; import { evalRowPredicate, hasDeclaredPredicate, @@ -139,6 +139,7 @@ import { getLazyFieldWidget, fileIdOf, buildValidationRules, resolveParamWidgetT import { useInitialFieldFocus } from '@object-ui/plugin-form/core'; import { paramToField, paramDegradesWithoutTarget } from '../utils/paramToField.js'; import { useActionDialogReturnFocus } from './actionDialogReturnFocus.js'; +import { ActionDialogNoticeList } from './ActionDialogNotices.js'; import type { DeclaredPreflight, ParamDialogCompanion } from './actionDialogCompanion.js'; import { UserAssignedWorkPanel } from './UserAssignedWorkPanel.js'; import { ResultField } from './ActionResultDialog.js'; @@ -194,6 +195,14 @@ export interface ParamDialogState { * through their own `required` mark. */ companion?: ParamDialogCompanion; + /** + * The action's declared `notices` (`ActionSchema.notices`) with the + * dispatch's record — the runner's `ParamCollectionHandler` `notices` + * argument, their `title` / `body` already resolved by the caller (the + * translation bundle's `_actions..notices..*` first). Drawn + * between the title and the description, each while its condition holds. + */ + notices?: ActionDialogNotices; } /** @@ -957,6 +966,8 @@ export function ActionParamDialog({ state, onOpenChange }: ActionParamDialogProp > {state.title || t('actionDialog.title')} + {/* The action's declared notices, above the description (`ActionSchema.notices`). */} + {/* `whitespace-pre-line` so a description composed of more than one paragraph renders as authored. objectui#5178 puts an admin-override warning ahead of the action's declared description here; collapsed diff --git a/ui/packages/app-shell/src/views/RecordDetailView.tsx b/ui/packages/app-shell/src/views/RecordDetailView.tsx index 0825f5238a8..db8f1e19ddc 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.tsx @@ -34,6 +34,7 @@ import { useRecordTabsConfig } from './RecordTabsConfig.js'; import { pruneUnregisteredRecordPageObjects, recordPageChildObjects } from './recordPageChildObjects.js'; import { stripDiscussionNodes, hasExplicitAttachments, hasExplicitApprovals } from '../utils/pageSchemaIntrospect.js'; import { ActionConfirmDialog, type ConfirmDialogState } from './ActionConfirmDialog.js'; +import { localizeDialogNotices } from './ActionDialogNotices.js'; import { ActionParamDialog, type ParamDialogState } from './ActionParamDialog.js'; import { resolveParamDialogCompanion } from './actionDialogCompanion.js'; import { ActionResultDialog, type ResultDialogState } from './ActionResultDialog.js'; @@ -657,7 +658,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // The tenant default currency (ADR-0053) a `dynamic` currency diff reads, // the same `useLocalization().currency` the record page's cells read. const { currency: tenantCurrency } = useLocalization(); - const { objectLabel, objectPluralLabel, viewLabel: _vLabel, sectionLabel, actionParamText, actionParamOptionLabel, actionDescription, actionSubmitText, actionCancelText, actionResultDialog, actionPreflight, fieldLabel, fieldOptionLabel } = useObjectLabel(); + const { objectLabel, objectPluralLabel, viewLabel: _vLabel, sectionLabel, actionParamText, actionParamOptionLabel, actionDescription, actionSubmitText, actionCancelText, actionNoticeText, actionResultDialog, actionPreflight, fieldLabel, fieldOptionLabel } = useObjectLabel(); // label + confirmText + successMessage through ONE call (objectui#4265) — // the three keys of an `_actions.` bundle entry can no longer be // localized apart from one another on this surface. @@ -1447,7 +1448,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // not read `overrideNotice` itself — it takes the envelope so the two // handlers on this seam cannot drift apart from each other, and so a reader // added here later has the key declared rather than reaching for a cast. - const paramCollectionHandler = useCallback((params: ActionParamDef[], action?: ConsoleActionDispatch, interpolate?: (text: string) => string, run?: Parameters[3], interpolateRead?: Parameters[4]) => { + const paramCollectionHandler = useCallback((params: ActionParamDef[], action?: ConsoleActionDispatch, interpolate?: (text: string) => string, run?: Parameters[3], interpolateRead?: Parameters[4], notices?: Parameters[5]) => { return new Promise | null>((resolve) => { // Related-list row actions retarget a CHILD object (e.g. sys_member rows // on an org record page) and stash the clicked row under @@ -1490,6 +1491,13 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // The dismiss button's label (`cancelText`), resolved the same way; // absent, the dialog says "Cancel". const cancelText = actionCancelText(objForI18n, action?.name, pickLocalized(action?.cancelText, language) || undefined); + // The action's declared notices, resolved as `useConsoleActionRuntime` + // resolves them (the shared `localizeDialogNotices`). + const localizedNotices = localizeDialogNotices( + notices, + (notice, attr, fallback) => actionNoticeText(objForI18n, action?.name, notice, attr, fallback), + language, + ); setParamState({ open: true, params: localized, @@ -1512,6 +1520,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri description: interpolate && declaredDescription ? interpolate(declaredDescription) : declaredDescription, submitText, cancelText, + ...(localizedNotices ? { notices: localizedNotices } : {}), interpolate, resolve, // The runner's `run`, as `useConsoleActionRuntime` forwards it: a @@ -1533,7 +1542,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri }), }); }); - }, [objectName, objectDef, objects, fieldLabel, fieldOptionLabel, actionParamText, actionParamOptionLabel, actionSubmitText, actionCancelText, actionPreflight, language]); + }, [objectName, objectDef, objects, fieldLabel, fieldOptionLabel, actionParamText, actionParamOptionLabel, actionSubmitText, actionCancelText, actionNoticeText, actionPreflight, language]); // Global undo/redo (Ctrl+Z), backed by the dataSource — the success toast's // "Undo" button (for `undoable` actions) restores the record's prior values. diff --git a/ui/packages/components/src/notifications/index.ts b/ui/packages/components/src/notifications/index.ts index 020afbb5bdc..0d3cafb52a7 100644 --- a/ui/packages/components/src/notifications/index.ts +++ b/ui/packages/components/src/notifications/index.ts @@ -25,3 +25,6 @@ export { NotificationBanners, type NotificationBannersProps } from './Notificati export { NotificationSnackbar, type NotificationSnackbarProps } from './NotificationSnackbar'; export { NotificationAlerts, type NotificationAlertsProps } from './NotificationAlerts'; export { NotificationInline, type NotificationInlineProps } from './NotificationInline'; +// The one severity tone table, for a surface that draws a severity without +// being a notification (an action's dialog notices, `ActionSchema.notices`). +export { notificationSeverityStyle, type NotificationSeverityStyle } from './severity'; diff --git a/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx index f12595d5431..24d1ad940e4 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx @@ -124,9 +124,12 @@ const CONTEXT = { target: 'contextWins', extraFromHost: 'present' }; * `cancelText` (objectstack#28879) is the next, beside `submitText`: the * dismiss button of the same param dialog, and of the confirm dialog. Same * reading. + * + * `notices` (objectstack#39045) is the next, beside `cancelText`: the notices + * the same two dialogs draw above their description. Same reading. */ const BUTTON_ORDER = [ - 'type', 'name', 'label', 'description', 'submitText', 'cancelText', 'target', 'openIn', 'endpoint', 'method', + 'type', 'name', 'label', 'description', 'submitText', 'cancelText', 'notices', 'target', 'openIn', 'endpoint', 'method', 'params', 'bodyExtra', 'bodyShape', 'operation', 'confirmText', 'variant', 'successMessage', 'outcomeMessages', 'errorMessage', 'refreshAfter', 'undoable', 'recordIdField', 'locations', 'toast', 'resultDialog', 'preflight', 'onSuccess', 'objectName', @@ -138,7 +141,7 @@ const BUTTON_ORDER = [ * `params` key used to, so the order is unchanged. */ const ICON_ORDER = [ - 'type', 'name', 'label', 'description', 'submitText', 'cancelText', 'target', 'openIn', 'endpoint', 'method', + 'type', 'name', 'label', 'description', 'submitText', 'cancelText', 'notices', 'target', 'openIn', 'endpoint', 'method', 'params', 'bodyExtra', 'bodyShape', 'operation', 'confirmText', 'variant', 'successMessage', 'outcomeMessages', 'errorMessage', 'refreshAfter', 'locations', 'toast', 'resultDialog', 'preflight', 'onSuccess', 'objectName', diff --git a/ui/packages/components/src/renderers/action/action-button.tsx b/ui/packages/components/src/renderers/action/action-button.tsx index dd7b2c5216d..113fde9d7fd 100644 --- a/ui/packages/components/src/renderers/action/action-button.tsx +++ b/ui/packages/components/src/renderers/action/action-button.tsx @@ -309,6 +309,8 @@ const ActionButtonRenderer = forwardRef< submitText: schema.submitText, // The dismiss-button label of the confirm and param dialogs. cancelText: schema.cancelText, + // The notices the confirm and param dialogs draw above their description. + notices: schema.notices, target: schema.target, // Static "open in new tab" switch for url actions — forward so the // runner's executeUrl honors it (dropped, the toggle is silently lost). diff --git a/ui/packages/components/src/renderers/action/action-group.tsx b/ui/packages/components/src/renderers/action/action-group.tsx index dd529658cc8..748981214f5 100644 --- a/ui/packages/components/src/renderers/action/action-group.tsx +++ b/ui/packages/components/src/renderers/action/action-group.tsx @@ -378,6 +378,8 @@ const ActionGroupRenderer = forwardRef Promise; +/** One declared notice of an action (`ActionSchema.notices`), as authored. */ +export type ActionNoticeDef = NonNullable[string]; + +/** One notice, named, in the order the action declares it. */ +export type ActionDialogNotice = ActionNoticeDef & { + /** The snake_case notice name: its translation address and its key. */ + name: string; +}; + +/** + * What the dialog an action opens before it runs needs to draw the action's + * `notices`: the notices in declared order, and the record the dispatch runs + * against (the row a row dispatch carries, else the runner context's record), + * which each notice's `visible` reads as `record`. The dialog judges the + * conditions against that record and its host predicate scope (`features`, + * the signed-in user), the scope the action's own `visible` reads, and draws + * the notices that hold. `record` is absent when the dispatch has none. + */ +export interface ActionDialogNotices { + notices: ActionDialogNotice[]; + record?: Record; +} + /** * Toast handler — consumers can wire to Sonner or any toast library. */ @@ -773,6 +809,9 @@ export type NavigationHandler = (url: string, options?: { * (or names a scope the grammar does not know): the dialog then sends nothing, * because a read with a blank segment asks a different question than the one * declared. + * + * `notices` carries the action's declared `notices` and the dispatch's record + * (see {@link ActionDialogNotices}); absent when the action declares none. */ export type ParamCollectionHandler = ( params: ActionParamDef[], @@ -780,6 +819,7 @@ export type ParamCollectionHandler = ( interpolate?: (text: string) => string, run?: (values: Record) => Promise, interpolateRead?: PreflightReadFiller, + notices?: ActionDialogNotices, ) => Promise | null>; /** @@ -1269,6 +1309,16 @@ function isUpdateOperationAction(action: ActionDef): boolean { * `params._rowRecord` — or `undefined` when it carries none. The record its * copy templates bind as `record` (see `ActionRunner.templateEvaluatorFor`). */ +/** + * Whether the action opens the param dialog before it runs: it declares a + * non-empty param list (`actionParams`, or `params` as an array), the test + * `execute` applies before it calls the `ParamCollectionHandler`. + */ +function opensParamDialog(action: ActionDef): boolean { + const defs: unknown = Array.isArray(action.actionParams) ? action.actionParams : action.params; + return Array.isArray(defs) && defs.length > 0; +} + function dispatchRow(action: ActionDef): Record | undefined { const params = action.params; const row = params && typeof params === 'object' && !Array.isArray(params) @@ -1852,6 +1902,7 @@ export class ActionRunner { this.dialogCopyFiller(action), run, this.preflightReadFiller(action), + this.dialogNotices(action), ); if (lastRun) { const last = await lastRun; @@ -2243,14 +2294,39 @@ export class ActionRunner { const label = action.label || undefined; const destructive = action.variant === 'danger'; const cancelText = typeof action.cancelText === 'string' && action.cancelText ? action.cancelText : undefined; - if (label === undefined && !destructive && cancelText === undefined) return undefined; + // An action that also collects params draws its notices in the param + // dialog, its one notice host (spec `ActionSchema.notices`), not twice. + const notices = opensParamDialog(action) ? undefined : this.dialogNotices(action); + if (label === undefined && !destructive && cancelText === undefined && notices === undefined) return undefined; return { ...(label !== undefined ? { title: label, confirmText: label } : {}), ...(cancelText !== undefined ? { cancelText } : {}), ...(destructive ? { destructive } : {}), + ...(notices !== undefined ? { notices } : {}), }; } + /** + * The action's declared `notices` for the dialog it opens before it runs, + * or `undefined` when it declares none: each entry named, in declared order, + * beside the record the dispatch runs against (`dispatchRecord`), which a + * notice's `visible` reads as `record`. The runner judges no condition + * itself: `features` and the signed-in user live in the host's predicate + * scope, which only the dialog holds. + */ + private dialogNotices(action: ActionDef): ActionDialogNotices | undefined { + const declared: unknown = action.notices; + if (!declared || typeof declared !== 'object' || Array.isArray(declared)) return undefined; + const notices: ActionDialogNotice[] = Object.entries(declared as Record) + .filter(([, notice]) => notice != null && typeof notice === 'object') + .map(([name, notice]) => ({ ...notice, name })); + if (notices.length === 0) return undefined; + const record = this.dispatchRecord(action); + return record && typeof record === 'object' && !Array.isArray(record) + ? { notices, record: record as Record } + : { notices }; + } + /** * The record a dispatch runs against, for its copy templates: the row the * dispatch carries (`params._rowRecord`), else the context's record — the diff --git a/ui/packages/core/src/actions/__tests__/ActionRunner.dialogNotices-39045.test.ts b/ui/packages/core/src/actions/__tests__/ActionRunner.dialogNotices-39045.test.ts new file mode 100644 index 00000000000..fd7dbea0907 --- /dev/null +++ b/ui/packages/core/src/actions/__tests__/ActionRunner.dialogNotices-39045.test.ts @@ -0,0 +1,116 @@ +/** + * ObjectUI + * Copyright (c) 2024-present ObjectStack Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * objectstack#39045 — the runner hands an action's declared `notices` + * (`ActionSchema.notices`) to the dialog the action opens before it runs, in + * declared order, beside the record the dispatch runs against: the confirm + * dialog's `options.notices` for a param-less action, the param dialog's + * `notices` argument for one that collects params (and then never the confirm + * dialog too). The runner judges no condition: the dialog holds the scope. + */ +import { describe, it, expect, vi } from 'vitest'; +import { ActionRunner, type ActionDef } from '../ActionRunner'; + +const MAIL = { + severity: 'warning' as const, + title: 'Mail is not configured on this server', + visible: 'has(features.emailDelivery) && features.emailDelivery != true', +}; +const SECOND = { body: 'Second notice' }; + +async function confirmOptionsFor(def: ActionDef, record?: Record): Promise { + const runner = new ActionRunner({ objectName: 'sys_invitation', ...(record ? { record } : {}) }); + const confirm = vi.fn().mockResolvedValue(false); + runner.setConfirmHandler(confirm); + await runner.execute(def); + expect(confirm).toHaveBeenCalledTimes(1); + return confirm.mock.calls[0][1]; +} + +describe('the runner hands an action\'s notices to its dialog (objectstack#39045)', () => { + it('a confirm-only action: the notices ride the confirm options, named, in declared order, with the record', async () => { + const options = await confirmOptionsFor({ + name: 'cancel_invitation', + label: 'Cancel Invitation', + onClick: () => {}, + confirmText: 'Cancel this invitation?', + notices: { mail_not_delivered: MAIL, second: SECOND }, + }, { id: 'inv1', email: 'a@example.com' }); + expect(options).toEqual({ + title: 'Cancel Invitation', + confirmText: 'Cancel Invitation', + notices: { + notices: [{ ...MAIL, name: 'mail_not_delivered' }, { ...SECOND, name: 'second' }], + record: { id: 'inv1', email: 'a@example.com' }, + }, + }); + }); + + it('a row dispatch reads the row as the record, not the page record', async () => { + const options = await confirmOptionsFor({ + onClick: () => {}, + confirmText: 'Proceed?', + params: { _rowRecord: { id: 'row1' } }, + notices: { second: SECOND }, + }, { id: 'page1' }) as { notices: { record: unknown } }; + expect(options.notices.record).toEqual({ id: 'row1' }); + }); + + it('no record: the notices travel without one', async () => { + const options = await confirmOptionsFor({ + onClick: () => {}, + confirmText: 'Proceed?', + notices: { second: SECOND }, + }); + expect(options).toEqual({ notices: { notices: [{ ...SECOND, name: 'second' }] } }); + }); + + it('CONTROL: no notices, no key in the bag', async () => { + const options = await confirmOptionsFor({ + label: 'Cancel Invitation', + onClick: () => {}, + confirmText: 'Cancel this invitation?', + }); + expect(options).not.toHaveProperty('notices'); + }); + + it('an action that collects params draws its notices in the param dialog alone', async () => { + const runner = new ActionRunner({ objectName: 'sys_user', record: { id: 'u1' } }); + const confirm = vi.fn().mockResolvedValue(true); + const collect = vi.fn().mockResolvedValue(null); + runner.setConfirmHandler(confirm); + runner.setParamCollectionHandler(collect); + await runner.execute({ + name: 'invite_user', + label: 'Invite User', + onClick: () => {}, + confirmText: 'Invite?', + params: [{ name: 'email', type: 'text' }] as never, + notices: { mail_not_delivered: MAIL }, + }); + expect(confirm.mock.calls[0][1]).not.toHaveProperty('notices'); + expect(collect).toHaveBeenCalledTimes(1); + expect(collect.mock.calls[0][5]).toEqual({ + notices: [{ ...MAIL, name: 'mail_not_delivered' }], + record: { id: 'u1' }, + }); + }); + + it('CONTROL: a param action with no notices hands the param dialog none', async () => { + const runner = new ActionRunner({ objectName: 'sys_user' }); + const collect = vi.fn().mockResolvedValue(null); + runner.setParamCollectionHandler(collect); + await runner.execute({ + name: 'invite_user', + onClick: () => {}, + params: [{ name: 'email', type: 'text' }] as never, + }); + expect(collect.mock.calls[0][5]).toBeUndefined(); + }); +}); diff --git a/ui/packages/core/src/actions/actionKeys.ts b/ui/packages/core/src/actions/actionKeys.ts index 269cff82a57..b9e0f3d7a4a 100644 --- a/ui/packages/core/src/actions/actionKeys.ts +++ b/ui/packages/core/src/actions/actionKeys.ts @@ -132,6 +132,10 @@ export const ACTION_DEF_KEYS = [ // (`ActionSchema.cancelText`), derived from the spec: the runner hands it to // the confirm dialog, and the console's param dialog draws it. 'cancelText', + // The notices the confirm and param dialogs draw above their description + // (`ActionSchema.notices`), derived from the spec: the runner hands them, + // with the dispatch's record, to whichever dialog the action opens. + 'notices', 'confirmText', 'confirm', 'condition', diff --git a/ui/packages/i18n/src/__tests__/useObjectLabel-identity-5564.test.tsx b/ui/packages/i18n/src/__tests__/useObjectLabel-identity-5564.test.tsx index 35c8eecefc3..af97caaa4b3 100644 --- a/ui/packages/i18n/src/__tests__/useObjectLabel-identity-5564.test.tsx +++ b/ui/packages/i18n/src/__tests__/useObjectLabel-identity-5564.test.tsx @@ -180,11 +180,13 @@ describe('useObjectLabel identity (objectui#5564)', () => { // objectstack#31937 added `actionPreflight` (the bundle labels of an // action's preflight panel rows), taking it to 31. objectstack#35513 added // `packageName` and `packageDescription` (a package's name and description - // in the reader's language), taking it to 33. A new resolver must land + // in the reader's language), taking it to 33. objectstack#39045 added + // `actionNoticeText` (the title and body of an action's dialog notices), + // taking it to 34. A new resolver must land // on both paths at once, because there is only one path — and a retired one // leaves both at once for the same reason, which is what the equality above // measures and this count anchors to an absolute. - expect(Object.keys(unbound.seen[0])).toHaveLength(33); + expect(Object.keys(unbound.seen[0])).toHaveLength(34); expect(Object.keys(unbound.seen[0])).not.toContain('widgetSubCaption'); expect(typeof unbound.seen[0].objectLabel).toBe('function'); expect(unbound.seen[0].objectLabel({ name: 'lead', label: 'Lead' })).toBe('Lead'); diff --git a/ui/packages/i18n/src/useObjectLabel.ts b/ui/packages/i18n/src/useObjectLabel.ts index 8d73e196beb..f86ac94cfea 100644 --- a/ui/packages/i18n/src/useObjectLabel.ts +++ b/ui/packages/i18n/src/useObjectLabel.ts @@ -788,6 +788,28 @@ export function useObjectLabel() { return resolved || undefined; }, + /** + * Resolve the translated `title` or `body` of one of an action's declared + * `notices` (`@objectstack/spec` `ActionSchema.notices`), keyed by the + * snake_case notice name. + * Convention: `{ns}.objects.{objectName}._actions.{actionName}.notices.{notice}.{title|body}`; + * with no key object, `{ns}.globalActions.{actionName}.notices.{notice}.*` + * — the addresses the spec's translation bundle declares. Falls back to + * the metadata's literal string; undefined when nothing resolves. + */ + actionNoticeText: ( + objectName: string | undefined, + actionName: string | undefined, + notice: string, + attr: 'title' | 'body', + fallback?: string, + ) => { + const fb = fallback ?? ''; + if (!actionName) return fb || undefined; + const resolved = resolve(actionSuffixes(objectName, actionName, `notices.${notice}.${attr}`), fb); + return resolved || undefined; + }, + /** * Resolve the translated reason a greyed action gives — its declared * `disabledReason` (objectstack#26619), shown while its `disabled` diff --git a/ui/packages/react/src/hooks/useActionTextLocalizer.ts b/ui/packages/react/src/hooks/useActionTextLocalizer.ts index ccebd9289eb..96470c69333 100644 --- a/ui/packages/react/src/hooks/useActionTextLocalizer.ts +++ b/ui/packages/react/src/hooks/useActionTextLocalizer.ts @@ -164,8 +164,37 @@ function resolveCopy( return answer === undefined || answer === source ? copy : { ...copy, source: answer }; } +/** + * An action's `notices` map with each notice's `title` / `body` resolved: the + * bundle entry at the notice's name first (`resolve`), then the authored + * `I18nLabel` collapsed to `language`. A text that resolves to nothing is + * dropped from its notice, never left as a locale map; the notice's other keys + * (`severity`, `visible`) pass through untouched. Shared by the dispatching + * surface (this hook, for the confirm dialog) and the console's param-dialog + * handler. + */ +export function localizeActionNotices( + notices: Record, + resolve: (notice: string, attr: 'title' | 'body', fallback: string | undefined) => string | undefined, + language: string, +): Record { + const out: Record = {}; + for (const [name, declared] of Object.entries(notices)) { + if (!isConfigBag(declared)) continue; + const notice: Record = { ...declared }; + for (const attr of ['title', 'body'] as const) { + if (declared[attr] === undefined) continue; + const text = resolve(name, attr, pickLocalized(declared[attr] as never, language) || undefined); + if (text) notice[attr] = text; + else delete notice[attr]; + } + out[name] = notice; + } + return out; +} + export function useActionTextLocalizer(): ActionTextLocalizer { - const { actionLabel, actionConfirm, actionSuccess, actionOutcome, actionDisabledReason, actionCancelText } = useObjectLabel(); + const { actionLabel, actionConfirm, actionSuccess, actionOutcome, actionDisabledReason, actionCancelText, actionNoticeText } = useObjectLabel(); const { language } = useObjectTranslation(); return useMemo(() => { @@ -260,7 +289,20 @@ export function useActionTextLocalizer(): ActionTextLocalizer { } out.outcomeMessages = outcomeMessages; } + // The dialog's declared notices (`ActionSchema.notices`): each notice's + // `title` / `body` reads the bundle at its notice name first, then the + // authored `I18nLabel` collapsed to the active language. The confirm + // dialog draws them as the runner hands them on, so they are resolved + // here, where `confirmText` is. + const authoredNotices: unknown = action.notices; + if (isConfigBag(authoredNotices)) { + out.notices = localizeActionNotices( + authoredNotices, + (notice, attr, fallback) => actionNoticeText(keyObject, name, notice, attr, fallback), + language, + ); + } return out as T; }) as ActionTextLocalizer; - }, [actionLabel, actionConfirm, actionSuccess, actionOutcome, actionDisabledReason, actionCancelText, language]); + }, [actionLabel, actionConfirm, actionSuccess, actionOutcome, actionDisabledReason, actionCancelText, actionNoticeText, language]); } diff --git a/ui/packages/types/src/ui-action.ts b/ui/packages/types/src/ui-action.ts index 78af73b004d..bee330f20b1 100644 --- a/ui/packages/types/src/ui-action.ts +++ b/ui/packages/types/src/ui-action.ts @@ -1094,6 +1094,16 @@ export interface UIActionSchema { */ cancelText?: SpecAction['cancelText']; + /** + * Notices the dialog the action opens before it runs (`ActionSchema.notices`) + * — its confirm dialog or its param dialog — draws above its description, + * each while its `visible` condition holds: a map from a snake_case notice + * name to `record:alert`'s `{ severity, title, body, visible }`. DERIVED from + * the spec; the console resolves each `title` / `body` after the translation + * bundle's `_actions.ACTION.notices.NAME.*` entry. + */ + notices?: SpecAction['notices']; + /** Permission required to execute */ permission?: string;