From b6c91c197c1650505897a641cccfbcaa91317e3a Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 27 Sep 2023 10:54:31 +0800 Subject: [PATCH 01/14] add isExpensifyCard --- src/libs/CardUtils.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 30bb17f3db52..1c4bcf43fbe6 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -10,6 +10,13 @@ function getMonthFromExpirationDateString(expirationDateString: string) { return expirationDateString.substring(0, 2); } +function isExpensifyCard(card: Card) { + if (!card){ + return false; + } + return card.bank === CONST.EXPENSIFY_CARD.BANK; +} + /** * @returns string with a year in YY or YYYY format */ @@ -56,4 +63,4 @@ function maskCard(lastFour = ''): string { return maskedString.replace(/(.{4})/g, '$1 ').trim(); } -export {getDomainCards, getCompanyCards, getMonthFromExpirationDateString, getYearFromExpirationDateString, maskCard}; +export {isExpensifyCard, getDomainCards, getCompanyCards, getMonthFromExpirationDateString, getYearFromExpirationDateString, maskCard}; From 3256ec87589681ec70d45bb1525b3d4b8c73391b Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 10:07:39 +0100 Subject: [PATCH 02/14] add isExpensifyCard --- src/libs/CardUtils.ts | 22 +++++++++++++++++++++- src/libs/TransactionUtils.ts | 8 ++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 1c4bcf43fbe6..260baf245d15 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -1,7 +1,22 @@ import lodash from 'lodash'; +import Onyx from 'react-native-onyx'; import {Card} from '../types/onyx'; import CONST from '../CONST'; import * as OnyxTypes from '../types/onyx'; +import ONYXKEYS, {OnyxValues} from '../ONYXKEYS'; + + +let allCards: OnyxValues[typeof ONYXKEYS.CARD_LIST] = {}; +Onyx.connect({ + key: ONYXKEYS.CARD_LIST, + callback: (val) => { + if (!val || Object.keys(val).length === 0) { + return; + } + + allCards = val; + }, +}); /** * @returns string with a month in MM format @@ -10,7 +25,12 @@ function getMonthFromExpirationDateString(expirationDateString: string) { return expirationDateString.substring(0, 2); } -function isExpensifyCard(card: Card) { +/** + * @param cardID + * @returns boolean + */ +function isExpensifyCard(cardID: string) { + const card = allCards[cardID]; if (!card){ return false; } diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index df2043ce44d5..1bd07f1ceea5 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -223,6 +223,13 @@ function getMerchant(transaction: Transaction): string { return transaction?.modifiedMerchant ? transaction.modifiedMerchant : transaction?.merchant || ''; } +/** + * Return the mccGroup field from the transaction, return the modifiedMCCGroup if present. + */ +function getMCCGroup(transaction: Transaction): string { + return transaction?.modifiedMCCGroup ? transaction.modifiedMCCGroup : transaction?.mccGroup || ''; +} + /** * Return the waypoints field from the transaction, return the modifiedWaypoints if present. */ @@ -368,6 +375,7 @@ export { getAmount, getCurrency, getMerchant, + getMCCGroup, getCreated, getCategory, getBillable, From a65effa3ce86f680162709bd714d22ad87604e47 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 10:38:37 +0100 Subject: [PATCH 03/14] add hasEreceipt --- src/libs/TransactionUtils.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 1bd07f1ceea5..6b7b4abf0686 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -295,6 +295,14 @@ function hasRoute(transaction: Transaction): boolean { return !!transaction?.routes?.route0?.geometry?.coordinates; } + +/** + * Check if the transaction has an Ereceipt + */ +function hasEreceipt(transaction: Transaction): boolean { + return !!transaction?.hasEReceipt; +} + /** * Get the transactions related to a report preview with receipts * Get the details linked to the IOU reportAction @@ -383,6 +391,7 @@ export { getLinkedTransaction, getAllReportTransactions, hasReceipt, + hasEreceipt, hasRoute, isReceiptBeingScanned, getValidWaypoints, From 85ed3cae0b4304b0e4dd318069629fd06c3bc92c Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 10:46:13 +0100 Subject: [PATCH 04/14] add getEReceiptColor --- src/styles/StyleUtils.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/styles/StyleUtils.ts b/src/styles/StyleUtils.ts index acee6512f4e4..6b0233c808d3 100644 --- a/src/styles/StyleUtils.ts +++ b/src/styles/StyleUtils.ts @@ -41,6 +41,7 @@ type AvatarSize = {width: number}; type ParsableStyle = ViewStyle | CSSProperties | ((state: PressableStateCallbackType) => ViewStyle | CSSProperties); type WorkspaceColorStyle = {backgroundColor: ColorValue; fill: ColorValue}; +type EreceiptColorStyle = {backgroundColor: ColorValue; fill: ColorValue}; type ModalPaddingStylesArgs = { shouldAddBottomSafeAreaMargin: boolean; @@ -86,6 +87,15 @@ const workspaceColorOptions: WorkspaceColorStyle[] = [ {backgroundColor: colors.ice700, fill: colors.ice200}, ]; +const eReceiptColorOptions: EreceiptColorStyle[] = [ + {backgroundColor: colors.yellow600, fill: colors.yellow100}, + {backgroundColor: colors.blue800, fill: colors.ice400}, + {backgroundColor: colors.blue400, fill: colors.blue100}, + {backgroundColor: colors.green800, fill: colors.green400}, + {backgroundColor: colors.tangerine800, fill: colors.tangerine400}, + {backgroundColor: colors.pink800, fill: colors.pink400}, +]; + const avatarBorderSizes: Partial> = { [CONST.AVATAR_SIZE.SMALL_SUBSCRIPT]: variables.componentBorderRadiusSmall, [CONST.AVATAR_SIZE.MID_SUBSCRIPT]: variables.componentBorderRadiusSmall, @@ -240,6 +250,16 @@ function getDefaultWorkspaceAvatarColor(workspaceName: string): ViewStyle | CSSP return workspaceColorOptions[colorHash]; } + +/** + * Helper method to return old dot default avatar associated with login + */ +function getEReceiptColor(transactionID: string): ViewStyle | CSSProperties { + const colorHash = UserUtils.hashText(transactionID.trim(), eReceiptColorOptions.length); + + return eReceiptColorOptions[colorHash]; +} + /** * Takes safe area insets and returns padding to use for a View */ @@ -1305,4 +1325,5 @@ export { getDropDownButtonHeight, getAmountFontSizeAndLineHeight, getTransparentColor, + getEReceiptColor, }; From fcf59044b798788534ad6ad75880e87a27d4ba37 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 11:07:06 +0100 Subject: [PATCH 05/14] add getCardDescription --- src/CONST.ts | 7 +++++++ src/languages/en.ts | 3 +++ src/languages/es.ts | 3 +++ src/libs/CardUtils.ts | 17 ++++++++++++++++- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 9f16d7f9ccab..289e41b5842c 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1219,6 +1219,13 @@ const CONST = { INDIVIDUAL: 'individal', NONE: 'none', }, + STATE: { + OPEN: 3, + NOT_ACTIVATED: 4, + STATE_DEACTIVATED: 5, + CLOSED: 6, + STATE_SUSPENDED: 7, + }, }, AVATAR_ROW_SIZE: { DEFAULT: 4, diff --git a/src/languages/en.ts b/src/languages/en.ts index 7e4c4d0c45e2..e48a4b032ee6 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1789,6 +1789,9 @@ export default { tryDifferentEmail: 'Please try a different email', }, }, + cardTransactions: { + notActivated: 'Not activated', + }, distance: { addStop: 'Add stop', deleteWaypoint: 'Delete waypoint', diff --git a/src/languages/es.ts b/src/languages/es.ts index 2c4b3e56523c..d55ee336f594 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2273,6 +2273,9 @@ export default { tryDifferentEmail: 'Por favor intenta con un e-mail diferente', }, }, + cardTransactions: { + notActivated: 'No activado', + }, distance: { addStop: 'Agregar parada', deleteWaypoint: 'Eliminar punto de ruta', diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 260baf245d15..63af8e85567a 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -2,6 +2,7 @@ import lodash from 'lodash'; import Onyx from 'react-native-onyx'; import {Card} from '../types/onyx'; import CONST from '../CONST'; +import * as Localize from './Localize'; import * as OnyxTypes from '../types/onyx'; import ONYXKEYS, {OnyxValues} from '../ONYXKEYS'; @@ -37,6 +38,20 @@ function isExpensifyCard(cardID: string) { return card.bank === CONST.EXPENSIFY_CARD.BANK; } + +/** + * @param cardID + * @returns string in format % - %. + */ +function getCardDescription(cardID: string) { + const card = allCards[cardID]; + if (!card){ + return ''; + } + const cardDescriptor = card.state === CONST.EXPENSIFY_CARD.STATE.NOT_ACTIVATED ? Localize.translateLocal('cardTransactions.notActivated') : card.lastFourPAN; + return `${card.bank} - ${cardDescriptor}`; +} + /** * @returns string with a year in YY or YYYY format */ @@ -83,4 +98,4 @@ function maskCard(lastFour = ''): string { return maskedString.replace(/(.{4})/g, '$1 ').trim(); } -export {isExpensifyCard, getDomainCards, getCompanyCards, getMonthFromExpirationDateString, getYearFromExpirationDateString, maskCard}; +export {isExpensifyCard, getDomainCards, getCompanyCards, getMonthFromExpirationDateString, getYearFromExpirationDateString, maskCard, getCardDescription}; From 2cdfd0508349cc630e1fdef87ac18457bf1e509f Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 11:08:23 +0100 Subject: [PATCH 06/14] prettier --- src/CONST.ts | 2 +- src/libs/CardUtils.ts | 6 ++---- src/libs/TransactionUtils.ts | 1 - src/styles/StyleUtils.ts | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 289e41b5842c..f96eb0f8fa4b 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1222,7 +1222,7 @@ const CONST = { STATE: { OPEN: 3, NOT_ACTIVATED: 4, - STATE_DEACTIVATED: 5, + STATE_DEACTIVATED: 5, CLOSED: 6, STATE_SUSPENDED: 7, }, diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 63af8e85567a..e138034ed327 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -6,7 +6,6 @@ import * as Localize from './Localize'; import * as OnyxTypes from '../types/onyx'; import ONYXKEYS, {OnyxValues} from '../ONYXKEYS'; - let allCards: OnyxValues[typeof ONYXKEYS.CARD_LIST] = {}; Onyx.connect({ key: ONYXKEYS.CARD_LIST, @@ -32,20 +31,19 @@ function getMonthFromExpirationDateString(expirationDateString: string) { */ function isExpensifyCard(cardID: string) { const card = allCards[cardID]; - if (!card){ + if (!card) { return false; } return card.bank === CONST.EXPENSIFY_CARD.BANK; } - /** * @param cardID * @returns string in format % - %. */ function getCardDescription(cardID: string) { const card = allCards[cardID]; - if (!card){ + if (!card) { return ''; } const cardDescriptor = card.state === CONST.EXPENSIFY_CARD.STATE.NOT_ACTIVATED ? Localize.translateLocal('cardTransactions.notActivated') : card.lastFourPAN; diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 6b7b4abf0686..342af3472f6c 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -295,7 +295,6 @@ function hasRoute(transaction: Transaction): boolean { return !!transaction?.routes?.route0?.geometry?.coordinates; } - /** * Check if the transaction has an Ereceipt */ diff --git a/src/styles/StyleUtils.ts b/src/styles/StyleUtils.ts index 6b0233c808d3..fba2f866e4b0 100644 --- a/src/styles/StyleUtils.ts +++ b/src/styles/StyleUtils.ts @@ -250,7 +250,6 @@ function getDefaultWorkspaceAvatarColor(workspaceName: string): ViewStyle | CSSP return workspaceColorOptions[colorHash]; } - /** * Helper method to return old dot default avatar associated with login */ From 516a961be46036c17ef8d5eb8a8e172933f42bfc Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 12:01:10 +0100 Subject: [PATCH 07/14] Add MCC icons --- assets/images/MCCGroupIcons/MCC-Airlines.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Commuter.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Gas.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Goods.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Groceries.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Hotel.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Mail.svg | 4 +++ assets/images/MCCGroupIcons/MCC-Meals.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Misc.svg | 3 ++ assets/images/MCCGroupIcons/MCC-RentalCar.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Services.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Taxi.svg | 3 ++ assets/images/MCCGroupIcons/MCC-Utilities.svg | 4 +++ assets/images/eReceiptIcon.svg | 3 ++ src/CONST.ts | 1 + src/components/Icon/Expensicons.js | 2 ++ src/components/Icon/MCCIcons.js | 29 +++++++++++++++++++ src/languages/en.ts | 2 ++ src/languages/es.ts | 2 ++ 19 files changed, 80 insertions(+) create mode 100644 assets/images/MCCGroupIcons/MCC-Airlines.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Commuter.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Gas.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Goods.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Groceries.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Hotel.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Mail.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Meals.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Misc.svg create mode 100644 assets/images/MCCGroupIcons/MCC-RentalCar.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Services.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Taxi.svg create mode 100644 assets/images/MCCGroupIcons/MCC-Utilities.svg create mode 100644 assets/images/eReceiptIcon.svg create mode 100644 src/components/Icon/MCCIcons.js diff --git a/assets/images/MCCGroupIcons/MCC-Airlines.svg b/assets/images/MCCGroupIcons/MCC-Airlines.svg new file mode 100644 index 000000000000..9d7924cff407 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Airlines.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Commuter.svg b/assets/images/MCCGroupIcons/MCC-Commuter.svg new file mode 100644 index 000000000000..2996c9f5f793 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Commuter.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Gas.svg b/assets/images/MCCGroupIcons/MCC-Gas.svg new file mode 100644 index 000000000000..519882921fb6 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Gas.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Goods.svg b/assets/images/MCCGroupIcons/MCC-Goods.svg new file mode 100644 index 000000000000..2aa86250e9d8 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Goods.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Groceries.svg b/assets/images/MCCGroupIcons/MCC-Groceries.svg new file mode 100644 index 000000000000..e957d6ee0238 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Groceries.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Hotel.svg b/assets/images/MCCGroupIcons/MCC-Hotel.svg new file mode 100644 index 000000000000..8de897bfafff --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Hotel.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Mail.svg b/assets/images/MCCGroupIcons/MCC-Mail.svg new file mode 100644 index 000000000000..56b4d7bd1005 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Mail.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/MCCGroupIcons/MCC-Meals.svg b/assets/images/MCCGroupIcons/MCC-Meals.svg new file mode 100644 index 000000000000..e8b9eab9d803 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Meals.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Misc.svg b/assets/images/MCCGroupIcons/MCC-Misc.svg new file mode 100644 index 000000000000..8bd292d0568f --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Misc.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-RentalCar.svg b/assets/images/MCCGroupIcons/MCC-RentalCar.svg new file mode 100644 index 000000000000..f88d28723569 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-RentalCar.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Services.svg b/assets/images/MCCGroupIcons/MCC-Services.svg new file mode 100644 index 000000000000..f4d632e86581 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Services.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Taxi.svg b/assets/images/MCCGroupIcons/MCC-Taxi.svg new file mode 100644 index 000000000000..89d3eb239371 --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Taxi.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/MCCGroupIcons/MCC-Utilities.svg b/assets/images/MCCGroupIcons/MCC-Utilities.svg new file mode 100644 index 000000000000..464344b41b4e --- /dev/null +++ b/assets/images/MCCGroupIcons/MCC-Utilities.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/eReceiptIcon.svg b/assets/images/eReceiptIcon.svg new file mode 100644 index 000000000000..f4fc8c9fcc34 --- /dev/null +++ b/assets/images/eReceiptIcon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/CONST.ts b/src/CONST.ts index f96eb0f8fa4b..2f92cf2fc4d0 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -688,6 +688,7 @@ const CONST = { }, }, MCC_GROUPS: { + AIRLINES: 'Airlines', COMMUTER: 'Commuter', GAS: 'Gas', GOODS: 'Goods', diff --git a/src/components/Icon/Expensicons.js b/src/components/Icon/Expensicons.js index 810bbc86b5dc..dd106c6b3c20 100644 --- a/src/components/Icon/Expensicons.js +++ b/src/components/Icon/Expensicons.js @@ -124,6 +124,7 @@ import Linkedin from '../../../assets/images/social-linkedin.svg'; import Instagram from '../../../assets/images/social-instagram.svg'; import AddReaction from '../../../assets/images/add-reaction.svg'; import Task from '../../../assets/images/task.svg'; +import EReceiptIcon from '../../../assets/images/eReceiptIcon.svg'; export { ActiveRoomAvatar, @@ -168,6 +169,7 @@ export { Download, DragAndDrop, DragHandles, + EReceiptIcon, Emoji, EmptyStateRoutePending, Exclamation, diff --git a/src/components/Icon/MCCIcons.js b/src/components/Icon/MCCIcons.js new file mode 100644 index 000000000000..fb320e0fb9b5 --- /dev/null +++ b/src/components/Icon/MCCIcons.js @@ -0,0 +1,29 @@ +import Airlines from '../../../assets/images/mccGroupIcons/MCC-Airlines.svg'; +import Commuter from '../../../assets/images/mccGroupIcons/MCC-Commuter.svg'; +import Gas from '../../../assets/images/mccGroupIcons/MCC-Gas.svg'; +import Goods from '../../../assets/images/mccGroupIcons/MCC-Goods.svg'; +import Groceries from '../../../assets/images/mccGroupIcons/MCC-Groceries.svg'; +import Hotel from '../../../assets/images/mccGroupIcons/MCC-Hotel.svg'; +import Mail from '../../../assets/images/mccGroupIcons/MCC-Mail.svg'; +import Meals from '../../../assets/images/mccGroupIcons/MCC-Meals.svg'; +import Rental from '../../../assets/images/mccGroupIcons/MCC-RentalCar.svg'; +import Services from '../../../assets/images/mccGroupIcons/MCC-Services.svg'; +import Taxi from '../../../assets/images/mccGroupIcons/MCC-Taxi.svg'; +import Miscellaneous from '../../../assets/images/mccGroupIcons/MCC-Misc.svg'; +// import Utilities from '../../../assets/images/mccGroupIcons/MCC-Misc.svg'; + + +export { + Airlines, + Commuter, + Gas, + Goods, + Groceries, + Hotel, + Mail, + Meals, + Rental, + Services, + Taxi, + Miscellaneous, +}; diff --git a/src/languages/en.ts b/src/languages/en.ts index e48a4b032ee6..aba98ac7d96a 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1791,6 +1791,8 @@ export default { }, cardTransactions: { notActivated: 'Not activated', + outOfPocketSpend: 'Out-of-pocket spend', + companySpend: 'Company spend', }, distance: { addStop: 'Add stop', diff --git a/src/languages/es.ts b/src/languages/es.ts index d55ee336f594..e95772fb782b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2275,6 +2275,8 @@ export default { }, cardTransactions: { notActivated: 'No activado', + outOfPocketSpend: 'Gasto de bolsillo', + companySpend: 'Gasto de la empresa', }, distance: { addStop: 'Agregar parada', From 4998f1468d558ae7b3c11fbf7e86258ff69e9bbd Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 12:03:58 +0100 Subject: [PATCH 08/14] Add missing Utilities icon --- src/components/Icon/MCCIcons.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Icon/MCCIcons.js b/src/components/Icon/MCCIcons.js index fb320e0fb9b5..cf9d3d55aa7c 100644 --- a/src/components/Icon/MCCIcons.js +++ b/src/components/Icon/MCCIcons.js @@ -10,8 +10,7 @@ import Rental from '../../../assets/images/mccGroupIcons/MCC-RentalCar.svg'; import Services from '../../../assets/images/mccGroupIcons/MCC-Services.svg'; import Taxi from '../../../assets/images/mccGroupIcons/MCC-Taxi.svg'; import Miscellaneous from '../../../assets/images/mccGroupIcons/MCC-Misc.svg'; -// import Utilities from '../../../assets/images/mccGroupIcons/MCC-Misc.svg'; - +import Utilities from '../../../assets/images/mccGroupIcons/MCC-Utilities.svg'; export { Airlines, @@ -26,4 +25,5 @@ export { Services, Taxi, Miscellaneous, + Utilities, }; From 7dd1986a1243e61c7f9710941b22d22d149d61e5 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 12:06:24 +0100 Subject: [PATCH 09/14] update spanish translations from review in slack --- src/languages/es.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index e95772fb782b..4eae97731ffb 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2275,8 +2275,8 @@ export default { }, cardTransactions: { notActivated: 'No activado', - outOfPocketSpend: 'Gasto de bolsillo', - companySpend: 'Gasto de la empresa', + outOfPocketSpend: 'Gastos por cuenta propia', + companySpend: 'Gastos de empresa', }, distance: { addStop: 'Agregar parada', From bd9dc7725dda46490de72074d31f252802e0b979 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 12:59:38 +0100 Subject: [PATCH 10/14] fix lint --- src/libs/TransactionUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 342af3472f6c..beb1f9c323d6 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -227,7 +227,7 @@ function getMerchant(transaction: Transaction): string { * Return the mccGroup field from the transaction, return the modifiedMCCGroup if present. */ function getMCCGroup(transaction: Transaction): string { - return transaction?.modifiedMCCGroup ? transaction.modifiedMCCGroup : transaction?.mccGroup || ''; + return transaction?.modifiedMCCGroup ? transaction.modifiedMCCGroup : transaction?.mccGroup ?? ''; } /** From bda441b358dbb9ec0dfe82ba8cf6929f39a434c5 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 13:03:55 +0100 Subject: [PATCH 11/14] fix comments --- src/styles/StyleUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/StyleUtils.ts b/src/styles/StyleUtils.ts index fba2f866e4b0..735cebbf045a 100644 --- a/src/styles/StyleUtils.ts +++ b/src/styles/StyleUtils.ts @@ -242,7 +242,7 @@ function getAvatarBorderStyle(size: AvatarSizeName, type: string): ViewStyle | C } /** - * Helper method to return old dot default avatar associated with login + * Helper method to return workspace avatar color styles */ function getDefaultWorkspaceAvatarColor(workspaceName: string): ViewStyle | CSSProperties { const colorHash = UserUtils.hashText(workspaceName.trim(), workspaceColorOptions.length); @@ -251,7 +251,7 @@ function getDefaultWorkspaceAvatarColor(workspaceName: string): ViewStyle | CSSP } /** - * Helper method to return old dot default avatar associated with login + * Helper method to return eReceipt color styles */ function getEReceiptColor(transactionID: string): ViewStyle | CSSProperties { const colorHash = UserUtils.hashText(transactionID.trim(), eReceiptColorOptions.length); From 0ba3cfdb29b0946e8ab42c2e0c45583850954981 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 13:11:21 +0100 Subject: [PATCH 12/14] prettier for lint --- src/components/Icon/MCCIcons.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/components/Icon/MCCIcons.js b/src/components/Icon/MCCIcons.js index cf9d3d55aa7c..bd30e426ab31 100644 --- a/src/components/Icon/MCCIcons.js +++ b/src/components/Icon/MCCIcons.js @@ -12,18 +12,4 @@ import Taxi from '../../../assets/images/mccGroupIcons/MCC-Taxi.svg'; import Miscellaneous from '../../../assets/images/mccGroupIcons/MCC-Misc.svg'; import Utilities from '../../../assets/images/mccGroupIcons/MCC-Utilities.svg'; -export { - Airlines, - Commuter, - Gas, - Goods, - Groceries, - Hotel, - Mail, - Meals, - Rental, - Services, - Taxi, - Miscellaneous, - Utilities, -}; +export {Airlines, Commuter, Gas, Goods, Groceries, Hotel, Mail, Meals, Rental, Services, Taxi, Miscellaneous, Utilities}; From f4b12bf89430de962bd00d787f4ba3d9f8c0d736 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 16:08:04 +0100 Subject: [PATCH 13/14] change to backgroundColor and color --- src/styles/StyleUtils.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/styles/StyleUtils.ts b/src/styles/StyleUtils.ts index 735cebbf045a..5fc8ae77ac35 100644 --- a/src/styles/StyleUtils.ts +++ b/src/styles/StyleUtils.ts @@ -41,7 +41,7 @@ type AvatarSize = {width: number}; type ParsableStyle = ViewStyle | CSSProperties | ((state: PressableStateCallbackType) => ViewStyle | CSSProperties); type WorkspaceColorStyle = {backgroundColor: ColorValue; fill: ColorValue}; -type EreceiptColorStyle = {backgroundColor: ColorValue; fill: ColorValue}; +type EreceiptColorStyle = {backgroundColor: ColorValue; color: ColorValue}; type ModalPaddingStylesArgs = { shouldAddBottomSafeAreaMargin: boolean; @@ -88,12 +88,12 @@ const workspaceColorOptions: WorkspaceColorStyle[] = [ ]; const eReceiptColorOptions: EreceiptColorStyle[] = [ - {backgroundColor: colors.yellow600, fill: colors.yellow100}, - {backgroundColor: colors.blue800, fill: colors.ice400}, - {backgroundColor: colors.blue400, fill: colors.blue100}, - {backgroundColor: colors.green800, fill: colors.green400}, - {backgroundColor: colors.tangerine800, fill: colors.tangerine400}, - {backgroundColor: colors.pink800, fill: colors.pink400}, + {backgroundColor: colors.yellow600, color: colors.yellow100}, + {backgroundColor: colors.blue800, color: colors.ice400}, + {backgroundColor: colors.blue400, color: colors.blue100}, + {backgroundColor: colors.green800, color: colors.green400}, + {backgroundColor: colors.tangerine800, color: colors.tangerine400}, + {backgroundColor: colors.pink800, color: colors.pink400}, ]; const avatarBorderSizes: Partial> = { From 005197e002ac48ac8f048edaa413094f2bec46c1 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 6 Oct 2023 16:12:15 +0100 Subject: [PATCH 14/14] Add Ereceipt BG file --- assets/images/eReceipt-BGImage.svg | 314 +++++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 assets/images/eReceipt-BGImage.svg diff --git a/assets/images/eReceipt-BGImage.svg b/assets/images/eReceipt-BGImage.svg new file mode 100644 index 000000000000..48aa548ad6ee --- /dev/null +++ b/assets/images/eReceipt-BGImage.svg @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +