-
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
[NoQA] [3rd Party Feeds] Workspace feeds clean up #49928
[NoQA] [3rd Party Feeds] Workspace feeds clean up #49928
Conversation
…an-up # Conflicts: # src/languages/en.ts # src/languages/es.ts
…an-up # Conflicts: # src/libs/ReportActionsUtils.ts # src/libs/actions/Policy/Policy.ts # src/pages/workspace/companyCards/WorkspaceCompanyCardFeedSelectorPage.tsx # src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx
…tup API call; add getCardFeedName function
…an-up # Conflicts: # src/libs/ReportActionsUtils.ts
@allgandalf conflicts are resolved! |
@allgandalf Any ETA on reviewing this one? |
~ half hour, testing the broken conenction flow now, almost done |
@VickyStash I would need active feed ? are there credentials or something or do i need your account? |
@allgandalf You can try to login in my account, just ping me in slack. |
This option is better no? otherwise i have to ping you for magic code everytime I login on all platforms |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2024-10-17.at.3.12.59.PM.movMacOS: DesktopScreen.Recording.2024-10-17.at.3.23.08.PM.movAndroid: NativeScreen.Recording.2024-10-17.at.3.31.31.PM.movAndroid: mWeb ChromeScreen.Recording.2024-10-17.at.3.27.09.PM.moviOS: NativeScreen.Recording.2024-10-17.at.3.39.22.PM.moviOS: mWeb SafariScreen.Recording.2024-10-17.at.3.42.49.PM.mov |
@VickyStash conflicts on the branch :)) |
…an-up # Conflicts: # src/languages/en.ts # src/languages/es.ts # src/pages/workspace/companyCards/addNew/AddNewCardPage.tsx # src/pages/workspace/companyCards/addNew/CardInstructionsStep.tsx # src/pages/workspace/companyCards/addNew/CardTypeStep.tsx # src/pages/workspace/companyCards/addNew/DetailsStep.tsx
Recording after conflict resolution: 1Monosnap.screencast.2024-10-17.16-50-26.mp4 |
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 neat, Code changes look good to me, up for your review @mountiny
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.
Great job @VickyStash @allgandalf
@@ -4421,6 +4435,23 @@ function enablePolicyAutoReimbursementLimit(policyID: string, enabled: boolean) | |||
}); | |||
} | |||
|
|||
function addNewCompanyCardsFeed(policyID: string, feedType: string, feedDetails: 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.
Why are these in Policy.ts? I think we could have created something like CompanyCards.ts actions file for these actions
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 can prepare a follow-up and move all of the company cards related methods there!
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.
Follow uo PR is ready: #51080
cc @allgandalf
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@mountiny Do we need to QA this PR? Can you pls help with more QA friendly steps? Seems like current is more backend heavy checks. |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.51-1 🚀
|
@mvtglobally sorry yeah I agree the tests are more technical. I have marked this as NoQA as testing the custom feeds will be done internally soon in production |
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.51-4 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.51-4 🚀
|
@@ -61,8 +61,8 @@ function WorkspaceMemberDetailsPage({personalDetails, policy, route}: WorkspaceM | |||
const {translate} = useLocalize(); | |||
const StyleUtils = useStyleUtils(); | |||
const currentUserPersonalDetails = useCurrentUserPersonalDetails(); | |||
const [expensifyCardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${CONST.EXPENSIFY_CARD.BANK}`); | |||
const [allCardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}`); | |||
const [allCardsList] = useOnyx(`${ONYXKEYS.CARD_LIST}`); |
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.
@VickyStash why was this change necessary?
- const [allCardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}`);
+ const [allCardsList] = useOnyx(`${ONYXKEYS.CARD_LIST}`);
coming from #50441, more context here: #50441 (comment) and #50441 (comment)
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 On the members details page, we need to show not only expensify cards, but also custom feeds/direct feeds cards.
They are not stored in the cards_
right away, we need to do API calls for every feed type to get the data, which can be a pretty big amount of calls.
So I've asked @robertjchen about the way I can get all user-related cards at once. And he suggested going with cardList_
key.
So that's the reason of the update.
return []; | ||
} | ||
return Object.values(expensifyCardsList).filter((expensifyCard) => expensifyCard.accountID === accountID); | ||
}, [expensifyCardsList, accountID]); | ||
return Object.values(allCardsList ?? {}).filter((card) => card.accountID === accountID && workspaceAccountID.toString() === card.fundID); |
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.
@VickyStash Could you please explain why we add this condition workspaceAccountID.toString() === card.fundID
?
It caused this bug: #51467 (comment)
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.
cc @allgandalf
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 guess this condition ensures that we only see the cards assigned on this policy in the workspace member page, which is expected
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 Could you ensure that the BE always returns fundID on cards_ fields (expensify cards)
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.
Well the fundID is the id in the key so its (cards_fundID_Expensify Card so its kinda duplication
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 just tried again with a new account and fundID has appeared. It seems this only happen with cards that is created long time ago
canDismissError={false} | ||
errorRowStyles={styles.ph5} | ||
> | ||
<View style={[styles.w100, styles.ph5, !shouldChangeLayout ? [styles.pv2, styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween] : styles.pb2]}> | ||
<PressableWithFeedback | ||
onPress={() => Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS_SELECT_FEED.getRoute(policyID))} | ||
style={[styles.flexRow, styles.alignItemsCenter, styles.gap3, shouldChangeLayout && styles.mb3]} | ||
accessibilityLabel={cardFeeds?.companyCardNicknames?.[selectedFeed] ?? ''} | ||
accessibilityLabel={feedName} |
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.
We should had used a custom formatted feed name here, like for visa
, it should had been: visa cards
.
This caused #51558
Details
Workspace feeds clean up, and API calls integration.
Fixed Issues
$ #49690
PROPOSAL: N/A
Tests
COMPANY_CARD_FEEDS
beta enabled (❗ but notDIRECT_FEEDS
beta).Add company cards
button and go through the new feed adding flow. After you finish you will see pending state of the feed.Card feed name update
andAllow deleting transactions
options work as expected. (❗ TheRemove feed
option won't work since API is in progress.)Assign card
flow and make sure the card is assigned.Unassign card
and make sure it works as expected. (❗Update card
is not working on the API side yet).Offline tests
Same as in the Tests section.
QA Steps
Same as in the Tests section.
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
android1.mp4
Android: mWeb Chrome
android_web1.mp4
iOS: Native
ios1.mp4
iOS: mWeb Safari
ios_web1.mp4
MacOS: Chrome / Safari
web1.mp4
MacOS: Desktop
desktop1.mp4