Skip to content

Commit 062378a

Browse files
committed
Resolve merge conflicts with main
2 parents 4b0f06b + fb62baa commit 062378a

49 files changed

Lines changed: 1135 additions & 372 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: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,68 @@
1-
diff --git a/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js b/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js
2-
index da5822e..04f3c80 100644
3-
--- a/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js
4-
+++ b/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js
5-
@@ -225,6 +225,10 @@ function xhrCallback(
1+
diff --git a/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js b/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js
2+
index 6bfc053..21d2a37 100644
3+
--- a/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js
4+
+++ b/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js
5+
@@ -227,6 +227,12 @@ function xhrCallback(
66
const span = spans[spanId];
77
if (span && sentryXhrData.status_code !== undefined) {
8-
setHttpStatus(span, sentryXhrData.status_code);
9-
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
10-
+ if (requestId) {
11-
+ span.setAttribute('request-id', requestId)
8+
core.setHttpStatus(span, sentryXhrData.status_code);
9+
+ if (handlerData.xhr.getAllResponseHeaders().toLowerCase().includes('x-request-id')) {
10+
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
11+
+ if (requestId) {
12+
+ span.setAttribute('request-id', requestId)
13+
+ }
1214
+ }
1315
span.end();
14-
16+
1517
onRequestSpanEnd?.(span, {
16-
diff --git a/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js b/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js
17-
index da5822e..04f3c80 100644
18-
--- a/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js
19-
+++ b/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js
20-
@@ -225,6 +225,10 @@ function xhrCallback(
18+
diff --git a/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js b/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js
19+
index 6bfc053..21d2a37 100644
20+
--- a/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js
21+
+++ b/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js
22+
@@ -227,6 +227,12 @@ function xhrCallback(
2123
const span = spans[spanId];
2224
if (span && sentryXhrData.status_code !== undefined) {
23-
setHttpStatus(span, sentryXhrData.status_code);
24-
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
25-
+ if (requestId) {
26-
+ span.setAttribute('request-id', requestId)
25+
core.setHttpStatus(span, sentryXhrData.status_code);
26+
+ if (handlerData.xhr.getAllResponseHeaders().toLowerCase().includes('x-request-id')) {
27+
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
28+
+ if (requestId) {
29+
+ span.setAttribute('request-id', requestId)
30+
+ }
2731
+ }
2832
span.end();
29-
33+
3034
onRequestSpanEnd?.(span, {
31-
diff --git a/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js b/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js
32-
index da5822e..04f3c80 100644
33-
--- a/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js
34-
+++ b/node_modules/@sentry/browser/build/npm/cjs/dev/tracing/request.js
35-
@@ -227,6 +227,10 @@ function xhrCallback(
35+
diff --git a/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js b/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js
36+
index 57d2ae8..063b495 100644
37+
--- a/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js
38+
+++ b/node_modules/@sentry/browser/build/npm/esm/dev/tracing/request.js
39+
@@ -225,6 +225,12 @@ function xhrCallback(
3640
const span = spans[spanId];
3741
if (span && sentryXhrData.status_code !== undefined) {
38-
core.setHttpStatus(span, sentryXhrData.status_code);
39-
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
40-
+ if (requestId) {
41-
+ span.setAttribute('request-id', requestId)
42+
setHttpStatus(span, sentryXhrData.status_code);
43+
+ if (handlerData.xhr.getAllResponseHeaders().toLowerCase().includes('x-request-id')) {
44+
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
45+
+ if (requestId) {
46+
+ span.setAttribute('request-id', requestId)
47+
+ }
4248
+ }
4349
span.end();
44-
50+
4551
onRequestSpanEnd?.(span, {
46-
diff --git a/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js b/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js
47-
index da5822e..04f3c80 100644
48-
--- a/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js
49-
+++ b/node_modules/@sentry/browser/build/npm/cjs/prod/tracing/request.js
50-
@@ -227,6 +227,10 @@ function xhrCallback(
52+
diff --git a/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js b/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js
53+
index 57d2ae8..063b495 100644
54+
--- a/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js
55+
+++ b/node_modules/@sentry/browser/build/npm/esm/prod/tracing/request.js
56+
@@ -225,6 +225,12 @@ function xhrCallback(
5157
const span = spans[spanId];
5258
if (span && sentryXhrData.status_code !== undefined) {
53-
core.setHttpStatus(span, sentryXhrData.status_code);
54-
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
55-
+ if (requestId) {
56-
+ span.setAttribute('request-id', requestId)
59+
setHttpStatus(span, sentryXhrData.status_code);
60+
+ if (handlerData.xhr.getAllResponseHeaders().toLowerCase().includes('x-request-id')) {
61+
+ const requestId = handlerData.xhr.getResponseHeader('x-request-id');
62+
+ if (requestId) {
63+
+ span.setAttribute('request-id', requestId)
64+
+ }
5765
+ }
5866
span.end();
59-
67+
6068
onRequestSpanEnd?.(span, {

patches/sentry-core/@sentry+core+10.39.0+002+request-id-support.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/node_modules/@sentry/core/build/esm/fetch.js b/node_modules/@sentry/core/build/esm/fetch.js
2-
index 3c6eafb..33481e8 100644
2+
index 27c5e79..9686203 100644
33
--- a/node_modules/@sentry/core/build/esm/fetch.js
44
+++ b/node_modules/@sentry/core/build/esm/fetch.js
5-
@@ -235,7 +235,10 @@ function _addTracingHeadersToFetchRequest(
5+
@@ -237,7 +237,10 @@ function _addTracingHeadersToFetchRequest(
66
function endSpan(span, handlerData) {
77
if (handlerData.response) {
88
setHttpStatus(span, handlerData.response.status);

src/components/DecisionModal.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ type DecisionModalProps = {
5050

5151
/** Whether modal is visible */
5252
isVisible: boolean;
53+
54+
/** Whether to handle browser navigation back to close the modal */
55+
shouldHandleNavigationBack?: boolean;
5356
};
5457

5558
function DecisionModal({
@@ -67,6 +70,7 @@ function DecisionModal({
6770
isFirstOptionSuccess = true,
6871
isSecondOptionSuccess = false,
6972
isSecondOptionDanger = false,
73+
shouldHandleNavigationBack,
7074
}: DecisionModalProps) {
7175
const styles = useThemeStyles();
7276

@@ -77,6 +81,7 @@ function DecisionModal({
7781
type={isSmallScreenWidth ? CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED : CONST.MODAL.MODAL_TYPE.CONFIRM}
7882
innerContainerStyle={styles.pv0}
7983
onModalHide={onModalHide}
84+
shouldHandleNavigationBack={shouldHandleNavigationBack}
8085
>
8186
<ScrollView contentContainerStyle={styles.m5}>
8287
<View>
@@ -112,4 +117,5 @@ function DecisionModal({
112117
);
113118
}
114119

120+
export type {DecisionModalProps};
115121
export default DecisionModal;

src/components/KYCWall/BaseKYCWall.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ function KYCWall({
6565
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
6666
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
6767
const [betas] = useOnyx(ONYXKEYS.BETAS);
68+
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
6869

6970
const {formatPhoneNumber} = useLocalize();
7071
const currentUserDetails = useCurrentUserPersonalDetails();
@@ -165,7 +166,7 @@ function KYCWall({
165166
}
166167

167168
const {policyID, workspaceChatReportID, reportPreviewReportActionID, adminsChatReportID} =
168-
createWorkspaceFromIOUPayment(iouReport, reportPreviewAction, currentUserEmail, employeeEmail) ?? {};
169+
createWorkspaceFromIOUPayment(iouReport, reportPreviewAction, currentUserEmail, employeeEmail, conciergeReportID) ?? {};
169170
if (policyID && iouReport?.policyID) {
170171
savePreferredPaymentMethod(iouReport.policyID, policyID, CONST.LAST_PAYMENT_METHOD.IOU, lastPaymentMethod?.[iouReport?.policyID]);
171172
}
@@ -216,6 +217,7 @@ function KYCWall({
216217
lastPaymentMethod,
217218
isSelfTourViewed,
218219
betas,
220+
conciergeReportID,
219221
],
220222
);
221223

src/components/LHNOptionsList/OptionRowLHNData.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ function OptionRowLHNData({
118118
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
119119
const {login} = useCurrentUserPersonalDetails();
120120
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${fullReport?.policyID}`);
121-
const [fullReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${fullReport?.reportID}`);
122121

123122
const card = useGetExpensifyCardFromReportAction({reportAction: lastAction, policyID: fullReport?.policyID});
124123

@@ -157,7 +156,7 @@ function OptionRowLHNData({
157156
reportAttributesDerived,
158157
policyTags,
159158
currentUserLogin: login ?? '',
160-
reportActions: fullReportActions,
159+
reportActions,
161160
});
162161

163162
// For single-sender IOUs, trim to the sender's avatar to match the header.

src/components/MenuItem.tsx

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ type MenuItemBaseProps = ForwardedFSClassProps &
183183
/** A description text to show under the title */
184184
description?: string;
185185

186+
/** Optional component to render before the description text (e.g. a badge pill) */
187+
descriptionAddon?: ReactNode;
188+
186189
/** Text to show below menu item. This text is not interactive */
187190
helperText?: string;
188191

@@ -507,6 +510,7 @@ function MenuItem({
507510
furtherDetailsStyle,
508511
furtherDetailsComponent,
509512
description,
513+
descriptionAddon,
510514
helperText,
511515
helperTextStyle,
512516
errorText,
@@ -645,13 +649,41 @@ function MenuItem({
645649

646650
const descriptionTextStyles = StyleUtils.combineStyles<TextStyle>([
647651
styles.textLabelSupporting,
648-
icon && !Array.isArray(icon) ? styles.ml3 : {},
649-
title ? descriptionVerticalMargin : StyleUtils.getFontSizeStyle(variables.fontSizeNormal),
652+
styles.flex1,
653+
title ? {} : StyleUtils.getFontSizeStyle(variables.fontSizeNormal),
650654
title ? styles.textLineHeightNormal : StyleUtils.getLineHeightStyle(variables.fontSizeNormalHeight),
655+
!descriptionAddon && icon && !Array.isArray(icon) ? styles.ml3 : {},
656+
descriptionAddon ? styles.ml2 : {},
651657
(descriptionTextStyle as TextStyle) || styles.breakWord,
652658
isDeleted ? styles.offlineFeedbackDeleted : {},
653659
]);
654660

661+
const descriptionContainerStyle = StyleUtils.combineStyles<ViewStyle>([
662+
styles.flexRow,
663+
styles.alignItemsCenter,
664+
descriptionAddon && icon && !Array.isArray(icon) ? styles.ml3 : {},
665+
title ? descriptionVerticalMargin : {},
666+
]);
667+
668+
const renderDescriptionView = () => {
669+
if (!description && !descriptionAddon) {
670+
return null;
671+
}
672+
return (
673+
<View style={descriptionContainerStyle}>
674+
{descriptionAddon}
675+
{!!description && (
676+
<Text
677+
style={descriptionTextStyles}
678+
numberOfLines={numberOfLinesDescription}
679+
>
680+
{description}
681+
</Text>
682+
)}
683+
</View>
684+
);
685+
};
686+
655687
const html = useMemo(() => {
656688
if (!title || !shouldParseTitle) {
657689
return '';
@@ -943,14 +975,7 @@ function MenuItem({
943975
titleContainerStyle,
944976
]}
945977
>
946-
{!!description && shouldShowDescriptionOnTop && (
947-
<Text
948-
style={descriptionTextStyles}
949-
numberOfLines={numberOfLinesDescription}
950-
>
951-
{description}
952-
</Text>
953-
)}
978+
{shouldShowDescriptionOnTop && renderDescriptionView()}
954979
{(!!title || !!shouldShowTitleIcon) && (
955980
<View
956981
style={[styles.flexRow, styles.alignItemsCenter, styles.mw100, titleWrapperStyle]}
@@ -981,14 +1006,7 @@ function MenuItem({
9811006
)}
9821007
</View>
9831008
)}
984-
{!!description && !shouldShowDescriptionOnTop && (
985-
<Text
986-
style={descriptionTextStyles}
987-
numberOfLines={numberOfLinesDescription}
988-
>
989-
{description}
990-
</Text>
991-
)}
1009+
{!shouldShowDescriptionOnTop && renderDescriptionView()}
9921010
{!!furtherDetails && (
9931011
<View style={[styles.flexRow, styles.mt1, styles.alignItemsCenter]}>
9941012
{!!furtherDetailsIcon && (
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React, {useState} from 'react';
2+
import type {DecisionModalProps} from '@components/DecisionModal';
3+
import DecisionModal from '@components/DecisionModal';
4+
import useResponsiveLayout from '@hooks/useResponsiveLayout';
5+
import {ModalActions} from './ModalContext';
6+
import type {ModalProps} from './ModalContext';
7+
8+
type DecisionModalWrapperProps = ModalProps & Omit<DecisionModalProps, 'onClose' | 'onSecondOptionSubmit' | 'onFirstOptionSubmit' | 'isVisible' | 'isSmallScreenWidth'>;
9+
10+
function DecisionModalWrapper({closeModal, onModalHide, ...props}: DecisionModalWrapperProps) {
11+
const [isVisible, setIsVisible] = useState(true);
12+
const [closeAction, setCloseAction] = useState<typeof ModalActions.CONFIRM | typeof ModalActions.CLOSE>(ModalActions.CLOSE);
13+
// We need to use isSmallScreenWidth here because the DecisionModal breaks in RHP with shouldUseNarrowLayout.
14+
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
15+
const {isSmallScreenWidth} = useResponsiveLayout();
16+
17+
const handleFirstOption = () => {
18+
setCloseAction(ModalActions.CONFIRM);
19+
setIsVisible(false);
20+
};
21+
22+
const handleSecondOption = () => {
23+
setCloseAction(ModalActions.CLOSE);
24+
setIsVisible(false);
25+
};
26+
27+
const handleModalHide = () => {
28+
if (isVisible) {
29+
return;
30+
}
31+
closeModal({action: closeAction});
32+
onModalHide?.();
33+
};
34+
35+
return (
36+
<DecisionModal
37+
// Spreading is needed to forward all modal configuration props from the wrapper to the underlying DecisionModal.
38+
// eslint-disable-next-line react/jsx-props-no-spreading
39+
{...props}
40+
isVisible={isVisible}
41+
isSmallScreenWidth={isSmallScreenWidth}
42+
onFirstOptionSubmit={handleFirstOption}
43+
onSecondOptionSubmit={handleSecondOption}
44+
onClose={handleSecondOption}
45+
onModalHide={handleModalHide}
46+
/>
47+
);
48+
}
49+
50+
export default DecisionModalWrapper;

0 commit comments

Comments
 (0)