Repository navigation
[NoQA][Insights] Add Compliance charts and chart eligibility rules - #105266
luacmartins merged 29 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
It looks like this PR adds a search filter or column. Please double check the following:
|
|
@OlGierd03 conflicts |
|
Resolving! 🏃 |
|
@luacmartins Should be good to go now |
|
lol thanks GH |
|
👀 Some more conflicts 💥🥊 |
|
@OlGierd03 the GH brownout got the last job stuck and I can't re-run it. Can you push another commit to the PR to re-trigger the workflow please? |
|
Going to test this real quick. |
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
All looks good to me! |
|
@luacmartins all set |
|
✋ 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.5.35-0 🚀
|
|
FullStory updates are recommended: stable custom elements for Compliance charts and menu actions, plus masking employee identities in tables and tooltips. No new events, user properties, or page-view code are needed. Created Update FullStory for E/A#105266 Compliance charts and eligible workspace filtering, assigned to |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.35-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Adds the Compliance dashboard charts: Violations over time, Top violations, Violations by submitter and Violations by approver. All of them count expenses (
metric: COUNT). Top violations groups by violation type through a newGROUP_BY.VIOLATION, which only Insights uses and Search autocomplete hides. Search can't filter by violation type yet, so its "View on Spend" opens a flat list of all violations. The submitter and approver charts narrow to their own stage (has:submitted-violation/has:approved-violation) and its date (submitted:/anyApproval:), so the drill-in matches what the chart counts. Violations by submitter needs a workspace with at least two members, and Violations by approver also needs approvals enabled. Eligibility only counts workspaces where the user is an admin or auditor, and the Compliance workspace filter lists only those.Known issues on Compliance:
Warning
The data includes workspaces where the user isn't an admin or auditor.
Will be fixed on the backend by limiting Compliance data to admin/auditor workspaces.
Warning
GetInsightsreturns each group asvalueinstead ofaccountID/violationnormalizeInsightsSnapshottemporarily renames it to let the charts reuse the Search grouping code. Will be fixed on the backend by returning the named fields, after whichnormalizeInsightsSnapshotcan be dropped.Warning
The drill-in from Violations over time and Top violations can show a different number of expenses than the chart.
The Insights numbers are correct, only the Spend query can't express the same filter yet. Will be fixed by the Submitters/Approvers selector in #697879.
Warning
Clicking a Top violations slice opens all violations, not only the clicked type.
Will be fixed by the
violation:filter in Search in #105301.Warning
"View on Spend" from Top violations opens a flat list of expenses, not grouped by violation type.
Will be fixed by
group-by:violationin Search in #105303, backed by #697165 on the backend.Fixed Issues
$ #102809
Tests
Precondition: account with the
insightsCompliancebeta that is an admin of a workspace with at least two members and approvals enabled, and a regular member of another workspace. In the admin workspace, some expenses with violations are submitted and approved in the current month.from:,has:submitted-violationand asubmitted:date that match the chart's count.approver:,has:approved-violationand ananyApproval:date that match the chart's count.Offline tests
QA Steps
NoQA
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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