base flow for representations

This commit is contained in:
2021-08-09 10:16:54 +01:00
parent f9f36bd065
commit b3fe6bf5f5
31 changed files with 2494 additions and 64 deletions
+33
View File
@@ -2,6 +2,9 @@ export const currentViewActionTypes = {
GETCURRENTVIEW: "GETCURRENTVIEW",
SETCURRENTVIEW: "SETCURRENTVIEW",
SETCURRENTREFERENCE: "SETCURRENTREFERENCE",
SETREPRESENTATIONCAPACITY: "SETREPRESENTATIONCAPACITY",
SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT",
SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION",
};
export const getCurrentViewObj = () => (dispatch) => {
@@ -23,3 +26,33 @@ export const setCurrentReference = (caseReference) => (dispatch) => {
caseReference: caseReference,
});
};
export const setRepresentationCapacity =
(representationCapacity) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONCAPACITY,
representationCapacity: representationCapacity,
});
};
export const setRepresentationSubmit = (representationSubmit) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONSUBMIT,
representationSubmit: representationSubmit,
});
};
export const setSubmitBack = (representationSubmit) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONSUBMIT,
representationSubmit: representationSubmit,
});
};
export const setRepresentationSubmitConfirmation =
(representationSubmitConfirmation) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETREPRESENTATIONSUBMITCONFIRMATION,
representationSubmitConfirmation: representationSubmitConfirmation,
});
};
+14
View File
@@ -3,6 +3,9 @@ import { currentViewActionTypes } from "./action";
const currentViewInitialState = {
currentView: {},
caseReference: {},
representationCapacity: {},
representationSubmit: null,
representationSubmitConfirmation: {},
};
export default function reducer(state = currentViewInitialState, action) {
@@ -17,6 +20,17 @@ export default function reducer(state = currentViewInitialState, action) {
...state,
caseReference: action.caseReference,
};
case currentViewActionTypes.SETREPRESENTATIONCAPACITY:
return {
...state,
representationCapacity: action.representationCapacity,
};
case currentViewActionTypes.SETREPRESENTATIONSUBMITCONFIRMATION:
return {
...state,
representationSubmitConfirmation:
action.representationSubmitConfirmation,
};
default:
return state;
}