Repository navigation
Skip non-existent categories when importing merchant rules from spreadsheet - #96522
Conversation
Merchant rules can only reference categories that exist on the workspace (the manual flow's picker enforces this), so the spreadsheet import now resolves each "Updated category" cell against the policy's enabled categories (case-insensitively, against the decoded name) and stores the canonical name. Cells that don't match any category are dropped and reported in the confirmation modal instead of being stored as a category the rule could never apply. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index ef0d300d9f9..fa21f11ca2c 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1171,11 +1171,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `${tags} Tags wurden hinzugefügt.` : '1 Tag wurde hinzugefügt.'),
importMultiLevelTagsSuccessfulDescription: 'Mehrstufige Tags wurden hinzugefügt.',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `${rates} Tagessätze wurden hinzugefügt.` : '1 Tagegeldsatz wurde hinzugefügt.'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? '1 Kategorie wurde' : `${invalidCategories} Kategorien waren`} übersprungen, weil ${invalidCategories === 1 ? 'tut es nicht' : 'sie nicht'} in diesem Workspace vorhanden sind.`
+ : '';
if (rules === 0) {
- return 'Es wurden keine Händlerregeln hinzugefügt, da sie alle bereits existieren.';
+ return `${duplicates > 0 ? 'Es wurden keine Händlerregeln hinzugefügt, da sie alle bereits existieren.' : 'Es wurden keine Händlerregeln hinzugefügt.'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `${rules} Händlerregeln wurden hinzugefügt.` : '1 Händlerregel wurde hinzugefügt.';
+ return `${rules > 1 ? `${rules} Händlerrichtlinien wurden hinzugefügt.` : '1 Händlerregel wurde hinzugefügt.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'Ups! Du musst mindestens eine Spalte („Händler ist“ oder „Händler enthält“) zuordnen sowie mindestens ein zu aktualisierendes Feld. Bitte überprüfe es und versuche es erneut.',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 46958bee7e9..57e23fe0b40 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1134,12 +1134,12 @@ const translations: TranslationDeepObject<typeof en> = {
importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
const invalidCategoriesNote =
invalidCategories > 0
- ? ` ${invalidCategories === 1 ? 'Se omitió 1 categoría porque no existe' : `Se omitieron ${invalidCategories} categorías porque no existen`} en este espacio de trabajo.`
+ ? `${invalidCategories === 1 ? '1 categoría fue' : `${invalidCategories} categorías eran`} omitido porque ${invalidCategories === 1 ? 'no lo hace' : 'no lo hacen'} existen en este espacio de trabajo.`
: '';
if (rules === 0) {
- return `${duplicates > 0 ? 'No se han añadido reglas de comerciante, ya que todas ya existen.' : 'No se han añadido reglas de comerciante.'}${invalidCategoriesNote}`;
+ return `${duplicates > 0 ? 'No se han añadido reglas de comercio, ya que todas ya existen.' : 'No se ha añadido ninguna regla de comerciante.'}${invalidCategoriesNote}`;
}
- return `${rules > 1 ? `Se han añadido ${rules} reglas de comerciante.` : 'Se ha añadido 1 regla de comerciante.'}${invalidCategoriesNote}`;
+ return `${rules > 1 ? `Se han añadido ${rules} reglas de comercio.` : 'Se ha añadido 1 regla de comerciante.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'¡Ups! Debes asignar al menos una columna "El comerciante es" o "El comerciante contiene", además de al menos un campo para actualizar. Por favor, revisa e inténtalo de nuevo.',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 3d3d2401ab0..dea44f0da9a 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1175,11 +1175,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `${tags} tags ont été ajoutés.` : '1 tag a été ajouté.'),
importMultiLevelTagsSuccessfulDescription: 'Des tags à plusieurs niveaux ont été ajoutés.',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `${rates} indemnités journalières ont été ajoutées.` : '1 taux de per diem a été ajouté.'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? '1 catégorie a été' : `${invalidCategories} catégories ont été`} ignoré car ${invalidCategories === 1 ? 'ça ne marche pas' : 'ils ne le font pas'} existe dans cet espace de travail.`
+ : '';
if (rules === 0) {
- return "Aucune règle de marchand n'a été ajoutée, car elles existent toutes déjà.";
+ return `${duplicates > 0 ? 'Aucune règle de commerçant n’a été ajoutée, car elles existent déjà toutes.' : 'Aucune règle de commerçant n’a été ajoutée.'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `${rules} règles de marchand ont été ajoutées.` : '1 règle de marchand a été ajoutée.';
+ return `${rules > 1 ? `${rules} règles de marchand ont été ajoutées.` : '1 règle de commerçant a été ajoutée.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'Oups ! Vous devez associer au moins une colonne « Le marchand est » ou « Le marchand contient », ainsi qu’au moins un champ à mettre à jour. Veuillez examiner et réessayer.',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index cbce8381f41..5760c57d10b 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1172,11 +1172,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `Sono stati aggiunti ${tags} tag.` : 'È stato aggiunto 1 tag.'),
importMultiLevelTagsSuccessfulDescription: 'Sono state aggiunte etichette multilivello.',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `Sono state aggiunte le diarie giornaliere ${rates}.` : 'È stata aggiunta 1 diaria.'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? '1 categoria è stata' : `${invalidCategories} categorie erano`} saltato perché ${invalidCategories === 1 ? 'non lo fa' : 'non lo fanno'} esiste in questo workspace.`
+ : '';
if (rules === 0) {
- return 'Nessuna regola esercente è stata aggiunta, poiché esistono già tutte.';
+ return `${duplicates > 0 ? 'Non è stata aggiunta alcuna regola per l’esercente, perché esistono già tutte.' : 'Non è stata aggiunta alcuna regola per l’esercente.'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `Sono state aggiunte ${rules} regole esercente.` : 'È stata aggiunta 1 regola esercente.';
+ return `${rules > 1 ? `Sono state aggiunte ${rules} regole fornitore.` : 'È stata aggiunta 1 regola commerciante.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns: 'Ops! Devi mappare almeno una colonna “L’esercente è” o “L’esercente contiene”, oltre ad almeno un campo da aggiornare. Controlla e riprova.',
importTransactionsSuccessfulDescription: ({transactions}: {transactions: number}) =>
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 454f27960e3..b92a5aae06c 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1154,11 +1154,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `${tags} 個のタグを追加しました。` : 'タグを1件追加しました。'),
importMultiLevelTagsSuccessfulDescription: 'マルチレベルタグが追加されました。',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `${rates}件の日当レートが追加されました。` : '1件の日当レートが追加されました。'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? 'そうではありません' : '彼らはしません'} がこのワークスペースに存在するため、${invalidCategories === 1 ? 'カテゴリ 1 件が' : `${invalidCategories} 個のカテゴリがありました`} をスキップしました。`
+ : '';
if (rules === 0) {
- return 'すべての加盟店ルールが既に存在するため、追加されませんでした。';
+ return `${duplicates > 0 ? 'すでにすべてのルールが存在しているため、マーチャントルールは追加されませんでした。' : 'マーチャントルールはまだ追加されていません。'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `${rules}件の加盟店ルールが追加されました。` : '1件の加盟店ルールが追加されました。';
+ return `${rules > 1 ? `${rules} 件のマーチャントルールが追加されました。` : 'マーチャントルールが 1 件追加されました。'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'おっと!「加盟店が一致」または「加盟店を含む」の列を少なくとも1つ、さらに更新するフィールドを少なくとも1つマッピングしてください。確認してもう一度お試しください。',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 336718d2023..8421566b9b8 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1170,11 +1170,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `${tags} tags zijn toegevoegd.` : '1 tag is toegevoegd.'),
importMultiLevelTagsSuccessfulDescription: 'Tags met meerdere niveaus zijn toegevoegd.',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `${rates} per diem-tarieven zijn toegevoegd.` : '1 dagvergoeding is toegevoegd.'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? '1 categorie is' : `${invalidCategories} categorieën waren`} overgeslagen omdat ${invalidCategories === 1 ? 'dat doet het niet' : 'zij niet'} in deze workspace bestaat.`
+ : '';
if (rules === 0) {
- return 'Er zijn geen handelaarregels toegevoegd, omdat ze allemaal al bestaan.';
+ return `${duplicates > 0 ? 'Er zijn geen handelaarregels toegevoegd, omdat ze allemaal al bestaan.' : 'Er zijn geen handelsregels toegevoegd.'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `${rules} handelaarregels zijn toegevoegd.` : '1 handelaarregel is toegevoegd.';
+ return `${rules > 1 ? `${rules} verkoopregelaars zijn toegevoegd.` : '1 merchantregel is toegevoegd.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'Oeps! Je moet ten minste één kolom "Handelaar is" of "Handelaar bevat" toewijzen, plus ten minste één veld om bij te werken. Controleer het en probeer het opnieuw.',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 7dacc8548a0..c4b13904b76 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1167,11 +1167,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `Dodano ${tags} tagów.` : 'Dodano 1 znacznik.'),
importMultiLevelTagsSuccessfulDescription: 'Dodano wielopoziomowe tagi.',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `Dodano stawki diety: ${rates}.` : 'Dodano 1 stawkę diety.'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? '1 kategoria została' : `${invalidCategories} kategorie były`} pominięto, ponieważ ${invalidCategories === 1 ? 'nie działa' : 'oni nie'} istnieje w tym obszarze roboczym.`
+ : '';
if (rules === 0) {
- return 'Nie dodano żadnych reguł sprzedawcy, ponieważ wszystkie już istnieją.';
+ return `${duplicates > 0 ? 'Nie dodano żadnych reguł sprzedawców, ponieważ wszystkie już istnieją.' : 'Nie dodano żadnych reguł dla sprzedawcy.'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `Dodano reguły sprzedawcy: ${rules}.` : 'Dodano 1 regułę sprzedawcy.';
+ return `${rules > 1 ? `Dodano ${rules} reguł sprzedawców.` : 'Dodano 1 regułę sprzedawcy.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'Ups! Musisz zmapować co najmniej jedną kolumnę „Sprzedawca to” lub „Sprzedawca zawiera” oraz co najmniej jedno pole do aktualizacji. Sprawdź i spróbuj ponownie.',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 0059a89ff8f..50839b69ee4 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1170,11 +1170,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `${tags} tags foram adicionadas.` : '1 tag foi adicionada.'),
importMultiLevelTagsSuccessfulDescription: 'Tags de vários níveis foram adicionadas.',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `Foram adicionadas ${rates} diárias.` : '1 diária foi adicionada.'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `${invalidCategories === 1 ? '1 categoria foi' : `${invalidCategories} categorias foram`} ignorado porque ${invalidCategories === 1 ? 'não faz' : 'eles não'} existe neste workspace.`
+ : '';
if (rules === 0) {
- return 'Nenhuma regra de comerciante foi adicionada, pois todas já existem.';
+ return `${duplicates > 0 ? 'Nenhuma regra de comerciante foi adicionada, pois todas elas já existem.' : 'Nenhuma regra de comerciante foi adicionada.'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `Foram adicionadas ${rules} regras de comerciante.` : '1 regra de comerciante foi adicionada.';
+ return `${rules > 1 ? `${rules} regras de comerciante foram adicionadas.` : '1 regra de comerciante foi adicionada.'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns:
'Ops! Você precisa mapear pelo menos uma coluna "O comerciante é" ou "O comerciante contém", além de pelo menos um campo para atualizar. Revise e tente novamente.',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 7af5b5ed79f..9ed8dda8f16 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1126,11 +1126,15 @@ const translations: TranslationDeepObject<typeof en> = {
importTagsSuccessfulDescription: ({tags}: {tags: number}) => (tags > 1 ? `已添加 ${tags} 个标签。` : '已添加 1 个标签。'),
importMultiLevelTagsSuccessfulDescription: '已添加多级标签。',
importPerDiemRatesSuccessfulDescription: ({rates}: {rates: number}) => (rates > 1 ? `已添加 ${rates} 个每日补贴标准。` : '已添加 1 条日津贴费率。'),
- importMerchantRulesSuccessfulDescription: ({rules}: {rules: number}) => {
+ importMerchantRulesSuccessfulDescription: ({rules, duplicates = 0, invalidCategories = 0}: {rules: number; duplicates?: number; invalidCategories?: number}) => {
+ const invalidCategoriesNote =
+ invalidCategories > 0
+ ? `已跳过 ${invalidCategories === 1 ? '1 个类别被' : `有 ${invalidCategories} 个类别被`},因为此工作区中已存在 ${invalidCategories === 1 ? '它不会' : '他们不会'}。`
+ : '';
if (rules === 0) {
- return '未添加任何商户规则,因为它们均已存在。';
+ return `${duplicates > 0 ? '未添加商家规则,因为它们已经全部存在。' : '尚未添加任何商户规则。'}${invalidCategoriesNote}`;
}
- return rules > 1 ? `已添加 ${rules} 条商户规则。` : '已添加 1 条商户规则。';
+ return `${rules > 1 ? `已添加 ${rules} 条商户规则。` : '已添加 1 条商家规则。'}${invalidCategoriesNote}`;
},
importMerchantRulesRequiredColumns: '哎呀!您必须至少映射一列“商户为”或“商户包含”,并且至少映射一个要更新的字段。请检查后重试。',
importTransactionsSuccessfulDescription: ({transactions}: {transactions: number}) => (transactions > 1 ? `已导入 ${transactions} 笔交易。` : '已导入 1 笔交易。'),
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eeb0e96716
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The category lookup validates imported cells against the policy's categories, so an unloaded collection (e.g. after a cache clear) would wrongly treat every category cell as invalid. Fetch the categories on focus and on reconnect, mirroring MerchantRulePageBase. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewer Checklist
Screenshots/Videos |
|
|
||
| const updatedMerchant = getCellValue(updatedMerchantColumn, rowIndex); | ||
| const category = getCellValue(categoryColumn, rowIndex); | ||
| // A rule may only reference a category that exists on the workspace, so unknown cells are dropped |
There was a problem hiding this comment.
Put an empty line before the comment unless it’s on the first line of a block.
See https://github.com/Expensify/Style-Guides/blob/main/general.md#comments
| // A rule may only reference a category that exists on the workspace, so unknown cells are dropped | |
| // A rule may only reference a category that exists on the workspace, so unknown cells are dropped |
There was a problem hiding this comment.
NAB: next time if you accept the suggestion's content, please do so directly here by clicking Apply suggestion so we both get credit for it :)
| /** | ||
| * Builds a lookup from decoded, lowercased category name to the canonical stored name for every category the | ||
| * manual "Add category" flow offers (enabled and not pending deletion). Imported "Updated category" cells are | ||
| * resolved through this map so a rule can only reference a category that exists on the workspace — mirroring the | ||
| * manual flow, where the category picker only offers existing categories — and so the rule stores the category | ||
| * exactly as the policy encodes it (policy category names are stored HTML-encoded, spreadsheet cells are plain text). | ||
| */ |
There was a problem hiding this comment.
Can we slim down these AI comments? Explaining the why and not the what
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Product authorized here: #96389 (comment) |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/NicolasBonet in version: 9.4.43-0 🚀
|
Help site review — no changes requiredI reviewed this PR against the help site articles under Why: This PR is a correctness refinement to the spreadsheet import flow for merchant rules — imported "Updated category" cells are now resolved against the workspace's existing enabled categories (case-insensitive, HTML-decoded), unknown categories are dropped, and the confirmation modal reports how many were skipped. The only merchant-rules help article, Workspace-Merchant-Rules.md, documents the manual creation flow (Rules → Add merchant rule) only. The spreadsheet import flow for merchant rules isn't documented anywhere in the help site today, so there's no existing content that this change makes inaccurate. What I checked
Documenting the merchant-rules spreadsheet import flow end-to-end would be a net-new article covering a feature this PR didn't introduce — that's a separate, larger docs effort rather than something this PR requires. Happy to open that if you'd like it tracked. @NicolasBonet, since no help site changes are required for this PR, I didn't open a docs PR. Let me know if you'd prefer the merchant-rules spreadsheet import flow documented as a separate effort and I'll create one. |
|
This PR failing in offline test because of the issue #96842 |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.43-1 🚀
Bundle Size Analysis (Sentry): |















Explanation of Change
Merchant rules can only reference categories that exist on the workspace — the manual flow's category picker enforces this by only offering existing enabled categories. The spreadsheet import flow, however, accepted the "Updated category" cell as free text, so a rule could be stored with a category that doesn't exist on the policy and would never be applied to a matching expense.
This PR makes the import flow enforce the same constraint as the manual flow:
food & drink→Food & Drink) no longer produce dangling references.Fixed Issues
$ #96389
PROPOSAL: #96389 (comment)
Tests
Precondition: a workspace with Rules enabled and Categories enabled, including the default
Travelcategory. Download the following CSV:merchant-rules-test.csv
merchant-rules-test.csvfile.Travel(the workspace's casing, even though the CSV cells wereTravel,TRAVEL, andtravel), and the Shell and Walmart rules have a description but no category set (their categoriesFuel ExpensesandNonexistent Categorydon't exist on the workspace).Starbucksand verify theTravelcategory is applied to the expense.Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari