fix: Hide invoice menu if the user can't send an invoice or has an invoice report#54945
Conversation
…'t create invoice
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import * as SearchActions from '@libs/actions/Search'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import {getAllTaxRates, hasWorkspaceWithInvoices} from '@libs/PolicyUtils'; |
There was a problem hiding this comment.
hasWorkspaceWithInvoices is now unused. Let's remove that function definition
There was a problem hiding this comment.
I have removed the function definition 🙏.
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2025-01-10.at.00.56.45.movMacOS: Desktop |
|
@luacmartins do you think we should handle the navigation case when user B is demoted from Admin to Member? Screen.Recording.2025-01-10.at.00.58.48.mov |
|
@etCoderDysto can you plz look into above^ issue |
@Pujan92 I have tried to reproduce the issue, and it is also reproducible on staging when you remove a member from a workspace.
I can put up a follow up PR if needed as this is already reproducible on staging and probably on production too. |
|
Maybe navigating to the other existing page is a different issue and needs to be solved in other PR, better to clarify with @luacmartins once. |
|
Not sure if we need to address that since it's a pretty small edge case. Either way, I think we can do that in a follow up if needed. |
|
Ok, Thanks @luacmartins |
|
✋ 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/luacmartins in version: 9.0.84-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.84-7 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.84-7 🚀
|
Explanation of Change
If Invoice feature is enabled in a workspace, hide Invoices menu in Reports page if a user is only a member of a workspace and have no invoice report.
Fixed Issues
$ #54562
PROPOSAL: #54562 (comment)
Tests
Same as QA steps
Offline tests
Same as QA steps
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Test 1
Precondition: Sign in with two new accounts in separate devices
invoices yet"
Test 2
Precondition: Sign in with two new accounts in separate devices
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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.10.in.the.morning.mp4
Android: mWeb Chrome
Android.chrome.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.safari.mp4
MacOS: Chrome / Safari
Web.Screen.Recording.2025-01-07.at.9.33.53.in.the.morning.mp4
MacOS: Desktop
Destop.Screen.Recording.2025-01-07.at.9.42.48.in.the.morning.mp4