Skip to content

Commit

Permalink
Merge branch 'main' into fix/49454-task-assignee-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Sep 30, 2024
2 parents 5147c37 + e84dab7 commit 6ed09b9
Show file tree
Hide file tree
Showing 56 changed files with 1,231 additions and 623 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package-lock.json
*.css
*.scss
*.md
*.markdown
# We need to modify the import here specifically, hence we disable prettier to get rid of the sorted imports
src/libs/E2E/reactNativeLaunchingTest.ts
# Temporary while we keep react-compiler in our repo
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009004102
versionName "9.0.41-2"
versionCode 1009004104
versionName "9.0.41-4"
// 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
4 changes: 2 additions & 2 deletions assets/images/table.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ Once the member verifies their email address, all Domain Admins will be notified
3. Click the **Domain Members** tab on the left.
4. Under the Domain Members section, enter the first part of the member’s email address and click **Invite**.

{% include info.html %}
This can be any email address—it does not have to be an email address under the domain. If someone who is not a Domain Admin invites a new member to a workspace, that member must validate their account via email before they will have access to it.
{% include end-info.html %}

# Add Domain Admin

1. Hover over Settings, then click **Domains**.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.0.41.2</string>
<string>9.0.41.4</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9.0.41.2</string>
<string>9.0.41.4</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>9.0.41</string>
<key>CFBundleVersion</key>
<string>9.0.41.2</string>
<string>9.0.41.4</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
19 changes: 9 additions & 10 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "9.0.41-2",
"version": "9.0.41-4",
"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 Expand Up @@ -107,7 +107,7 @@
"date-fns-tz": "^2.0.0",
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"expensify-common": "2.0.88",
"expensify-common": "2.0.94",
"expo": "51.0.31",
"expo-av": "14.0.7",
"expo-image": "1.12.15",
Expand Down Expand Up @@ -169,7 +169,7 @@
"react-native-svg": "15.6.0",
"react-native-tab-view": "^3.5.2",
"react-native-url-polyfill": "^2.0.0",
"react-native-view-shot": "4.0.0-alpha.3",
"react-native-view-shot": "3.8.0",
"react-native-vision-camera": "4.0.0-beta.13",
"react-native-web": "^0.19.12",
"react-native-web-sound": "^0.1.3",
Expand Down
94 changes: 94 additions & 0 deletions patches/react-native-draggable-flatlist+4.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
diff --git a/node_modules/react-native-draggable-flatlist/src/components/DraggableFlatList.tsx b/node_modules/react-native-draggable-flatlist/src/components/DraggableFlatList.tsx
index d7d98c2..2f59c7a 100644
--- a/node_modules/react-native-draggable-flatlist/src/components/DraggableFlatList.tsx
+++ b/node_modules/react-native-draggable-flatlist/src/components/DraggableFlatList.tsx
@@ -295,7 +295,7 @@ function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
const springTo = placeholderOffset.value - activeCellOffset.value;
touchTranslate.value = withSpring(
springTo,
- animationConfigRef.current,
+ animationConfigRef.value,
() => {
runOnJS(onDragEnd)({
from: activeIndexAnim.value,
diff --git a/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx b/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx
index ea21575..66c5eed 100644
--- a/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx
+++ b/node_modules/react-native-draggable-flatlist/src/context/refContext.tsx
@@ -1,14 +1,14 @@
import React, { useContext } from "react";
import { useMemo, useRef } from "react";
import { FlatList } from "react-native-gesture-handler";
-import Animated, { WithSpringConfig } from "react-native-reanimated";
+import Animated, { type SharedValue, useSharedValue, WithSpringConfig } from "react-native-reanimated";
import { DEFAULT_PROPS } from "../constants";
import { useProps } from "./propsContext";
import { CellData, DraggableFlatListProps } from "../types";

type RefContextValue<T> = {
propsRef: React.MutableRefObject<DraggableFlatListProps<T>>;
- animationConfigRef: React.MutableRefObject<WithSpringConfig>;
+ animationConfigRef: SharedValue<WithSpringConfig>;
cellDataRef: React.MutableRefObject<Map<string, CellData>>;
keyToIndexRef: React.MutableRefObject<Map<string, number>>;
containerRef: React.RefObject<Animated.View>;
@@ -54,8 +54,8 @@ function useSetupRefs<T>({
...DEFAULT_PROPS.animationConfig,
...animationConfig,
} as WithSpringConfig;
- const animationConfigRef = useRef(animConfig);
- animationConfigRef.current = animConfig;
+ const animationConfigRef = useSharedValue(animConfig);
+ animationConfigRef.value = animConfig;

const cellDataRef = useRef(new Map<string, CellData>());
const keyToIndexRef = useRef(new Map<string, number>());
diff --git a/node_modules/react-native-draggable-flatlist/src/hooks/useCellTranslate.tsx b/node_modules/react-native-draggable-flatlist/src/hooks/useCellTranslate.tsx
index ce4ab68..efea240 100644
--- a/node_modules/react-native-draggable-flatlist/src/hooks/useCellTranslate.tsx
+++ b/node_modules/react-native-draggable-flatlist/src/hooks/useCellTranslate.tsx
@@ -101,7 +101,7 @@ export function useCellTranslate({ cellIndex, cellSize, cellOffset }: Params) {
? activeCellSize.value * (isAfterActive ? -1 : 1)
: 0;

- return withSpring(translationAmt, animationConfigRef.current);
+ return withSpring(translationAmt, animationConfigRef.value);
}, [activeKey, cellIndex]);

return translate;
diff --git a/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts b/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts
index 7c20587..857c7d0 100644
--- a/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts
+++ b/node_modules/react-native-draggable-flatlist/src/hooks/useOnCellActiveAnimation.ts
@@ -1,8 +1,9 @@
-import { useRef } from "react";
-import Animated, {
+
+import {
useDerivedValue,
withSpring,
WithSpringConfig,
+ useSharedValue,
} from "react-native-reanimated";
import { DEFAULT_ANIMATION_CONFIG } from "../constants";
import { useAnimatedValues } from "../context/animatedValueContext";
@@ -15,8 +16,8 @@ type Params = {
export function useOnCellActiveAnimation(
{ animationConfig }: Params = { animationConfig: {} }
) {
- const animationConfigRef = useRef(animationConfig);
- animationConfigRef.current = animationConfig;
+ const animationConfigRef = useSharedValue(animationConfig);
+ animationConfigRef.value = animationConfig;

const isActive = useIsActive();

@@ -26,7 +27,7 @@ export function useOnCellActiveAnimation(
const toVal = isActive && isTouchActiveNative.value ? 1 : 0;
return withSpring(toVal, {
...DEFAULT_ANIMATION_CONFIG,
- ...animationConfigRef.current,
+ ...animationConfigRef.value,
});
}, [isActive]);

3 changes: 0 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ LogBox.ignoreLogs([
// the timer is lost. Currently Expensify is using a 30 minutes interval to refresh personal details.
// More details here: https://git.io/JJYeb
'Setting a timer for a long period of time',
// We silence this warning for now and will address all the places where it happens separately.
// Then we can remove this line so the problem does not occur in the future.
'[Reanimated] Tried to modify key `current`',
]);

const fill = {flex: 1};
Expand Down
8 changes: 4 additions & 4 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4550,12 +4550,12 @@ const CONST = {
'Here’s how to set up categories:\n' +
'\n' +
'1. Click your profile picture.\n' +
'2. Go to Workspaces.\n' +
'2. Go to *Workspaces*.\n' +
'3. Select your workspace.\n' +
'4. Click *Categories*.\n' +
'5. Enable and disable default categories.\n' +
'6. Click *Add categories* to make your own.\n' +
'7. For more controls like requiring a category for every expense, click *Settings*.\n' +
'5. Add or import your own categories.\n' +
"6. Disable any default categories you don't need.\n" +
'7. Require a category for every expense in *Settings*.\n' +
'\n' +
`[Take me to workspace category settings](${workspaceCategoriesLink}).`,
},
Expand Down
33 changes: 30 additions & 3 deletions src/components/Search/SearchContext.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
import React, {useCallback, useContext, useMemo, useState} from 'react';
import type {ReportActionListItemType, ReportListItemType, TransactionListItemType} from '@components/SelectionList/types';
import * as SearchUtils from '@libs/SearchUtils';
import type ChildrenProps from '@src/types/utils/ChildrenProps';
import type {SearchContext, SelectedTransactions} from './types';

const defaultSearchContext = {
currentSearchHash: -1,
selectedTransactions: {},
selectedReports: [],
setCurrentSearchHash: () => {},
setSelectedTransactions: () => {},
clearSelectedTransactions: () => {},
shouldShowStatusBarLoading: false,
setShouldShowStatusBarLoading: () => {},
};

const Context = React.createContext<SearchContext>(defaultSearchContext);

function getReportsFromSelectedTransactions(data: TransactionListItemType[] | ReportListItemType[] | ReportActionListItemType[], selectedTransactions: SelectedTransactions) {
return (data ?? [])
.filter(
(item) =>
!SearchUtils.isTransactionListItemType(item) &&
!SearchUtils.isReportActionListItemType(item) &&
item.reportID &&
item?.transactions?.every((transaction: {keyForList: string | number}) => selectedTransactions[transaction.keyForList]?.isSelected),
)
.map((item) => item.reportID);
}

function SearchContextProvider({children}: ChildrenProps) {
const [searchContextData, setSearchContextData] = useState<Pick<SearchContext, 'currentSearchHash' | 'selectedTransactions'>>({
const [searchContextData, setSearchContextData] = useState<Pick<SearchContext, 'currentSearchHash' | 'selectedTransactions' | 'selectedReports'>>({
currentSearchHash: defaultSearchContext.currentSearchHash,
selectedTransactions: defaultSearchContext.selectedTransactions,
selectedReports: defaultSearchContext.selectedReports,
});

const setCurrentSearchHash = useCallback((searchHash: number) => {
Expand All @@ -25,10 +43,14 @@ function SearchContextProvider({children}: ChildrenProps) {
}));
}, []);

const setSelectedTransactions = useCallback((selectedTransactions: SelectedTransactions) => {
const setSelectedTransactions = useCallback((selectedTransactions: SelectedTransactions, data: TransactionListItemType[] | ReportListItemType[] | ReportActionListItemType[]) => {
// When selecting transactions, we also need to manage the reports to which these transactions belong. This is done to ensure proper exporting to CSV.
const selectedReports = getReportsFromSelectedTransactions(data, selectedTransactions);

setSearchContextData((prevState) => ({
...prevState,
selectedTransactions,
selectedReports,
}));
}, []);

Expand All @@ -40,19 +62,24 @@ function SearchContextProvider({children}: ChildrenProps) {
setSearchContextData((prevState) => ({
...prevState,
selectedTransactions: {},
selectedReports: [],
}));
},
[searchContextData.currentSearchHash],
);

const [shouldShowStatusBarLoading, setShouldShowStatusBarLoading] = useState(false);

const searchContext = useMemo<SearchContext>(
() => ({
...searchContextData,
setCurrentSearchHash,
setSelectedTransactions,
clearSelectedTransactions,
shouldShowStatusBarLoading,
setShouldShowStatusBarLoading,
}),
[searchContextData, setCurrentSearchHash, setSelectedTransactions, clearSelectedTransactions],
[searchContextData, setCurrentSearchHash, setSelectedTransactions, clearSelectedTransactions, shouldShowStatusBarLoading],
);

return <Context.Provider value={searchContext}>{children}</Context.Provider>;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Search/SearchFiltersChatsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
const selectedOptions = useMemo<OptionData[]>(() => {
return selectedReportIDs.map((id) => {
const report = getSelectedOptionData(OptionsListUtils.createOptionFromReport({...reports?.[`${ONYXKEYS.COLLECTION.REPORT}${id}`], reportID: id}, personalDetails));
const alternateText = OptionsListUtils.getAlternateText(report, {showChatPreviewLine: true});
const alternateText = OptionsListUtils.getAlternateText(report, {});
return {...report, alternateText};
});
}, [personalDetails, reports, selectedReportIDs]);
Expand All @@ -65,7 +65,7 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
if (!areOptionsInitialized || !isScreenTransitionEnd) {
return defaultListOptions;
}
return OptionsListUtils.getSearchOptions(options);
return OptionsListUtils.getSearchOptions(options, '', undefined, false);
}, [areOptionsInitialized, isScreenTransitionEnd, options]);

const chatOptions = useMemo(() => {
Expand Down
Loading

0 comments on commit 6ed09b9

Please sign in to comment.