[HOLD WEB#54776] Render agent rule change logs in NewDot #admins#96773
Open
yuwenmemon wants to merge 2 commits into
Open
[HOLD WEB#54776] Render agent rule change logs in NewDot #admins#96773yuwenmemon wants to merge 2 commits into
yuwenmemon wants to merge 2 commits into
Conversation
Contributor
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index a09698b9842..184201e3be1 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -8605,9 +8605,10 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
`hat die Standardausgabenkategorie für „${mccGroupName}“ in „${newCategory}“ geändert (zuvor „${oldCategory}“)`,
updatedRequireCompanyCards: ({enabled}: {enabled: boolean}) => `${enabled ? 'aktiviert' : 'deaktiviert'} die Anforderung für Firmenkartenkäufe`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `Agentenregel "${title}" hinzugefügt: ${prompt}` : `Eine Agentenregel hinzugefügt: ${prompt}`),
- updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `Agentenregel "${title}" aktualisiert auf: ${prompt}` : `Eine Agentenregel aktualisiert auf: ${prompt}`),
- deleted: ({title}: {title: string}) => (title ? `Agentenregel "${title}" entfernt` : 'Eine Agentenregel entfernt'),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `hat die Agentenregel „${title}“ hinzugefügt: ${prompt}` : `hat eine Agentenregel hinzugefügt: ${prompt}`),
+ updated: ({title, prompt}: {title: string; prompt: string}) =>
+ title ? `hat die Agentenregel „${title}“ aktualisiert auf: ${prompt}` : `eine Agentenregel aktualisiert zu: ${prompt}`,
+ deleted: ({title}: {title: string}) => (title ? `hat die Agentenregel „${title}“ gelöscht` : 'hat eine Agentenregel gelöscht'),
},
expensifyCardRule: {
actionVerb: {block: 'blockiert', allow: 'erlaubt'},
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 31737008cd8..64fed33d1ba 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -8069,9 +8069,9 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
updatedCardFeedStatementPeriod: (feedName: string, newValue?: string, previousValue?: string) =>
`cambió el día de cierre del período de estado de cuenta de la fuente de tarjetas "${feedName}"${newValue ? ` a "${newValue}"` : ''}${previousValue ? ` (previamente "${previousValue}")` : ''}`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `agregó la regla de agente "${title}": ${prompt}` : `agregó una regla de agente: ${prompt}`),
- updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `actualizó la regla de agente "${title}" a: ${prompt}` : `actualizó una regla de agente a: ${prompt}`),
- deleted: ({title}: {title: string}) => (title ? `eliminó la regla de agente "${title}"` : 'eliminó una regla de agente'),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `añadió la regla de agente «${title}»: ${prompt}` : `añadió una regla de agente: ${prompt}`),
+ updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `actualizó la regla del agente «${title}» a: ${prompt}` : `actualizó una regla de agente a: ${prompt}`),
+ deleted: ({title}: {title: string}) => (title ? `eliminó la regla de agente «${title}»` : 'eliminó una regla de agente'),
},
expensifyCardRule: {
actionVerb: {block: 'bloqueado', allow: 'permitido'},
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index d591fe52028..358b47cb9d6 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -8640,10 +8640,10 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
`a modifié la catégorie de dépense par défaut pour « ${mccGroupName} » en « ${newCategory} » (auparavant « ${oldCategory} »)`,
updatedRequireCompanyCards: ({enabled}: {enabled: boolean}) => `${enabled ? 'activé' : 'désactivé'} l’exigence d’achats par carte d’entreprise`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `a ajouté la règle d'agent "${title}" : ${prompt}` : `a ajouté une règle d'agent : ${prompt}`),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `a ajouté la règle d’agent « ${title} » : ${prompt}` : `a ajouté une règle d’agent : ${prompt}`),
updated: ({title, prompt}: {title: string; prompt: string}) =>
- title ? `a mis à jour la règle d'agent "${title}" en : ${prompt}` : `a mis à jour une règle d'agent en : ${prompt}`,
- deleted: ({title}: {title: string}) => (title ? `a supprimé la règle d'agent "${title}"` : `a supprimé une règle d'agent`),
+ title ? `a mis à jour la règle d’agent « ${title} » en : ${prompt}` : `a mis à jour une règle d’agent en : ${prompt}`,
+ deleted: ({title}: {title: string}) => (title ? `a supprimé la règle d’agent « ${title} »` : 'a supprimé une règle d’agent'),
},
expensifyCardRule: {
actionVerb: {block: 'bloqué', allow: 'autorisé'},
diff --git a/src/languages/it.ts b/src/languages/it.ts
index e4f2c11e190..05bf26683a1 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -8587,9 +8587,10 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
`ha modificato la categoria di spesa predefinita per "${mccGroupName}" in "${newCategory}" (precedentemente "${oldCategory}")`,
updatedRequireCompanyCards: ({enabled}: {enabled: boolean}) => `${enabled ? 'abilitato' : 'disabilitato'} il requisito per gli acquisti con carta aziendale`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `regola dell'agente "${title}" aggiunta: ${prompt}` : `regola dell'agente aggiunta: ${prompt}`),
- updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `regola dell'agente "${title}" aggiornata in: ${prompt}` : `regola dell'agente aggiornata in: ${prompt}`),
- deleted: ({title}: {title: string}) => (title ? `regola dell'agente "${title}" rimossa` : `regola dell'agente rimossa`),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `ha aggiunto la regola dell'agente "${title}": ${prompt}` : `ha aggiunto una regola agente: ${prompt}`),
+ updated: ({title, prompt}: {title: string; prompt: string}) =>
+ title ? `ha aggiornato la regola dell'agente "${title}" in: ${prompt}` : `ha aggiornato una regola dell'agente in: ${prompt}`,
+ deleted: ({title}: {title: string}) => (title ? `ha eliminato la regola agente "${title}"` : 'ha eliminato una regola agente'),
},
expensifyCardRule: {
actionVerb: {block: 'bloccato', allow: 'consentito'},
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 186f088085c..f100ec24bae 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -8478,8 +8478,8 @@ ${reportName}`,
agentRule: {
added: ({title, prompt}: {title: string; prompt: string}) => (title ? `エージェントルール「${title}」を追加しました:${prompt}` : `エージェントルールを追加しました:${prompt}`),
updated: ({title, prompt}: {title: string; prompt: string}) =>
- title ? `エージェントルール「${title}」を次のように更新しました:${prompt}` : `エージェントルールを次のように更新しました:${prompt}`,
- deleted: ({title}: {title: string}) => (title ? `エージェントルール「${title}」を削除しました` : `エージェントルールを削除しました`),
+ title ? `エージェントルール「${title}」を次の内容に更新しました:${prompt}` : `エージェントルールを次の内容に更新しました:${prompt}`,
+ deleted: ({title}: {title: string}) => (title ? `エージェントルール「${title}」を削除しました` : 'エージェントルールを削除しました'),
},
expensifyCardRule: {
actionVerb: {block: 'ブロック済み', allow: '許可済み'},
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 8c308c3666a..03b6cbc2b5c 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -8558,9 +8558,10 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
`heeft de standaarduitgavencategorie voor ‘${mccGroupName}’ gewijzigd in ‘${newCategory}’ (voorheen ‘${oldCategory}’)`,
updatedRequireCompanyCards: ({enabled}: {enabled: boolean}) => `vereiste ${enabled ? 'ingeschakeld' : 'uitgeschakeld'} voor bedrijfskaarttransacties`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `agentregel "${title}" toegevoegd: ${prompt}` : `een agentregel toegevoegd: ${prompt}`),
- updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `agentregel "${title}" bijgewerkt naar: ${prompt}` : `een agentregel bijgewerkt naar: ${prompt}`),
- deleted: ({title}: {title: string}) => (title ? `agentregel "${title}" verwijderd` : `een agentregel verwijderd`),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `heeft de agentregel "${title}" toegevoegd: ${prompt}` : `heeft een agentregel toegevoegd: ${prompt}`),
+ updated: ({title, prompt}: {title: string; prompt: string}) =>
+ title ? `heeft de agentregel „${title}” bijgewerkt naar: ${prompt}` : `heeft een agentregel bijgewerkt naar: ${prompt}`,
+ deleted: ({title}: {title: string}) => (title ? `heeft de agentregel '${title}' verwijderd` : 'heeft een agentregel verwijderd'),
},
expensifyCardRule: {
actionVerb: {block: 'geblokkeerd', allow: 'toegestaan'},
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 862f6257854..e3216571511 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -8538,9 +8538,9 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
`zmieniono domyślną kategorię wydatków dla „${mccGroupName}” na „${newCategory}” (poprzednio „${oldCategory}”)`,
updatedRequireCompanyCards: ({enabled}: {enabled: boolean}) => `${enabled ? 'włączone' : 'wyłączone'} wymóg dotyczący zakupów kartą służbową`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `dodano regułę agenta "${title}": ${prompt}` : `dodano regułę agenta: ${prompt}`),
- updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `zaktualizowano regułę agenta "${title}" na: ${prompt}` : `zaktualizowano regułę agenta na: ${prompt}`),
- deleted: ({title}: {title: string}) => (title ? `usunięto regułę agenta "${title}"` : `usunięto regułę agenta`),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `dodał(a) regułę agenta „${title}”: ${prompt}` : `dodano regułę agenta: ${prompt}`),
+ updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `zaktualizowano regułę agenta „${title}” na: ${prompt}` : `zaktualizowano regułę agenta na: ${prompt}`),
+ deleted: ({title}: {title: string}) => (title ? `usunięto regułę agenta „${title}”` : 'usunął(-ę) regułę agenta'),
},
expensifyCardRule: {
actionVerb: {block: 'zablokowane', allow: 'dozwolone'},
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 749e3aaf28a..df79fcb7f10 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -8547,8 +8547,8 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
agentRule: {
added: ({title, prompt}: {title: string; prompt: string}) => (title ? `adicionou a regra de agente "${title}": ${prompt}` : `adicionou uma regra de agente: ${prompt}`),
updated: ({title, prompt}: {title: string; prompt: string}) =>
- title ? `atualizou a regra de agente "${title}" para: ${prompt}` : `atualizou uma regra de agente para: ${prompt}`,
- deleted: ({title}: {title: string}) => (title ? `removeu a regra de agente "${title}"` : `removeu uma regra de agente`),
+ title ? `atualizou a regra do agente "${title}" para: ${prompt}` : `atualizou uma regra de agente para: ${prompt}`,
+ deleted: ({title}: {title: string}) => (title ? `excluiu a regra de agente "${title}"` : 'excluiu uma regra de agente'),
},
expensifyCardRule: {
actionVerb: {block: 'bloqueado', allow: 'permitido'},
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 3f7cb167397..3fdabd1cb49 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -8284,9 +8284,9 @@ ${reportName}`,
addedReportField: (fieldType: string, fieldName?: string, defaultValue?: string) => `已添加 ${fieldType} 报告字段“${fieldName}”${defaultValue ? ` 默认值为“${defaultValue}”` : ''}`,
updatedRequireCompanyCards: ({enabled}: {enabled: boolean}) => `${enabled ? '已启用' : '已禁用'} 公司商务卡消费要求`,
agentRule: {
- added: ({title, prompt}: {title: string; prompt: string}) => (title ? `已添加代理规则"${title}":${prompt}` : `已添加一条代理规则:${prompt}`),
- updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `已将代理规则"${title}"更新为:${prompt}` : `已更新一条代理规则:${prompt}`),
- deleted: ({title}: {title: string}) => (title ? `已删除代理规则"${title}"` : `已删除一条代理规则`),
+ added: ({title, prompt}: {title: string; prompt: string}) => (title ? `已添加代理规则“${title}”:${prompt}` : `添加了一条代理规则:${prompt}`),
+ updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `已将智能体规则“${title}”更新为:${prompt}` : `已将代理规则更新为:${prompt}`),
+ deleted: ({title}: {title: string}) => (title ? `已删除代理规则“${title}”` : '删除了代理规则'),
},
expensifyCardRule: {
actionVerb: {block: '已阻止', allow: '允许'},
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Contributor
Author
|
(Yuwen's Agent) Squawk received 🦜 — adopted the suggested translations for all 9 locales in a104f43. |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@puneetlath please review
Explanation of Change
Renders the three new agent-rule change-log system messages in NewDot's #admins room, so admins get a visible audit trail whenever an agent rule is added, updated, or deleted. Add/update messages show the rule title and full prompt; delete shows just the title (the title is server-generated and may be empty, so each message falls back to a generic phrasing).
The backend that emits these
POLICYCHANGELOG_{ADD,UPDATE,DELETE}_AGENT_RULEactions is the companion Auth PR https://github.com/Expensify/Auth/pull/23134. Deploy this NewDot PR first so the messages render as soon as Auth starts emitting them; an unhandled subtype simply renders nothing (no crash). OldDot's own rendering is the companion Web-Expensify PR https://github.com/Expensify/Web-Expensify/pull/54776.Fixed Issues
For https://github.com/Expensify/Expensify/issues/660979
PROPOSAL:
Tests
(Requires the companion Auth PR on the same environment to emit the actions.)
Offline tests
These are server-emitted system messages, so no new offline behavior is introduced — an already-synced #admins room shows the cached messages while offline.
QA Steps
Same as tests (run on staging once the companion Auth change is deployed there).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos