-
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
Chore/52820 workspace cards cleanup #52871
Chore/52820 workspace cards cleanup #52871
Conversation
@DylanDylann 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] |
@koko57 Step 2 on workspace C seems to be confusing to me
I think it should be
|
@DylanDylann yes, you're right, fixing it |
@koko57 We don't reset Screen.Recording.2024-11-22.at.10.08.22.movMy suggestion is that we reset |
data.cardNumber = Object.keys(filteredCardList).at(0); | ||
data.encryptedCardNumber = Object.values(filteredCardList).at(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.
@koko57 I believe that the two fields are different
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.
what do you mean?
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.
you have the key - "480801XXXXX2554" for the card name and the value "v11:47A..." for the encryptedCradNumber
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 In your code change, you set two fields to the same value
data.cardNumber = Object.keys(filteredCardList).at(0);
data.encryptedCardNumber = Object.values(filteredCardList).at(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.
Object.keys vs Object.values? how they are the same
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'm getting the first key "480801XXXXX2554" and it's value "v11:47A..." f
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.
Sorry, my bad
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 is fine
@@ -64,11 +68,19 @@ function WorkspaceMemberNewCardPage({route, personalDetails}: WorkspaceMemberNew | |||
}); | |||
Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW.getRoute(policyID, ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID))); | |||
} else { | |||
const data: Partial<AssignCardData> = { | |||
email: memberLogin, |
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: Let's add bankName value here
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, wouldn't say that is a NAB, I removed setting the feed in the assign card flow
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 It is a NAB because we already saved feed on the route. But I think we still need to fix it
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, you're saving the feed on the route but not in the Onyx
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 Let's add cardName
along with email
let currentStep: AssignCardStep = CONST.COMPANY_CARD.STEP.ASSIGNEE; | ||
|
||
if (Object.keys(policy?.employeeList ?? {}).length === 1) { | ||
data.email = Object.keys(policy?.employeeList ?? {}).at(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.
Let's add cardName
along with email
@@ -64,11 +68,19 @@ function WorkspaceMemberNewCardPage({route, personalDetails}: WorkspaceMemberNew | |||
}); | |||
Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW.getRoute(policyID, ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID))); | |||
} else { | |||
const data: Partial<AssignCardData> = { | |||
email: memberLogin, |
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 Let's add cardName
along with email
if (Object.keys(policy?.employeeList ?? {}).length === 1) { | ||
const userEmail = Object.keys(policy?.employeeList ?? {}).at(0) ?? ''; | ||
data.email = userEmail; | ||
const personalDetails = PersonalDetailsUtils.getPersonalDetailByEmail(userEmail); |
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 NAB Let's create a util function to get card member name
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'll be done in my other PR #52735 - if it's a NAB here I will improve it in the other PR after this one is merged
email: memberLogin, | ||
}, | ||
currentStep, | ||
data, | ||
isEditing: false, | ||
}); | ||
Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS_ASSIGN_CARD.getRoute(policyID, selectedFeed, ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID))); |
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 The App displays the asignee step a moment before moving to the correct page. I think we need to wait for Onyx.update before navigating (maybe use setNavigationActionToMicrotaskQueue)
Screen.Recording.2024-11-22.at.11.39.33.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.
fixed
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-22.at.11.39.33.movAndroid: mWeb ChromeScreen.Recording.2024-11-22.at.11.38.39.moviOS: NativeScreen.Recording.2024-11-22.at.11.37.46.moviOS: mWeb SafariScreen.Recording.2024-11-22.at.11.38.10.movMacOS: Chrome / SafariScreen.Recording.2024-11-22.at.11.34.00.movMacOS: DesktopScreen.Recording.2024-11-22.at.11.36.35.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.
Thanks!
@@ -352,6 +353,16 @@ function getSelectedFeed(lastSelectedFeed: OnyxEntry<CompanyCardFeed>, cardFeeds | |||
return lastSelectedFeed ?? defaultFeed; | |||
} | |||
|
|||
function getFilteredCardList(list?: WorkspaceCardsList) { | |||
const {cardList, ...cards} = list ?? {}; | |||
// We need to filter out cards which already has been assigned |
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 need to filter out cards which already has been assigned | |
// We need to filter out cards which already has been assigned |
✋ 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.66-0 🚀
|
Tested and this case passed!
This worked for custom feeds but not direct feeds.
This worked with custom feeds but not direct feeds.
All good! |
I don't think the cases not working are blockers, so checking off and flagging in slack. |
Agree not a blocker, thanks! |
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.66-8 🚀
|
Explanation of Change
Fixed Issues
$ #52820
PROPOSAL:
Tests
PREREQUISITES: ideally 4 workspaces with Company Cards enabled and a feed added
Workspace A - 1 member, multiple cards to assign
Workspace B - several members, 1 card to assign (if you don't have a workspace with only 1 card you can change this code from)
to
Workspace C - 1 member, 1 card to assign
Workspace D - several members, several cards to assign
Workspace A
Workspace B
Workspace C
Workspace D
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Screen.Recording.2024-11-21.at.17.17.23.mp4
Screen.Recording.2024-11-21.at.17.06.33.mp4
Screen.Recording.2024-11-21.at.17.06.10.mp4
MacOS: Desktop