refactor(actions): complete priority-1 consumer import migration pass
This commit is contained in:
@@ -6,30 +6,32 @@ import { parseCookies } from "nookies";
|
||||
import { connect } from "react-redux";
|
||||
import {
|
||||
deleteAwaitingSubmissions,
|
||||
deleteMyRepresentationsFromBlob,
|
||||
deleteWatchedCases,
|
||||
getAwaitingSubmissionProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
getRepsFromBlobProxy,
|
||||
getWatchedCasesProxy,
|
||||
} from "../../actions";
|
||||
getWatchedCasesProxy
|
||||
} from "../../actions/services/portalService";
|
||||
import {
|
||||
deleteMyRepresentationsFromBlob,
|
||||
getRepsFromBlobProxy
|
||||
} from "../../actions/services/documentService";
|
||||
import { consoleLogger } from "../../actions/core/logger";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
setAwaitingSubmission,
|
||||
setAwaitingSubmissionDetails,
|
||||
setAwaitingSubmissionDetails
|
||||
} from "../../store/awaitingSubmission/action";
|
||||
import {
|
||||
setCurrentReference,
|
||||
setCurrentView,
|
||||
setRepresentationCapacity,
|
||||
setRepresentationCapacity
|
||||
} from "../../store/currentView/action";
|
||||
import {
|
||||
setMyRepresentations,
|
||||
setMyRepresentationsDetails,
|
||||
setMyRepresentationsDetails
|
||||
} from "../../store/myRepresentations/action";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
setWatchedCasesDetails
|
||||
} from "../../store/watchedCases/action";
|
||||
import { getFormCollectionByID, getDetailsProxy } from "../utils";
|
||||
|
||||
@@ -46,7 +48,7 @@ const TopThree = (props) => {
|
||||
setAwaitingSubmissionDetails,
|
||||
setMyRepresentations,
|
||||
setMyRepresentationsDetails,
|
||||
setRepresentationCapacity,
|
||||
setRepresentationCapacity
|
||||
} = props;
|
||||
|
||||
const router = useRouter();
|
||||
@@ -80,12 +82,12 @@ const TopThree = (props) => {
|
||||
.then((data) => data)
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||
setWatchedCases(data),
|
||||
(setWatchedCases(data),
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -97,7 +99,7 @@ const TopThree = (props) => {
|
||||
.then(() => {
|
||||
getAwaitingSubmissionProxy(cookies.pinsUser).then(
|
||||
(data) => {
|
||||
setAwaitingSubmission(data),
|
||||
(setAwaitingSubmission(data),
|
||||
getDetailsProxy(
|
||||
data,
|
||||
"awaitingSubmission"
|
||||
@@ -107,7 +109,7 @@ const TopThree = (props) => {
|
||||
// data
|
||||
// );
|
||||
setAwaitingSubmissionDetails(data);
|
||||
});
|
||||
}));
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -136,12 +138,12 @@ const TopThree = (props) => {
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
res.status(400).json(error);
|
||||
return null;
|
||||
})
|
||||
.then(() => {
|
||||
setCurrentView({
|
||||
"viewName": "My Representations",
|
||||
"viewKey": "myRepresentations",
|
||||
"viewKey": "myRepresentations"
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -211,7 +213,7 @@ const TopThree = (props) => {
|
||||
style={{
|
||||
color: "#0360a6",
|
||||
cursor: "pointer",
|
||||
fontWeight: "bold",
|
||||
fontWeight: "bold"
|
||||
}}
|
||||
data-id={index}
|
||||
onClick={() => {
|
||||
@@ -225,7 +227,7 @@ const TopThree = (props) => {
|
||||
showTopThreeArr[key].incidentID,
|
||||
"appealType":
|
||||
showTopThreeArr[key].appealType,
|
||||
"repDetails": showTopThreeArr[key],
|
||||
"repDetails": showTopThreeArr[key]
|
||||
});
|
||||
isLPA && setRepresentationCapacity("LPA");
|
||||
router.push({
|
||||
@@ -239,8 +241,8 @@ const TopThree = (props) => {
|
||||
state: "edit",
|
||||
created:
|
||||
showTopThreeArr[key]
|
||||
.repfile_name,
|
||||
},
|
||||
.repfile_name
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -294,7 +296,7 @@ const TopThree = (props) => {
|
||||
showTopThreeArr[key].representationType +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
eval: true
|
||||
})
|
||||
: showTopThreeArr[key].representationType || ""}
|
||||
</div>
|
||||
@@ -312,27 +314,27 @@ const TopThree = (props) => {
|
||||
.representationCapacity +
|
||||
'" )].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
eval: true
|
||||
})
|
||||
: jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
}).length > 0
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: showTopThreeArr[key].representationCapacity}
|
||||
path:
|
||||
'$..[?(@ && @.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value',
|
||||
json: transLookup,
|
||||
eval: true
|
||||
}).length > 0
|
||||
? jsonpath({
|
||||
path:
|
||||
'$..[?(@ && @.value_cy=="' +
|
||||
showTopThreeArr[key]
|
||||
.representationCapacity +
|
||||
'")].value',
|
||||
json: transLookup,
|
||||
eval: true
|
||||
})
|
||||
: showTopThreeArr[key].representationCapacity}
|
||||
</div>
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:date-raised")}:</b>
|
||||
@@ -352,7 +354,7 @@ const TopThree = (props) => {
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
eval: true
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -400,7 +402,7 @@ const TopThree = (props) => {
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
// currentView: state.currentView,
|
||||
accountDetails: state.accountDetails,
|
||||
accountDetails: state.accountDetails
|
||||
// search: state.search,
|
||||
// searchResultsObj: state.searchResultsObj,
|
||||
};
|
||||
@@ -431,7 +433,7 @@ const mapDispatchToProps = (dispatch) => {
|
||||
},
|
||||
setRepresentationCapacity: (representationCapacity) => {
|
||||
dispatch(setRepresentationCapacity(representationCapacity));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user