logic to let child cases be shown in case details
This commit is contained in:
+24
-10
@@ -143,7 +143,7 @@ export const getBasicSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=contains(title, '" +
|
||||||
searchString +
|
searchString +
|
||||||
"') and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
"') and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
||||||
azureHeaders(token)
|
azureHeaders(token)
|
||||||
@@ -166,7 +166,7 @@ export const getBasicDNSSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true",
|
||||||
azureHeaders(token)
|
azureHeaders(token)
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -204,7 +204,7 @@ export const getAdvancedSearch = (token, searchString) => {
|
|||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL +
|
WEBAPI_URL +
|
||||||
"incidents?$select=_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||||
queryString +
|
queryString +
|
||||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true&$top=201",
|
||||||
|
|
||||||
@@ -269,13 +269,8 @@ export const getSearchDocumentHistory = (token, documentID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchDocumentDetails1 = (incidentID) => {
|
export const getSearchDocumentDetails1 = (incidentID) => {
|
||||||
console.log(incidentID);
|
//console.log(incidentID);
|
||||||
var token = getSASToken();
|
var token = getSASToken();
|
||||||
console.log(
|
|
||||||
"/api/proxy/pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
|
||||||
incidentID +
|
|
||||||
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference"
|
|
||||||
);
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
"/api/proxy/pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
"/api/proxy/pinswg_documents?$count=true&$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
|
||||||
@@ -289,7 +284,7 @@ export const getSearchDocumentDetails1 = (incidentID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchDocumentHistory1 = (documentID) => {
|
export const getSearchDocumentHistory1 = (documentID) => {
|
||||||
console.log(documentID);
|
// console.log(documentID);
|
||||||
var token = getSASToken();
|
var token = getSASToken();
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
@@ -318,6 +313,25 @@ export const getBasicDNSSearchDetails = (token, appealType, caseReference) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getLinkedCases = (parentIncidentid) => {
|
||||||
|
console.log(parentIncidentid);
|
||||||
|
var token = getSASToken();
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
"/api/proxy/incidents?$count=true&$filter=_parentcaseid_value eq " +
|
||||||
|
parentIncidentid +
|
||||||
|
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true &$select=title, incidentid,"
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(" linked date", res.data);
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("thiserror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getFormData = (token, whichForm) => {
|
export const getFormData = (token, whichForm) => {
|
||||||
//console.log("got to axios", whichForm);
|
//console.log("got to axios", whichForm);
|
||||||
//console.log("api_root: ", BASE_URL);
|
//console.log("api_root: ", BASE_URL);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ const CaseSummary = (props) => {
|
|||||||
searchResultsObj={props.searchResultsObj}
|
searchResultsObj={props.searchResultsObj}
|
||||||
searchDetailsObj={props.searchDetailsObj}
|
searchDetailsObj={props.searchDetailsObj}
|
||||||
searchString={props.searchString}
|
searchString={props.searchString}
|
||||||
|
incidentid={props.incidentid}
|
||||||
/>
|
/>
|
||||||
<Documents
|
<Documents
|
||||||
incidentid={props.incidentid}
|
incidentid={props.incidentid}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const DocumentDetails = (props) => {
|
|||||||
var documentDetailsArr = documentDetailsObj || [];
|
var documentDetailsArr = documentDetailsObj || [];
|
||||||
|
|
||||||
const DocumentView = (documentDetailsArr) => {
|
const DocumentView = (documentDetailsArr) => {
|
||||||
console.log(documentDetailsArr);
|
//console.log(documentDetailsArr);
|
||||||
|
|
||||||
documentDetailsArr = documentDetailsArr.value;
|
documentDetailsArr = documentDetailsArr.value;
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ const DocumentDetails = (props) => {
|
|||||||
const docDetailsObj = async () => {
|
const docDetailsObj = async () => {
|
||||||
let docObj = await getSearchDocumentDetails1(incidentid)
|
let docObj = await getSearchDocumentDetails1(incidentid)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
console.log(data);
|
//console.log(data);
|
||||||
setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
|
|||||||
+112
-18
@@ -1,18 +1,26 @@
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
|
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
import LoadingOverlay from "react-loading-overlay";
|
||||||
|
|
||||||
|
import { getLinkedCases } from "../../actions";
|
||||||
|
import {
|
||||||
|
setCurrentLinkedCases,
|
||||||
|
setCurrentReference,
|
||||||
|
} from "../../store/currentView/action";
|
||||||
|
|
||||||
const CaseSummary = (props) => {
|
const CaseSummary = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const {
|
const {
|
||||||
|
incidentid,
|
||||||
caseReference,
|
caseReference,
|
||||||
myCases,
|
myCases,
|
||||||
myRepresentations,
|
myRepresentations,
|
||||||
@@ -21,6 +29,9 @@ const CaseSummary = (props) => {
|
|||||||
searchResultsObj,
|
searchResultsObj,
|
||||||
searchDetailsObj,
|
searchDetailsObj,
|
||||||
currentType,
|
currentType,
|
||||||
|
setCurrentLinkedCases,
|
||||||
|
linkedCasesReference,
|
||||||
|
setCurrentReference,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const noRepresentationLink = ["/case", "/dnsdetails"];
|
const noRepresentationLink = ["/case", "/dnsdetails"];
|
||||||
@@ -322,28 +333,39 @@ const CaseSummary = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{_.has(detailsObj, [
|
{_.has(casesObj, [
|
||||||
"pinswg_linkedstatus@OData.Community.Display.V1.FormattedValue",
|
"numberofchildincidents",
|
||||||
])
|
])
|
||||||
? detailsObj[
|
? casesObj.numberofchildincidents >
|
||||||
"pinswg_linkedstatus@OData.Community.Display.V1.FormattedValue"
|
0
|
||||||
]
|
? t(
|
||||||
|
"case:summary-case-link-status-linked"
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
"case:summary-case-link-status-not-linked"
|
||||||
|
)
|
||||||
: t(
|
: t(
|
||||||
"case:summary-case-link-status-not-linked"
|
"case:summary-case-link-status-not-linked"
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-summary-list__row">
|
{casesObj.numberofchildincidents > 0 ? (
|
||||||
<dt className="govuk-summary-list__key">
|
<div className="govuk-summary-list__row">
|
||||||
{t(
|
<dt className="govuk-summary-list__key">
|
||||||
"case:summary-linked-cases-label"
|
{t(
|
||||||
)}
|
"case:summary-linked-cases-label"
|
||||||
</dt>
|
)}
|
||||||
<dd className="govuk-summary-list__value">
|
</dt>
|
||||||
{/* {casesObj.caseDetails.linkedCases ||
|
<dd className="govuk-summary-list__value">
|
||||||
""} */}
|
{linkedCasesList(
|
||||||
</dd>
|
props.currentView
|
||||||
</div>
|
.linkedCaseReferences
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -582,6 +604,20 @@ const CaseSummary = (props) => {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const linkCaseObj = async () => {
|
||||||
|
let docObj = await getLinkedCases(incidentid).then((data) => {
|
||||||
|
console.log(data);
|
||||||
|
setCurrentLinkedCases(data);
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
|
||||||
|
return linkCaseObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const linkedCases = linkCaseObj();
|
||||||
|
}, [incidentid, setCurrentLinkedCases]);
|
||||||
|
|
||||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
|
|
||||||
let spinnerState = () => {
|
let spinnerState = () => {
|
||||||
@@ -599,6 +635,47 @@ const CaseSummary = (props) => {
|
|||||||
return dd + "/" + mm + "/" + yyyy;
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function linkedCasesList(linkedCasesReference) {
|
||||||
|
console.log(linkedCasesReference);
|
||||||
|
|
||||||
|
linkedCasesReference = linkedCasesReference.value || [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ul className="govuk-list govuk-!-font-size-14">
|
||||||
|
{linkedCasesReference.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<li key={key}>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/achos"
|
||||||
|
: "/case"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentReference({
|
||||||
|
"currentReference": item.title,
|
||||||
|
"currentType":
|
||||||
|
"searchResultsObj",
|
||||||
|
"incidentid": item.incidentid,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
className=""
|
||||||
|
>
|
||||||
|
{item.title}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
// console.log(item.incidentid, item.title);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{showDetailsBlock}
|
{showDetailsBlock}
|
||||||
@@ -611,4 +688,21 @@ const CaseSummary = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CaseSummary;
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentLinkedCases: (parentIncidentid) => {
|
||||||
|
dispatch(setCurrentLinkedCases(parentIncidentid));
|
||||||
|
},
|
||||||
|
setCurrentReference: (currentReference) => {
|
||||||
|
dispatch(setCurrentReference(currentReference));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(CaseSummary);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const CRMError = (props) => {
|
|||||||
? "LPAData"
|
? "LPAData"
|
||||||
: "searchResultsObj";
|
: "searchResultsObj";
|
||||||
|
|
||||||
console.log(errorSwitch);
|
//console.log(errorSwitch);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function Search(props) {
|
|||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
console.log("has an error", hasError);
|
//console.log("has an error", hasError);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main
|
<main
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ let AdvancedSearch = (props) => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
spinnerState();
|
spinnerState();
|
||||||
|
|
||||||
console.log(values);
|
//console.log(values);
|
||||||
// var appTypeCollection = values.appealTypes.split(",")[1];
|
// var appTypeCollection = values.appealTypes.split(",")[1];
|
||||||
|
|
||||||
// appTypeCollection = getFormCollection(
|
// appTypeCollection = getFormCollection(
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function Search(props) {
|
|||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
console.log("has an error", hasError);
|
//console.log("has an error", hasError);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main
|
<main
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"summary-decision-label": "Penderfyniad a chanlyniad",
|
"summary-decision-label": "Penderfyniad a chanlyniad",
|
||||||
"summary-case-link-status-label": "Statws cysylltiad yr Achos",
|
"summary-case-link-status-label": "Statws cysylltiad yr Achos",
|
||||||
"summary-case-link-status-not-linked": "Heb ei Gysylltu",
|
"summary-case-link-status-not-linked": "Heb ei Gysylltu",
|
||||||
|
"summary-case-link-status-linked": "Cysylltiedig",
|
||||||
"summary-linked-cases-label": "Achosion cysylltiedig",
|
"summary-linked-cases-label": "Achosion cysylltiedig",
|
||||||
"summary-dates-label": "Dyddiadau",
|
"summary-dates-label": "Dyddiadau",
|
||||||
"summary-no-date-entered-label": "dim dyddiad wedi'i nodi",
|
"summary-no-date-entered-label": "dim dyddiad wedi'i nodi",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"summary-decision-label": "Decision and Outcome",
|
"summary-decision-label": "Decision and Outcome",
|
||||||
"summary-case-link-status-label": "Case Link Status",
|
"summary-case-link-status-label": "Case Link Status",
|
||||||
"summary-case-link-status-not-linked": "Not linked",
|
"summary-case-link-status-not-linked": "Not linked",
|
||||||
|
"summary-case-link-status-linked": "Linked",
|
||||||
"summary-linked-cases-label": "Linked Cases",
|
"summary-linked-cases-label": "Linked Cases",
|
||||||
"summary-dates-label": "Dates",
|
"summary-dates-label": "Dates",
|
||||||
"summary-no-date-entered-label": "no date entered",
|
"summary-no-date-entered-label": "no date entered",
|
||||||
|
|||||||
+11
-6
@@ -33,6 +33,7 @@ import {
|
|||||||
setAwaitingSubmissionDetails,
|
setAwaitingSubmissionDetails,
|
||||||
} from "../../store/awaitingSubmission/action";
|
} from "../../store/awaitingSubmission/action";
|
||||||
import {
|
import {
|
||||||
|
getSASToken,
|
||||||
getMyCases,
|
getMyCases,
|
||||||
getMyRepresentations,
|
getMyRepresentations,
|
||||||
getWatchedCases,
|
getWatchedCases,
|
||||||
@@ -85,16 +86,19 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
(store) =>
|
(store) =>
|
||||||
async ({ query, req, res }) => {
|
async ({ query, req, res }) => {
|
||||||
//console.log("the query", query);
|
//console.log("the query", query);
|
||||||
|
|
||||||
|
const token = await getSASToken();
|
||||||
|
|
||||||
const [
|
const [
|
||||||
myCases,
|
myCases,
|
||||||
myRepresentations,
|
myRepresentations,
|
||||||
watchedCases,
|
watchedCases,
|
||||||
awaitingSubmission,
|
awaitingSubmission,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
await getMyCases("f8b454ed-eded-eb11-aac7-00224800be9c"),
|
await getMyCases(token, "f8b454ed-eded-eb11-aac7-00224800be9c"),
|
||||||
await getMyRepresentations(),
|
await getMyRepresentations(token),
|
||||||
await getWatchedCases(),
|
await getWatchedCases(token),
|
||||||
await getAwaitingSubmission(),
|
await getAwaitingSubmission(token),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const cookies = new Cookies(req, res);
|
const cookies = new Cookies(req, res);
|
||||||
@@ -109,7 +113,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
// watchedCasesDetails,
|
// watchedCasesDetails,
|
||||||
// awaitingSubmissionDetails,
|
// awaitingSubmissionDetails,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
await getDetails(myCases),
|
await getDetails(token, myCases),
|
||||||
// await getDetails(myRepresentations),
|
// await getDetails(myRepresentations),
|
||||||
// await getDetails(watchedCases),
|
// await getDetails(watchedCases),
|
||||||
// await getDetails(awaitingSubmission),
|
// await getDetails(awaitingSubmission),
|
||||||
@@ -142,7 +146,7 @@ const getFormCollection = (formtype) => {
|
|||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetails = (resultsObj) => {
|
const getDetails = (token, resultsObj) => {
|
||||||
//console.log(resultsObj);
|
//console.log(resultsObj);
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
resultsObj = resultsObj.value;
|
resultsObj = resultsObj.value;
|
||||||
@@ -152,6 +156,7 @@ const getDetails = (resultsObj) => {
|
|||||||
} else {
|
} else {
|
||||||
detailsArr.push(
|
detailsArr.push(
|
||||||
getPortalModuelDetails(
|
getPortalModuelDetails(
|
||||||
|
token,
|
||||||
getFormCollection(
|
getFormCollection(
|
||||||
"pinswg_" +
|
"pinswg_" +
|
||||||
searchDetail[
|
searchDetail[
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export const currentViewActionTypes = {
|
|||||||
SETREPRESENTATIONCAPACITY: "SETREPRESENTATIONCAPACITY",
|
SETREPRESENTATIONCAPACITY: "SETREPRESENTATIONCAPACITY",
|
||||||
SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT",
|
SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT",
|
||||||
SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION",
|
SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION",
|
||||||
|
SETCURRENTLINKEDCASES: "SETCURRENTLINKEDCASES",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCurrentViewObj = () => (dispatch) => {
|
export const getCurrentViewObj = () => (dispatch) => {
|
||||||
@@ -56,3 +57,10 @@ export const setRepresentationSubmitConfirmation =
|
|||||||
representationSubmitConfirmation: representationSubmitConfirmation,
|
representationSubmitConfirmation: representationSubmitConfirmation,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setCurrentLinkedCases = (linkedCaseReferences) => (dispatch) => {
|
||||||
|
return dispatch({
|
||||||
|
type: currentViewActionTypes.SETCURRENTLINKEDCASES,
|
||||||
|
linkedCaseReferences: linkedCaseReferences,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const currentViewInitialState = {
|
|||||||
representationCapacity: {},
|
representationCapacity: {},
|
||||||
representationSubmit: null,
|
representationSubmit: null,
|
||||||
representationSubmitConfirmation: {},
|
representationSubmitConfirmation: {},
|
||||||
|
linkedCaseReferences: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function reducer(state = currentViewInitialState, action) {
|
export default function reducer(state = currentViewInitialState, action) {
|
||||||
@@ -20,6 +21,12 @@ export default function reducer(state = currentViewInitialState, action) {
|
|||||||
...state,
|
...state,
|
||||||
caseReference: action.caseReference,
|
caseReference: action.caseReference,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
case currentViewActionTypes.SETCURRENTLINKEDCASES:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
linkedCaseReferences: action.linkedCaseReferences,
|
||||||
|
};
|
||||||
case currentViewActionTypes.SETREPRESENTATIONCAPACITY:
|
case currentViewActionTypes.SETREPRESENTATIONCAPACITY:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
|||||||
Reference in New Issue
Block a user