Repository navigation
[Payment due @mkhutornyi] [No QA] Handle POLICYCHANGELOG_ADD_RULE, UPDATE_RULE, REMOVE_RULE report actions - #98689
Conversation
Backend added these report action types for the rules engine (see Web-Expensify PR #55203).
…ctions Follows the static-string pattern used by other simple policy changelog actions (e.g. IMPORT_TAGS, CORPORATE_UPGRADE).
🦜 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 d0ef4aee..68998cb0 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -8741,9 +8741,9 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
title ? `hat die Agentenregel „${title}“ aktualisiert zu: ${prompt}` : `hat eine Agentenregel aktualisiert zu: ${prompt}`,
deleted: ({title}: {title: string}) => (title ? `hat die Agentenregel „${title}“ entfernt` : 'hat eine Agentenregel entfernt'),
},
- addedRule: 'eine Regel hinzugefügt',
+ addedRule: 'hat eine Regel hinzugefügt',
updatedRule: 'eine Regel aktualisiert',
- removedRule: 'eine Regel entfernt',
+ removedRule: 'hat eine Regel entfernt',
expensifyCardRule: {
actionVerb: {block: 'blockiert', allow: 'erlaubt'},
amountOperator: {over: 'über', under: 'unter'},
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index e5d7a087..9f6aff3d 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -8661,9 +8661,9 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `zaktualizował(a) regułę agenta „${title}” na: ${prompt}` : `zaktualizowano regułę agenta na: ${prompt}`),
deleted: ({title}: {title: string}) => (title ? `usunął(-ęła) regułę agenta „${title}”` : 'usunięto regułę agenta'),
},
- addedRule: 'dodał(-a) regułę',
- updatedRule: 'zaktualizował(-a) regułę',
- removedRule: 'usunął(-ęła) regułę',
+ addedRule: 'dodano regułę',
+ updatedRule: 'zaktualizowano regułę',
+ removedRule: 'usunięto regułę',
expensifyCardRule: {
actionVerb: {block: 'zablokowane', allow: 'dozwolone'},
amountOperator: {over: 'ponad', under: 'pod'},
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index cb277a63..36cb06ea 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -8377,9 +8377,9 @@ ${reportName}`,
updated: ({title, prompt}: {title: string; prompt: string}) => (title ? `已将代理规则“${title}”更新为:${prompt}` : `已将代理规则更新为:${prompt}`),
deleted: ({title}: {title: string}) => (title ? `已移除代理规则“${title}”` : '已移除代理规则'),
},
- addedRule: '已添加规则',
- updatedRule: '已更新规则',
- removedRule: '已移除规则',
+ addedRule: '已添加一条规则',
+ updatedRule: '更新了一条规则',
+ removedRule: '已删除一条规则',
expensifyCardRule: {
actionVerb: {block: '已阻止', allow: '允许'},
amountOperator: {over: '结束', under: '在……之下'},
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
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.
|
|
@mkhutornyi 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] |
mkhutornyi
left a comment
There was a problem hiding this comment.
Please consider updating below files too:
- ReportNameUtils for report title
- OptionsListUtils for search router last message text
- ContextMenuActions for copy to clipboard
For easier regression catch: test in non-English language
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03e56937f0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Add cases for POLICYCHANGELOG_ADD_RULE/UPDATE_RULE/REMOVE_RULE, matching the existing simple policy changelog actions, so replying to one of these system messages doesn't fall back to a generic thread title.
OptionsListUtils.getLastMessageTextForReport() is used by search/selector option construction independently of SidebarUtils, so it needs the same branches for POLICYCHANGELOG_ADD_RULE/UPDATE_RULE/REMOVE_RULE.
Add clipboard cases for POLICYCHANGELOG_ADD_RULE/UPDATE_RULE/REMOVE_RULE, matching the other supported policy changelog actions.
|
@mkhutornyi addressed all three |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safariweb.mov |
| addedRule: 'hat eine Regel hinzugefügt', | ||
| updatedRule: 'eine Regel aktualisiert', | ||
| removedRule: 'hat eine Regel entfernt', |
There was a problem hiding this comment.
updatedRule seems missing hat
|
@mjasikowski 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] |
|
🎯 @mkhutornyi, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.57-0 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against the help site files under Why: This PR is a purely technical rendering change. It adds App-side support for displaying three new policy changelog report actions ( These are auto-generated system chat messages ("added a rule" / "updated a rule" / "removed a rule") emitted by the new rules engine backend (which isn't fully live yet). The PR introduces no new user-facing feature, setting, tab, button, or workflow. Help site articles document how customers use features—not the individual changelog messages the system emits in chat—so there's nothing to add or change. Since no docs changes are required, I did not create a draft help site PR. @luacmartins, if you believe the underlying rules engine feature itself needs customer-facing documentation (beyond these system messages), let me know and I can scope that separately. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.57-3 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #99123 |
Explanation of Change
Adds App-side support for rendering the new
POLICYCHANGELOG_ADD_RULE,UPDATE_RULE, andREMOVE_RULEreport actions from Web-Expensify#55203, following the existing static-text policy changelog pattern.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/662964
Tests
N/A this will be tested with the new rules engine BE
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)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
Android: Native
Not tested - backend feature not fully live yet.
Android: mWeb Chrome
Not tested - backend feature not fully live yet.
iOS: Native
Not tested - backend feature not fully live yet.
iOS: mWeb Safari
Not tested - backend feature not fully live yet.
MacOS: Chrome / Safari
Not tested - backend feature not fully live yet.