BOD-23 Added schema changes for time tickets + redux config for time ticket modal + scaffolding for time ticket modal.

This commit is contained in:
Patrick Fic
2020-04-14 17:38:05 -07:00
parent 91af10eef2
commit 325a82ac86
27 changed files with 829 additions and 9 deletions

View File

@@ -4,8 +4,8 @@ const baseModal = {
visible: false,
context: {},
actions: {
refetch: null
}
refetch: null,
},
};
const INITIAL_STATE = {
@@ -14,7 +14,8 @@ const INITIAL_STATE = {
courtesyCarReturn: { ...baseModal },
noteUpsert: { ...baseModal },
schedule: { ...baseModal },
partsOrder: { ...baseModal }
partsOrder: { ...baseModal },
timeTicket: { ...baseModal },
};
const modalsReducer = (state = INITIAL_STATE, action) => {
@@ -24,8 +25,8 @@ const modalsReducer = (state = INITIAL_STATE, action) => {
...state,
[action.payload]: {
...state[action.payload],
visible: !state[action.payload].visible
}
visible: !state[action.payload].visible,
},
};
case ModalsActionTypes.SET_MODAL_CONTEXT:
return {
@@ -33,8 +34,8 @@ const modalsReducer = (state = INITIAL_STATE, action) => {
[action.payload.modal]: {
...state[action.payload.modal],
...action.payload.context,
visible: true
}
visible: true,
},
};
default:
return state;

View File

@@ -31,3 +31,8 @@ export const selectPartsOrder = createSelector(
[selectModals],
modals => modals.partsOrder
);
export const selectTimeTicket = createSelector(
[selectModals],
modals => modals.timeTicket
);