From 58833a1c59977079b34c594f6f178962c5d0b661 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Sun, 11 Aug 2024 17:42:22 +0300 Subject: [PATCH 001/100] rm padding from nested list --- docs/_sass/_main.scss | 8 ++++++++ .../Add-Expensify-Card-to-Apple-or-Google-Pay.md | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/_sass/_main.scss b/docs/_sass/_main.scss index 82446fe08b3a..2b8627921958 100644 --- a/docs/_sass/_main.scss +++ b/docs/_sass/_main.scss @@ -374,6 +374,14 @@ button { } } + ol { + li { + ul { + padding-bottom: 0; + } + } + } + table { margin-bottom: 20px; border-radius: 8px; diff --git a/docs/articles/new-expensify/expensify-card/Add-Expensify-Card-to-Apple-or-Google-Pay.md b/docs/articles/new-expensify/expensify-card/Add-Expensify-Card-to-Apple-or-Google-Pay.md index 844a688e0011..3c147e33517b 100644 --- a/docs/articles/new-expensify/expensify-card/Add-Expensify-Card-to-Apple-or-Google-Pay.md +++ b/docs/articles/new-expensify/expensify-card/Add-Expensify-Card-to-Apple-or-Google-Pay.md @@ -9,7 +9,7 @@ You can use your Expensify Card for contactless in-person payments by adding it {% include selector.html values="mobile" %} {% include option.html value="mobile" %} -**Apple Pay** +### Apple Pay 1. Open the Apple Pay app. 2. Tap the + button. @@ -17,7 +17,7 @@ You can use your Expensify Card for contactless in-person payments by adding it 4. Tap **Continue**. 5. Follow the steps provided to add your virtual card. -**Google Pay** +### Google Pay 1. Open the Google Pay app. 2. Tap **Add to Wallet**. From 6e03be685267d8b52b4b9974f0d48733bcf7371a Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Sun, 11 Aug 2024 18:04:23 +0300 Subject: [PATCH 002/100] add 4px padding to li --- docs/_sass/_main.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_sass/_main.scss b/docs/_sass/_main.scss index 2b8627921958..2d87df80a13d 100644 --- a/docs/_sass/_main.scss +++ b/docs/_sass/_main.scss @@ -374,6 +374,10 @@ button { } } + li { + padding-bottom: 4px; + } + ol { li { ul { From d31cc9cc4446bddcd08c080faf1d6e03c51b3dce Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 18 Oct 2024 00:49:32 +0530 Subject: [PATCH 003/100] fix: update navigation for qab --- .../FloatingActionButtonAndPopover.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index a49b474b185e..700c2d5ad021 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -248,37 +248,37 @@ function FloatingActionButtonAndPopover( switch (quickAction?.action) { case CONST.QUICK_ACTIONS.REQUEST_MANUAL: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.MANUAL, true), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, undefined, true), true); return; case CONST.QUICK_ACTIONS.REQUEST_SCAN: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, true), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, undefined, true), true); return; case CONST.QUICK_ACTIONS.REQUEST_DISTANCE: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.DISTANCE, true), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, undefined, true), true); return; case CONST.QUICK_ACTIONS.SPLIT_MANUAL: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.MANUAL, true), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, undefined, true), true); return; case CONST.QUICK_ACTIONS.SPLIT_SCAN: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, true), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, undefined, true), true); return; case CONST.QUICK_ACTIONS.SPLIT_DISTANCE: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.DISTANCE, false), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, undefined, false), true); return; case CONST.QUICK_ACTIONS.SEND_MONEY: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.PAY, quickActionReportID, CONST.IOU.REQUEST_TYPE.MANUAL, true), false); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.PAY, quickActionReportID, undefined, true), false); return; case CONST.QUICK_ACTIONS.ASSIGN_TASK: selectOption(() => Task.startOutCreateTaskQuickAction(isValidReport ? quickActionReportID : '', quickAction.targetAccountID ?? -1), false); break; case CONST.QUICK_ACTIONS.TRACK_MANUAL: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, CONST.IOU.REQUEST_TYPE.MANUAL, true), false); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, undefined, true), false); break; case CONST.QUICK_ACTIONS.TRACK_SCAN: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, true), false); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, undefined, true), false); break; case CONST.QUICK_ACTIONS.TRACK_DISTANCE: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, CONST.IOU.REQUEST_TYPE.DISTANCE, true), false); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.TRACK, quickActionReportID, undefined, true), false); break; default: } From d726dcbfa13d8c8f1c0fe4177561dba2ce9b1a7a Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 24 Oct 2024 15:51:19 -0600 Subject: [PATCH 004/100] add consts --- src/CONST.ts | 3 +++ src/components/SelectionList/Search/ActionCell.tsx | 3 +++ src/libs/SearchUIUtils.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index a3df980ff5dd..f5441e6f942d 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -5644,6 +5644,9 @@ const CONST = { ACTION_TYPES: { VIEW: 'view', REVIEW: 'review', + SUBMIT: 'submit', + APPROVE: 'approve', + PAY: 'pay', DONE: 'done', PAID: 'paid', }, diff --git a/src/components/SelectionList/Search/ActionCell.tsx b/src/components/SelectionList/Search/ActionCell.tsx index faafa6159dc1..57db7e7d7969 100644 --- a/src/components/SelectionList/Search/ActionCell.tsx +++ b/src/components/SelectionList/Search/ActionCell.tsx @@ -15,6 +15,9 @@ import type {SearchTransactionAction} from '@src/types/onyx/SearchResults'; const actionTranslationsMap: Record = { view: 'common.view', review: 'common.review', + submit: 'common.submit', + approve: 'iou.approve', + pay: 'iou.pay', done: 'common.done', paid: 'iou.settledExpensify', }; diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index a7ce065a6d23..ed865d6eac2d 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -223,6 +223,7 @@ function getTransactionsSections(data: OnyxTypes.SearchResults['data'], metadata return { ...transactionItem, + action: 'submit', from, to, formattedFrom, From 2f4c9802966b65fc23163394222aaf8231216707 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 24 Oct 2024 16:26:25 -0600 Subject: [PATCH 005/100] create getAction --- src/libs/SearchUIUtils.ts | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/libs/SearchUIUtils.ts b/src/libs/SearchUIUtils.ts index ed865d6eac2d..7ce8cfb44c0a 100644 --- a/src/libs/SearchUIUtils.ts +++ b/src/libs/SearchUIUtils.ts @@ -4,6 +4,7 @@ import ChatListItem from '@components/SelectionList/ChatListItem'; import ReportListItem from '@components/SelectionList/Search/ReportListItem'; import TransactionListItem from '@components/SelectionList/Search/TransactionListItem'; import type {ListItem, ReportActionListItemType, ReportListItemType, TransactionListItemType} from '@components/SelectionList/types'; +import * as IOU from '@libs/actions/IOU'; import * as Expensicons from '@src/components/Icon/Expensicons'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; @@ -11,7 +12,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; import type SearchResults from '@src/types/onyx/SearchResults'; -import type {ListItemDataType, ListItemType, SearchDataTypes, SearchPersonalDetails, SearchReport, SearchTransaction} from '@src/types/onyx/SearchResults'; +import type {ListItemDataType, ListItemType, SearchDataTypes, SearchPersonalDetails, SearchReport, SearchTransaction, SearchTransactionAction} from '@src/types/onyx/SearchResults'; import * as CurrencyUtils from './CurrencyUtils'; import DateUtils from './DateUtils'; import {translateLocal} from './Localize'; @@ -223,7 +224,7 @@ function getTransactionsSections(data: OnyxTypes.SearchResults['data'], metadata return { ...transactionItem, - action: 'submit', + action: getAction(data, key), from, to, formattedFrom, @@ -241,6 +242,35 @@ function getTransactionsSections(data: OnyxTypes.SearchResults['data'], metadata }); } +/** + * @private + * Returns the action that can be taken on a given transaction or report + * + * Do not use directly, use only via `getSections()` facade. + */ +function getAction(data: OnyxTypes.SearchResults['data'], key: string): SearchTransactionAction { + if (!isTransactionEntry(key) && !isReportEntry(key)) { + return CONST.SEARCH.ACTION_TYPES.VIEW; + } + + return CONST.SEARCH.ACTION_TYPES.VIEW; + + // const report = isReportEntry(key) ? data[key] : data[data[key].reportID]; + // const chatReport = isReportEntry(key) ? data[key].chatReportID + // iouReport + // chatReport + // policy + // transactions + // if (IOU.canIOUBePaid()) { + // pay + // approve + // submit + // review + // view + // done + // paid +} + /** * @private * Organizes data into List Sections for display, for the ReportActionListItemType of Search Results. From 584a539d4ad69b2dc000765d87178a659931f264 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 24 Oct 2024 16:49:39 -0600 Subject: [PATCH 006/100] create canReportBeSubmitted --- .../SelectionList/Search/ActionCell.tsx | 4 +-- src/libs/SearchUIUtils.ts | 26 +++++++++++++------ src/libs/actions/IOU.ts | 21 +++++++++++++++ 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/components/SelectionList/Search/ActionCell.tsx b/src/components/SelectionList/Search/ActionCell.tsx index 57db7e7d7969..612f515791c0 100644 --- a/src/components/SelectionList/Search/ActionCell.tsx +++ b/src/components/SelectionList/Search/ActionCell.tsx @@ -80,7 +80,7 @@ function ActionCell({action = CONST.SEARCH.ACTION_TYPES.VIEW, isLargeScreenWidth ) : null; } - if (action === CONST.SEARCH.ACTION_TYPES.REVIEW) { + // if (action === CONST.SEARCH.ACTION_TYPES.REVIEW) { return (