Skip to content

Workspace address: send discrete SetPolicyAddress params and keep legacy display compatibility #84378

@c3024

Description

@c3024

Problem

App still sends legacy nested params (data[addressStreet], etc.) for SetPolicyAddress, and still concatenates line 1 + line 2 into addressStreet with \n.

Parent issue: https://github.com/Expensify/Expensify/issues/394853

Solution

  • Update SetPolicyAddress params to flat fields in:
    • src/libs/API/parameters/UpdatePolicyAddressParams.ts
    • src/libs/actions/Policy/Policy.ts
  • Add addressStreet2?: string to CompanyAddress in:
    • src/types/onyx/Policy.ts
  • Stop newline concatenation when submitting workspace address in:
    • src/pages/workspace/WorkspaceOverviewAddressPage.tsx
    • src/pages/Travel/WorkspaceAddressForTravelPage.tsx
  • Update display/read compatibility to support both:
    • New format: addressStreet + addressStreet2
    • Legacy format: addressStreet containing \n
  • Compatibility updates in:
    • src/pages/workspace/WorkspaceOverviewPage.tsx
    • src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
    • src/libs/ReportActionsUtils.ts
    • src/pages/workspace/WorkspaceOverviewAddressPage.tsx (form prefill path)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions