Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function detectReactComponentInFile(filename: string): Promise<boolean | u
};
try {
const {data} = await GithubUtils.octokit.repos.getContent(params);
const content = nodeBase64ToUtf8('content' in data ? data?.content ?? '' : '');
const content = nodeBase64ToUtf8('content' in data ? (data?.content ?? '') : '');
return detectReactComponent(content, filename);
} catch (error) {
console.error('An unknown error occurred with the GitHub API: ', error, params);
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15419,7 +15419,7 @@ async function detectReactComponentInFile(filename) {
};
try {
const { data } = await GithubUtils_1.default.octokit.repos.getContent(params);
const content = nodeBase64ToUtf8('content' in data ? data?.content ?? '' : '');
const content = nodeBase64ToUtf8('content' in data ? (data?.content ?? '') : '');
return detectReactComponent(content, filename);
}
catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12321,7 +12321,7 @@ const replacer = (str) => ({
'\r': '\\r',
'\f': '\\f',
'"': '\\"',
}[str] ?? '');
})[str] ?? '';
/**
* Replace any characters in the string that will break JSON.parse for our Git Log output
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12358,7 +12358,7 @@ const replacer = (str) => ({
'\r': '\\r',
'\f': '\\f',
'"': '\\"',
}[str] ?? '');
})[str] ?? '';
/**
* Replace any characters in the string that will break JSON.parse for our Git Log output
*
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/getPreviousVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3018,7 +3018,7 @@ const replacer = (str) => ({
'\r': '\\r',
'\f': '\\f',
'"': '\\"',
}[str] ?? '');
})[str] ?? '';
/**
* Replace any characters in the string that will break JSON.parse for our Git Log output
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,30 @@ function getTestBuildMessage(): string {
[inputs[3]]: 'Web',
};

const result = inputs.reduce((acc, platform) => {
const input = core.getInput(platform, {required: false});
const result = inputs.reduce(
(acc, platform) => {
const input = core.getInput(platform, {required: false});

if (!input) {
acc[platform] = {link: 'N/A', qrCode: 'N/A'};
return acc;
}
if (!input) {
acc[platform] = {link: 'N/A', qrCode: 'N/A'};
return acc;
}

const isSuccess = input === 'success';
const isSuccess = input === 'success';

const link = isSuccess ? core.getInput(`${platform}_LINK`) : '❌ FAILED ❌';
const qrCode = isSuccess
? `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})`
: `The QR code can't be generated, because the ${names[platform]} build failed`;
const link = isSuccess ? core.getInput(`${platform}_LINK`) : '❌ FAILED ❌';
const qrCode = isSuccess
? `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})`
: `The QR code can't be generated, because the ${names[platform]} build failed`;

acc[platform] = {
link,
qrCode,
};
return acc;
}, {} as Record<TupleToUnion<typeof inputs>, {link: string; qrCode: string}>);
acc[platform] = {
link,
qrCode,
};
return acc;
},
{} as Record<TupleToUnion<typeof inputs>, {link: string; qrCode: string}>,
);

const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
| Android :robot: | iOS :apple: |
Expand Down
2 changes: 1 addition & 1 deletion .github/libs/sanitizeStringForJSONParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const replacer = (str: string): string =>
'\r': '\\r',
'\f': '\\f',
'"': '\\"',
}[str] ?? '');
})[str] ?? '';

/**
* Replace any characters in the string that will break JSON.parse for our Git Log output
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ jobs:

- name: Verify there's no Prettier diff
run: |
npm run prettier -- --loglevel silent
npm run prettier -- --log-level silent
if ! git diff --name-only --exit-code; then
# shellcheck disable=SC2016
echo 'Error: Prettier diff detected! Please run `npm run prettier` and commit the changes.'
exit 1
fi

- name: Run unused style searcher
shell: bash
run: ./.github/scripts/findUnusedKeys.sh
26 changes: 6 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
"patch-package": "^8.1.0-canary.1",
"peggy": "^4.0.3",
"portfinder": "^1.0.28",
"prettier": "^2.8.8",
"prettier": "3.5.3",
"react-compiler-healthcheck": "^19.0.0-beta-8a03594-20241020",
"react-compiler-runtime": "^19.0.0-beta-8a03594-20241020",
"react-is": "^18.3.1",
Expand Down
25 changes: 11 additions & 14 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3640,11 +3640,14 @@ const CONST = {
SELF_SELECT: '__predefined_selfSelect',
},

EXPENSIFY_EMAILS_OBJECT: Object.entries(EMAIL).reduce((prev, [, email]) => {
// eslint-disable-next-line no-param-reassign
prev[email] = true;
return prev;
}, {} as Record<string, boolean>),
EXPENSIFY_EMAILS_OBJECT: Object.entries(EMAIL).reduce(
(prev, [, email]) => {
// eslint-disable-next-line no-param-reassign
prev[email] = true;
return prev;
},
{} as Record<string, boolean>,
),
EXPENSIFY_EMAILS: [
EMAIL.ACCOUNTING,
EMAIL.ACCOUNTS_PAYABLE,
Expand Down Expand Up @@ -5504,15 +5507,9 @@ const CONST = {
type: 'addAccountingIntegration',
autoCompleted: false,
mediaAttributes: {
[`${CLOUDFRONT_URL}/${
connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.netsuite]
}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_netsuite.png" data-expensify-width="1920" data-expensify-height="1080"`,
[`${CLOUDFRONT_URL}/${
connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.quickbooksOnline]
}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_qbo.png" data-expensify-width="1920" data-expensify-height="1080"`,
[`${CLOUDFRONT_URL}/${
connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.xero]
}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_xero.png" data-expensify-width="1920" data-expensify-height="1080"`,
[`${CLOUDFRONT_URL}/${connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.netsuite]}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_netsuite.png" data-expensify-width="1920" data-expensify-height="1080"`,
[`${CLOUDFRONT_URL}/${connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.quickbooksOnline]}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_qbo.png" data-expensify-width="1920" data-expensify-height="1080"`,
[`${CLOUDFRONT_URL}/${connectionsVideoPaths[ONBOARDING_ACCOUNTING_MAPPING.xero]}`]: `data-expensify-thumbnail-url="${CLOUDFRONT_URL}/images/walkthrough-connect_to_xero.png" data-expensify-width="1920" data-expensify-height="1080"`,
},
title: ({integrationName, workspaceAccountingLink}) => `Connect to [${integrationName}](${workspaceAccountingLink})`,
description: ({integrationName, workspaceAccountingLink}) =>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function Avatar({
src={avatarSource}
height={iconSize}
width={iconSize}
fill={imageError ? iconColors?.fill ?? theme.offline : iconColors?.fill ?? fill}
fill={imageError ? (iconColors?.fill ?? theme.offline) : (iconColors?.fill ?? fill)}
additionalStyles={[StyleUtils.getAvatarBorderStyle(size, type), iconColors, iconAdditionalStyles]}
/>
</View>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function Button(
<View style={[styles.mr2, !text && styles.mr0, iconStyles]}>
<Icon
src={icon}
fill={isHovered ? iconHoverFill ?? defaultFill : iconFill ?? defaultFill}
fill={isHovered ? (iconHoverFill ?? defaultFill) : (iconFill ?? defaultFill)}
small={small}
medium={medium}
large={large}
Expand All @@ -342,7 +342,7 @@ function Button(
{!isSplitButton ? (
<Icon
src={iconRight}
fill={isHovered ? iconHoverFill ?? defaultFill : iconFill ?? defaultFill}
fill={isHovered ? (iconHoverFill ?? defaultFill) : (iconFill ?? defaultFill)}
small={small}
medium={medium}
large={large}
Expand All @@ -351,7 +351,7 @@ function Button(
) : (
<Icon
src={iconRight}
fill={isHovered ? iconHoverFill ?? defaultFill : iconFill ?? defaultFill}
fill={isHovered ? (iconHoverFill ?? defaultFill) : (iconFill ?? defaultFill)}
small={small}
medium={medium}
large={large}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type CardPreviewProps = CardPreviewOnyxProps;
function CardPreview({privatePersonalDetails, session}: CardPreviewProps) {
const styles = useThemeStyles();
const {legalFirstName, legalLastName} = privatePersonalDetails ?? {};
const cardHolder = legalFirstName && legalLastName ? `${legalFirstName} ${legalLastName}` : session?.email ?? '';
const cardHolder = legalFirstName && legalLastName ? `${legalFirstName} ${legalLastName}` : (session?.email ?? '');

return (
<View style={styles.walletCard}>
Expand Down
38 changes: 17 additions & 21 deletions src/components/Composer/implementation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,28 +289,24 @@ function Composer(
onClear(currentText);
}, [onClear, onSelectionChange]);

useImperativeHandle(
ref,
() => {
const textInputRef = textInput.current;
if (!textInputRef) {
throw new Error('textInputRef is not available. This should never happen and indicates a developer error.');
}
useImperativeHandle(ref, () => {
const textInputRef = textInput.current;
if (!textInputRef) {
throw new Error('textInputRef is not available. This should never happen and indicates a developer error.');
}

return {
...textInputRef,
// Overwrite clear with our custom implementation, which mimics how the native TextInput's clear method works
clear,
// We have to redefine these methods as they are inherited by prototype chain and are not accessible directly
blur: () => textInputRef.blur(),
focus: () => textInputRef.focus(),
get scrollTop() {
return textInputRef.scrollTop;
},
};
},
[clear],
);
return {
...textInputRef,
// Overwrite clear with our custom implementation, which mimics how the native TextInput's clear method works
clear,
// We have to redefine these methods as they are inherited by prototype chain and are not accessible directly
blur: () => textInputRef.blur(),
focus: () => textInputRef.focus(),
get scrollTop() {
return textInputRef.scrollTop;
},
};
}, [clear]);

const handleKeyPress = useCallback(
(e: NativeSyntheticEvent<TextInputKeyPressEventData>) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function ConfirmContent({
<View style={[shouldCenterIcon ? styles.justifyContentCenter : null, styles.flexRow, styles.mb3]}>
<Icon
src={iconSource}
fill={iconFill === false ? undefined : iconFill ?? theme.icon}
fill={iconFill === false ? undefined : (iconFill ?? theme.icon)}
width={iconWidth}
height={iconHeight}
additionalStyles={iconAdditionalStyles}
Expand Down
2 changes: 1 addition & 1 deletion src/components/FlatList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function MVCPFlatList<TItem>({maintainVisibleContentPosition, horizontal = false
if (!scrollRef.current) {
return 0;
}
return horizontal ? getScrollableNode(scrollRef.current)?.scrollLeft ?? 0 : getScrollableNode(scrollRef.current)?.scrollTop ?? 0;
return horizontal ? (getScrollableNode(scrollRef.current)?.scrollLeft ?? 0) : (getScrollableNode(scrollRef.current)?.scrollTop ?? 0);
}, [horizontal]);

const getContentView = useCallback(() => getScrollableNode(scrollRef.current)?.childNodes[0], []);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/FormWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function FormWrapper({
const errorMessage = useMemo(() => (formState ? getLatestErrorMessage(formState) : undefined), [formState]);

const onFixTheErrorsLinkPressed = useCallback(() => {
const errorFields = !isEmptyObject(errors) ? errors : formState?.errorFields ?? {};
const errorFields = !isEmptyObject(errors) ? errors : (formState?.errorFields ?? {});
const focusKey = Object.keys(inputRefs.current ?? {}).find((key) => Object.keys(errorFields).includes(key));

if (!focusKey) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio

const itemPolicy = policy?.[`${ONYXKEYS.COLLECTION.POLICY}${item?.policyID}`];
const transactionID = isMoneyRequestAction(itemParentReportAction)
? getOriginalMessage(itemParentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID
? (getOriginalMessage(itemParentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID)
: CONST.DEFAULT_NUMBER_ID;
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
const hasDraftComment = isValidDraftComment(draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`]);
Expand All @@ -191,7 +191,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio

// Get the transaction for the last report action
const lastReportActionTransactionID = isMoneyRequestAction(lastReportAction)
? getOriginalMessage(lastReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID
? (getOriginalMessage(lastReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID)
: CONST.DEFAULT_NUMBER_ID;
const lastReportActionTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${lastReportActionTransactionID}`];

Expand Down
4 changes: 2 additions & 2 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,12 @@ function MenuItem(
fill={
displayInDefaultIconColor
? undefined
: iconFill ??
: (iconFill ??
StyleUtils.getIconFillColor(
getButtonState(focused || isHovered, pressed, success, disabled, interactive),
true,
isPaneMenu,
)
))
}
additionalStyles={additionalIconStyles}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function BaseModal(
// except if we are in a narrow pane navigator. In this case, we use the narrow pane's original values.
const {isInNarrowPane} = useContext(NarrowPaneContext);
const {originalValues} = useContext(ScreenWrapperOfflineIndicatorContext);
const offlineIndicatorContextValue = useMemo(() => (isInNarrowPane ? originalValues ?? {} : {}), [isInNarrowPane, originalValues]);
const offlineIndicatorContextValue = useMemo(() => (isInNarrowPane ? (originalValues ?? {}) : {}), [isInNarrowPane, originalValues]);

return (
<ModalContext.Provider value={modalContextValue}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
});
const [transaction] = useOnyx(
`${ONYXKEYS.COLLECTION.TRANSACTION}${
isMoneyRequestAction(parentReportAction) ? getOriginalMessage(parentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID : CONST.DEFAULT_NUMBER_ID
isMoneyRequestAction(parentReportAction) ? (getOriginalMessage(parentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID) : CONST.DEFAULT_NUMBER_ID
}`,
{canBeMissing: true},
);
Expand Down
Loading
Loading