-
Notifications
You must be signed in to change notification settings - Fork 5
fix: wire TIME_OFF_EDIT_POLICY and TIME_OFF_CHANGE_SETTINGS transitions #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,7 +308,7 @@ export const timeOffMachine = { | |
| ), | ||
| transition( | ||
| componentEvents.TIME_OFF_CHANGE_SETTINGS, | ||
| 'policySettings', | ||
| 'editPolicySettings', | ||
| reduce( | ||
| ( | ||
| ctx: TimeOffFlowContextInterface, | ||
|
|
@@ -324,6 +324,35 @@ export const timeOffMachine = { | |
| backToListTransition, | ||
|
Comment on lines
+309
to
+324
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch — fixed in 03ff1c7. Added a dedicated |
||
| ), | ||
|
|
||
| // Distinct from `policySettings` (the create-flow step) so that DONE/BACK | ||
| // return to the policy detail view instead of routing into the create | ||
| // flow's add-employees / details-form steps. | ||
| editPolicySettings: state<MachineTransition>( | ||
| transition( | ||
| componentEvents.TIME_OFF_POLICY_SETTINGS_DONE, | ||
| 'viewTimeOffPolicyDetail', | ||
| reduce( | ||
| (ctx: TimeOffFlowContextInterface): TimeOffFlowContextInterface => ({ | ||
| ...ctx, | ||
| component: TimeOffPolicyDetailContextual, | ||
| alerts: undefined, | ||
| }), | ||
| ), | ||
| ), | ||
| transition( | ||
| componentEvents.TIME_OFF_POLICY_SETTINGS_BACK, | ||
| 'viewTimeOffPolicyDetail', | ||
| reduce( | ||
| (ctx: TimeOffFlowContextInterface): TimeOffFlowContextInterface => ({ | ||
| ...ctx, | ||
| component: TimeOffPolicyDetailContextual, | ||
| alerts: undefined, | ||
| }), | ||
| ), | ||
| ), | ||
| cancelToPolicyList, | ||
| ), | ||
|
|
||
| holidaySelectionForm: state<MachineTransition>( | ||
| transition( | ||
| componentEvents.TIME_OFF_HOLIDAY_SELECTION_DONE, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added round-trip coverage in 03ff1c7 — tests for DONE →
viewTimeOffPolicyDetail, BACK →viewTimeOffPolicyDetail, and CANCEL →policyListfromeditPolicySettings, plus a regression test pinning the create-flow DONE behavior.