feat: add delete option to deletable report fields#36039
feat: add delete option to deletable report fields#36039thienlnam merged 24 commits intoExpensify:mainfrom allroundexperts:feat-35331
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-03-28_11.46.32.mp4Android: mWeb Chromeandroid-chrome-2024-03-28_12.49.31.mp4iOS: Nativeios-app-2024-03-28_12.35.14.mp4iOS: mWeb Safariios-safari-2024-03-28_12.43.48.mp4MacOS: Chrome / Safaridesktop-chrome-2024-03-28_11.24.49.mp4MacOS: Desktopdesktop-app-2024-03-28_11.34.26.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@allroundexperts Any thoughts on the bugs above? |
|
@allroundexperts Friendly bump! 🙇 |
|
Hi @jjcoffee! |
This would be handled from the backend. I think pusher is not sending the delete event to the ND. @thienlnam Can you check here please? |
This seems to be on the backend as well. @thienlnam can you verify? I'm sending the field like shown here |
This is known, there's another big refactor happening right now for pusher updates in the BE. This will be broken until that is finished
I can take a look at this one - created an issue to look into it further https://github.com/Expensify/Expensify/issues/375261 |
|
Hmm now the delete option never shows, I think because the |
|
Yeah that is one change, additionally for the API call - what are the parameters being sent? You no longer need to prefix with expensify_ since it comes that way now from the changes listed here #36170 (comment) |
|
We might want to move forward with the FE changes for #36170 before doing this PR |
|
@thienlnam Another one that seems most likely BE-related. When adding a new field in OD, it does come through via pusher on ND, but tapping on the field leads to desktop-chrome-newfield-2024-04-04_15.15.03.mp4 |
Hmm, if the data is stored correctly in the policy onyx key - then I would imagine this would be a FE issue |
Added the check icon @jjcoffee |
@thienlnam Just double-checked it's also happening on main. It looks like there's no pusher event to update the report's |
|
@allroundexperts Sorry, there are conflicts now, can you fix? 😄 |
|
Ah looks like the PR with the conflicts was reverted. New PR is in draft #39711. I have asked there if they can HOLD for our PR to get merged first (I think that makes the most sense here!). |
|
Damn just noticed the perf test is failing. Can you merge main @allroundexperts? |
|
Conflicting PR won't block us, we're good to merge this once the perf test passes @thienlnam 🙇 |
thienlnam
left a comment
There was a problem hiding this comment.
This is unrelated to the perf tests, and it seems like we're going to merge them anyways https://expensify.slack.com/archives/C01GTK53T8Q/p1712343373389919
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.4.61-0 🚀
|
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.4.61-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀
|
| fieldName={Str.UCFirst(reportField.name)} | ||
| fieldKey={fieldKey} | ||
| fieldValue={fieldValue} | ||
| isRequired={!reportField.deletable} |
There was a problem hiding this comment.
We should have made sure that the report title field is always required. #42525
|
|
||
| const handleReportFieldDelete = () => { | ||
| ReportActions.deleteReportField(report.reportID, reportField); | ||
| Navigation.dismissModal(report?.reportID); |
There was a problem hiding this comment.
Before we call Navigation.dismissModal here, we should set isDeleteModalVisible to false to prevent the delay in closing the delete modal #43496
| ); | ||
| const menuItems: ThreeDotsMenuItem[] = []; | ||
|
|
||
| const isReportFieldDeletable = reportField.deletable && !isReportFieldTitle; |
There was a problem hiding this comment.
isReportFieldTitle checks for formula also and the tile field can be text as well. So, we need to check if fieldID is title. More details here #49077

Details
This PR adds the ability to delete a report field attached to a report, given it was removed from a policy.
Fixed Issues
$ #35331
PROPOSAL: N/A
Tests
Reportsoption in the LHN and create some report fields.policyReportFieldsbeta turned on in the code.Offline tests
N/A
QA Steps
Reportsoption in the LHN and create some report fields.policyReportFieldsbeta turned on in the code.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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 so 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
Screen.Recording.2024-02-19.at.6.39.31.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-02-19.at.6.38.47.AM.mov
iOS: Native
Screen.Recording.2024-02-19.at.6.36.11.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-02-19.at.6.30.21.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-19.at.6.23.01.AM.mov
MacOS: Desktop
Screen.Recording.2024-02-19.at.6.29.01.AM.mov