[NewFeature] Add ability to require attendees based on category selection#76687
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 ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by 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.
|
…7-categoryRequireAttendees
…7-categoryRequireAttendees
…7-categoryRequireAttendees
…7-categoryRequireAttendees
|
@shubham1206agra 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] |
|
@shubham1206agra To be noted before starting review that BE is only on staging at the moment (mentioned in tests precondition), and that we have a situation which wasn't decided on yet, even though I went with Option 2. |
trjExpensify
left a comment
There was a problem hiding this comment.
Part of a WN project, so no qualms there.
A couple of things from me:
- I don't think this second error message is required here, can we remove it?
- The copy of the error "Attendees required for this category" appearing when one attendee is always populated in the field is a bit confusing. I think we could update it to something that's more clear to reflect that multiple attendees are required, like:
Multiple attendees required for this category
|
Yeah, I think I agree with that. I started with |
|
@ikevin127, we can briefly see the violation error when we don’t include yourself in the attendee list. Steps to reproduce:
You’ll notice that in the preview, the violation error appears for a moment until the backend sends the response. violation-flicker.movI’m also attaching the offline video below, in the offline case, the violation error stays visible until the device reconnects to the internet. offline-bug.mov |
JS00001
left a comment
There was a problem hiding this comment.
Code looks good, one question
|
ℹ️ The failing lint issue related to |
|
@ikevin127 Not a major issue, but I noticed that when we select only ourselves, we see the |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid.movAndroid: mWeb Chromemweb-chrome.moviOS: HybridAppiOS.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.mov |
✅ I think that's expected as it notifies the user that review is required at report level - and once report is opened the user will see exactly what the issue is - I think this is how the violations system was designed to work at report level. But if that's not the case and we need to handle this differently - I can always follow-up on it. ❌ Asked on Slack about the |
…7-categoryRequireAttendees
|
@ikevin127 Would you mind pinging me when you get a response in slack so I can review this? |
…7-categoryRequireAttendees
| "eslint": "^9.36.0", | ||
| "eslint-config-airbnb-typescript": "^18.0.0", | ||
| "eslint-config-expensify": "^2.0.101", | ||
| "eslint-config-expensify": "2.0.101", |
There was a problem hiding this comment.
I performed npm i because lint was failing locally after this PR added the:
// eslint-disable-next-line rulesdir/no-deep-equal-in-memo -- selectedParticipants is derived with .map() which creates new array references
rule in 2 of the files we're changing in this PR - I had to install modules to have lint not fail locally. The change was already approved here.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.2.82-0 🚀
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.2.82-0 🚀
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.2.82-0 🚀
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.2.84-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.84-8 🚀
|

Explanation of Change
We’re expanding support for required category fields and coding. Specifically, we’ll add more category-based rules within each NewDot category. For example: “If the category is Meals & Entertainment, then require the Attendees field.”
Scope:
Description hintfield more discoverable: Specifically, we'll move Description hint field below Payroll code and above Delete categoryRequire fieldspush row: This new row contains options for bothRequire descriptionandRequire attendees, like soAttendees required for this category.👁️ See issue OP / screenshots for more details / UI representation.
Fixed Issues
$ #76155
PROPOSAL:
Tests
Preconditions:
I. Enable Attendees Required for Category
Require description/Require attendeesRequire attendees.II. Confirmation Page Validation
III. Existing Expense Violation Display
Offline tests
I. Offline Toggle
II. Offline Expense Creation
III. Offline Category Change
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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: HybridApp
android-hybrid.mp4
Android: mWeb Chrome
android-mweb.mp4
iOS: HybridApp
ios-hybrid.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov