Skip to content

Hide Vendors row in More features when accounting connection doesn't scope vendors #98591

Description

@Beamanator

Version Number: latest main

Reproduction Steps

  1. Enable the vendorMatching beta on any account.
  2. Open a workspace with either (a) no accounting integration connected, or (b) an accounting integration whose non-reimbursable export destination does not scope the vendor field.
  3. Go to Settings → Workspace → More features.

Expected Result

The Vendors row should not appear in More features. It should only appear when the workspace has an accounting connection whose export config scopes the vendor field (this is exactly what hasVendorFeature in src/libs/PolicyUtils.ts returns).

When the row does appear, it should stay locked ON with a tooltip explaining that it is on because of the accounting integration (similar to how Categories/Tags/Taxes are handled when they come from a connection).

Actual Result

The row is rendered for any user with the beta enabled, regardless of accounting/export config. The toggle is disabled/locked with no explanation, so users don't understand how to make it work or turn it off.

Video repro from Tom in Slack: https://expensify.slack.com/archives/C07HPDRELLD/p1786096006215669?thread_ts=1785782693.225439&cid=C07HPDRELLD

Design & discussion

Fix scope

Two mechanical changes plus one copy string.

1. Hide the row when the feature doesn't apply.

src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx around line 461 — change the render gate from:

{isVendorMatchingEnabled && (
    <MoreFeatureToggle ... />
)}

to:

{hasVendorFeature(policy, isVendorMatchingEnabled) && (
    <MoreFeatureToggle ... />
)}

hasVendorFeature already exists in src/libs/PolicyUtils.ts and is exported. It mirrors the PHP backend gate (QBO w/ non-reimbursable = Credit Card or Debit Card, Sage Intacct w/ non-reimbursable = Credit Card Charge, Xero w/ config.isConfigured). No changes needed there — it is the single source of truth for this predicate.

2. Add a tooltip on the locked switch explaining why it's on.

The row stays disabled (there is no backend EnablePolicyVendors command yet, and the inline comment at the same call site explains why the switch stays purely derived). Per the design it should show a tooltip on hover, similar to how imported-from-integration Categories/Tags/Taxes explain themselves.

  • src/pages/workspace/WorkspaceMoreFeaturesPage/MoreFeatureToggle.tsx: add a disabledText?: string prop and forward it to the underlying <ToggleSettingOptionRow> — that component already accepts disabledText and wraps the switch in <Tooltip text={disabledText}> when disabled is true.
  • Pass disabledText={translate('workspace.moreFeatures.vendors.enabledExplanation')} to the Vendors <MoreFeatureToggle> in WorkspaceMoreFeaturesPage/index.tsx.
  • Add the new copy string in src/languages/en.ts inside workspace.moreFeatures.vendors (around line 6388). Suggested wording: "This is enabled by your accounting integration." — confirm final copy with @heyjennahay before shipping.
  • Add the same key to es.ts.

Scope confirmations (already answered — no follow-up needed)

  • Integration coverage: use hasVendorFeature as-is. Only QBO, Sage Intacct, and Xero are in scope. NetSuite and QuickBooks Desktop are intentionally excluded until they're picked up in a later release of the vendor project.
  • Backend toggle: out of scope for this fix. The switch stays purely derived from policy.connections — do not add an onToggle handler or an EnablePolicyVendors API call. That is a separate future PR (see the inline comment at WorkspaceMoreFeaturesPage/index.tsx line 461 on main).

Related

Platforms

All platforms — this is a shared React page.

Testing

  1. Enable the vendorMatching beta.
  2. Open a workspace with no accounting connection → Vendors row should not appear.
  3. Connect QBO with non-reimbursable export = Credit Card → Vendors row appears, locked ON, tooltip on hover.
  4. Switch non-reimbursable export to a non-card destination (e.g. Journal Entry) → Vendors row disappears.
  5. Repeat 3–4 for Sage Intacct (Credit Card Charge) and Xero (any configured connection).
Upwork Automation - Do Not Edit

Metadata

Metadata

Labels

ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions