Skip to content

Commit

Permalink
Merge branch 'main' into fix/44586-pay-system-message-doesnt-show-in-lhn
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jul 8, 2024
2 parents f0e6713 + 83be857 commit 0a08cbb
Show file tree
Hide file tree
Showing 62 changed files with 639 additions and 476 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ jobs:
git fetch origin "$BASELINE_BRANCH" --no-tags --depth=1
git switch "$BASELINE_BRANCH"
npm install --force
npx reassure --baseline
NODE_OPTIONS=--experimental-vm-modules npx reassure --baseline
git switch --force --detach -
git merge --no-commit --allow-unrelated-histories "$BASELINE_BRANCH" -X ours
git checkout --ours .
npm install --force
npx reassure --branch
NODE_OPTIONS=--experimental-vm-modules npx reassure --branch
- name: Validate output.json
id: validateReassureOutput
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009000407
versionName "9.0.4-7"
versionCode 1009000502
versionName "9.0.5-2"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
9 changes: 9 additions & 0 deletions assets/images/circular-arrow-backwards.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>9.0.4</string>
<string>9.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.0.4.7</string>
<string>9.0.5.2</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>9.0.4</string>
<string>9.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9.0.4.7</string>
<string>9.0.5.2</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>9.0.4</string>
<string>9.0.5</string>
<key>CFBundleVersion</key>
<string>9.0.4.7</string>
<string>9.0.5.2</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "9.0.4-7",
"version": "9.0.5-2",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
3 changes: 2 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ const CONST = {
TASK_EDITED: 'TASKEDITED',
TASK_REOPENED: 'TASKREOPENED',
TRIPPREVIEW: 'TRIPPREVIEW',
UNAPPROVED: 'UNAPPROVED', // OldDot Action
UNAPPROVED: 'UNAPPROVED',
UNHOLD: 'UNHOLD',
UNSHARE: 'UNSHARE', // OldDot Action
UPDATE_GROUP_CHAT_MEMBER_ROLE: 'UPDATEGROUPCHATMEMBERROLE',
Expand Down Expand Up @@ -2335,6 +2335,7 @@ const CONST = {
PRIVATE_NOTES: 'privateNotes',
DELETE: 'delete',
MARK_AS_INCOMPLETE: 'markAsIncomplete',
UNAPPROVE: 'unapprove',
},
EDIT_REQUEST_FIELD: {
AMOUNT: 'amount',
Expand Down
4 changes: 4 additions & 0 deletions src/components/FocusTrap/SCREENS_WITH_AUTOFOCUS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const SCREENS_WITH_AUTOFOCUS: string[] = [
SCREENS.PRIVATE_NOTES.EDIT,
SCREENS.SETTINGS.PROFILE.STATUS,
SCREENS.SETTINGS.PROFILE.PRONOUNS,
SCREENS.REPORT_SETTINGS.ROOT,
SCREENS.REPORT_SETTINGS.NOTIFICATION_PREFERENCES,
SCREENS.REPORT_PARTICIPANTS.ROOT,
SCREENS.ROOM_MEMBERS_ROOT,
SCREENS.NEW_TASK.DETAILS,
SCREENS.MONEY_REQUEST.CREATE,
SCREENS.SIGN_IN_ROOT,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import ChatBubbles from '@assets/images/chatbubbles.svg';
import CheckCircle from '@assets/images/check-circle.svg';
import CheckmarkCircle from '@assets/images/checkmark-circle.svg';
import Checkmark from '@assets/images/checkmark.svg';
import CircularArrowBackwards from '@assets/images/circular-arrow-backwards.svg';
import Close from '@assets/images/close.svg';
import ClosedSign from '@assets/images/closed-sign.svg';
import Coins from '@assets/images/coins.svg';
Expand Down Expand Up @@ -201,6 +202,7 @@ export {
Wrench,
BackArrow,
Bank,
CircularArrowBackwards,
Bill,
Bell,
BellSlash,
Expand Down
14 changes: 13 additions & 1 deletion src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,18 @@ function MoneyRequestConfirmationList({
],
);

const shouldDisableParticipant = (participant: Participant): boolean => {
if (ReportUtils.isDraftReport(participant.reportID)) {
return true;
}

if (!participant.isInvoiceRoom && !participant.isPolicyExpenseChat && !participant.isSelfDM && ReportUtils.isOptimisticPersonalDetail(participant.accountID ?? -1)) {
return true;
}

return false;
};

const sections = useMemo(() => {
const options: Array<SectionListDataType<MoneyRequestConfirmationListItem>> = [];
if (isTypeSplit) {
Expand All @@ -553,7 +565,7 @@ function MoneyRequestConfirmationList({
const formattedSelectedParticipants = selectedParticipants.map((participant) => ({
...participant,
isSelected: false,
isDisabled: !participant.isInvoiceRoom && !participant.isPolicyExpenseChat && !participant.isSelfDM && ReportUtils.isOptimisticPersonalDetail(participant.accountID ?? -1),
isInteractive: !shouldDisableParticipant(participant),
}));
options.push({
title: translate('common.to'),
Expand Down
6 changes: 4 additions & 2 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@ function PopoverMenu({
const selectedItemIndex = useRef<number | null>(null);

const [currentMenuItems, setCurrentMenuItems] = useState(menuItems);
const currentMenuItemsFocusedIndex = currentMenuItems?.findIndex((option) => option.isSelected);
const [enteredSubMenuIndexes, setEnteredSubMenuIndexes] = useState<number[]>([]);

const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({initialFocusedIndex: -1, maxIndex: currentMenuItems.length - 1, isActive: isVisible});
const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({initialFocusedIndex: currentMenuItemsFocusedIndex, maxIndex: currentMenuItems.length - 1, isActive: isVisible});

const selectItem = (index: number) => {
const selectedItem = currentMenuItems[index];
if (selectedItem?.subMenuItems) {
setCurrentMenuItems([...selectedItem.subMenuItems]);
setEnteredSubMenuIndexes([...enteredSubMenuIndexes, index]);
setFocusedIndex(-1);
const selectedSubMenuItemIndex = selectedItem?.subMenuItems.findIndex((option) => option.isSelected);
setFocusedIndex(selectedSubMenuItemIndex);
} else {
selectedItemIndex.current = index;
onItemSelected(selectedItem, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function GenericPressable(
onPressOut,
accessible = true,
fullDisabled = false,
interactive = true,
...rest
}: PressableProps,
ref: PressableRef,
Expand Down Expand Up @@ -67,14 +68,17 @@ function GenericPressable(
* Returns the cursor style based on the state of Pressable
*/
const cursorStyle = useMemo(() => {
if (!interactive) {
return styles.cursorDefault;
}
if (shouldUseDisabledCursor) {
return styles.cursorDisabled;
}
if ([rest.accessibilityRole, rest.role].includes(CONST.ROLE.PRESENTATION)) {
return styles.cursorText;
}
return styles.cursorPointer;
}, [styles, shouldUseDisabledCursor, rest.accessibilityRole, rest.role]);
}, [styles, shouldUseDisabledCursor, rest.accessibilityRole, rest.role, interactive]);

const onLongPressHandler = useCallback(
(event: GestureResponderEvent) => {
Expand All @@ -98,7 +102,7 @@ function GenericPressable(

const onPressHandler = useCallback(
(event?: GestureResponderEvent | KeyboardEvent) => {
if (isDisabled) {
if (isDisabled || !interactive) {
return;
}
if (!onPress) {
Expand All @@ -113,7 +117,7 @@ function GenericPressable(
}
return onPress(event);
},
[shouldUseHapticsOnPress, onPress, nextFocusRef, ref, isDisabled],
[shouldUseHapticsOnPress, onPress, nextFocusRef, ref, isDisabled, interactive],
);

const voidOnPressHandler = useCallback(
Expand Down
6 changes: 6 additions & 0 deletions src/components/Pressable/GenericPressable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ type PressableProps = RNPressableProps &
* Specifies if the pressable responder should be disabled
*/
fullDisabled?: boolean;

/**
* Whether the menu item should be interactive at all
* e.g., show disabled cursor when disabled
*/
interactive?: boolean;
};

type PressableRef = ForwardedRef<HTMLDivElement | View | RNText | undefined>;
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectionList/BaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function BaseListItem<TItem extends ListItem>({
onSelectRow(item);
}}
disabled={isDisabled && !item.isSelected}
interactive={item.isInteractive}
accessibilityLabel={item.text ?? ''}
role={CONST.ROLE.BUTTON}
hoverDimmingValue={1}
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ type ListItem = {
/** Whether this option is disabled for selection */
isDisabled?: boolean | null;

/** Whether this item should be interactive at all */
isInteractive?: boolean;

/** List title is bold by default. Use this props to customize it */
isBold?: boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function VideoPopoverMenuContextProvider({children}: ChildrenProps) {
updatePlaybackSpeed(speed);
},
shouldPutLeftPaddingWhenNoIcon: true,
isSelected: currentPlaybackSpeed === speed,
})),
});
return items;
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useMarkdownStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const defaultEmptyArray: Array<keyof MarkdownStyle> = [];

function useMarkdownStyle(message: string | null = null, excludeStyles: Array<keyof MarkdownStyle> = defaultEmptyArray): MarkdownStyle {
const theme = useTheme();
const emojiFontSize = containsOnlyEmojis(message ?? '') ? variables.fontSizeOnlyEmojis : variables.fontSizeNormal;
const hasMessageOnlyEmojis = message != null && message.length > 0 && containsOnlyEmojis(message);
const emojiFontSize = hasMessageOnlyEmojis ? variables.fontSizeOnlyEmojis : variables.fontSizeNormal;

// this map is used to reset the styles that are not needed - passing undefined value can break the native side
const nonStylingDefaultValues: Record<string, string | number> = useMemo(
Expand Down
Loading

0 comments on commit 0a08cbb

Please sign in to comment.