Skip to content

Commit 8e725d5

Browse files
authored
Merge pull request Expensify#62851 from Expensify/jsenyitko-suggested-search
Suggested Search
2 parents ff222c4 + 5cae141 commit 8e725d5

77 files changed

Lines changed: 3418 additions & 1615 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/CONST.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ const CONST = {
418418
horizontal: 12 + variables.navigationTabBarSize,
419419
vertical: 72,
420420
},
421+
POPOVER_DROPDOWN_WIDTH: 336,
422+
POPOVER_DROPDOWN_MIN_HEIGHT: 0,
423+
POPOVER_DROPDOWN_MAX_HEIGHT: 416,
421424
POPOVER_DATE_WIDTH: 338,
422425
POPOVER_DATE_MAX_HEIGHT: 366,
423426
POPOVER_DATE_MIN_HEIGHT: 322,
@@ -6540,6 +6543,7 @@ const CONST = {
65406543
},
65416544

65426545
SEARCH: {
6546+
NEVER: 'never',
65436547
RESULTS_PAGE_SIZE: 50,
65446548
DATA_TYPES: {
65456549
EXPENSE: 'expense',
@@ -6636,7 +6640,6 @@ const CONST = {
66366640
TAX_AMOUNT: 'taxAmount',
66376641
TITLE: 'title',
66386642
ASSIGNEE: 'assignee',
6639-
CREATED_BY: 'createdBy',
66406643
IN: 'in',
66416644
},
66426645
SYNTAX_OPERATORS: {
@@ -6665,6 +6668,8 @@ const CONST = {
66656668
DESCRIPTION: 'description',
66666669
FROM: 'from',
66676670
TO: 'to',
6671+
PAYER: 'payer',
6672+
EXPORTER: 'exporter',
66686673
CATEGORY: 'category',
66696674
TAG: 'tag',
66706675
TAX_RATE: 'taxRate',
@@ -6680,7 +6685,6 @@ const CONST = {
66806685
POSTED: 'posted',
66816686
TITLE: 'title',
66826687
ASSIGNEE: 'assignee',
6683-
CREATED_BY: 'createdBy',
66846688
REIMBURSABLE: 'reimbursable',
66856689
BILLABLE: 'billable',
66866690
POLICY_ID: 'policyID',
@@ -6706,6 +6710,8 @@ const CONST = {
67066710
DESCRIPTION: 'description',
67076711
FROM: 'from',
67086712
TO: 'to',
6713+
PAYER: 'payer',
6714+
EXPORTER: 'exporter',
67096715
CATEGORY: 'category',
67106716
TAG: 'tag',
67116717
TAX_RATE: 'tax-rate',
@@ -6721,13 +6727,13 @@ const CONST = {
67216727
POSTED: 'posted',
67226728
TITLE: 'title',
67236729
ASSIGNEE: 'assignee',
6724-
CREATED_BY: 'created-by',
67256730
REIMBURSABLE: 'reimbursable',
67266731
BILLABLE: 'billable',
67276732
},
67286733
DATE_MODIFIERS: {
67296734
BEFORE: 'Before',
67306735
AFTER: 'After',
6736+
ON: 'On',
67316737
},
67326738
SNAPSHOT_ONYX_KEYS: [
67336739
ONYXKEYS.COLLECTION.REPORT,

src/ROUTES.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ const ROUTES = {
7373
SEARCH_ADVANCED_FILTERS_POSTED: 'search/filters/posted',
7474
SEARCH_ADVANCED_FILTERS_TITLE: 'search/filters/title',
7575
SEARCH_ADVANCED_FILTERS_ASSIGNEE: 'search/filters/assignee',
76-
SEARCH_ADVANCED_FILTERS_CREATED_BY: 'search/filters/createdBy',
7776
SEARCH_ADVANCED_FILTERS_REIMBURSABLE: 'search/filters/reimbursable',
7877
SEARCH_ADVANCED_FILTERS_BILLABLE: 'search/filters/billable',
7978
SEARCH_ADVANCED_FILTERS_WORKSPACE: 'search/filters/workspace',

src/SCREENS.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const SCREENS = {
6363
ADVANCED_FILTERS_TO_RHP: 'Search_Advanced_Filters_To_RHP',
6464
ADVANCED_FILTERS_TITLE_RHP: 'Search_Advanced_Filters_Title_RHP',
6565
ADVANCED_FILTERS_ASSIGNEE_RHP: 'Search_Advanced_Filters_Assignee_RHP',
66-
ADVANCED_FILTERS_CREATED_BY_RHP: 'Search_Advanced_Filters_Created_By_RHP',
6766
ADVANCED_FILTERS_REIMBURSABLE_RHP: 'Search_Advanced_Filters_Reimbursable_RHP',
6867
ADVANCED_FILTERS_BILLABLE_RHP: 'Search_Advanced_Filters_Billable_RHP',
6968
ADVANCED_FILTERS_WORKSPACE_RHP: 'Search_Advanced_Filters_Workspace_RHP',

src/components/Button/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,12 @@ function Button(
294294
danger && styles.buttonDangerText,
295295
!!icon && styles.textAlignLeft,
296296
!!secondLineText && styles.noPaddingBottom,
297-
textStyles,
298297
isHovered && textHoverStyles,
299-
link && styles.link,
300-
link && isHovered && StyleUtils.getColorStyle(theme.linkHover),
301298
link && styles.fontWeightNormal,
302299
link && styles.fontSizeLabel,
300+
textStyles,
301+
link && styles.link,
302+
link && isHovered && StyleUtils.getColorStyle(theme.linkHover),
303303
]}
304304
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
305305
>

src/components/CaretWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import type {ViewStyle} from 'react-native';
2+
import type {StyleProp, ViewStyle} from 'react-native';
33
import {View} from 'react-native';
44
import useTheme from '@hooks/useTheme';
55
import useThemeStyles from '@hooks/useThemeStyles';
@@ -9,7 +9,7 @@ import Icon from './Icon';
99
import * as Expensicons from './Icon/Expensicons';
1010

1111
type CaretWrapperProps = ChildrenProps & {
12-
style?: ViewStyle;
12+
style?: StyleProp<ViewStyle>;
1313
};
1414

1515
function CaretWrapper({children, style}: CaretWrapperProps) {

src/components/DatePicker/CalendarPicker/YearPickerModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear
5555
hideModalContentWhileAnimating
5656
useNativeDriver
5757
shouldHandleNavigationBack
58+
shouldUseCustomBackdrop
59+
onBackdropPress={onClose}
5860
enableEdgeToEdgeBottomSafeAreaPadding
5961
>
6062
<ScreenWrapper

src/components/EmptyStateComponent/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function EmptyStateComponent({
105105
<View style={[styles.gap2, styles.mt5, !shouldUseNarrowLayout ? styles.flexRow : styles.mhAuto]}>
106106
{buttons?.map(({buttonText, buttonAction, success, icon, isDisabled, style}) => (
107107
<Button
108+
key={buttonText}
108109
success={success}
109110
onPress={buttonAction}
110111
text={buttonText}

src/components/EmptyStateComponent/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import type IconAsset from '@src/types/utils/IconAsset';
99

1010
type ValidSkeletons = typeof SearchRowSkeleton | typeof TableRowSkeleton;
1111
type MediaTypes = ValueOf<typeof CONST.EMPTY_STATE_MEDIA>;
12-
type Button = {buttonText?: string; buttonAction?: () => void; success?: boolean; icon?: IconAsset; isDisabled?: boolean; style?: StyleProp<ViewStyle>};
12+
type EmptyStateButton = {buttonText?: string; buttonAction?: () => void; success?: boolean; icon?: IconAsset; isDisabled?: boolean; style?: StyleProp<ViewStyle>};
1313

1414
type SharedProps<T> = {
1515
SkeletonComponent?: ValidSkeletons;
1616
title: string;
1717
titleStyles?: StyleProp<TextStyle>;
1818
subtitle?: string;
1919
children?: React.ReactNode;
20-
buttons?: Button[];
20+
buttons?: EmptyStateButton[];
2121
containerStyles?: StyleProp<ViewStyle>;
2222
cardStyles?: StyleProp<ViewStyle>;
2323
cardContentStyles?: StyleProp<ViewStyle>;
@@ -45,4 +45,4 @@ type VideoLoadedEventType = {
4545
};
4646
};
4747

48-
export type {EmptyStateComponentProps, VideoLoadedEventType};
48+
export type {EmptyStateComponentProps, VideoLoadedEventType, EmptyStateButton};

src/components/MenuItem.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,12 @@ function MenuItem(
502502
const {isExecuting, singleExecution, waitForNavigate} = useContext(MenuItemGroupContext) ?? {};
503503
const popoverAnchor = useRef<View>(null);
504504

505+
const isCompact = viewMode === CONST.OPTION_MODE.COMPACT;
505506
const isDeleted = style && Array.isArray(style) ? style.includes(styles.offlineFeedback.deleted) : false;
506507
const descriptionVerticalMargin = shouldShowDescriptionOnTop ? styles.mb1 : styles.mt1;
507-
const fallbackAvatarSize = viewMode === CONST.OPTION_MODE.COMPACT ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT;
508+
const fallbackAvatarSize = isCompact ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT;
508509
const firstRightIcon = floatRightAvatars.at(0);
510+
509511
const combinedTitleTextStyle = StyleUtils.combineStyles(
510512
[
511513
styles.flexShrink1,
@@ -663,6 +665,8 @@ function MenuItem(
663665
containerStyle,
664666
combinedStyle,
665667
!interactive && styles.cursorDefault,
668+
isCompact && styles.alignItemsCenter,
669+
isCompact && styles.optionRowCompact,
666670
!shouldRemoveBackground &&
667671
StyleUtils.getButtonBackgroundColorStyle(getButtonState(focused || isHovered, pressed, success, disabled, interactive), true),
668672
...(Array.isArray(wrapperStyle) ? wrapperStyle : [wrapperStyle]),
@@ -797,7 +801,7 @@ function MenuItem(
797801
style={[
798802
styles.justifyContentCenter,
799803
styles.flex1,
800-
StyleUtils.getMenuItemTextContainerStyle(isSmallAvatarSubscriptMenu),
804+
StyleUtils.getMenuItemTextContainerStyle(isSmallAvatarSubscriptMenu || isCompact),
801805
titleContainerStyle,
802806
]}
803807
>
@@ -869,7 +873,7 @@ function MenuItem(
869873
</View>
870874
</View>
871875
</View>
872-
<View style={[styles.flexRow, styles.menuItemTextContainer, !hasPressableRightComponent && styles.pointerEventsNone]}>
876+
<View style={[styles.flexRow, StyleUtils.getMenuItemTextContainerStyle(isCompact), !hasPressableRightComponent && styles.pointerEventsNone]}>
873877
{!!badgeText && (
874878
<Badge
875879
text={badgeText}
@@ -919,7 +923,11 @@ function MenuItem(
919923
)}
920924
{shouldShowRightIcon && (
921925
<View
922-
style={[styles.popoverMenuIcon, styles.pointerEventsAuto, disabled && !shouldUseDefaultCursorWhenDisabled && styles.cursorDisabled]}
926+
style={[
927+
styles.pointerEventsAuto,
928+
StyleUtils.getMenuItemIconStyle(isCompact),
929+
disabled && !shouldUseDefaultCursorWhenDisabled && styles.cursorDisabled,
930+
]}
923931
>
924932
<Icon
925933
src={iconRight}

src/components/MoneyRequestReportView/MoneyRequestReportTableHeader.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const shouldShowColumnConfig: Record<SortableColumnName, (isIOUReport: boolean)
3030
[CONST.SEARCH.TABLE_COLUMNS.ACTION]: () => false,
3131
[CONST.SEARCH.TABLE_COLUMNS.TITLE]: () => false,
3232
[CONST.SEARCH.TABLE_COLUMNS.ASSIGNEE]: () => false,
33-
[CONST.SEARCH.TABLE_COLUMNS.CREATED_BY]: () => false,
3433
};
3534

3635
const columnConfig: ColumnConfig[] = [

0 commit comments

Comments
 (0)