Skip to content

[DEW in NewDot] Hide the approval workflow UI when "Hide People Table Columns" (dynamicExternalWorkflowHidePeople) is set #98491

Description

@MelvinBot

Problem

When a workspace is on a Dynamic External Workflow (DEW / LINEARAPPROVAL, approvalMode === DYNAMICEXTERNAL) and the "Hide People Table Columns" option (dynamicExternalWorkflowHidePeople) is set in the DEW Manager, NewDot should hide the approval workflow UI from the customer — matching Expensify Classic (OldDot). Today NewDot ignores that flag: the Workflows page keys entirely off approvalMode === DYNAMICEXTERNAL and always renders the read-only approval workflow list plus the "custom approval workflow enabled" info banner, so the "Hide People Table Columns" toggle has no effect in NewDot.

The backend already returns dynamicExternalWorkflowHidePeople in the policy summary payload (returned only when true), so the client can decide to hide the section. NewDot just never consumes it — the App codebase currently has zero references to this flag.

Expected behavior: when dynamicExternalWorkflowHidePeople is true, keep the existing "custom approval workflow is enabled…" info banner as the explanation, but hide the actual approval workflow configuration UI so the customer never sees or reaches it.

Proposed changes

  1. Add the flag to the Policy type — add dynamicExternalWorkflowHidePeople?: boolean; to src/types/onyx/Policy.ts (alongside approvalMode).

  2. Gate the approval-workflow render in src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx on the flag. Suggested approach: derive something like hidePeople = !!policy?.dynamicExternalWorkflowHidePeople and, when it is true:

    Context: isDEWEnabled is computed at WorkspaceWorkflowsPage.tsx:467 via hasDynamicExternalWorkflow in src/libs/PolicyUtils.ts:1596, which today only checks approvalMode and ignores any hide flag.

  3. Block deep-link access to the approvals routes while the flag is true — ensure WORKSPACE_WORKFLOWS_APPROVALS_* routes (WORKSPACE_WORKFLOWS_APPROVALS_NEW / _EDIT and WORKSPACE_WORKFLOWS_APPROVALS_EXPENSES_FROM) can't be reached via direct URL when dynamicExternalWorkflowHidePeople is true (e.g. redirect to a NotFound/full-page fallback in the approvals screens, following existing access-gating patterns in those pages).

Tests

Add a Jest test for WorkspaceWorkflowsPage covering both flag states:

  • dynamicExternalWorkflowHidePeople: true → banner is rendered, workflow list / search bar / add-approval affordance are not rendered.
  • flag false/absent (DEW still enabled) → existing behavior is unchanged (banner + read-only workflow list still rendered).

Open item to confirm before/while implementing

Confirm dynamicExternalWorkflowHidePeople is actually present in the NewDot policy summary payload for an affected workspace — the backend returns it only when true, so verify a real DEW workspace with the toggle set surfaces it in the client policy object.


This App work was split out from an internal tracking issue so an external contributor can pick it up.

Upwork Automation - Do Not Edit

Metadata

Metadata

Assignees

Labels

DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions