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
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8144,6 +8144,7 @@ const CONST = {
SCAN_TEST_DRIVE_CONFIRMATION: 'scanTestDriveConfirmation',
MULTI_SCAN_EDUCATIONAL_MODAL: 'multiScanEducationalModal',
GPS_TOOLTIP: 'gpsTooltip',
HAS_FILTER_NEGATION: 'hasFilterNegation',
},
CHANGE_POLICY_TRAINING_MODAL: 'changePolicyModal',
SMART_BANNER_HEIGHT: 152,
Expand Down
8 changes: 8 additions & 0 deletions src/components/ProductTrainingContext/TOOLTIPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const {
ACCOUNT_SWITCHER,
SCAN_TEST_DRIVE_CONFIRMATION,
GPS_TOOLTIP,
HAS_FILTER_NEGATION,
} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;

type ProductTrainingTooltipName = Exclude<ValueOf<typeof CONST.PRODUCT_TRAINING_TOOLTIP_NAMES>, typeof CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.MULTI_SCAN_EDUCATIONAL_MODAL>;
Expand Down Expand Up @@ -101,6 +102,13 @@ const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
priority: 800,
shouldShow: () => true,
},
[HAS_FILTER_NEGATION]: {
content: 'productTrainingTooltip.hasFilterNegation',
onHideTooltip: (isDismissedUsingCloseButton = false) => dismissProductTraining(HAS_FILTER_NEGATION, isDismissedUsingCloseButton),
name: HAS_FILTER_NEGATION,
priority: 1000,
shouldShow: () => true,
},
};

