Skip to content

Commit 35b0cfd

Browse files
committed
Merge branch 'main' of https://github.com/TaduJR/App into feat-user-pill-workflow-attendees
2 parents 8bbd0f7 + 885f601 commit 35b0cfd

42 files changed

Lines changed: 2258 additions & 332 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4646
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
4747
"typecheck-tsgo": "tsgo --noEmit --incremental --tsBuildInfoFile tsconfig.tsgo.tsbuildinfo",
48-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=313 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
48+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=292 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
4949
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5050
"lint-watch": "npx eslint-watch --watch --changed",
5151
"shellcheck": "./scripts/shellCheck.sh",

src/CONST/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ const CONST = {
886886
PAY_INVOICE_VIA_EXPENSIFY: 'payInvoiceViaExpensify',
887887
SUGGESTED_FOLLOWUPS: 'suggestedFollowups',
888888
GUSTO: 'gustoNewDot',
889+
BULK_DUPLICATE_REPORT: 'bulkDuplicateReport',
889890
BULK_EDIT: 'bulkEdit',
890891
NEW_MANUAL_EXPENSE_FLOW: 'newManualExpenseFlow',
891892
BULK_SUBMIT_APPROVE_PAY: 'bulkSubmitApprovePay',
@@ -7554,6 +7555,7 @@ const CONST = {
75547555
CHANGE_REPORT: 'changeReport',
75557556
SPLIT: 'split',
75567557
DUPLICATE: 'duplicate',
7558+
DUPLICATE_REPORT: 'duplicateReport',
75577559
UNDELETE: 'undelete',
75587560
},
75597561
BULK_DUPLICATE_LIMIT: 50,

src/components/AddUnreportedExpenseFooter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function AddUnreportedExpenseFooter({selectedIds, report, reportToConfirm, repor
5858
const [quickAction] = useOnyx(ONYXKEYS.NVP_QUICK_ACTION_GLOBAL_CREATE);
5959
const [betas] = useOnyx(ONYXKEYS.BETAS);
6060
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`);
61+
const [policyTagList] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policy?.id}`);
6162

6263
const handleConfirm = () => {
6364
if (selectedIds.size === 0) {
@@ -93,6 +94,7 @@ function AddUnreportedExpenseFooter({selectedIds, report, reportToConfirm, repor
9394
reportNextStep,
9495
policyCategories,
9596
allTransactions: selectedTransactions,
97+
policyTagList,
9698
});
9799
}
98100
});

src/components/Icon/chunks/illustrations.chunk.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ import CalendarMonthly from '@assets/images/simple-illustrations/simple-illustra
113113
import CarIce from '@assets/images/simple-illustrations/simple-illustration__car-ice.svg';
114114
import Car from '@assets/images/simple-illustrations/simple-illustration__car.svg';
115115
import Chair from '@assets/images/simple-illustrations/simple-illustration__chair.svg';
116+
import Chalkboard from '@assets/images/simple-illustrations/simple-illustration__chalkboard.svg';
116117
import ChatBubbles from '@assets/images/simple-illustrations/simple-illustration__chatbubbles.svg';
117118
import CheckboxText from '@assets/images/simple-illustrations/simple-illustration__checkboxtext.svg';
118119
import CheckmarkCircle from '@assets/images/simple-illustrations/simple-illustration__checkmarkcircle.svg';
@@ -398,6 +399,7 @@ const Illustrations = {
398399
Trophy,
399400
Trophy1,
400401
FoodTruck,
402+
Chalkboard,
401403

402404
// Multifactor Authentication Illustrations
403405
MagnifyingGlassSpyMouthClosed,

src/components/KYCWall/BaseKYCWall.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function KYCWall({
171171
}
172172

173173
const lastWorkspaceNumber = lastWorkspaceNumberSelector(policies, currentUserEmail);
174-
const {policyID, workspaceChatReportID, reportPreviewReportActionID, adminsChatReportID} =
174+
const {policyID, workspaceChatReportID, adminsChatReportID} =
175175
createWorkspaceFromIOUPayment(
176176
iouReport,
177177
reportPreviewAction,
@@ -188,12 +188,11 @@ function KYCWall({
188188
savePreferredPaymentMethod(iouReport.policyID, policyID, CONST.LAST_PAYMENT_METHOD.IOU, lastPaymentMethod?.[iouReport?.policyID]);
189189
}
190190
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected, isSelfTourViewed, betas, adminsChatReportID, policyID);
191-
if (workspaceChatReportID) {
192-
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID, reportPreviewReportActionID));
193-
}
191+
const workspaceReportRoute = workspaceChatReportID ? ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID) : undefined;
194192

195-
// Navigate to the bank account set up flow for this specific policy
196-
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}));
193+
setNavigationActionToMicrotaskQueue(() => {
194+
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID, backTo: workspaceReportRoute}));
195+
});
197196
return;
198197
}
199198

