From 2821d6d4d58eae7df41b4244607bac4b4b69be44 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 5 Nov 2025 16:19:01 -0700 Subject: [PATCH] resolve conflicts --- src/CONST/index.ts | 2 + src/components/AnimatedCollapsible/index.tsx | 35 +- src/components/MoneyReportHeader.tsx | 2 +- .../MoneyRequestReportPreviewContent.tsx | 32 +- .../MoneyRequestReportPreview/index.tsx | 3 +- .../MoneyRequestReportPreview/types.ts | 3 +- .../Search/ActionCell.tsx | 6 +- .../Search/TransactionGroupListItem.tsx | 30 +- src/languages/de.ts | 1 - src/languages/en.ts | 1 - src/languages/es.ts | 1 - src/languages/fr.ts | 1 - src/languages/it.ts | 1 - src/languages/ja.ts | 1 - src/languages/nl.ts | 1 - src/languages/pl.ts | 1 - src/languages/pt-BR.ts | 1 - src/languages/zh-hans.ts | 1 - src/libs/ReportPreviewActionUtils.ts | 98 +++++- src/libs/SearchUIUtils.ts | 44 ++- tests/actions/ReportPreviewActionUtilsTest.ts | 315 +++++++++++++++++- tests/ui/MoneyRequestReportPreview.test.tsx | 89 +++++ .../MoneyRequestReportButtonUtils.test.ts | 1 + tests/unit/Search/SearchUIUtilsTest.ts | 80 ++++- 24 files changed, 630 insertions(+), 120 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 061db10e8dd7a..ac4c7a8746adb 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1149,6 +1149,7 @@ const CONST = { REPORT_PREVIEW_ACTIONS: { VIEW: 'view', ADD_EXPENSE: 'addExpense', + REVIEW: 'review', SUBMIT: 'submit', APPROVE: 'approve', PAY: 'pay', @@ -6518,6 +6519,7 @@ const CONST = { }, ACTION_TYPES: { VIEW: 'view', + REVIEW: 'review', SUBMIT: 'submit', APPROVE: 'approve', PAY: 'pay', diff --git a/src/components/AnimatedCollapsible/index.tsx b/src/components/AnimatedCollapsible/index.tsx index d4a9b9fca09f7..d2b5930ebf2ac 100644 --- a/src/components/AnimatedCollapsible/index.tsx +++ b/src/components/AnimatedCollapsible/index.tsx @@ -21,9 +21,6 @@ type AnimatedCollapsibleProps = { /** Header content to display above the collapsible content */ header: ReactNode; - /** Description content to display below the header */ - description?: ReactNode; - /** Duration of expansion animation */ duration?: number; @@ -56,7 +53,6 @@ function AnimatedCollapsible({ isExpanded, children, header, - description, duration = 300, style, headerStyle, @@ -70,9 +66,9 @@ function AnimatedCollapsible({ const theme = useTheme(); const styles = useThemeStyles(); const contentHeight = useSharedValue(0); - const descriptionHeight = useSharedValue(0); const hasExpanded = useSharedValue(isExpanded); const [isRendered, setIsRendered] = React.useState(isExpanded); + useEffect(() => { hasExpanded.set(isExpanded); if (isExpanded) { @@ -103,21 +99,6 @@ function AnimatedCollapsible({ return withTiming(hasExpanded.get() ? 1 : 0, {duration, easing}); }); - const descriptionOpacity = useDerivedValue(() => { - return withTiming(!hasExpanded.get() ? 1 : 0, {duration, easing}); - }); - - const descriptionAnimatedHeight = useDerivedValue(() => { - return withTiming(!isExpanded ? descriptionHeight.get() : 0, {duration, easing}); - }); - - const descriptionAnimatedStyle = useAnimatedStyle(() => { - return { - opacity: descriptionOpacity.get(), - height: descriptionAnimatedHeight.get(), - }; - }, []); - const contentAnimatedStyle = useAnimatedStyle(() => { return { height: animatedHeight.get(), @@ -148,20 +129,6 @@ function AnimatedCollapsible({ )} - {!!description && ( - - { - const height = e.nativeEvent.layout.height; - if (height) { - descriptionHeight.set(height); - } - }} - > - {description} - - - )} {isExpanded || isRendered ? ( { return getReportPreviewAction( + violations, isIouReportArchived || isChatReportArchived, + currentUserDetails.email ?? '', iouReport, policy, transactions, @@ -486,8 +491,22 @@ function MoneyRequestReportPreviewContent({ isPaidAnimationRunning, isApprovedAnimationRunning, isSubmittingAnimationRunning, + areStrictPolicyRulesEnabled, ); - }, [isPaidAnimationRunning, isApprovedAnimationRunning, isSubmittingAnimationRunning, iouReport, policy, transactions, isIouReportArchived, invoiceReceiverPolicy, isChatReportArchived]); + }, [ + isPaidAnimationRunning, + isApprovedAnimationRunning, + isSubmittingAnimationRunning, + violations, + iouReport, + policy, + transactions, + isIouReportArchived, + invoiceReceiverPolicy, + isChatReportArchived, + areStrictPolicyRulesEnabled, + currentUserDetails.email, + ]); const addExpenseDropdownOptions = useMemo( () => getAddExpenseDropdownOptions(iouReport?.reportID, policy, chatReportID, iouReport?.parentReportID, lastDistanceExpenseType), @@ -564,6 +583,15 @@ function MoneyRequestReportPreviewContent({ }} /> ) : null, + [CONST.REPORT.REPORT_PREVIEW_ACTIONS.REVIEW]: ( +