-
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
[CP Staging] [NO QA]: Add bank urls to Company Card flow #51384
Conversation
@allgandalf 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] |
src/CONST.ts
Outdated
@@ -180,6 +180,7 @@ const CONST = { | |||
BILLABLE: 'billable', | |||
NON_BILLABLE: 'nonBillable', | |||
}, | |||
COMPANY_CARD_DOMAIN_NAME: 'expensify-policyABASDASDASDASDFASD.exfy', |
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.
where did you take this value from ?
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.
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.
tagged you in thread as well
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 was just a format example, the policyID has to be the policyID of the policy to which you trying to connect the bank :D
src/CONST.ts
Outdated
@@ -180,6 +180,7 @@ const CONST = { | |||
BILLABLE: 'billable', |
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.
Looks good, did you test atleast on one platform ?
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.
yeah
Screen.Recording.2024-10-24.at.11.44.11.mov
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2024-10-24.at.2.43.24.PM.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.
code cleanup, looks great, thanks @narefyev91 !
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.
The domain name has to be dynamic to the policy you trying to connect the bank to
src/CONST.ts
Outdated
@@ -180,6 +180,7 @@ const CONST = { | |||
BILLABLE: 'billable', | |||
NON_BILLABLE: 'nonBillable', | |||
}, | |||
COMPANY_CARD_DOMAIN_NAME: 'expensify-policyABASDASDASDASDFASD.exfy', |
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 was just a format example, the policyID has to be the policyID of the policy to which you trying to connect the bank :D
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.
small change, but i think we should stay consistent across our codebase
@@ -14,14 +15,16 @@ import CONST from '@src/CONST'; | |||
import ONYXKEYS from '@src/ONYXKEYS'; | |||
|
|||
function BankConnection() { | |||
const params = useRoute().params as Record<string, 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.
This is not really the way we get route params, can you please update this , i can attach the pattern we follow below:
type WorkspaceCompanyCardDetailsPageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.COMPANY_CARD_DETAILS>; | |
function WorkspaceCompanyCardDetailsPage({route}: WorkspaceCompanyCardDetailsPageProps) { | |
const {policyID, cardID, backTo, bank} = route.params; |
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.
yeah but it's not a navigation page - it's just a component
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.
ummm, can't we then just pass the prop down to the component then? do we do the same thing in other component pages ? just that i saw this pattern for the first time
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.
updated - passed inside AddNewCardPage
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.
Okay the policyId are dynamic now, thanks for the quick change @narefyev91
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.
Looks terrific
src/libs/getPolicyDomainName.ts
Outdated
export default function getPolicyDomainName(policyID: string): string { | ||
return `expensify-policy${policyID}.exfy`; | ||
} |
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: but in future PR can you please move this to the existing policy utils file?
src/libs/getPolicyDomainName.ts
Outdated
@@ -0,0 +1,3 @@ | |||
export default function getPolicyDomainName(policyID: string): string { | |||
return `expensify-policy${policyID}.exfy`; |
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.
@narefyev91 actually relaized, this has to be lowercase, can you make sure the returned string is made lowercase?
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.
@mountiny you mean policyID value?
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.
updated
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.
Yeah the entire thing but the policyID in there would be passed as uppercase
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.
yeah i found already existed util function for that
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.
Thanks!
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
tests were passing |
[CP Staging] [NO QA]: Add bank urls to Company Card flow (cherry picked from commit 7e5910e) (CP triggered by mountiny)
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.53-1 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.53-1 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.53-1 🚀
|
Details
Add correct redirect urls for Bank connection
Fixed Issues
$ #50448
PROPOSAL:
Tests
It's just polish to remove test code
Offline tests
It's just polish to remove test code
QA Steps
It's just polish to remove test code
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
Screen.Recording.2024-10-24.at.11.44.11.mov
MacOS: Desktop