[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 |
mountiny
left a comment
There was a problem hiding this comment.
I am finding it a bit unintuitive that the feedType and cardFeed is same in this case
src/libs/CardUtils.ts
Outdated
|
|
||
| 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.
I find it confusing that the cardFeed is used here for the same that feedType represents.
There was a problem hiding this comment.
@mountiny we were sending cardFeed as a feedType before, what name do you suggest?
There was a problem hiding this comment.
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.
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.
Yes please 🙌 or do you have any concerns? maybe I am reading it wrong
There was a problem hiding this comment.
FeedKey maybe? as they are all mainly used as key in the settings object
src/libs/CardUtils.ts
Outdated
| firstAvailableNumber++; | ||
| } | ||
|
|
||
| return `${cardFeed}${firstAvailableNumber}`; |
There was a problem hiding this comment.
Can you please add unit test for this? Thanks!
src/libs/actions/CompanyCards.ts
Outdated
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.LAST_SELECTED_FEED}${policyID}`, | ||
| value: feedType, | ||
| value: cardFeed, |
There was a problem hiding this comment.
| 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 |
|
✋ 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 🚀
|
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID}`, | ||
| value: { | ||
| isLoading: true, |
There was a problem hiding this comment.
Only adding isLoading: true in optimisticData / failureData without changing it back to false led to the following issue:
which we fixed by adding isLoading: false in the finallyData.




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>.exfyaccountvcf1feed requestedvcf2PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop