Keep merchant rules import button active offline for the all-skipped path#96976
Keep merchant rules import button active offline for the all-skipped path#96976MelvinBot wants to merge 1 commit into
Conversation
Co-authored-by: Joe Ph <gijoe0295@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
The only failing check is PR Author Checklist / checklist, and it's not something I can push a code fix for. It fails because Every other check is passing or still running — none of them have genuinely failed. To get this green: edit the PR description to complete the author checklist and write out the Tests / Offline tests / QA steps (or add |
Explanation of Change
The "Import" button in the merchant-rules import flow was disabled whenever the device was offline. This blocked the client-side-only path where every parsed row is a duplicate of an existing rule and/or references a category that doesn't exist — in that case
ImportedMerchantRulesPage.importRulesshort-circuits and builds the "No merchant rules have been added…" confirmation modal locally, with no API call. Since no network is required for that path, the button should stay active offline.The offline guard lived hard-coded in the shared
ImportSpreadsheetColumnscomponent (isDisabled={isOffline}), which is correct for its other consumers (categories, tags, members, per diem, company cards, wallet transactions) that need a live server round-trip. Rather than change behavior for everyone, this PR:shouldDisableButtonWhenOfflineprop (defaulttrue, preserving existing behavior for every other importer) toImportSpreadsheetColumns, applied asisDisabled={shouldDisableButtonWhenOffline && isOffline}.shouldDisableButtonWhenOffline={false}from the merchant-rules page so its button stays active offline.Fixed Issues
$ #96842
PROPOSAL: #96842 (comment)
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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