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] |
aldo-expensify
left a comment
There was a problem hiding this comment.
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.
NAB: Wondering if we can use this hook inside the existing HOC to make the code dry.
There was a problem hiding this comment.
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 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