Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6892,6 +6892,8 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
merchants: 'Händler',
noAvailableCards: 'Alle Karten haben bereits eine Regel',
noAvailableCardsSubtitle: 'Bearbeiten Sie eine vorhandene Kartenregel, um Änderungen vorzunehmen',
noCardsIssuedTitle: 'Keine Expensify Karten ausgestellt',
noCardsIssuedSubtitle: 'Geben Sie Expensify Karten aus, um Ausgabelimits festzulegen',
max: 'Max',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Fluggesellschaften',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6928,6 +6928,8 @@ const translations = {
merchants: 'Merchants',
noAvailableCards: 'All cards already have a rule',
noAvailableCardsSubtitle: 'Edit an existing card rule to make changes',
noCardsIssuedTitle: 'No Expensify Cards issued',
noCardsIssuedSubtitle: 'Issue Expensify Cards to create spend rules',
max: 'Max',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Airlines',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6795,6 +6795,8 @@ ${amount} para ${merchant} - ${date}`,
merchants: 'Comerciantes',
noAvailableCards: 'No hay tarjetas activas en este feed',
noAvailableCardsSubtitle: 'Edita una regla de tarjeta existente para hacer cambios',
noCardsIssuedTitle: 'No se han emitido Tarjetas Expensify',
noCardsIssuedSubtitle: 'Emite Tarjetas Expensify para crear reglas de gasto',
max: 'Máx.',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Aerolíneas',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6914,6 +6914,8 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
merchants: 'Commerçants',
noAvailableCards: 'Toutes les cartes ont déjà une règle',
noAvailableCardsSubtitle: 'Modifier une règle de carte existante pour apporter des changements',
noCardsIssuedTitle: 'Aucune Carte Expensify émise',
noCardsIssuedSubtitle: 'Émettre des cartes Expensify pour créer des règles de dépense',
max: 'Max',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Compagnies aériennes',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6877,6 +6877,8 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
merchants: 'Esercenti',
noAvailableCards: 'Tutte le carte hanno già una regola',
noAvailableCardsSubtitle: 'Modifica una regola carta esistente per apportare modifiche',
noCardsIssuedTitle: 'Nessuna Carta Expensify emessa',
noCardsIssuedSubtitle: 'Emetti Carte Expensify per creare regole di spesa',
max: 'Massimo',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Compagnie aeree',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6800,6 +6800,8 @@ ${reportName}
merchants: '加盟店',
noAvailableCards: 'すべてのカードにはすでにルールがあります',
noAvailableCardsSubtitle: '既存のカードルールを編集して変更します',
noCardsIssuedTitle: 'Expensify カードは発行されていません',
noCardsIssuedSubtitle: 'Expensify カードを発行して支出ルールを作成しましょう',
max: '最大',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: '航空会社',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6857,6 +6857,8 @@ Voeg meer bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
merchants: 'Handelaars',
noAvailableCards: 'Alle kaarten hebben al een regel',
noAvailableCardsSubtitle: 'Bewerk een bestaande kaartregel om wijzigingen aan te brengen',
noCardsIssuedTitle: 'Geen Expensify Kaarten uitgegeven',
noCardsIssuedSubtitle: 'Geef Expensify Kaarten uit om bestedingsregels te maken',
max: 'Max',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Luchtvaartmaatschappijen',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6849,6 +6849,8 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
merchants: 'Sprzedawcy',
noAvailableCards: 'Wszystkie karty mają już regułę',
noAvailableCardsSubtitle: 'Edytuj istniejącą regułę karty, aby wprowadzić zmiany',
noCardsIssuedTitle: 'Nie wydano żadnych Kart Expensify',
noCardsIssuedSubtitle: 'Wydaj karty Expensify, aby utworzyć zasady wydatków',
max: 'Maks',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Linie lotnicze',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6855,6 +6855,8 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
merchants: 'Comerciantes',
noAvailableCards: 'Todos os cartões já têm uma regra',
noAvailableCardsSubtitle: 'Edite uma regra de cartão existente para fazer alterações',
noCardsIssuedTitle: 'Nenhum Cartão Expensify emitido',
noCardsIssuedSubtitle: 'Emita Cartões Expensify para criar regras de gastos',
max: 'Máx.',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: 'Companhias aéreas',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6682,6 +6682,8 @@ ${reportName}
merchants: '商家',
noAvailableCards: '所有卡片已具有规则',
noAvailableCardsSubtitle: '编辑现有的卡片规则以进行更改',
noCardsIssuedTitle: '尚未发放 Expensify 卡',
noCardsIssuedSubtitle: '发放 Expensify 卡以创建支出规则',
max: '最大',
categoryOptions: {
[CONST.SPEND_RULES.CATEGORIES.AIRLINES]: '航空公司',
Expand Down
30 changes: 18 additions & 12 deletions src/pages/workspace/rules/SpendRules/SpendRuleCardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE);
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
const [cardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${defaultFundID}_${CONST.EXPENSIFY_CARD.BANK}`, {selector: filterInactiveCards});
const {cardList, ...allCards} = cardsList ?? {};
const hasAnyCards = Object.keys(allCards).length > 0;

const [expensifyCardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS}${defaultFundID}`);
const [spendRuleForm] = useOnyx(ONYXKEYS.FORMS.SPEND_RULE_FORM);
const illustrations = useMemoizedLazyIllustrations(['HandCard']);
Expand Down Expand Up @@ -184,8 +187,9 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
goBack();
};

const hasCards = listData.length > 0;
const hasEligibleCards = eligibleCards.length > 0;
const headerMessage = hasEligibleCards ? getHeaderMessage(listData.length > 0, false, inputValue, countryCode, false) : '';
const headerMessage = hasEligibleCards ? getHeaderMessage(hasCards, false, inputValue, countryCode, false) : '';

return (
<AccessOrNotFoundWrapper
Expand Down Expand Up @@ -239,17 +243,19 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
shouldUpdateFocusedIndex
shouldPreventDefaultFocusOnSelectRow={!canUseTouchScreen()}
listEmptyContent={
<ScrollView contentContainerStyle={[styles.flexGrow1]}>
<BlockingView
icon={illustrations.HandCard}
iconWidth={variables.iconSection}
iconHeight={variables.iconSection}
title={inputValue.trim() ? translate('common.noResultsFound') : translate('workspace.rules.spendRules.noAvailableCards')}
titleStyles={styles.mb2}
subtitle={translate('workspace.rules.spendRules.noAvailableCardsSubtitle')}
subtitleStyle={styles.textSupporting}
/>
</ScrollView>
!inputValue.trim() || hasCards ? (
<ScrollView contentContainerStyle={[styles.flexGrow1]}>
<BlockingView
icon={illustrations.HandCard}
iconWidth={variables.iconSection}
iconHeight={variables.iconSection}
title={translate(hasAnyCards ? 'workspace.rules.spendRules.noAvailableCards' : 'workspace.rules.spendRules.noCardsIssuedTitle')}
titleStyles={styles.mb2}
subtitle={translate(hasAnyCards ? 'workspace.rules.spendRules.noAvailableCardsSubtitle' : 'workspace.rules.spendRules.noCardsIssuedSubtitle')}
subtitleStyle={styles.textSupporting}
/>
</ScrollView>
) : undefined
}
footerContent={
<FormAlertWithSubmitButton
Expand Down
Loading