-
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
[InternalQA] fix: always send feedType with the order number for custom feeds #55223
[InternalQA] fix: always send feedType with the order number for custom feeds #55223
Conversation
@alitoshmatov 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] |
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@mountiny eslint fixed |
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 am finding it a bit unintuitive that the feedType and cardFeed is same in this case
src/libs/CardUtils.ts
Outdated
@@ -451,6 +451,28 @@ const getDescriptionForPolicyDomainCard = (domainName: string): string => { | |||
return domainName; | |||
}; | |||
|
|||
const CUSTOM_FEEDS = [CONST.COMPANY_CARD.FEED_BANK_NAME.MASTER_CARD, CONST.COMPANY_CARD.FEED_BANK_NAME.VISA, CONST.COMPANY_CARD.FEED_BANK_NAME.AMEX]; | |||
|
|||
function getFeedType(cardFeed: CompanyCardFeed, cardFeeds: OnyxEntry<CardFeeds>): CompanyCardFeedWithNumber { |
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 find it confusing that the cardFeed is used here for the same that feedType represents.
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 we were sending cardFeed as a feedType before, what name do you suggest?
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 do you mean? I think if the variable only contains the key vcf
etc then it should be feedType and cardFeed would be the entire object maybe?
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.
no, CompanyCardFeed type is a value of FEED_BANK_NAME, so it's only a name. I can rename this to feedName if you prefer
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.
Yes please 🙌 or do you have any concerns? maybe I am reading it wrong
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.
FeedKey maybe? as they are all mainly used as key in the settings object
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.
oki, done
src/libs/CardUtils.ts
Outdated
firstAvailableNumber++; | ||
} | ||
|
||
return `${cardFeed}${firstAvailableNumber}`; |
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.
Can you please add unit test for this? Thanks!
src/libs/actions/CompanyCards.ts
Outdated
const optimisticData: OnyxUpdate[] = [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.LAST_SELECTED_FEED}${policyID}`, | ||
value: feedType, | ||
value: cardFeed, |
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.
value: cardFeed, | |
value: feedType, |
If we haven't added any vcf card, I think the first vcf feed should be vcf (instead of vcf1). @koko57 Wdyt? |
@DylanDylann If you haven't added any that means that you had it from the backend earlier. We're not changing the existing values here |
Reviewer Checklist
Screenshots/Videos |
@koko57 Also please resolve conflict |
as per this discussion we're not doing it now |
The change looks fine. There is a minor thing that need to be confirmed |
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!
✋ 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.87-0 🚀
|
Tested and works great! I was able to add two Visa feeds and assign cards under both and everything works well. Checked the backend and everything looks good with the naming convention, eg: |
🚀 Deployed to production by https://github.com/Beamanator in version: 9.0.87-3 🚀
|
Explanation of Change
Fixed Issues
$ #54891
$ #52002
PROPOSAL:
Tests
Prerequisites: Company Cards enabled
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
+@expensify-policy<policyID>.exfy
accountvcf1
feed requestedvcf2
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