A part of collect v2
Summary of changes
- Make attendee tracking a feature that can be enabled/disabled via a toggle
- Make it restricted to Control policies, by placing the toggle in the Rules section of the workspace editor (which can only be accessed after upgrading)
- Text to use below the toggle:
Track the per-person cost for every expense.
Initial discussion here (internal).
Technical changes
-
Backend
-
Frontend
- Update
onyx/Policy.ts with a new prop isAttendeeTrackingEnabled?: boolean
- Add a toggle to enable or disable Attendee Tracking in the Rules section of the workspace editor, under the existing
eReceipts toggle
- For backwards compatibility, assume the feature is disabled if the prop
isAttendeeTrackingEnabled doesn't exist
- Use the new API command
SetPolicyAttendeeTrackingEnabled when toggling the option, with optimistic data
- Update
shouldShowAttendees to only show the attendee selector when the feature is enabled on the selected workspace
-
Backend (can be done as follow-up updates)
- Update commands to throw an error if trying to set/edit attendees on a collect policy expense
- Disable the flag after downgrading a policy
- Prevent from enabling the feature on collect policies
A part of collect v2
Summary of changes
Track the per-person cost for every expense.Initial discussion here (internal).
Technical changes
Backend
SetPolicyAttendeeTrackingEnabledthat takes apolicyID: stringandenabled: booleanisAttendeeTrackingEnabledFrontend
onyx/Policy.tswith a new propisAttendeeTrackingEnabled?: booleaneReceiptstoggleisAttendeeTrackingEnableddoesn't existSetPolicyAttendeeTrackingEnabledwhen toggling the option, with optimistic datashouldShowAttendeesto only show the attendee selector when the feature is enabled on the selected workspaceBackend (can be done as follow-up updates)