Merge from git
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
export const AccountDetailsDataActionTypes = {
|
||||
SETCOOKIECONSENT: "SETCOOKIECONSENT",
|
||||
GETACCOUNTDETAILSDATA: "GETACCOUNTDETAILSDATA",
|
||||
SETACCOUNTDETAILSDATA: "SETACCOUNTDETAILSDATA",
|
||||
SETLOGGEDINUSER: "SETLOGGEDINUSER",
|
||||
SETACCOUNTCREATED: "SETACCOUNTCREATED",
|
||||
USER_LOGOUT: "USER_LOGOUT",
|
||||
};
|
||||
|
||||
export const setCookieConsent = (cookieObj) => (dispatch) => {
|
||||
console.log("wertyewrtyt", cookieObj);
|
||||
return dispatch({
|
||||
type: AccountDetailsDataActionTypes.SETCOOKIECONSENT,
|
||||
cookieObj: cookieObj,
|
||||
});
|
||||
};
|
||||
|
||||
export const getAccountDetailsObj = () => (dispatch) => {
|
||||
@@ -16,8 +28,22 @@ export const setAccountDetails = (accountDetails) => (dispatch) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const setLoggedInUserId = (loggedinUserId) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: AccountDetailsDataActionTypes.SETLOGGEDINUSER,
|
||||
loggedinUserId: loggedinUserId,
|
||||
});
|
||||
};
|
||||
|
||||
export const setLogout = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: "USER_LOGOUT",
|
||||
});
|
||||
};
|
||||
|
||||
export const setAccCr = (accCr) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: AccountDetailsDataActionTypes.SETACCOUNTCREATED,
|
||||
accCr: accCr,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,6 +2,9 @@ import { AccountDetailsDataActionTypes } from "./action";
|
||||
|
||||
const AccountDetailsDataInitialState = {
|
||||
accountDetails: {},
|
||||
loggedinUserId: "",
|
||||
accCr: false,
|
||||
cookieObj: "",
|
||||
};
|
||||
|
||||
export default function reducer(
|
||||
@@ -14,6 +17,21 @@ export default function reducer(
|
||||
...state,
|
||||
accountDetails: action.accountDetails,
|
||||
};
|
||||
case AccountDetailsDataActionTypes.SETLOGGEDINUSER:
|
||||
return {
|
||||
...state,
|
||||
loggedinUserId: action.loggedinUserId,
|
||||
};
|
||||
case AccountDetailsDataActionTypes.SETACCOUNTCREATED:
|
||||
return {
|
||||
...state,
|
||||
accCr: action.accCr,
|
||||
};
|
||||
case AccountDetailsDataActionTypes.SETCOOKIECONSENT:
|
||||
return {
|
||||
...state,
|
||||
cookieObj: action.cookieObj,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const appealTypeDataInitialState = {
|
||||
appealTypeID: {},
|
||||
currentSection: 1,
|
||||
appealLPA: "",
|
||||
caseReference: "",
|
||||
caseReference: {},
|
||||
formComplete: "false",
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const awaitingSubmissionActionTypes = {
|
||||
GETAWAITINGSUBMISSION: "GETAWAITINGSUBMISSION",
|
||||
SETAWAITINGSUBMISSION: "SETAWAITINGSUBMISSION",
|
||||
SETAWAITINGSUBMISSIONDETAILS: "SETAWAITINGSUBMISSIONDETAILS",
|
||||
UPDATEAWAITINGSUBMISSION: "UPDATEAWAITINGSUBMISSION",
|
||||
};
|
||||
|
||||
@@ -16,3 +17,11 @@ export const setAwaitingSubmission = (awaitingSubmission) => (dispatch) => {
|
||||
awaitingSubmission: awaitingSubmission,
|
||||
});
|
||||
};
|
||||
|
||||
export const setAwaitingSubmissionDetails =
|
||||
(awaitingSubmissionDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: awaitingSubmissionActionTypes.SETAWAITINGSUBMISSIONDETAILS,
|
||||
awaitingSubmissionDetails: awaitingSubmissionDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ import { awaitingSubmissionActionTypes } from "./action";
|
||||
|
||||
const awaitingSubmissionInitialState = {
|
||||
awaitingSubmission: {},
|
||||
awaitingSubmissionDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(
|
||||
@@ -11,8 +12,14 @@ export default function reducer(
|
||||
switch (action.type) {
|
||||
case awaitingSubmissionActionTypes.SETAWAITINGSUBMISSION:
|
||||
return {
|
||||
...state,
|
||||
awaitingSubmission: action.awaitingSubmission,
|
||||
};
|
||||
case awaitingSubmissionActionTypes.SETAWAITINGSUBMISSIONDETAILS:
|
||||
return {
|
||||
...state,
|
||||
awaitingSubmissionDetails: action.awaitingSubmissionDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ export const currentViewActionTypes = {
|
||||
SETREPRESENTATIONCAPACITY: "SETREPRESENTATIONCAPACITY",
|
||||
SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT",
|
||||
SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION",
|
||||
SETCURRENTLINKEDCASES: "SETCURRENTLINKEDCASES",
|
||||
};
|
||||
|
||||
export const getCurrentViewObj = () => (dispatch) => {
|
||||
@@ -56,3 +57,10 @@ export const setRepresentationSubmitConfirmation =
|
||||
representationSubmitConfirmation: representationSubmitConfirmation,
|
||||
});
|
||||
};
|
||||
|
||||
export const setCurrentLinkedCases = (linkedCaseReferences) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: currentViewActionTypes.SETCURRENTLINKEDCASES,
|
||||
linkedCaseReferences: linkedCaseReferences,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ const currentViewInitialState = {
|
||||
representationCapacity: {},
|
||||
representationSubmit: null,
|
||||
representationSubmitConfirmation: {},
|
||||
linkedCaseReferences: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = currentViewInitialState, action) {
|
||||
@@ -20,6 +21,12 @@ export default function reducer(state = currentViewInitialState, action) {
|
||||
...state,
|
||||
caseReference: action.caseReference,
|
||||
};
|
||||
|
||||
case currentViewActionTypes.SETCURRENTLINKEDCASES:
|
||||
return {
|
||||
...state,
|
||||
linkedCaseReferences: action.linkedCaseReferences,
|
||||
};
|
||||
case currentViewActionTypes.SETREPRESENTATIONCAPACITY:
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -10,9 +10,12 @@ export const getFormObj = () => (dispatch) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const setForm = (formData) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: formDataActionTypes.SETFORMDATA,
|
||||
formData: formData,
|
||||
});
|
||||
};
|
||||
export const setForm =
|
||||
(formData, mandatoryFieldsData, pickListData) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: formDataActionTypes.SETFORMDATA,
|
||||
formData: formData,
|
||||
mandatoryFieldsData: mandatoryFieldsData,
|
||||
pickListData: pickListData,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,6 +2,8 @@ import { formDataActionTypes } from "./action";
|
||||
|
||||
const formDataInitialState = {
|
||||
formData: {},
|
||||
mandatoryFieldsData: {},
|
||||
pickListData: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = formDataInitialState, action) {
|
||||
@@ -9,6 +11,8 @@ export default function reducer(state = formDataInitialState, action) {
|
||||
case formDataActionTypes.SETFORMDATA:
|
||||
return {
|
||||
formData: action.formData,
|
||||
mandatoryFieldsData: action.mandatoryFieldsData,
|
||||
pickListData: action.pickListData,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
|
||||
@@ -2,6 +2,7 @@ export const myCasesActionTypes = {
|
||||
GETMYCASES: "GETMYCASES",
|
||||
SETMYCASES: "SETMYCASES",
|
||||
UPDATEMYCASES: "UPDATEMYCASES",
|
||||
SETMYCASESDETAILS: "SETMYCASESDETAILS",
|
||||
};
|
||||
|
||||
export const getMyCasesObj = () => (dispatch) => {
|
||||
@@ -16,3 +17,9 @@ export const setMyCases = (myCases) => (dispatch) => {
|
||||
myCases: myCases,
|
||||
});
|
||||
};
|
||||
export const setMyCasesDetails = (myCasesDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: myCasesActionTypes.SETMYCASESDETAILS,
|
||||
myCasesDetails: myCasesDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,21 @@ import { myCasesActionTypes } from "./action";
|
||||
|
||||
const myCasesInitialState = {
|
||||
myCases: {},
|
||||
myCasesDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = myCasesInitialState, action) {
|
||||
switch (action.type) {
|
||||
case myCasesActionTypes.SETMYCASES:
|
||||
return {
|
||||
...state,
|
||||
myCases: action.myCases,
|
||||
};
|
||||
case myCasesActionTypes.SETMYCASESDETAILS:
|
||||
return {
|
||||
...state,
|
||||
myCasesDetails: action.myCasesDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const myRepresentationsActionTypes = {
|
||||
GETMYREPRESENTATIONS: "GETMYREPRESENTATIONS",
|
||||
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
|
||||
SETMYREPRESENTATIONSDETAILS: "SETMYREPRESENTATIONSDETAILS",
|
||||
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
|
||||
};
|
||||
|
||||
@@ -16,3 +17,11 @@ export const setMyRepresentations = (myRepresentations) => (dispatch) => {
|
||||
myRepresentations: myRepresentations,
|
||||
});
|
||||
};
|
||||
|
||||
export const setMyRepresentationsDetails =
|
||||
(myRepresentationsDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: myRepresentationsActionTypes.SETMYREPRESENTATIONSDETAILS,
|
||||
myRepresentationsDetails: myRepresentationsDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,21 @@ import { myRepresentationsActionTypes } from "./action";
|
||||
|
||||
const myRepresentationsInitialState = {
|
||||
myRepresentations: {},
|
||||
myRepresentationsDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = myRepresentationsInitialState, action) {
|
||||
switch (action.type) {
|
||||
case myRepresentationsActionTypes.SETMYREPRESENTATIONS:
|
||||
return {
|
||||
...state,
|
||||
myRepresentations: action.myRepresentations,
|
||||
};
|
||||
case myRepresentationsActionTypes.SETMYREPRESENTATIONSDETAILS:
|
||||
return {
|
||||
...state,
|
||||
myRepresentationsDetails: action.myRepresentationsDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ export const searchResultsActionTypes = {
|
||||
GETSEARCHRESULTS: "GETSEARCHRESULTS",
|
||||
SETSEARCHRESULTS: "SETSEARCHRESULTS",
|
||||
UPDATESEARCHRESULTS: "UPDATESEARCHRESULTS",
|
||||
SETSEARCHDETAILS: "SETSEARCHDETAILS",
|
||||
SETDOCUMENTDETAILS: "SETDOCUMENTDETAILS",
|
||||
SETDOCUMENTHISTORY: "SETDOCUMENTHISTORY",
|
||||
};
|
||||
|
||||
export const getSearchResultshObj = () => (dispatch) => {
|
||||
@@ -16,3 +19,23 @@ export const setSearchResults = (searchResults) => (dispatch) => {
|
||||
searchResultsObj: searchResults,
|
||||
});
|
||||
};
|
||||
|
||||
export const setSearchDetails = (searchDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETSEARCHDETAILS,
|
||||
searchDetailsObj: searchDetails,
|
||||
});
|
||||
};
|
||||
export const setDocumentDetails = (documentDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETDOCUMENTDETAILS,
|
||||
documentDetailsObj: documentDetails,
|
||||
});
|
||||
};
|
||||
|
||||
export const setDocumentHistory = (documentHistory) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: searchResultsActionTypes.SETDOCUMENTHISTORY,
|
||||
documentHistoryObj: documentHistory,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,33 @@ import { searchResultsActionTypes } from "./action";
|
||||
|
||||
const searchResultsInitialState = {
|
||||
searchResultsObj: {},
|
||||
searchDetailsObj: {},
|
||||
documentDetailsObj: {},
|
||||
documentHistoryObj: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = searchResultsInitialState, action) {
|
||||
switch (action.type) {
|
||||
case searchResultsActionTypes.SETSEARCHRESULTS:
|
||||
return {
|
||||
...state,
|
||||
searchResultsObj: action.searchResultsObj,
|
||||
};
|
||||
case searchResultsActionTypes.SETSEARCHDETAILS:
|
||||
return {
|
||||
...state,
|
||||
searchDetailsObj: action.searchDetailsObj,
|
||||
};
|
||||
case searchResultsActionTypes.SETDOCUMENTDETAILS:
|
||||
return {
|
||||
...state,
|
||||
documentDetailsObj: action.documentDetailsObj,
|
||||
};
|
||||
case searchResultsActionTypes.SETDOCUMENTHISTORY:
|
||||
return {
|
||||
...state,
|
||||
documentHistoryObj: action.documentHistoryObj,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import createWebStorage from "redux-persist/lib/storage/createWebStorage";
|
||||
|
||||
const createNoopStorage = () => {
|
||||
return {
|
||||
getItem(_key) {
|
||||
return Promise.resolve(null);
|
||||
},
|
||||
setItem(_key, value) {
|
||||
return Promise.resolve(value);
|
||||
},
|
||||
removeItem(_key) {
|
||||
return Promise.resolve();
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const storage =
|
||||
typeof window !== "undefined"
|
||||
? createWebStorage("local")
|
||||
: createNoopStorage();
|
||||
|
||||
export default storage;
|
||||
+5
-4
@@ -1,10 +1,11 @@
|
||||
import { createStore, applyMiddleware, combineReducers } from "redux";
|
||||
import { createWrapper, HYDRATE } from "next-redux-wrapper";
|
||||
import { createWrapper, HYDRATE, REHYDRATE } from "next-redux-wrapper";
|
||||
import thunkMiddleware from "redux-thunk";
|
||||
import { reducer as formReducer } from "redux-form";
|
||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||
import autoMergeLevel1 from "redux-persist/lib/stateReconciler/autoMergeLevel1";
|
||||
import storage from "redux-persist/lib/storage";
|
||||
//import storage from "redux-persist/lib/storage";
|
||||
import storage from "./storage";
|
||||
import currentView from "./currentView/reducer";
|
||||
import search from "./search/reducer";
|
||||
import searchResultsObj from "./searchOutput/reducer";
|
||||
@@ -103,11 +104,11 @@ const makeStore = ({ isServer }) => {
|
||||
const storage = require("redux-persist/lib/storage").default;
|
||||
|
||||
const persistConfig = {
|
||||
key: "acp_" + Math.floor(100000 + Math.random() * 900000),
|
||||
key: "acp",
|
||||
whitelist: [
|
||||
"currentView",
|
||||
"search",
|
||||
"searchResults",
|
||||
"searchResultsObj",
|
||||
"formData",
|
||||
"appealType",
|
||||
"LPAData",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const watchedCasesActionTypes = {
|
||||
GETWATCHEDCASES: "GETWATCHEDCASES",
|
||||
SETWATCHEDCASES: "SETWATCHEDCASES",
|
||||
SETWATCHEDCASESDETAILS: "SETWATCHEDCASESDETAILS",
|
||||
UPDATEWATCHEDCASES: "UPDATEWATCHEDCASES",
|
||||
};
|
||||
|
||||
@@ -16,3 +17,10 @@ export const setWatchedCases = (watchedCases) => (dispatch) => {
|
||||
watchedCases: watchedCases,
|
||||
});
|
||||
};
|
||||
|
||||
export const setWatchedCasesDetails = (watchedCasesDetails) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: watchedCasesActionTypes.SETWATCHEDCASESDETAILS,
|
||||
watchedCasesDetails: watchedCasesDetails,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,14 +2,21 @@ import { watchedCasesActionTypes } from "./action";
|
||||
|
||||
const watchedCasesInitialState = {
|
||||
watchedCases: {},
|
||||
watchedCasesDetails: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = watchedCasesInitialState, action) {
|
||||
switch (action.type) {
|
||||
case watchedCasesActionTypes.SETWATCHEDCASES:
|
||||
return {
|
||||
...state,
|
||||
watchedCases: action.watchedCases,
|
||||
};
|
||||
case watchedCasesActionTypes.SETWATCHEDCASESDETAILS:
|
||||
return {
|
||||
...state,
|
||||
watchedCasesDetails: action.watchedCasesDetails,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user