-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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 |
@@ -219,4 +220,4 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro | |||
|
|||
WorkspaceMoreFeaturesPage.displayName = 'WorkspaceMoreFeaturesPage'; | |||
|
|||
export default withPolicyAndFullscreenLoading(WorkspaceMoreFeaturesPage); | |||
export default withPolicyConnections(WorkspaceMoreFeaturesPage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's correct.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
MoreFeatures
page.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/390465
PROPOSAL: N/A
Tests / QA Steps
Accounting
is disabled with the lock icon.Accounting
is no longer disabledOffline tests
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop