Handle POLICYCHANGELOG_ADD_RULE, UPDATE_RULE, REMOVE_RULE report actions - #98689
Draft
luacmartins wants to merge 5 commits into
Draft
Handle POLICYCHANGELOG_ADD_RULE, UPDATE_RULE, REMOVE_RULE report actions#98689luacmartins wants to merge 5 commits into
luacmartins wants to merge 5 commits into
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).
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 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.
|
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.
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
PROPOSAL:
Tests
The backend rules engine that emits these actions isn't fully live yet, so this was verified by forging report actions in Onyx rather than end-to-end.
POLICYCHANGELOG_ADD_RULEin Onyx for a report.POLICYCHANGELOG_UPDATE_RULE("updated a rule") andPOLICYCHANGELOG_REMOVE_RULE("removed a rule").Offline tests
Same as Tests.
QA Steps
Not testable on staging yet - the backend rules engine has not shipped. QA coverage will follow once Web-Expensify#55203 is live.
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.