-
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
Feat/44305 be integration configure expensify cards for policy #46564
Feat/44305 be integration configure expensify cards for policy #46564
Conversation
@koko57 Discussing in DM, logs are here. This error means the user is not a domain admin. Have you created this policy and account recently? We had this bug when we initially deployed this command, where the existing policy members and admins were not added as domain admins/ members which would explain this error. But this should be fixed for new workspace feeds |
src/libs/PolicyUtils.ts
Outdated
if (!policy) { | ||
return ''; | ||
} | ||
return policy.workspaceAccountID ?? ''; |
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 think the workspaceAccountID should be Number same as the user accountID
src/types/onyx/Policy.ts
Outdated
@@ -1536,6 +1536,9 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback< | |||
|
|||
/** Whether GL codes are enabled */ | |||
glCodes?: boolean; | |||
|
|||
/** Workspace account ID configured for Expensify Card */ | |||
workspaceAccountID?: 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.
I think this has to be a number
@DylanDylann @mountiny 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] |
opening this one for review as I can't add a bank account through VBBA for a new Workspace |
@DylanDylann I've addressed your comment with the policyID being sent instead of workspaceAccountID, now I will address the bug you've found |
@DylanDylann issue with not redirecting to the VBBA fixed |
const eligibleBankAccounts = CardUtils.getEligibleBankAccountsForCard(bankAccountsList); | ||
|
||
return eligibleBankAccounts.map((bankAccount) => { | ||
const bankName = (bankAccount.accountData?.addressName ?? '') as BankName; | ||
const bankAccountNumber = bankAccount.accountData?.accountNumber ?? ''; | ||
// TODO: change 1 to 0 - applied for testing purposes, as sometimes accountData lacks fundID | ||
const bankAccountID = bankAccount.accountData?.fundID ?? 1; | ||
const bankAccountID = bankAccount.accountData?.bankAccountID ?? 0; |
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.
- First question, why do we use fundID before?
- Why do we use 0 as the default value in API params? If
bankAccount.accountData?.bankAccountID
is undefined we should prevent from calling API instead of calling API with value as 0
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 should we use fundID or bankAccountID?
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.
it should be bankAccountID
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.
@koko57 Bump
Why do we use 0 as the default value in API params? If bankAccount.accountData?.bankAccountID is undefined we should prevent from calling API instead of calling API with value as 0
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.
@DylanDylann for eslint not to complain, but ok, fixed it for you
@DylanDylann Have you connected the bank account via plaid? I can see this error can only show up if you have connected the account with Plaid as we might need to do some additional checks |
@mountiny I connected bank accounts following this guideline |
@koko57 Thanks for your update. I will review again today |
@DylanDylann great, thanks! |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2024-08-12.at.23.34.46.mov |
NOTE:The ConfigureExpensifyCardsForPolicy API still returns the wrong data. We need to test again in #46570 |
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, one very minor comment, all yours @MariaHCD
@@ -22,7 +22,7 @@ function WorkspaceCardListHeader() { | |||
const isLessThanMediumScreen = isMediumScreenWidth || isSmallScreenWidth; | |||
|
|||
// TODO: uncomment the code line below to use cardSettings data from Onyx when it's supported | |||
// const [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_EXPENSIFY_CARD_SETTINGS}${policyID}`); | |||
// const [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.EXPENSIFY_CARD_SETTINGS}${policyID}`); |
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 [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.EXPENSIFY_CARD_SETTINGS}${policyID}`); | |
// const [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.EXPENSIFY_CARD_SETTINGS}${workspaceAccountID}`); |
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! I will merge this as Maria is ooo tomorrow
✋ 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/mountiny in version: 9.0.20-0 🚀
|
FYI I believe this was deployed to prod yesterday, from this checklist - #47356 |
Details
Fixed Issues
$ #44305
PROPOSAL:
Tests
PREREQUISITES: all betas/workspaceFeed beta enabled
Offline tests
QA Steps
PREREQUISITES: all betas/workspaceFeed beta enabled
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label 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