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
49 changes: 49 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8173,6 +8173,55 @@ const CONST = {
USER_SELECTION_CHECKBOX: 'Search-UserSelectionCheckbox',
TRANSACTION_GROUP_LIST_ITEM: 'Search-TransactionGroupListItem',
SELECT_ALL_BUTTON: 'Search-SelectAllButton',
TYPE_MENU_BUTTON: 'Search-TypeMenuButton',
FILTER_TYPE: 'Search-FilterType',
FILTER_STATUS: 'Search-FilterStatus',
FILTER_DATE: 'Search-FilterDate',
FILTER_FROM: 'Search-FilterFrom',
FILTER_WORKSPACE: 'Search-FilterWorkspace',
FILTER_GROUP_BY: 'Search-FilterGroupBy',
FILTER_GROUP_CURRENCY: 'Search-FilterGroupCurrency',
FILTER_VIEW: 'Search-FilterView',
FILTER_FEED: 'Search-FilterFeed',
FILTER_POSTED: 'Search-FilterPosted',
FILTER_WITHDRAWN: 'Search-FilterWithdrawn',
FILTER_WITHDRAWAL_TYPE: 'Search-FilterWithdrawalType',
FILTER_HAS: 'Search-FilterHas',
FILTER_IS: 'Search-FilterIs',
ADVANCED_FILTERS_BUTTON: 'Search-AdvancedFiltersButton',
COLUMNS_BUTTON: 'Search-ColumnsButton',
SELECT_ALL_MATCHING_BUTTON: 'Search-SelectAllMatchingButton',
BULK_ACTIONS_DROPDOWN: 'Search-BulkActionsDropdown',
SELECT_ALL_CHECKBOX: 'Search-SelectAllCheckbox',
SELECTION_MODE_MENU_ITEM: 'Search-SelectionModeMenuItem',
FILTER_RESET_BUTTON: 'Search-FilterResetButton',
FILTER_SAVE_BUTTON: 'Search-FilterSaveButton',
NARROW_BULK_ACTIONS_DROPDOWN: 'Search-NarrowBulkActionsDropdown',
SAVED_SEARCH_THREE_DOT_MENU: 'Search-SavedSearchThreeDotMenu',
FILTER_POPUP_RESET_SINGLE_SELECT: 'Search-FilterPopupResetSingleSelect',
FILTER_POPUP_APPLY_SINGLE_SELECT: 'Search-FilterPopupApplySingleSelect',
FILTER_POPUP_RESET_MULTI_SELECT: 'Search-FilterPopupResetMultiSelect',
FILTER_POPUP_APPLY_MULTI_SELECT: 'Search-FilterPopupApplyMultiSelect',
FILTER_POPUP_RESET_DATE: 'Search-FilterPopupResetDate',
FILTER_POPUP_APPLY_DATE: 'Search-FilterPopupApplyDate',
FILTER_POPUP_RESET_USER: 'Search-FilterPopupResetUser',
FILTER_POPUP_APPLY_USER: 'Search-FilterPopupApplyUser',
TRANSACTION_LIST_ITEM: 'Search-TransactionListItem',
TRANSACTION_LIST_ITEM_CHECKBOX: 'Search-TransactionListItemCheckbox',
EXPANDED_TRANSACTION_ROW: 'Search-ExpandedTransactionRow',
EXPANDED_TRANSACTION_ROW_CHECKBOX: 'Search-ExpandedTransactionRowCheckbox',
TYPE_MENU_ITEM: 'Search-TypeMenuItem',
SAVED_SEARCH_MENU_ITEM: 'Search-SavedSearchMenuItem',
ADVANCED_FILTER_ITEM: 'Search-AdvancedFilterItem',
SAVE_SEARCH_BUTTON: 'Search-SaveSearchButton',
VIEW_RESULTS_BUTTON: 'Search-ViewResultsButton',
ACTION_CELL_VIEW: 'Search-ActionCellView',
ACTION_CELL_PAY: 'Search-ActionCellPay',
ACTION_CELL_ACTION: 'Search-ActionCellAction',
EXPENSE_REPORT_CHECKBOX: 'Search-ExpenseReportCheckbox',
GROUP_EXPAND_TOGGLE: 'Search-GroupExpandToggle',
GROUP_SELECT_ALL_CHECKBOX: 'Search-GroupSelectAllCheckbox',
SORTABLE_HEADER: 'Search-SortableHeader',
},
REPORT: {
FLOATING_MESSAGE_COUNTER: 'Report-FloatingMessageCounter',
Expand Down
5 changes: 4 additions & 1 deletion src/components/AnimatedCollapsible/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import type WithSentryLabel from '@src/types/utils/SentryLabel';

type AnimatedCollapsibleProps = {
type AnimatedCollapsibleProps = WithSentryLabel & {
/** Whether the component is expanded */
isExpanded: boolean;

Expand Down Expand Up @@ -67,6 +68,7 @@ function AnimatedCollapsible({
disabled = false,
shouldShowToggleButton = true,
borderBottomStyle,
sentryLabel,
}: AnimatedCollapsibleProps) {
const theme = useTheme();
const styles = useThemeStyles();
Expand Down Expand Up @@ -139,6 +141,7 @@ function AnimatedCollapsible({
style={[styles.p3Half, styles.justifyContentCenter, styles.alignItemsCenter, expandButtonStyle]}
accessibilityRole={CONST.ROLE.BUTTON}
accessibilityLabel={isExpanded ? CONST.ACCESSIBILITY_LABELS.COLLAPSE : CONST.ACCESSIBILITY_LABELS.EXPAND}
sentryLabel={sentryLabel}
>
{({hovered}) => (
<Icon
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/FilterDropdowns/DateSelectPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ function DateSelectPopup({label, value, presets, closeOverlay, onChange}: DateSe
style={[styles.flex1]}
text={translate('common.reset')}
onPress={resetChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_RESET_DATE}
/>
<Button
success
medium
style={[styles.flex1]}
text={translate('common.apply')}
onPress={applyChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_DATE}
/>
</View>
</View>
Expand Down
6 changes: 4 additions & 2 deletions src/components/Search/FilterDropdowns/DropdownButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import useWindowDimensions from '@hooks/useWindowDimensions';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type WithSentryLabel from '@src/types/utils/SentryLabel';

type PopoverComponentProps = {
closeOverlay: () => void;
};

type DropdownButtonProps = {
type DropdownButtonProps = WithSentryLabel & {
/** The label to display on the select */
label: string;

Expand Down Expand Up @@ -58,7 +59,7 @@ const ANCHOR_ORIGIN = {
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
};

function DropdownButton({label, value, viewportOffsetTop, PopoverComponent, medium = false, labelStyle, innerStyles, caretWrapperStyle, wrapperStyle}: DropdownButtonProps) {
function DropdownButton({label, value, viewportOffsetTop, PopoverComponent, medium = false, labelStyle, innerStyles, caretWrapperStyle, wrapperStyle, sentryLabel}: DropdownButtonProps) {
// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to distinguish RHL and narrow layout
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {isSmallScreenWidth} = useResponsiveLayout();
Expand Down Expand Up @@ -134,6 +135,7 @@ function DropdownButton({label, value, viewportOffsetTop, PopoverComponent, medi
ref={triggerRef}
innerStyles={[isOverlayVisible && styles.buttonHoveredBG, {maxWidth: 256}, innerStyles]}
onPress={calculatePopoverPositionAndToggleOverlay}
sentryLabel={sentryLabel}
// eslint-disable-next-line react/jsx-props-no-spreading
{...(medium ? {medium: true} : {small: true})}
>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Search/FilterDropdowns/MultiSelectPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import CONST from '@src/CONST';
import type {Icon} from '@src/types/onyx/OnyxCommon';

type MultiSelectItem<T> = {
Expand Down Expand Up @@ -118,13 +119,15 @@ function MultiSelectPopup<T extends string>({label, value, items, closeOverlay,
style={[styles.flex1]}
text={translate('common.reset')}
onPress={resetChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_RESET_MULTI_SELECT}
/>
<Button
success
medium
style={[styles.flex1]}
text={translate('common.apply')}
onPress={applyChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_MULTI_SELECT}
/>
</View>
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Search/FilterDropdowns/SingleSelectPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import CONST from '@src/CONST';

type SingleSelectItem<T> = {
text: string;
Expand Down Expand Up @@ -134,13 +135,15 @@ function SingleSelectPopup<T extends string>({label, value, items, closeOverlay,
style={[styles.flex1]}
text={translate('common.reset')}
onPress={resetChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_RESET_SINGLE_SELECT}
/>
<Button
success
medium
style={[styles.flex1]}
text={translate('common.apply')}
onPress={applyChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_SINGLE_SELECT}
/>
</View>
</View>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/FilterDropdowns/UserSelectPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,15 @@ function UserSelectPopup({value, closeOverlay, onChange, isSearchable}: UserSele
style={[styles.flex1]}
text={translate('common.reset')}
onPress={resetChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_RESET_USER}
/>
<Button
success
medium
style={[styles.flex1]}
text={translate('common.apply')}
onPress={applyChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_USER}
/>
</View>
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Search/SearchFilterPageFooterButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {View} from 'react-native';
import Button from '@components/Button';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';

type SearchFilterPageFooterButtonsProps = {
/** Function to reset changes made in the filter */
Expand All @@ -24,6 +25,7 @@ function SearchFilterPageFooterButtons({resetChanges, applyChanges}: SearchFilte
style={[styles.mt3]}
text={translate('common.reset')}
onPress={resetChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_RESET_BUTTON}
/>
)}
<Button
Expand All @@ -33,6 +35,7 @@ function SearchFilterPageFooterButtons({resetChanges, applyChanges}: SearchFilte
style={[styles.mt3]}
text={translate('common.save')}
onPress={applyChanges}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_SAVE_BUTTON}
/>
</View>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/SearchList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ function SearchList({
onAllCheckboxPress();
}}
disabled={totalItems === 0}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.SELECT_ALL_CHECKBOX}
/>
)}

Expand Down Expand Up @@ -597,6 +598,7 @@ function SearchList({
title={translate('common.select')}
icon={expensifyIcons.CheckSquare}
onPress={turnOnSelectionMode}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.SELECTION_MODE_MENU_ITEM}
/>
</Modal>
</View>
Expand Down
22 changes: 21 additions & 1 deletion src/components/Search/SearchPageHeader/SearchFiltersBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ import FILTER_KEYS, {AMOUNT_FILTER_KEYS, DATE_FILTER_KEYS} from '@src/types/form
import type {SearchAdvancedFiltersKey} from '@src/types/form/SearchAdvancedFiltersForm';
import type {Icon} from '@src/types/onyx/OnyxCommon';
import {getEmptyObject} from '@src/types/utils/EmptyObject';
import type WithSentryLabel from '@src/types/utils/SentryLabel';
import type {SearchHeaderOptionValue} from './SearchPageHeader';

type FilterItem = {
type FilterItem = WithSentryLabel & {
label: string;
PopoverComponent: (props: PopoverComponentProps) => ReactNode;
value: string | string[] | null;
Expand Down Expand Up @@ -576,6 +577,7 @@ function SearchFiltersBar({
PopoverComponent: typeComponent,
value: type?.text ?? null,
filterKey: FILTER_KEYS.TYPE,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_TYPE,
},
...(shouldDisplayGroupByFilter
? [
Expand All @@ -584,6 +586,7 @@ function SearchFiltersBar({
PopoverComponent: groupByComponent,
value: groupBy?.text ?? null,
filterKey: FILTER_KEYS.GROUP_BY,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_GROUP_BY,
},
]
: []),
Expand All @@ -594,6 +597,7 @@ function SearchFiltersBar({
PopoverComponent: groupCurrencyComponent,
value: groupCurrency?.value ?? null,
filterKey: FILTER_KEYS.GROUP_CURRENCY,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_GROUP_CURRENCY,
},
]
: []),
Expand All @@ -604,6 +608,7 @@ function SearchFiltersBar({
PopoverComponent: feedComponent,
value: feed.map((option) => option.text),
filterKey: FILTER_KEYS.FEED,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_FEED,
},
]
: []),
Expand All @@ -614,6 +619,7 @@ function SearchFiltersBar({
PopoverComponent: postedPickerComponent,
value: displayPosted,
filterKey: FILTER_KEYS.POSTED_ON,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_POSTED,
},
]
: []),
Expand All @@ -624,6 +630,7 @@ function SearchFiltersBar({
PopoverComponent: withdrawalTypeComponent,
value: withdrawalType?.text ?? null,
filterKey: FILTER_KEYS.WITHDRAWAL_TYPE,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_WITHDRAWAL_TYPE,
},
]
: []),
Expand All @@ -634,6 +641,7 @@ function SearchFiltersBar({
PopoverComponent: withdrawnPickerComponent,
value: displayWithdrawn,
filterKey: FILTER_KEYS.WITHDRAWN_ON,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_WITHDRAWN,
},
]
: []),
Expand All @@ -642,6 +650,7 @@ function SearchFiltersBar({
PopoverComponent: statusComponent,
value: status.map((option) => option.text),
filterKey: FILTER_KEYS.STATUS,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_STATUS,
},
...(type?.value === CONST.SEARCH.DATA_TYPES.CHAT
? [
Expand All @@ -650,6 +659,7 @@ function SearchFiltersBar({
PopoverComponent: hasComponent,
value: has.map((option) => option.text),
filterKey: FILTER_KEYS.HAS,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_HAS,
},
]
: []),
Expand All @@ -660,6 +670,7 @@ function SearchFiltersBar({
PopoverComponent: isComponent,
value: is.map((option) => option.text),
filterKey: FILTER_KEYS.IS,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_IS,
},
]
: []),
Expand All @@ -668,12 +679,14 @@ function SearchFiltersBar({
PopoverComponent: datePickerComponent,
value: displayDate,
filterKey: FILTER_KEYS.DATE_ON,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_DATE,
},
{
label: translate('common.from'),
PopoverComponent: userPickerComponent,
value: fromValue,
filterKey: FILTER_KEYS.FROM,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_FROM,
},
...(shouldDisplayWorkspaceFilter
? [
Expand All @@ -682,6 +695,7 @@ function SearchFiltersBar({
PopoverComponent: workspaceComponent,
value: workspaceValue,
filterKey: FILTER_KEYS.POLICY_ID,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_WORKSPACE,
},
]
: []),
Expand All @@ -692,6 +706,7 @@ function SearchFiltersBar({
PopoverComponent: viewComponent,
value: viewValue?.text ?? null,
filterKey: FILTER_KEYS.VIEW,
sentryLabel: CONST.SENTRY_LABEL.SEARCH.FILTER_VIEW,
},
]
: []),
Expand Down Expand Up @@ -803,6 +818,7 @@ function SearchFiltersBar({
label={item.label}
value={item.value}
PopoverComponent={item.PopoverComponent}
sentryLabel={item.sentryLabel}
/>
),
[],
Expand All @@ -828,6 +844,7 @@ function SearchFiltersBar({
icon={expensifyIcons.Filter}
textStyles={[styles.textMicroBold]}
onPress={openAdvancedFilters}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.ADVANCED_FILTERS_BUTTON}
/>
{shouldShowColumnsButton && (
<Button
Expand All @@ -840,6 +857,7 @@ function SearchFiltersBar({
icon={expensifyIcons.Columns}
textStyles={[styles.textMicroBold]}
onPress={openSearchColumns}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.COLUMNS_BUTTON}
/>
)}
</View>
Expand Down Expand Up @@ -911,6 +929,7 @@ function SearchFiltersBar({
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.BULK_ACTIONS_DROPDOWN}
/>
{!areAllMatchingItemsSelected && showSelectAllMatchingItems && (
<Button
Expand All @@ -920,6 +939,7 @@ function SearchFiltersBar({
innerStyles={styles.p0}
onPress={() => selectAllMatchingItems(true)}
text={translate('search.exportAll.selectAllMatchingItems')}
sentryLabel={CONST.SENTRY_LABEL.SEARCH.SELECT_ALL_MATCHING_BUTTON}
/>
)}
</View>
Expand Down
Loading
Loading