[App PR #41278] Prevent users from disabling accounting feature if there is active accounting connection#40940
Conversation
… an active accounting connection
…ction to any of the accounting software
|
@eVoloshchak 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] |
|
@s77rt, can you do a code review for this one, please? |
|
Yes sure, will review later today |
Reviewer Checklist
Screenshots/VideosAndroid: NativeHaving build errors |
| WorkspaceMoreFeaturesPage.displayName = 'WorkspaceMoreFeaturesPage'; | ||
|
|
||
| export default withPolicyAndFullscreenLoading(WorkspaceMoreFeaturesPage); | ||
| export default withPolicyConnections(WorkspaceMoreFeaturesPage); |
There was a problem hiding this comment.
This is causing a bug.
- Sign out
- Sign in
- Go offline
- Go to the more features page
- Page should be accessible offline
There was a problem hiding this comment.
I just realised that all the components that use this HOC do not work offline (unless the connections are already present in Onyx)
There was a problem hiding this comment.
@aldo-expensify, how should be handle this? We want to make sure that we don't allow the admin from disabling the accounting feature when the workspace is connected to the QBO. But to do that, we need the connections data. When the connections data hasn't been fetched and the device is offline, we cannot tell if there is an accounting connection or not.
There was a problem hiding this comment.
@s77rt, am I right that all screens, including Categories and Tags screens, that were previously offline first that were later modified to use withPolicyConnections will not be offline first
|
We decided to use Pattern B here. I'm working on the backend code right now to send the error to the front end. I'll modify this PR to read the error and display the error received form the backend. |
|
Creating a custom hook here |
…ng-feature-if-there-is-active-accounting-connection
|
PR is ready for another review 🙇 |
|
@hayata-suenaga Shouldn't we display the returned error from BE? Screen.Recording.2024-05-01.at.10.30.40.PM.mov |
|
@neil-marcellini 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] |
…ng-feature-if-there-is-active-accounting-connection
aldo-expensify
left a comment
There was a problem hiding this comment.
@hayata-suenaga I left a comment here about the new hook: #41278 (comment)
In summary, I think we may need to rethink the approach because the usage of the hook is breaking 1:1:1 IMO
|
@hayata-suenaga we can close this one, right? |
|
Oh wow good catch Aldo, it's easy to miss seeing that, but I agree it's not the right approach. |
|
this method is getting the entire policy object, including also the custom hook was deleted recently 🙇 |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.71-6 🚀
|





Details
When there is a connection with an accounting software, we have to prevent the user from disabling the accounting integration feature on the
MoreFeaturespage.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/390465
PROPOSAL: N/A
Tests / QA Steps
Accountingis disabled with the lock icon.Accountingis no longer disabledOffline tests
N/A
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop