Skip to content

Commit 5d184ee

Browse files
authored
Merge pull request Expensify#91176 from Expensify/alberto-csvBetaGo
Remove CSV Card Import beta
2 parents eb51454 + 3179bd5 commit 5d184ee

6 files changed

Lines changed: 8 additions & 19 deletions

File tree

src/CONST/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,6 @@ const CONST = {
895895
BETAS: {
896896
ALL: 'all',
897897
ASAP_SUBMIT: 'asapSubmit',
898-
CSV_CARD_IMPORT: 'csvCardImport',
899898
CUSTOM_AGENT: 'customAgent',
900899
DEFAULT_ROOMS: 'defaultRooms',
901900
PREVENT_SPOTNANA_TRAVEL: 'preventSpotnanaTravel',

src/hooks/useFeedKeysWithAssignedCards.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import useOnyx from './useOnyx';
88
type FeedKeysWithAssignedCards = Record<string, true>;
99

1010
function useFeedKeysWithAssignedCards(): FeedKeysWithAssignedCards | undefined {
11-
const [betas] = useOnyx(ONYXKEYS.BETAS);
12-
const feedKeysWithCardsSelector = useCallback((allWorkspaceCards: OnyxCollection<WorkspaceCardsList>) => buildFeedKeysWithAssignedCards(allWorkspaceCards, betas), [betas]);
11+
const feedKeysWithCardsSelector = useCallback((allWorkspaceCards: OnyxCollection<WorkspaceCardsList>) => buildFeedKeysWithAssignedCards(allWorkspaceCards), []);
1312
const [feedKeysWithCards] = useOnyx(ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST, {
1413
selector: feedKeysWithCardsSelector,
1514
});

src/pages/settings/Wallet/WalletPage/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import useNetwork from '@hooks/useNetwork';
3333
import useOnyx from '@hooks/useOnyx';
3434
import usePaymentMethodState from '@hooks/usePaymentMethodState';
3535
import type {FormattedSelectedPaymentMethod} from '@hooks/usePaymentMethodState/types';
36-
import usePermissions from '@hooks/usePermissions';
3736
import useResponsiveLayout from '@hooks/useResponsiveLayout';
3837
import useTheme from '@hooks/useTheme';
3938
import useThemeStyles from '@hooks/useThemeStyles';
@@ -115,7 +114,6 @@ function WalletPage() {
115114
const styles = useThemeStyles();
116115
const network = useNetwork();
117116
const {shouldUseNarrowLayout} = useResponsiveLayout();
118-
const {isBetaEnabled} = usePermissions();
119117
const {paymentMethod, setPaymentMethod, resetSelectedPaymentMethodData} = usePaymentMethodState();
120118
const {showConfirmModal} = useConfirmModal();
121119
const [shouldShowLoadingSpinner, setShouldShowLoadingSpinner] = useState(false);
@@ -612,7 +610,7 @@ function WalletPage() {
612610
};
613611

614612
const cardThreeDotsMenuItems = useMemo(() => {
615-
const shouldShowCSVImportItems = selectedCard?.bank === CONST.COMPANY_CARD.FEED_BANK_NAME.UPLOAD && isBetaEnabled(CONST.BETAS.CSV_CARD_IMPORT);
613+
const shouldShowCSVImportItems = selectedCard?.bank === CONST.COMPANY_CARD.FEED_BANK_NAME.UPLOAD;
616614
return [
617615
...(shouldUseNarrowLayout ? [bottomMountItem] : []),
618616
{
@@ -659,7 +657,7 @@ function WalletPage() {
659657
]
660658
: []),
661659
];
662-
}, [bottomMountItem, confirmDeleteCard, isBetaEnabled, icons.MoneySearch, icons.Table, icons.Trashcan, paymentMethod.methodID, selectedCard?.bank, shouldUseNarrowLayout, translate]);
660+
}, [bottomMountItem, confirmDeleteCard, icons.MoneySearch, icons.Table, icons.Trashcan, paymentMethod.methodID, selectedCard?.bank, shouldUseNarrowLayout, translate]);
663661

664662
if (isLoadingApp) {
665663
const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'WalletPage', isLoadingApp: !!isLoadingApp};

src/pages/workspace/companyCards/addNew/SelectFeedType.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import SingleSelectListItem from '@components/SelectionList/ListItem/SingleSelec
1010
import Text from '@components/Text';
1111
import useLocalize from '@hooks/useLocalize';
1212
import useOnyx from '@hooks/useOnyx';
13-
import usePermissions from '@hooks/usePermissions';
1413
import useThemeStyles from '@hooks/useThemeStyles';
1514
import {isPlaidSupportedCountry} from '@libs/CardUtils';
1615
import {setAddNewCompanyCardStepAndData} from '@userActions/CompanyCards';
@@ -23,8 +22,6 @@ function SelectFeedType() {
2322
const [addNewCard] = useOnyx(ONYXKEYS.ADD_NEW_COMPANY_CARD);
2423
const [localTypeSelected, setLocalTypeSelected] = useState<ValueOf<typeof CONST.COMPANY_CARDS.FEED_TYPE>>();
2524
const [hasError, setHasError] = useState(false);
26-
const {isBetaEnabled} = usePermissions();
27-
const isCSVCardImportBetaEnabled = isBetaEnabled(CONST.BETAS.CSV_CARD_IMPORT);
2825
const doesCountrySupportPlaid = isPlaidSupportedCountry(addNewCard?.data?.selectedCountry);
2926
const isUSCountry = addNewCard?.data?.selectedCountry === CONST.COUNTRY.US;
3027
const defaultTypeSelected = addNewCard?.data.selectedFeedType ?? (doesCountrySupportPlaid ? CONST.COMPANY_CARDS.FEED_TYPE.DIRECT : CONST.COMPANY_CARDS.FEED_TYPE.CUSTOM);
@@ -89,8 +86,7 @@ function SelectFeedType() {
8986
isSelected: typeSelected === CONST.COMPANY_CARDS.FEED_TYPE.FILE_IMPORT,
9087
};
9188

92-
const baseItems = doesCountrySupportPlaid ? [directFeedItem, commercialFeedItem] : [commercialFeedItem];
93-
const finalData = isCSVCardImportBetaEnabled ? [...baseItems, fileImportItem] : baseItems;
89+
const finalData = doesCountrySupportPlaid ? [directFeedItem, commercialFeedItem, fileImportItem] : [commercialFeedItem, fileImportItem];
9490

9591
const confirmButtonOptions = useMemo(
9692
() => ({

src/selectors/Card.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
22
import {getExpensifyCardFeedsForDisplay} from '@libs/CardFeedUtils';
33
import {isCard, isCardHiddenFromSearch, isCSVFeedOrExpensifyCard, isExpensifyCard, isPersonalCard, supportsPINManagementFeatures} from '@libs/CardUtils';
44
import {filterObject} from '@libs/ObjectUtils';
5-
import Permissions from '@libs/Permissions';
65
import CONST from '@src/CONST';
76
import ONYXKEYS from '@src/ONYXKEYS';
87
import type {CardList, NonPersonalAndWorkspaceCardListDerivedValue, WorkspaceCardsList} from '@src/types/onyx';
9-
import type Beta from '@src/types/onyx/Beta';
108

119
/**
1210
* Builds a lightweight map of "${domainID}_${feedName}" keys that have card entries.
1311
* A feed counts as having cards when:
1412
* - it has at least one assigned card object, OR
15-
* - it is a CSV feed, the CSV_CARD_IMPORT beta is enabled, and it has at least one entry in `cardList`.
13+
* - it is a CSV feed, and it has at least one entry in `cardList`.
1614
*
1715
* Input key format: "cards_${domainID}_${feedName}" (e.g., "cards_12345_oauth.chase.com")
1816
* Output key format: "${domainID}_${feedName}" (e.g., "12345_oauth.chase.com")
1917
*/
20-
const buildFeedKeysWithAssignedCards = (allWorkspaceCards: OnyxCollection<WorkspaceCardsList>, betas?: OnyxEntry<Beta[]>): Record<string, true> => {
18+
const buildFeedKeysWithAssignedCards = (allWorkspaceCards: OnyxCollection<WorkspaceCardsList>): Record<string, true> => {
2119
const result: Record<string, true> = {};
22-
const isCSVCardImportBetaEnabled = Permissions.isBetaEnabled(CONST.BETAS.CSV_CARD_IMPORT, betas);
2320

2421
for (const [key, cards] of Object.entries(allWorkspaceCards ?? {})) {
2522
if (!cards || typeof cards !== 'object') {
@@ -30,7 +27,7 @@ const buildFeedKeysWithAssignedCards = (allWorkspaceCards: OnyxCollection<Worksp
3027
const cardFeedName = feedKey.split('_').slice(1).join('_');
3128
const hasAssignedCards = Object.keys(cards).some((k) => k !== 'cardList');
3229
const isCSVFeed = isCSVFeedOrExpensifyCard(cardFeedName);
33-
const hasCardsToAssign = isCSVCardImportBetaEnabled && isCSVFeed && Object.keys(cards.cardList ?? {}).length > 0;
30+
const hasCardsToAssign = isCSVFeed && Object.keys(cards.cardList ?? {}).length > 0;
3431
if (hasAssignedCards || hasCardsToAssign) {
3532
result[feedKey] = true;
3633
}

tests/unit/CardUtilsTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ describe('CardUtils', () => {
11641164
},
11651165
},
11661166
};
1167-
expect(buildFeedKeysWithAssignedCards(allWorkspaceCards as unknown as OnyxCollection<WorkspaceCardsList>, [CONST.BETAS.CSV_CARD_IMPORT])).toStrictEqual({
1167+
expect(buildFeedKeysWithAssignedCards(allWorkspaceCards as unknown as OnyxCollection<WorkspaceCardsList>)).toStrictEqual({
11681168
[`12345_${csvFeed}`]: true,
11691169
});
11701170
});

0 commit comments

Comments
 (0)