Merged PR 483: defect 7 - case refresh error
defect 7 - case refresh error Related work items: #6256
This commit is contained in:
@@ -128,9 +128,11 @@ const DocumentDetails = (props) => {
|
|||||||
{_.has(historyObj, [
|
{_.has(historyObj, [
|
||||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
|
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue",
|
||||||
])
|
])
|
||||||
? historyObj[
|
? formatDates(
|
||||||
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
historyObj[
|
||||||
]
|
"pinswg_publisheddate@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
)
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
@@ -194,6 +196,15 @@ const DocumentDetails = (props) => {
|
|||||||
const searchDocumentResultsObj = docDetailsObj();
|
const searchDocumentResultsObj = docDetailsObj();
|
||||||
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
||||||
|
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
|
|||||||
@@ -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;
|
||||||
+3
-2
@@ -4,7 +4,8 @@ import thunkMiddleware from "redux-thunk";
|
|||||||
import { reducer as formReducer } from "redux-form";
|
import { reducer as formReducer } from "redux-form";
|
||||||
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
|
||||||
import autoMergeLevel1 from "redux-persist/lib/stateReconciler/autoMergeLevel1";
|
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 currentView from "./currentView/reducer";
|
||||||
import search from "./search/reducer";
|
import search from "./search/reducer";
|
||||||
import searchResultsObj from "./searchOutput/reducer";
|
import searchResultsObj from "./searchOutput/reducer";
|
||||||
@@ -107,7 +108,7 @@ const makeStore = ({ isServer }) => {
|
|||||||
whitelist: [
|
whitelist: [
|
||||||
"currentView",
|
"currentView",
|
||||||
"search",
|
"search",
|
||||||
"searchResults",
|
"searchResultsObj",
|
||||||
"formData",
|
"formData",
|
||||||
"appealType",
|
"appealType",
|
||||||
"LPAData",
|
"LPAData",
|
||||||
|
|||||||
Reference in New Issue
Block a user