-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add a custom hook to fetch the connections field of the policy object #41278
Add a custom hook to fetch the connections field of the policy object #41278
Conversation
@rushatgabhane @ One of you needs to 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] |
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.
While I do prefer hooks over the HOC we have, I have to ask why are we needing this hook if we have the HOC? :P
is my review required? i think not. code LGTM |
We need the What we want to do on these pages is that we fetch the So, we need a custom hook without the blocking rendering logic of the HOC. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import useNetwork from './useNetwork'; | ||
|
||
export default function usePolicyConnections(policyID: string) { |
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.
NAB: Wondering if we can use this hook inside the existing HOC to make the code dry.
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.
yep I'll do that as a cleanup issue once release is done 😄
✋ 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/aldo-expensify in version: 1.4.69-0 🚀
|
Thinking again about this, we already call a command when we open the "Category" pages: |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.69-2 🚀
|
@aldo-expensify, so upon examining the Auth code, we're already returning the I double-confirmed that by looking at the payload of |
I'll remove the hook from the categories page. Also, as other workspace pages probably use the same method on the Auth side, there is really no need for the custom hook |
Sounds good, thanks for investigating! |
…sabling-accounting-feature-if-there-is-active-accounting-connection [App PR #41278] Prevent users from disabling accounting feature if there is active accounting connection
Details
Add a custom hook to fetch the connections field of the policy object.
Fixed Issues
$ #41277
PROPOSAL: N/A
Tests
Can be tested on a PR that uses this change.
Offline tests
N/A
QA Steps
NO QA
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