Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7293bb4
Add transactionAutoSelections parameter to policy deletion APIs and i…
mukhrr Apr 2, 2026
9c97f2a
Revert "Add transactionAutoSelections parameter to policy deletion AP…
mukhrr Apr 4, 2026
d70cef8
Merge remote-tracking branch 'origin' into fix/86220
mukhrr Apr 5, 2026
6e5878e
Merge remote-tracking branch 'origin/main' into fix/86220
mukhrr Apr 26, 2026
84e8ff6
removed tax/distance rate and fixed related tests
mukhrr Apr 27, 2026
b43341a
fixed ai reviews
mukhrr Apr 27, 2026
227f710
added tests for disabling tag/category case
mukhrr Apr 29, 2026
c3b694b
Extracted private helper getOptimisticPolicyState
mukhrr Apr 30, 2026
ee8d915
fixed prettier
mukhrr Apr 30, 2026
4213c62
Refactor pushTransactionAutoSelectionsOnyxData to return updates map
mukhrr May 4, 2026
0756c3a
reverted unnecessary code change
mukhrr May 4, 2026
2ae9d23
reverted multi-level tags auto-selection
mukhrr May 7, 2026
593f873
Merge remote-tracking branch 'origin' into fix/86220
mukhrr May 29, 2026
f50a7cf
Merge remote-tracking branch 'origin' into fix/86220
mukhrr Jun 1, 2026
307c569
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
d466ad1
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
5f94988
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
addaece
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
c748696
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
4dfd693
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
06e8370
Update tests/unit/ReportUtilsTest.ts
mukhrr Jun 1, 2026
d6cda4c
fixed category and tag outOfPolcy error offline
mukhrr Jun 2, 2026
8a79b71
Merge remote-tracking branch 'origin' into fix/86220
mukhrr Jun 2, 2026
99e81cf
Fix stale optimistic violations when toggling policy categories, tags…
mukhrr Jun 9, 2026
9c6d4c9
Merge 'origin/main' into origin/fix/86220
mukhrr Jun 9, 2026
6f0af40
reverted Mobile-Expensify
mukhrr Jun 9, 2026
bbe49ee
fixed wrong merge issues
mukhrr Jun 9, 2026
1cd4070
added missing translations
mukhrr Jun 9, 2026
7d95877
added first approver and first approved columns
mukhrr Jun 10, 2026
515645a
Merge branch 'Expensify:main' into main
mukhrr Jun 10, 2026
dbc29f5
fixed eslint failures
mukhrr Jun 10, 2026
32779e9
used existing isMultiLevelTags
mukhrr Jun 10, 2026
63973de
Merge branch 'Expensify:main' into main
mukhrr Jun 10, 2026
0d98285
Merge origin/main into fix/86220
mukhrr Jun 10, 2026
46f5116
Merge origin/main into fix/86220
mukhrr Jun 10, 2026
770617a
reverted unrelated changes
mukhrr Jun 10, 2026
f31bd6b
Merge upstream/main into fix/86220
mukhrr Jun 10, 2026
a21dd64
prettier fix
mukhrr Jun 10, 2026
2b27c21
Merge remote-tracking branch 'origin' into fix/86220
mukhrr Jun 11, 2026
340bb2a
reverted unrelated language changes and added tests for auto-selection
mukhrr Jun 11, 2026
af39446
auto-select only on dissable/delete actions
mukhrr Jun 11, 2026
a0f4562
Now the recompute uses the same optimistic taxRates that gets written…
mukhrr Jun 15, 2026
42ca66a
reverted unrelated changes
mukhrr Jun 16, 2026
2138f48
Merge remote-tracking branch 'origin/main' into fix/86220
mukhrr Jun 16, 2026
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
84 changes: 83 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useTransactionViolations from '@hooks/useTransactionViolations';
import type {ViolationField} from '@hooks/useViolations';
import useViolations from '@hooks/useViolations';
import {updateMoneyRequestBillable, updateMoneyRequestReimbursable, updateMoneyRequestTaxRate} from '@libs/actions/IOU/UpdateMoneyRequest';
import {updateMoneyRequestBillable, updateMoneyRequestCategory, updateMoneyRequestReimbursable, updateMoneyRequestTag, updateMoneyRequestTaxRate} from '@libs/actions/IOU/UpdateMoneyRequest';
import initSplitExpense from '@libs/actions/SplitExpenses';
import {enrichAndSortAttendees, getIsMissingAttendeesViolation} from '@libs/AttendeeUtils';
import {getBrokenConnectionUrlToFixPersonalCard, getCompanyCardDescription} from '@libs/CardUtils';
Expand All @@ -70,6 +70,7 @@ import {
hasVendorFeature,
isAttendeeTrackingEnabled,
isGroupPolicyByType,
isMultiLevelTags,
isPolicyAccessible,
isTaxTrackingEnabled,
} from '@libs/PolicyUtils';
Expand Down Expand Up @@ -444,6 +445,11 @@ function MoneyRequestView({
// transactionTag can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const shouldShowTag = (isPolicyExpenseChat || isExpenseUnreported) && (transactionTag || (canEdit && hasEnabledTags(policyTagLists)));
// Surface a delete confirmation (like tax) when the value is stale and there's nothing valid to select, instead
// of navigating to edit. Categories need at least one, so they only hit this when disabled; tags can be fully
// emptied, so also cover "no enabled tags remain". Scoped to single-level tag lists.
const shouldShowCategoryDisabledAlert = !policy?.areCategoriesEnabled && !!category;
const shouldShowTagDisabledAlert = (!policy?.areTagsEnabled || !hasEnabledTags(policyTagLists)) && !!transactionTag && !isMultiLevelTags(policyTagList);
const shouldShowBillable = (isPolicyExpenseChat || isExpenseUnreported) && (!!transactionBillable || isBillableEnabledOnPolicy(policy) || !!updatedTransaction?.billable);
const isCurrentTransactionReimbursableDifferentFromPolicyDefault =
policy?.defaultReimbursable !== undefined && !!(updatedTransaction?.reimbursable ?? transactionReimbursable) !== policy.defaultReimbursable;
Expand Down Expand Up @@ -745,6 +751,73 @@ function MoneyRequestView({
});
};

const showCategoryDisabledAlert = () => {
const transactionID = transaction?.transactionID;
if (!transactionID) {
return;
}
showConfirmModal({
title: translate('iou.categoryDisabledAlert.title'),
prompt: translate('iou.categoryDisabledAlert.prompt'),
confirmText: translate('iou.categoryDisabledAlert.confirmText'),
cancelText: translate('common.cancel'),
}).then(({action}) => {
if (action !== ModalActions.CONFIRM || !canEdit) {
return;
}

updateMoneyRequestCategory({
transactionID,
transactionThreadReport,
parentReport,
category: '',
policy,
policyTagList,
policyCategories,
policyRecentlyUsedCategories: undefined,
currentUserAccountIDParam,
currentUserEmailParam,
isASAPSubmitBetaEnabled,
parentReportNextStep,
delegateAccountID,
});
});
};

const showTagDisabledAlert = () => {
const transactionID = transaction?.transactionID;
if (!transactionID) {
return;
}
showConfirmModal({
title: translate('iou.tagDisabledAlert.title'),
prompt: translate('iou.tagDisabledAlert.prompt'),
confirmText: translate('iou.tagDisabledAlert.confirmText'),
cancelText: translate('common.cancel'),
}).then(({action}) => {
if (action !== ModalActions.CONFIRM || !canEdit) {
return;
}

updateMoneyRequestTag({
transactionID,
transactionThreadReport,
parentReport,
tag: '',
policy,
policyTagList,
policyRecentlyUsedTags: undefined,
policyCategories,
currentUserAccountIDParam,
currentUserEmailParam,
isASAPSubmitBetaEnabled,
parentReportNextStep,
isOffline,
delegateAccountID,
});
});
};

const distanceCopyValue = !canEditDistance ? distanceToDisplay : undefined;
const distanceRateCopyValue = !canEditDistanceRate ? rateToDisplay : undefined;
const amountCopyValue = !canEditAmount ? amountTitle : undefined;
Expand Down Expand Up @@ -931,6 +1004,10 @@ function MoneyRequestView({
if (!transaction?.transactionID || !transactionThreadReport?.reportID) {
return;
}
if (shouldShowTagDisabledAlert) {
showTagDisabledAlert();
return;
}
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_TAG.getRoute(
CONST.IOU.ACTION.EDIT,
Expand Down Expand Up @@ -1130,6 +1207,11 @@ function MoneyRequestView({
shouldShowRightIcon={canEdit}
titleStyle={styles.flex1}
onPress={() => {
if (shouldShowCategoryDisabledAlert) {
showCategoryDisabledAlert();
return;
}

if (shouldNavigateToUpgradePath && transactionThreadReport) {
Navigation.navigate(
ROUTES.MONEY_REQUEST_UPGRADE.getRoute({
Expand Down
10 changes: 10 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,16 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `Sie können bis zu ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} Ausgaben gleichzeitig duplizieren. Bitte wählen Sie weniger Ausgaben aus und versuchen Sie es erneut.`,
deleted: 'Gelöscht',
categoryDisabledAlert: {
title: 'Kategorie deaktiviert',
prompt: 'Aktivieren Sie Kategorien im Arbeitsbereich, um die Ausgabendetails zu bearbeiten oder die Kategorie aus dieser Ausgabe zu löschen.',
confirmText: 'Kategorie löschen',
},
tagDisabledAlert: {
title: 'Tag deaktiviert',
prompt: 'Aktivieren Sie Tags im Workspace, um die Ausgabendetails zu bearbeiten oder den Tag aus dieser Ausgabe zu löschen.',
confirmText: 'Tag löschen',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,16 @@ const translations = {
prompt: 'Enable tax tracking on the workspace to edit the expense details or delete the tax from this expense.',
confirmText: 'Delete tax',
},
categoryDisabledAlert: {
title: 'Category disabled',
prompt: 'Enable categories on the workspace to edit the expense details or delete the category from this expense.',
confirmText: 'Delete category',
},
tagDisabledAlert: {
title: 'Tag disabled',
prompt: 'Enable tags on the workspace to edit the expense details or delete the tag from this expense.',
confirmText: 'Delete tag',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,16 @@ const translations: TranslationDeepObject<typeof en> = {
prompt: 'Habilita el seguimiento de impuestos en el espacio de trabajo para editar los detalles del gasto o eliminar el impuesto de este gasto.',
confirmText: 'Eliminar impuesto',
},
categoryDisabledAlert: {
title: 'Categoría deshabilitada',
prompt: 'Habilita las categorías en el espacio de trabajo para editar los detalles del gasto o eliminar la categoría de este gasto.',
confirmText: 'Eliminar categoría',
},
tagDisabledAlert: {
title: 'Etiqueta deshabilitada',
prompt: 'Habilita las etiquetas en el espacio de trabajo para editar los detalles del gasto o eliminar la etiqueta de este gasto.',
confirmText: 'Eliminar etiqueta',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,16 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `Vous pouvez dupliquer jusqu’à ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} dépenses à la fois. Veuillez sélectionner moins de dépenses et réessayer.`,
deleted: 'Supprimé',
categoryDisabledAlert: {
title: 'Catégorie désactivée',
prompt: 'Activez les catégories dans l’espace de travail pour modifier les détails de la dépense ou supprimer la catégorie de cette dépense.',
confirmText: 'Supprimer la catégorie',
},
tagDisabledAlert: {
title: 'Tag désactivé',
prompt: 'Active les tags dans l’espace de travail pour modifier les détails de la dépense ou supprimer le tag de cette dépense.',
confirmText: 'Supprimer le tag',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,16 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `Puoi duplicare fino a ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} spese alla volta. Seleziona meno spese e riprova.`,
deleted: 'Eliminato',
categoryDisabledAlert: {
title: 'Categoria disattivata',
prompt: 'Attiva le categorie nello spazio di lavoro per modificare i dettagli della spesa o eliminare la categoria da questa spesa.',
confirmText: 'Elimina categoria',
},
tagDisabledAlert: {
title: 'Tag disattivato',
prompt: 'Abilita le etichette nello spazio di lavoro per modificare i dettagli della spesa o eliminare l’etichetta da questa spesa.',
confirmText: 'Elimina tag',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,16 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `一度に複製できる経費は最大で ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} 件です。経費の数を減らして、もう一度お試しください。`,
deleted: '削除済み',
categoryDisabledAlert: {
title: 'カテゴリは無効です',
prompt: 'ワークスペースでカテゴリを有効にすると、この経費の詳細を編集したり、この経費からカテゴリを削除したりできます。',
confirmText: 'カテゴリを削除',
},
tagDisabledAlert: {
title: 'タグは無効です',
prompt: 'ワークスペースでタグを有効にすると、この経費の詳細を編集したり、この経費からタグを削除したりできます。',
confirmText: 'タグを削除',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,16 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `Je kunt maximaal ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} uitgaven tegelijk dupliceren. Selecteer minder uitgaven en probeer het opnieuw.`,
deleted: 'Verwijderd',
categoryDisabledAlert: {
title: 'Categorie uitgeschakeld',
prompt: 'Schakel categorieën in de workspace in om de onkostendetails te bewerken of de categorie uit deze onkost te verwijderen.',
confirmText: 'Categorie verwijderen',
},
tagDisabledAlert: {
title: 'Label uitgeschakeld',
prompt: 'Schakel tags in op de werkruimte om de onkostendetails te bewerken of de tag uit deze onkosten te verwijderen.',
confirmText: 'Label verwijderen',
},
},
transactionMerge: {
listPage: {
Expand Down
10 changes: 10 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,16 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `Możesz jednocześnie zduplikować maksymalnie ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} wydatków. Wybierz mniej wydatków i spróbuj ponownie.`,
deleted: 'Usunięto',
categoryDisabledAlert: {
title: 'Kategoria wyłączona',
prompt: 'Włącz kategorie w przestrzeni roboczej, żeby edytować szczegóły wydatku lub usunąć kategorię z tego wydatku.',
confirmText: 'Usuń kategorię',
},
tagDisabledAlert: {
title: 'Tag wyłączony',
prompt: 'Włącz tagi w przestrzeni roboczej, aby edytować szczegóły wydatku lub usunąć ten tag z tego wydatku.',
confirmText: 'Usuń znacznik',
},
},
transactionMerge: {
listPage: {
Expand Down
6 changes: 6 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,12 @@ const translations: TranslationDeepObject<typeof en> = {
},
bulkDuplicateLimit: `Você pode duplicar até ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} despesas por vez. Selecione menos despesas e tente novamente.`,
deleted: 'Excluído',
categoryDisabledAlert: {
title: 'Categoria desativada',
prompt: 'Ative as categorias no workspace para editar os detalhes da despesa ou excluir a categoria desta despesa.',
confirmText: 'Excluir categoria',
},
tagDisabledAlert: {title: 'Tag desativada', prompt: 'Ative as tags no workspace para editar os detalhes da despesa ou excluir a tag desta despesa.', confirmText: 'Excluir tag'},
},
transactionMerge: {
listPage: {
Expand Down
2 changes: 2 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,8 @@ const translations: TranslationDeepObject<typeof en> = {
taxDisabledAlert: {title: '税费已禁用', prompt: '请在工作区中启用税费跟踪,以便编辑此报销的详细信息或从该报销中删除税费。', confirmText: '删除税费'},
bulkDuplicateLimit: `您一次最多可以复制 ${CONST.SEARCH.BULK_DUPLICATE_LIMIT} 笔报销。请减少选择的报销数量后重试。`,
deleted: '已删除',
categoryDisabledAlert: {title: '类别已禁用', prompt: '在工作区中启用类别,以编辑报销详情或从此报销中删除该类别。', confirmText: '删除类别'},
tagDisabledAlert: {title: '标签已停用', prompt: '请在工作区中启用标签,以便编辑该报销的详细信息或从此报销中删除该标签。', confirmText: '删除标签'},
},
transactionMerge: {
listPage: {
Expand Down
Loading
Loading