export default TOOLTIPS;
Expand Down
1 change: 1 addition & 0 deletions src/components/ProductTrainingContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_CONFIRMATION &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_DRIVE_CONFIRMATION &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.GPS_TOOLTIP &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.HAS_FILTER_NEGATION &&
isModalVisible
) {
return false;
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8376,6 +8376,7 @@ Fordern Sie Spesendetails wie Belege und Beschreibungen an, legen Sie Limits und
outstandingFilter: '<tooltip>Nach Ausgaben filtern,\ndie <strong>genehmigt werden müssen</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Sende diese Quittung, um\n<strong>die Probefahrt abzuschließen!</strong></tooltip>',
gpsTooltip: '<tooltip>GPS-Tracking läuft! Wenn du fertig bist, stoppe die Aufzeichnung unten.</tooltip>',
hasFilterNegation: '<tooltip>Suchen Sie nach Ausgaben ohne Belege mit <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Änderungen verwerfen?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8334,6 +8334,7 @@ const translations = {
outstandingFilter: '<tooltip>Filter for expenses\nthat <strong>need approval</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Send this receipt to\n<strong>complete the test drive!</strong></tooltip>',
gpsTooltip: "<tooltip>GPS tracking in progress! When you're done, stop tracking below.</tooltip>",
hasFilterNegation: '<tooltip>Search for expenses without receipts using <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Discard changes?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8575,6 +8575,7 @@ ${amount} para ${merchant} - ${date}`,
outstandingFilter: '<tooltip>Filtra los gastos\nque <strong>necesitan aprobación</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>¡Envía este recibo para\n<strong>completar la prueba</strong>!</tooltip>',
gpsTooltip: '<tooltip>¡Seguimiento por GPS en curso! Cuando termines, detén el seguimiento a continuación.</tooltip>',
hasFilterNegation: '<tooltip>Busca gastos sin recibos usando <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: '¿Descartar cambios?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8398,6 +8398,7 @@ Rendez obligatoires des informations de dépense comme les reçus et les descrip
outstandingFilter: '<tooltip>Filtrer les dépenses\nqui <strong>doivent être approuvées</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Envoyez ce reçu pour\n<strong>terminer l’essai !</strong></tooltip>',
gpsTooltip: '<tooltip>Suivi GPS en cours ! Lorsque vous avez terminé, arrêtez le suivi ci-dessous.</tooltip>',
hasFilterNegation: '<tooltip>Recherchez les dépenses sans reçus à l’aide de <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Ignorer les modifications ?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8363,6 +8363,7 @@ Richiedi dettagli sulle spese come ricevute e descrizioni, imposta limiti e valo
outstandingFilter: '<tooltip>Filtra per le spese\nche <strong>necessitano di approvazione</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Invia questa ricevuta per\n<strong>completare il test drive!</strong></tooltip>',
gpsTooltip: '<tooltip>Tracciamento GPS in corso! Quando hai finito, interrompi il tracciamento qui sotto.</tooltip>',
hasFilterNegation: '<tooltip>Cerca le spese senza ricevute usando <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Scartare le modifiche?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8269,6 +8269,7 @@ ${reportName}
outstandingFilter: '<tooltip><strong>承認が必要な</strong>経費を絞り込む</tooltip>',
scanTestDriveTooltip: '<tooltip>このレシートを送信して\n<strong>試用を完了しましょう!</strong></tooltip>',
gpsTooltip: '<tooltip>GPS追跡を実行中です!完了したら、下で追跡を停止してください。</tooltip>',
hasFilterNegation: '<tooltip><strong>-has:receipt</strong> を使って、レシートのない経費を検索します。</tooltip>',
},
discardChangesConfirmation: {
title: '変更を破棄しますか?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8340,6 +8340,7 @@ Vereis onkostendetails zoals bonnen en beschrijvingen, stel limieten en standaar
outstandingFilter: '<tooltip>Filter voor uitgaven\ndie <strong>goedkeuring nodig hebben</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Stuur deze bon om\n<strong>de proefrit te voltooien!</strong></tooltip>',
gpsTooltip: '<tooltip>GPS-tracking bezig! Als je klaar bent, stop dan hieronder met bijhouden.</tooltip>',
hasFilterNegation: '<tooltip>Zoek naar uitgaven zonder bonnen met <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Wijzigingen negeren?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8326,6 +8326,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
outstandingFilter: '<tooltip>Filtruj wydatki,\nktóre <strong>wymagają zatwierdzenia</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Wyślij ten paragon, aby\n<strong>zakończyć jazdę próbną!</strong></tooltip>',
gpsTooltip: '<tooltip>Śledzenie GPS w toku! Gdy skończysz, zatrzymaj śledzenie poniżej.</tooltip>',
hasFilterNegation: '<tooltip>Wyszukaj wydatki bez paragonów za pomocą <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Odrzucić zmiany?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8331,6 +8331,7 @@ Exija dados de despesas como recibos e descrições, defina limites e padrões e
outstandingFilter: '<tooltip>Filtrar despesas\nque <strong>precisam de aprovação</strong></tooltip>',
scanTestDriveTooltip: '<tooltip>Envie este recibo para\n<strong>concluir o test drive!</strong></tooltip>',
gpsTooltip: '<tooltip>Rastreamento por GPS em andamento! Quando terminar, pare o rastreamento abaixo.</tooltip>',
hasFilterNegation: '<tooltip>Pesquise despesas sem recibos usando <strong>-has:receipt</strong>.</tooltip>',
},
discardChangesConfirmation: {
title: 'Descartar alterações?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8138,6 +8138,7 @@ ${reportName}
outstandingFilter: '<tooltip>筛选<strong>待审批</strong>的报销</tooltip>',
scanTestDriveTooltip: '<tooltip>发送此收据以\n<strong>完成试用体验!</strong></tooltip>',
gpsTooltip: '<tooltip>正在进行 GPS 跟踪!完成后,请在下方停止跟踪。</tooltip>',
hasFilterNegation: '<tooltip>使用 <strong>-has:receipt</strong> 搜索没有收据的报销。</tooltip>',
},
discardChangesConfirmation: {
title: '放弃更改?',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ import {View} from 'react-native';
import FixedFooter from '@components/FixedFooter';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import {useProductTrainingContext} from '@components/ProductTrainingContext';
import ScreenWrapper from '@components/ScreenWrapper';
import SearchFilterPageFooterButtons from '@components/Search/SearchFilterPageFooterButtons';
import SelectionList from '@components/SelectionList';
import MultiSelectListItem from '@components/SelectionList/ListItem/MultiSelectListItem';
import type {ListItem} from '@components/SelectionList/types';
import EducationalTooltip from '@components/Tooltip/EducationalTooltip';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {updateAdvancedFilters} from '@libs/actions/Search';
import Navigation from '@libs/Navigation/Navigation';
import {getHasOptions} from '@libs/SearchUIUtils';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand All @@ -23,6 +26,7 @@ function SearchFiltersHasPage() {
const {translate} = useLocalize();
const [searchAdvancedFiltersForm, searchAdvancedFiltersFormResult] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM);
const currentType = searchAdvancedFiltersForm?.type ?? CONST.SEARCH.DATA_TYPES.EXPENSE;
const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip} = useProductTrainingContext(CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.HAS_FILTER_NEGATION);
const [selectedItems, setSelectedItems] = useState<string[]>(() => {
if (!searchAdvancedFiltersForm?.has) {
return [];
Expand Down Expand Up @@ -76,12 +80,27 @@ function SearchFiltersHasPage() {
offlineIndicatorStyle={styles.mtAuto}
shouldEnableMaxHeight
>
<HeaderWithBackButton
title={translate('search.has')}
onBackButtonPress={() => {
Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS.getRoute());
<EducationalTooltip
shouldRender={shouldShowProductTrainingTooltip && currentType === CONST.SEARCH.DATA_TYPES.EXPENSE}
renderTooltipContent={renderProductTrainingTooltip}
anchorAlignment={{
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
/>
maxWidth={variables.hasFilterNegationTooltipMaxWidth}
wrapperStyle={styles.productTrainingTooltipWrapper}
shiftHorizontal={variables.hasFilterNegationTooltipShiftHorizontal}
shiftVertical={variables.hasFilterNegationTooltipShiftVertical}
>
<View>
<HeaderWithBackButton
title={translate('search.has')}
onBackButtonPress={() => {
Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS.getRoute());
}}
/>
</View>
</EducationalTooltip>
<View style={[styles.flex1]}>
<SelectionList
data={listData}
Expand Down
3 changes: 3 additions & 0 deletions src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ export default {
expenseReportsTypeTooltipShiftHorizontal: 10,
inviteMemberListItemTooltipShiftVertical: -8,
inviteMemberListItemTooltipShiftHorizontal: 4,
hasFilterNegationTooltipShiftHorizontal: -16,
hasFilterNegationTooltipShiftVertical: 40,
hasFilterNegationTooltipMaxWidth: 260,

inlineImagePreviewMinSize: 64,
inlineImagePreviewMaxSize: 148,
Expand Down
6 changes: 6 additions & 0 deletions src/types/onyx/DismissedProductTraining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const {
SCAN_TEST_DRIVE_CONFIRMATION,
MULTI_SCAN_EDUCATIONAL_MODAL,
GPS_TOOLTIP,
HAS_FILTER_NEGATION,
} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;

/**
Expand Down Expand Up @@ -88,6 +89,11 @@ type DismissedProductTraining = {
* When user dismisses the GPS tooltip, we store the timestamp here.
*/
[GPS_TOOLTIP]: DismissedProductTrainingElement;

/**
* When user dismisses the Has filter negation tooltip, we store the timestamp here.
*/
[HAS_FILTER_NEGATION]: DismissedProductTrainingElement;
};

export default DismissedProductTraining;
4 changes: 4 additions & 0 deletions tests/utils/TestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ function getNvpDismissedProductTraining(): OnyxEntry<DismissedProductTraining> {
timestamp: '',
dismissedMethod: 'click',
},
[CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.HAS_FILTER_NEGATION]: {
timestamp: '',
dismissedMethod: 'click',
},
};
}

Expand Down
Loading