Fix approver field disappears after deselecting the user#47955
Conversation
| /> | ||
|
|
||
| {approvalWorkflow.approvers.map((approver, approverIndex) => { | ||
| {(approvalWorkflow.approvers.length > 0 ? approvalWorkflow.approvers : [undefined]).map((approver, approverIndex) => { |
There was a problem hiding this comment.
I did this a bit differently than what I wrote in the proposal. What is lacking from the proposal is that the Approver won't have a field required error text and it will still show in the "Additional approver" field.
So, I just put an undefined item here, the index will be 0 and I update the error assignment above to assign the error to "approver-0" instead of "additionalApprover".
blazejkustra
left a comment
There was a problem hiding this comment.
Before proceeding with this code, let's discuss it further on the issue here
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-native-2024-08-27_15.42.02.mp4Android: mWeb Chromeandroid-chrome-2024-08-26_14.53.21.mp4iOS: Nativeios-app-2024-08-26_16.05.20.mp4iOS: mWeb Safariios-safari-2024-08-26_16.10.32.mp4MacOS: Chrome / Safaridesktop-chrome-2024-08-27_14.27.23.mp4MacOS: Desktopdesktop-app-2024-08-26_14.44.12.mp4 |
|
✋ 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/mountiny in version: 9.0.26-1 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.26-6 🚀
|
Details
The approver field disappears if we unselect the approver.
Fixed Issues
$ #47723
PROPOSAL: #47723 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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: Native
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
desktop.mp4
MacOS: Desktop
web.mp4