src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,12 +810,14 @@ function MoneyRequestReportTransactionList({
810810
</View>
811811
)}
812812

813-
<MoneyRequestReportTotalSpend
814-
isEmptyTransactions={isEmptyTransactions}
815-
totalDisplaySpend={totalDisplaySpend}
816-
report={report}
817-
hasPendingAction={hasPendingAction}
818-
/>
813+
<OfflineWithFeedback pendingAction={report?.pendingFields?.total}>
814+
<MoneyRequestReportTotalSpend
815+
isEmptyTransactions={isEmptyTransactions}
816+
totalDisplaySpend={totalDisplaySpend}
817+
report={report}
818+
hasPendingAction={hasPendingAction}
819+
/>
820+
</OfflineWithFeedback>
819821
</View>
820822
</View>
821823
<Modal
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {useEffect} from 'react';
2+
import type {OnyxCollection} from 'react-native-onyx';
3+
import useBulkDuplicateReportAction from '@hooks/useBulkDuplicateReportAction';
4+
import type {Report} from '@src/types/onyx';
5+
import type {SelectedReports} from './types';
6+
7+
type BulkDuplicateReportHandlerProps = {
8+
selectedReports: SelectedReports[];
9+
allReports: OnyxCollection<Report> | undefined;
10+
searchData: Record<string, unknown> | undefined;
11+
onHandlerReady: (handler: () => void) => void;
12+
};
13+
14+
/**
15+
* Invisible component that subscribes to action-time Onyx data for bulk report duplication.
16+
* Only mounted when the duplicate report option is visible, avoiding unnecessary global
17+
* subscriptions on the search page for users who aren't duplicating.
18+
*/
19+
function BulkDuplicateReportHandler({selectedReports, allReports, searchData, onHandlerReady}: BulkDuplicateReportHandlerProps) {
20+
const handleDuplicateReports = useBulkDuplicateReportAction({selectedReports, allReports, searchData});
21+
22+
useEffect(() => {
23+
onHandlerReady(handleDuplicateReports);
24+
}, [handleDuplicateReports, onHandlerReady]);
25+
26+
return null;
27+
}
28+
29+
export default BulkDuplicateReportHandler;

src/components/Search/SearchBulkActionsButton.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import CONST from '@src/CONST';
2525
import ONYXKEYS from '@src/ONYXKEYS';
2626
import ROUTES from '@src/ROUTES';
2727
import BulkDuplicateHandler from './BulkDuplicateHandler';
28+
import BulkDuplicateReportHandler from './BulkDuplicateReportHandler';
2829
import {useSearchActionsContext, useSearchStateContext} from './SearchContext';
2930
import type {BulkPaySelectionData, SearchQueryJSON} from './types';
3031

@@ -38,7 +39,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
3839
// We need isSmallScreenWidth (not just shouldUseNarrowLayout) because DecisionModal requires it for correct modal type
3940
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
4041
const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
41-
const {selectedTransactions, areAllMatchingItemsSelected, shouldShowSelectAllMatchingItems} = useSearchStateContext();
42+
const {selectedTransactions, selectedReports, areAllMatchingItemsSelected, shouldShowSelectAllMatchingItems} = useSearchStateContext();
4243
const {selectAllMatchingItems} = useSearchActionsContext();
4344
const kycWallRef = useContext(KYCWallContext);
4445
const {isAccountLocked} = useLockedAccountState();
@@ -69,6 +70,8 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
6970
dismissRejectModalBasedOnAction,
7071
isDuplicateOptionVisible,
7172
setDuplicateHandler,
73+
isDuplicateReportOptionVisible,
74+
setDuplicateReportHandler,
7275
allTransactions,
7376
allReports,
7477
searchData,
@@ -114,6 +117,14 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
114117
onHandlerReady={setDuplicateHandler}
115118
/>
116119
)}
120+
{isDuplicateReportOptionVisible && (
121+
<BulkDuplicateReportHandler
122+
selectedReports={selectedReports}
123+
allReports={allReports}
124+
searchData={searchData}
125+
onHandlerReady={setDuplicateReportHandler}
126+
/>
127+
)}
117128
<KYCWall
118129
ref={kycWallRef}
119130
chatReportID={currentSelectedReportID}

src/components/Search/SearchContext.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ function SearchContextProvider({children}: SearchContextProps) {
189189
ownerAccountID,
190190
parentReportActionID,
191191
parentReportID,
192+
type,
192193
}) => ({
193194
reportID,
194195
action,
@@ -201,6 +202,7 @@ function SearchContextProvider({children}: SearchContextProps) {
201202
ownerAccountID,
202203
parentReportActionID,
203204
parentReportID,
205+
type,
204206
}),
205207
);
206208
} else if (data.length && data.every(isTransactionListItemType)) {

0 commit comments

Comments
 (0)