-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2692 from ita-social-projects/bugfix/#6050-Fix-sa…
…ving-order-data-when-usbugFix/#6050-Fix-saving-order-when-user-left-page bugFix/#6050, #6289-Fix-saving-order-when-user-left-page
- Loading branch information
Showing
32 changed files
with
464 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createAction, props } from '@ngrx/store'; | ||
import { OrderDetails, PersonalData } from 'src/app/ubs/ubs/models/ubs.interface'; | ||
|
||
export enum OrderActions { | ||
AddOrderDetails = '[Order] Add Order Details', | ||
AddPersonalData = '[Order] Add Personal Data', | ||
UpdateOrderDetails = '[Order] Update Order Details', | ||
UpdatePersonalData = '[Order] Update Personal Data' | ||
} | ||
|
||
export const AddOrderData = createAction(OrderActions.AddOrderDetails, props<{ orderDetails: OrderDetails }>()); | ||
export const AddPersonalData = createAction(OrderActions.AddPersonalData, props<{ personalData: PersonalData }>()); | ||
|
||
export const UpdateOrderData = createAction(OrderActions.UpdateOrderDetails, props<{ orderDetails: null }>()); | ||
export const UpdatePersonalData = createAction(OrderActions.UpdatePersonalData, props<{ personalData: null }>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { initialOrderState } from '../state/order.state'; | ||
import { AddOrderData, AddPersonalData, UpdateOrderData, UpdatePersonalData } from '../actions/order.actions'; | ||
import { createReducer, on } from '@ngrx/store'; | ||
|
||
export const orderReducer = createReducer( | ||
initialOrderState, | ||
on(AddOrderData, (state, action) => { | ||
return { | ||
...state, | ||
orderDetails: action.orderDetails | ||
}; | ||
}), | ||
|
||
on(AddPersonalData, (state, action) => { | ||
return { | ||
...state, | ||
personalData: action.personalData | ||
}; | ||
}), | ||
|
||
on(UpdateOrderData, (state, action) => { | ||
return { | ||
...state, | ||
orderDetails: action.orderDetails | ||
}; | ||
}), | ||
|
||
on(UpdatePersonalData, (state, action) => { | ||
return { | ||
...state, | ||
personalData: action.personalData | ||
}; | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { PersonalData, OrderDetails } from 'src/app/ubs/ubs/models/ubs.interface'; | ||
|
||
export interface IOrderState { | ||
orderDetails: OrderDetails | null; | ||
personalData: PersonalData | null; | ||
error?: string | null; | ||
} | ||
|
||
export const initialOrderState: IOrderState = { | ||
orderDetails: null, | ||
personalData: null, | ||
error: null | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const ubsOrderServiseMock = { | ||
orderDetails: null, | ||
personalData: null, | ||
error: null | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.