-
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
[Wave collect] [Xero] Block Xero screens if Xero is not connected. #42619
[Wave collect] [Xero] Block Xero screens if Xero is not connected. #42619
Conversation
@ishpaul777 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] |
@ishpaul777 You can ignore this PR. @rushatgabhane @hungvu193 @lakchote This is ready for review. |
I'm thinking about the way we handle it in our |
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.
Here's my idea. Let's me know what you think
src/components/ConnectionLayout.tsx
Outdated
shouldBeBlocked?: boolean; | ||
}; |
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.
shouldBeBlocked?: boolean; | |
}; | |
shouldBeBlocked?: boolean; | |
/** Name of the current connection **/ | |
connectionName: 'xero' | 'quickbooksOnline'; | |
}; |
@@ -77,6 +80,7 @@ function ConnectionLayout({ | |||
titleStyle, | |||
shouldIncludeSafeAreaPaddingBottom, | |||
shouldUseScrollView = true, | |||
shouldBeBlocked = false, | |||
}: ConnectionLayoutProps) { | |||
const {translate} = useLocalize(); | |||
|
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.
const policy = PolicyUtils.getPolicy(policyID ?? ''); | |
const isConnectionEmpty = isEmpty(policy.connections?.[connectionName]); |
src/components/ConnectionLayout.tsx
Outdated
@@ -97,6 +101,7 @@ function ConnectionLayout({ | |||
policyID={policyID} | |||
accessVariants={accessVariants} | |||
featureName={featureName} | |||
shouldBeBlocked={shouldBeBlocked} |
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.
shouldBeBlocked={shouldBeBlocked} | |
shouldBeBlocked={shouldBeBlocked || isConnectionEmpty} |
I like that idea, to prevent repeating code and adhere to the DRY principle. |
I think the amount of changes in the files is still the same. But I have updated the code anyway. I've also refactored the @hungvu193 @lakchote All yours. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeissue with current Android studio. Android: mWeb ChromeUploading mAndroid.mov… iOS: NativeiOS.moviOS: mWeb SafarimSafari.movMacOS: Chrome / Safarichrome.movMacOS: Desktopdesktop.mov |
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.
LGTM 🚀
🚀 Deployed to staging by https://github.com/lakchote in version: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/lakchote in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
Provide access to Xero related screens only if the integration connected is Xero.
Details
Fixed Issues
$ #41726
PROPOSAL:
Tests
Pre-requisite:
Test Steps
{policyID}
with your workspace's policyID and try to access the page.Xero URLs
Offline tests
N/A
QA Steps
Same as Test Steps all the links are for staging.
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-xero-pages.mov
Android: mWeb Chrome
mweb-chrome-xero-pages.mov
iOS: Native
ios-xero-pages.mov
iOS: mWeb Safari
mweb-safari-xero-pages.mov
MacOS: Chrome / Safari
web-xero-pages-access.mp4
MacOS: Desktop
desktop-xero-pages.mov