Repository navigation
Allow disabling and deleting report fields once the integration that imported them is disconnected - #100783
Conversation
…on is connected Co-authored-by: dmkt9 <dmkt9@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Co-authored-by: dmkt9 <dmkt9@users.noreply.github.com>
|
Fixed and pushed as Cause: Fix: Ran
Local checks re-run after the fix
|
|
🤖 Web test steps verification results: Verified manual report/invoice field CRUD and the unlocked toggle baseline on a workspace with no accounting integration. Could not reach an imported-field/connected-integration state (no live NetSuite/QBO/Xero credentials available), so the lock and unlock-on-disconnect behavior itself (steps 1, 2, 4, 5) is blocked, not failed.
Run notes: dev NewDot web on branch The core gate this PR changes — imported fields unlocking once the integration is disconnected — still needs a manual pass on an account with real accounting credentials. This matches the Android run on the same PR. view run · no recording available |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@MelvinBot mark this PR as ready |
|
🤖 Marked this PR as ready for review. Two things still need you before a reviewer can sign off:
Checks are green apart from |
|
@MelvinBot update your checklist:
|
|
🤖 Updated the PR description:
One thing to flag: the Android run I did earlier could only verify step 3. Steps 1, 2, and 4 need a workspace with report fields imported from a live NetSuite connection, and the test account has no accounting credentials — so those steps are documented but not yet verified by me, and the Screenshots/Videos sections are still empty. |
Reviewer Checklist
Screenshots/Videoschrome.mp4 |
|
Product requested in here: #98469 (comment) |
|
🚧 NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 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.76-0 🚀
|
|
Yes — help site changes are required. Draft PR: #100901 Why: What the docs PR changes
What I checkedSearched every article under Behavior sourced from UI labels and the Workspaces > [workspace name] > Reports path were verified in the live web app on a Control workspace, not inferred from the code. @dmkt9, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR view run · no recording available |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.76-1 🚀
Bundle Size Analysis (Sentry): |
… connection Combines Expensify#100901 into this PR. Both PRs rewrote the same article, so the post-disconnect behavior from Expensify#100783 is merged into this branch's version instead of landing separately: - New section covering leftover imported fields after you disconnect or replace an integration: Report fields can be turned off, each field shows Delete, and List values become editable again. - Sharpened the lock wording to say List values can't be added, edited, enabled, or disabled while the connection is active. - Scoped every lock statement to an active connection. - Added the Initial value step to the create-a-field instructions. - Updated the FAQ answers and frontmatter to cover both states.












Explanation of Change
Follow-up to #99308.
That PR locked the Report Fields / Invoice Fields toggle on, and hid the per-field delete action, whenever any report field carried an accounting-integration
origin. Theoriginan integration stamps on a report field stays on the field after the integration is disconnected, so once a workspace imported report fields from (say) NetSuite and then disconnected NetSuite, the feature could never be turned off again and the leftover fields could never be deleted. PertrjExpensify, admins should be able to disable the feature once the connection is gone.isReportFieldImportedFromIntegrationnow takes the policy and only treats a field as imported while the connection that stamped itsoriginis still present onpolicy.connections. So:The
policyargument is required rather than optional so a call site can't silently fall back to the old behavior.Out of scope: this only keys off whether the connection is active. If a workspace stays connected but turns off "import coding as report fields", the imported fields are expected to be removed by the next sync rather than being unlocked by the frontend.
AI tests run
npm run typechecknpm run lint-changednpm run spell-changednpm run react-compiler-compliance-check checkon the 5 changed.tsxfilesnpm test -- tests/unit/WorkspaceReportFieldUtilsTest.ts tests/actions/ReportFieldTest.ts tests/unit/ReportFieldOptionsListUtilsTest.ts tests/ui/ReportFieldsInitialListValuePickerTest.tsxNew unit tests cover: every accounting origin locks while its integration is connected; a NetSuite-origin field stops being locked once accounting is disconnected or replaced by a different integration; connection names are not mistaken for stamped origins; manually-created fields are never locked.
Not run: a live browser pass. The prestarted web session rendered blank (0 accessibility nodes) before any interaction, and the gated behavior needs a workspace with a live accounting connection and integration-imported report fields, which the test harness can't produce.
Fixed Issues
$ #98469
PROPOSAL: #98469 (comment)
Tests
Offline tests
N/A
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