Merged PR 767: Added service stage status and delete functions
Added service stage status and delete functions Related work items: #7319
This commit is contained in:
+58
-6
@@ -464,7 +464,7 @@ export const createCase = (appealTypeId, lpaID, contactid) => {
|
|||||||
contactid;
|
contactid;
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "post",
|
method: "get",
|
||||||
url: BASE_URL + queryUrl,
|
url: BASE_URL + queryUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -566,17 +566,34 @@ export const getWatchedCasesProxy = (loggedInUserId) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAwaitingSubmission = () => {
|
export const getAwaitingSubmissionProxy = (loggedInUserId) => {
|
||||||
return axios
|
return axios
|
||||||
.get(BASE_URL + "/api/lookups/awaitingSubmission", {
|
.get(
|
||||||
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
BASE_URL +
|
||||||
})
|
"/api/endpoint/getawaitingsubmissionproxy_api?loggedInUserId=" +
|
||||||
|
loggedInUserId
|
||||||
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("API call error", error);
|
console.log("API call error", error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getAwaitingSubmission = (loggedInUserId) => {
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
BASE_URL +
|
||||||
|
"/api/endpoint/getawaitingsubmission_api?loggedInUserId=" +
|
||||||
|
loggedInUserId
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("API call error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getPortalModuleDetails = (appealType, caseReference) => {
|
export const getPortalModuleDetails = (appealType, caseReference) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
@@ -699,7 +716,7 @@ export const updateCase = async (
|
|||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "post",
|
method: "post",
|
||||||
url: queryUrl + hashAPIPath(queryUrl),
|
url: queryUrl,
|
||||||
data: data,
|
data: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -712,6 +729,22 @@ export const updateCase = async (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const patchCase = async (incidentid) => {
|
||||||
|
var queryUrl = "/api/endpoint/patchcase_api?incidentid=" + incidentid;
|
||||||
|
var config = {
|
||||||
|
method: "get",
|
||||||
|
url: queryUrl,
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("this error:", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const deleteMyRepresentations = (myRepresentationsID) => {
|
export const deleteMyRepresentations = (myRepresentationsID) => {
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"/api/endpoint/deletemyrepresentations_api?myRepresentationsID=" +
|
"/api/endpoint/deletemyrepresentations_api?myRepresentationsID=" +
|
||||||
@@ -739,6 +772,25 @@ export const deleteMyRepresentations = (myRepresentationsID) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const deleteAwaitingSubmissions = (incidentID) => {
|
||||||
|
var queryUrl =
|
||||||
|
"/api/endpoint/deleteawaitingsubmissions_api?incidentID=" + incidentID;
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "delete",
|
||||||
|
url: queryUrl,
|
||||||
|
};
|
||||||
|
// console.log(config);
|
||||||
|
return axios(config)
|
||||||
|
.then((res) => {
|
||||||
|
//console.log("deleted ", res.data);
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("this serror", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const deleteWatchedCases = (watchedCaseID) => {
|
export const deleteWatchedCases = (watchedCaseID) => {
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
|
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
|
||||||
|
|||||||
@@ -75,6 +75,16 @@ const CaseSummary = (props) => {
|
|||||||
searchResultsObj,
|
searchResultsObj,
|
||||||
'$..[?(@.title=="' + caseReference + '")]'
|
'$..[?(@.title=="' + caseReference + '")]'
|
||||||
))
|
))
|
||||||
|
: currentType == "watchedCases"
|
||||||
|
? (casesObj = jsonpath.query(
|
||||||
|
setCaseQueryObj,
|
||||||
|
'$..[?(@.pinswg_title=="' + caseReference + '")]'
|
||||||
|
))
|
||||||
|
: currentType == "myCases"
|
||||||
|
? (casesObj = jsonpath.query(
|
||||||
|
setCaseQueryObj,
|
||||||
|
'$..[?(@.pinswg_title=="' + caseReference + '")]'
|
||||||
|
))
|
||||||
: (casesObj = jsonpath.query(
|
: (casesObj = jsonpath.query(
|
||||||
setCaseQueryObj,
|
setCaseQueryObj,
|
||||||
'$..[?(@.reference=="' + caseReference + '")]'
|
'$..[?(@.reference=="' + caseReference + '")]'
|
||||||
@@ -232,7 +242,6 @@ const CaseSummary = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{showSummary(casesObj, detailsObj)}
|
{showSummary(casesObj, detailsObj)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -201,10 +201,14 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
? jsonpath.query(
|
? jsonpath.query(
|
||||||
transLookup,
|
transLookup,
|
||||||
'$..[?(@.value=="' +
|
'$..[?(@.value=="' +
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
detailsObj[
|
||||||
|
"pinswg_relevantauthorityname@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
'")].value_cy'
|
'")].value_cy'
|
||||||
)
|
)
|
||||||
: detailsObj.pinswg_relevantauthorityname ||
|
: detailsObj[
|
||||||
|
"pinswg_relevantauthorityname@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
t(
|
t(
|
||||||
"case:summary-no-date-entered-label"
|
"case:summary-no-date-entered-label"
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -20,11 +20,7 @@ export default function MakeNewAppeal() {
|
|||||||
{t("myportal:makenewappeal-card-paragraph-two")}
|
{t("myportal:makenewappeal-card-paragraph-two")}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link href={"/newappeal"}>
|
||||||
href={
|
|
||||||
router.locale == "cy" ? "/apelnewydd" : "/newappeal"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<a className="govuk-button">
|
<a className="govuk-button">
|
||||||
{t("myportal:makenewappeal-card-button-label")}
|
{t("myportal:makenewappeal-card-button-label")}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -9,12 +9,18 @@ import {
|
|||||||
getWatchedCasesProxy,
|
getWatchedCasesProxy,
|
||||||
getPortalModuleDetailsProxy,
|
getPortalModuleDetailsProxy,
|
||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
|
deleteAwaitingSubmissions,
|
||||||
|
getAwaitingSubmissionProxy,
|
||||||
} from "../../actions";
|
} from "../../actions";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setWatchedCases,
|
setWatchedCases,
|
||||||
setWatchedCasesDetails,
|
setWatchedCasesDetails,
|
||||||
} from "../../store/watchedCases/action";
|
} from "../../store/watchedCases/action";
|
||||||
|
import {
|
||||||
|
setAwaitingSubmission,
|
||||||
|
setAwaitingSubmissionDetails,
|
||||||
|
} from "../../store/awaitingSubmission/action";
|
||||||
import { getFormCollectionByID } from "../../components/utils";
|
import { getFormCollectionByID } from "../../components/utils";
|
||||||
|
|
||||||
const TopThree = (props) => {
|
const TopThree = (props) => {
|
||||||
@@ -26,6 +32,8 @@ const TopThree = (props) => {
|
|||||||
topThreeType,
|
topThreeType,
|
||||||
setWatchedCases,
|
setWatchedCases,
|
||||||
setWatchedCasesDetails,
|
setWatchedCasesDetails,
|
||||||
|
setAwaitingSubmission,
|
||||||
|
setAwaitingSubmissionDetails,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -37,6 +45,7 @@ const TopThree = (props) => {
|
|||||||
|
|
||||||
const deleteItem = (caseID, topThreeType) => {
|
const deleteItem = (caseID, topThreeType) => {
|
||||||
let cookies = parseCookies();
|
let cookies = parseCookies();
|
||||||
|
//console.log("sssss", caseID, topThreeType);
|
||||||
topThreeType == "watchedCases" &&
|
topThreeType == "watchedCases" &&
|
||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
@@ -48,6 +57,32 @@ const TopThree = (props) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
topThreeType == "awaitingSubmission" &&
|
||||||
|
deleteAwaitingSubmissions(caseID)
|
||||||
|
.then((data) => {
|
||||||
|
console.log("zzzzz");
|
||||||
|
|
||||||
|
return data;
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
console.log("qqqqqq");
|
||||||
|
getAwaitingSubmissionProxy(cookies.pinsUser).then(
|
||||||
|
(data) => {
|
||||||
|
console.log("assss", data);
|
||||||
|
setAwaitingSubmission(data),
|
||||||
|
getDetails(data, "awaitingSubmission").then(
|
||||||
|
(data) => {
|
||||||
|
console.log(
|
||||||
|
"submission get details:",
|
||||||
|
data
|
||||||
|
);
|
||||||
|
setAwaitingSubmissionDetails(data);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetails = (resultsObj, detailsType) => {
|
const getDetails = (resultsObj, detailsType) => {
|
||||||
@@ -94,6 +129,7 @@ const TopThree = (props) => {
|
|||||||
return objArr.ticketnumber;
|
return objArr.ticketnumber;
|
||||||
break;
|
break;
|
||||||
case "awaitingSubmission":
|
case "awaitingSubmission":
|
||||||
|
return objArr.ticketnumber;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// code block
|
// code block
|
||||||
@@ -183,14 +219,12 @@ const TopThree = (props) => {
|
|||||||
|
|
||||||
{topThreeType == "awaitingSubmission" ? (
|
{topThreeType == "awaitingSubmission" ? (
|
||||||
<div className="carModuleAddress">
|
<div className="carModuleAddress">
|
||||||
Make Representation on Case Incomplete, not
|
Case Incomplete, not submitted
|
||||||
submitted
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{topThreeType == "watchedCases" && (
|
{topThreeType == "watchedCases" && (
|
||||||
<div className="">
|
<div className="">
|
||||||
<a
|
<a
|
||||||
@@ -214,6 +248,27 @@ const TopThree = (props) => {
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{topThreeType == "awaitingSubmission" && (
|
||||||
|
<div className="">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||||
|
onClick={() => {
|
||||||
|
event.preventDefault();
|
||||||
|
deleteItem(
|
||||||
|
showTopThreeArr[key].incidentid,
|
||||||
|
"awaitingSubmission"
|
||||||
|
);
|
||||||
|
alert(
|
||||||
|
"You have deleted case " +
|
||||||
|
showTopThreeArr[key].ticketnumber
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
—
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -255,6 +310,12 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
setWatchedCasesDetails: (watchedCasesDetails) => {
|
setWatchedCasesDetails: (watchedCasesDetails) => {
|
||||||
dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||||
},
|
},
|
||||||
|
setAwaitingSubmission: (awaitingSubmission) => {
|
||||||
|
dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||||
|
},
|
||||||
|
setAwaitingSubmissionDetails: (awaitingSubmissionDetails) => {
|
||||||
|
dispatch(setAwaitingSubmissionDetails(awaitingSubmissionDetails));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+110
-34
@@ -3,6 +3,8 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { setCurrentReference } from "../../store/currentView/action";
|
import { setCurrentReference } from "../../store/currentView/action";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
|
||||||
const ViewAllResults = (props) => {
|
const ViewAllResults = (props) => {
|
||||||
const {
|
const {
|
||||||
@@ -21,8 +23,16 @@ const ViewAllResults = (props) => {
|
|||||||
var resultsArr = props[currentView.viewKey][currentView.viewKey].value || [
|
var resultsArr = props[currentView.viewKey][currentView.viewKey].value || [
|
||||||
{},
|
{},
|
||||||
];
|
];
|
||||||
|
var searchDetailsObj =
|
||||||
|
props[currentView.viewKey][currentView.viewKey + "Details"] || {};
|
||||||
let resultsRowArr = [];
|
let resultsRowArr = [];
|
||||||
Object.keys(resultsArr).map((key, index) => {
|
resultsArr.map((item, key) => {
|
||||||
|
let detailsObj = jsonpath.query(
|
||||||
|
searchDetailsObj,
|
||||||
|
"$..value[?(@.pinswg_name=='" + item.pinswg_title + "')]"
|
||||||
|
);
|
||||||
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
resultsRowArr.push(
|
resultsRowArr.push(
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||||
@@ -42,21 +52,21 @@ const ViewAllResults = (props) => {
|
|||||||
setCurrentReference({
|
setCurrentReference({
|
||||||
"currentReference":
|
"currentReference":
|
||||||
currentView.viewKey != "watchedCases"
|
currentView.viewKey != "watchedCases"
|
||||||
? resultsArr[index].ticketnumber
|
? resultsArr[key].ticketnumber
|
||||||
: resultsArr[index][
|
: resultsArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
],
|
],
|
||||||
|
|
||||||
"currentType": currentView.viewKey,
|
"currentType": currentView.viewKey,
|
||||||
"incidentid":
|
"incidentid":
|
||||||
currentView.viewKey != "watchedCases"
|
currentView.viewKey != "watchedCases"
|
||||||
? resultsArr[index].incidentid
|
? resultsArr[key].incidentid
|
||||||
: resultsArr[index][
|
: resultsArr[key][
|
||||||
" _pinswg_watchedcase_value"
|
"_pinswg_watchedcase_value"
|
||||||
],
|
],
|
||||||
|
|
||||||
"appealType":
|
"appealType":
|
||||||
resultsArr[index].pinswg_appealcasetype,
|
resultsArr[key].pinswg_appealcasetype,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -65,8 +75,8 @@ const ViewAllResults = (props) => {
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey != "watchedCases"
|
{currentView.viewKey != "watchedCases"
|
||||||
? resultsArr[index].ticketnumber
|
? resultsArr[key].ticketnumber
|
||||||
: resultsArr[index][
|
: resultsArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]}
|
]}
|
||||||
</a>
|
</a>
|
||||||
@@ -74,42 +84,108 @@ const ViewAllResults = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
Site Address:{" "}
|
{t("search:searchresults-site-address-label")}:
|
||||||
</span>
|
</span>
|
||||||
{resultsArr[index].address1}
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
<br /> {resultsArr[index].town}
|
? detailsObj.pinswg_siteaddressline1
|
||||||
<br />
|
: ""}
|
||||||
{resultsArr[index].postcode}
|
|
||||||
|
{/* {detailsObj.pinswg_siteaddressline1 !=
|
||||||
|
null && <br />} */}
|
||||||
|
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
||||||
|
detailsObj.pinswg_siteaddressline1 != null && <br />}
|
||||||
|
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
|
? detailsObj.pinswg_siteaddressline2
|
||||||
|
: ""}
|
||||||
|
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
||||||
|
detailsObj.pinswg_siteaddressline2 != null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
|
? detailsObj.pinswg_siteaddresstown
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
|
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||||
|
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||||
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresscounty") &&
|
||||||
|
detailsObj.pinswg_siteaddresscounty != null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
||||||
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
Appellant/Applicant:
|
{t("search:searchresults-applicant-label")}:
|
||||||
</span>
|
</span>
|
||||||
Mr smith
|
|
||||||
|
{_.has(detailsObj, [
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||||
|
])
|
||||||
|
? detailsObj[
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
: resultsArr[key][
|
||||||
|
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">Authority:</span>
|
<span className="results-visually-hidden">
|
||||||
{
|
{t("search:searchresults-authority-label")}:
|
||||||
resultsArr[index][
|
</span>
|
||||||
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
{_.has(detailsObj, [
|
||||||
]
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||||
}
|
])
|
||||||
|
? router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
item[
|
||||||
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: detailsObj[
|
||||||
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] || "N/A"
|
||||||
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">Case Type:</span>
|
<span className="results-visually-hidden">
|
||||||
{
|
{t("search:searchresults-case-type-label")}:
|
||||||
resultsArr[index][
|
</span>
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
{router.locale == "cy"
|
||||||
]
|
? jsonpath.query(
|
||||||
}
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
item[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: item[
|
||||||
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">Status:</span>
|
<span className="results-visually-hidden">
|
||||||
{
|
{t("search:searchresults-status-label")}:
|
||||||
resultsArr[index][
|
</span>
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
{router.locale == "cy"
|
||||||
]
|
? jsonpath.query(
|
||||||
}
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
item[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: item[
|
||||||
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ import jsonpath from "jsonpath";
|
|||||||
import BuildCheckField from "./buildCheckfield";
|
import BuildCheckField from "./buildCheckfield";
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getPickListLabel,
|
||||||
|
} from "../../components/utils";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setCaseReference,
|
setCaseReference,
|
||||||
@@ -105,6 +109,16 @@ let BuildCheckRow = (props) => {
|
|||||||
datafieldname[0].value
|
datafieldname[0].value
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
: fieldtype[0].value ==
|
||||||
|
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}"
|
||||||
|
? getPickListLabel(
|
||||||
|
props.props.formData.pickListData,
|
||||||
|
datafieldname[0].value,
|
||||||
|
props.props.form["appealForm"]
|
||||||
|
.values[
|
||||||
|
datafieldname[0].value
|
||||||
|
]
|
||||||
|
)
|
||||||
: props.props.form["appealForm"].values[
|
: props.props.form["appealForm"].values[
|
||||||
datafieldname[0].value
|
datafieldname[0].value
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
|
import jsonpath from "jsonpath";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import { useEffect } from "react";
|
||||||
import { useState, useEffect } from "react";
|
import { connect } from "react-redux";
|
||||||
|
import { formValueSelector } from "redux-form";
|
||||||
import xpath from "xpath";
|
import xpath from "xpath";
|
||||||
import BuildRow from "./buildrow";
|
import { updateCase, patchCase } from "../../actions";
|
||||||
import { reduxForm, formValueSelector } from "redux-form";
|
import data from "../../data/collections.json";
|
||||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import { setCurrentSection } from "../../store/appealType/action";
|
import { setCurrentSection } from "../../store/appealType/action";
|
||||||
import { updateCase } from "../../actions";
|
|
||||||
import jsonpath from "jsonpath";
|
|
||||||
import { getFormCollectionByID } from "../utils";
|
import { getFormCollectionByID } from "../utils";
|
||||||
|
|
||||||
import data from "../../data/collections.json";
|
|
||||||
|
|
||||||
let CompleteAppeal = (props) => {
|
let CompleteAppeal = (props) => {
|
||||||
// un comment to update incident with an appealtype id
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let incidentId = props.appealType.caseReference.incidentid;
|
let incidentId = props.appealType.caseReference.incidentid;
|
||||||
let updateBody = props.props.form.appealForm.values;
|
let updateBody = props.props.form.appealForm.values;
|
||||||
@@ -51,6 +48,8 @@ let CompleteAppeal = (props) => {
|
|||||||
primaryAttribute,
|
primaryAttribute,
|
||||||
props.appealType.caseReference.ticketnumber
|
props.appealType.caseReference.ticketnumber
|
||||||
);
|
);
|
||||||
|
console.log("patching////////");
|
||||||
|
patchCase(incidentId);
|
||||||
}, [
|
}, [
|
||||||
props.appealType.caseReference,
|
props.appealType.caseReference,
|
||||||
props.props.form.appealForm.values,
|
props.props.form.appealForm.values,
|
||||||
|
|||||||
@@ -1,23 +1,15 @@
|
|||||||
import Link from "next/link";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import xpath from "xpath";
|
|
||||||
import BuildRow from "./buildrow";
|
|
||||||
import { reduxForm, formValueSelector, Field } from "redux-form";
|
|
||||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, formValueSelector, reduxForm } from "redux-form";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import { getFormCollectionByID } from "../utils";
|
|
||||||
|
|
||||||
import data from "../../data/collections.json";
|
|
||||||
import {
|
import {
|
||||||
setAppealType,
|
|
||||||
setAppealTypeTitle,
|
|
||||||
setAppealTypeID,
|
|
||||||
setAppealLPA,
|
setAppealLPA,
|
||||||
getAppealTypeObj,
|
setAppealTypeID,
|
||||||
|
setAppealTypeTitle,
|
||||||
} from "../../store/appealType/action";
|
} from "../../store/appealType/action";
|
||||||
|
import { getFormCollectionByID } from "../utils";
|
||||||
|
|
||||||
let CreateCase = (props) => {
|
let CreateCase = (props) => {
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
@@ -222,7 +214,7 @@ let CreateCase = (props) => {
|
|||||||
appTypeCollection = getFormCollectionByID(appTypeCollection);
|
appTypeCollection = getFormCollectionByID(appTypeCollection);
|
||||||
|
|
||||||
router.replace(
|
router.replace(
|
||||||
(router.locale = "cy" ? "/apelnewydd" : "/newappeal") +
|
"/newappeal" +
|
||||||
"/" +
|
"/" +
|
||||||
appTypeCollection.UrlName +
|
appTypeCollection.UrlName +
|
||||||
"?lpa=" +
|
"?lpa=" +
|
||||||
|
|||||||
@@ -25,6 +25,19 @@ export const getFormCollectionByID = (appealTypeID) => {
|
|||||||
return collectionName[0];
|
return collectionName[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getPickListLabel = (data, picklistType, picklistID) => {
|
||||||
|
const pickListData = jsonpath.query(
|
||||||
|
data,
|
||||||
|
"$..[?(@.LogicalName=='" + picklistType + "')]"
|
||||||
|
);
|
||||||
|
|
||||||
|
const pickListLabel = jsonpath.query(
|
||||||
|
pickListData,
|
||||||
|
"$..[?(@.Value=='" + picklistID + "')].Label.LocalizedLabels..Label"
|
||||||
|
);
|
||||||
|
return pickListLabel[0];
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the details of a case from the appeal type
|
* Get the details of a case from the appeal type
|
||||||
* @param object searchResultsObj
|
* @param object searchResultsObj
|
||||||
|
|||||||
@@ -214,6 +214,16 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"pinswg_decision": [
|
"pinswg_decision": [
|
||||||
|
{
|
||||||
|
"value": "Allowed",
|
||||||
|
"value_cy": "Caniateir",
|
||||||
|
"pinswg_decision": 846040000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Non Determination",
|
||||||
|
"value_cy": "Amhenderfyniad",
|
||||||
|
"pinswg_decision": 846040001
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"value": "Dismissed",
|
"value": "Dismissed",
|
||||||
"value_cy": "Gwrthodwyd",
|
"value_cy": "Gwrthodwyd",
|
||||||
|
|||||||
@@ -31,11 +31,14 @@ export default async function ApiProxy(req, res) {
|
|||||||
var data = JSON.stringify({
|
var data = JSON.stringify({
|
||||||
"title": "insertion test case",
|
"title": "insertion test case",
|
||||||
"caseorigincode": 3,
|
"caseorigincode": 3,
|
||||||
|
"servicestage": 1,
|
||||||
"customerid_contact@odata.bind": "/contacts(" + contactid + ")",
|
"customerid_contact@odata.bind": "/contacts(" + contactid + ")",
|
||||||
"pinswg_appealcasetype": appealTypeId,
|
"pinswg_appealcasetype": appealTypeId,
|
||||||
"pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")",
|
"pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "post",
|
method: "post",
|
||||||
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
//return "&hash=" + hashlink;
|
||||||
|
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var incidentID = req.query.incidentID;
|
||||||
|
var token = await getToken();
|
||||||
|
var queryUrl = "incidents(" + incidentID + ")";
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "delete",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*"',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
console.log("deleted awaitingsubmission case - " + incidentID);
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
" and servicestage eq 1 and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
|
console.log(queryUrl);
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
data.value.forEach(function (element) {
|
||||||
|
element.pinswg_title = element.title;
|
||||||
|
});
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var loggedInUserId = req.query.loggedInUserId;
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var queryUrl =
|
||||||
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
||||||
|
loggedInUserId +
|
||||||
|
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
azureHeaders(token.access_token)
|
||||||
|
)
|
||||||
|
.then(({ data }) => {
|
||||||
|
data.value.forEach(function (element) {
|
||||||
|
element.pinswg_title = element.title;
|
||||||
|
});
|
||||||
|
console.log(data);
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -15,9 +15,6 @@ const hashAPIPath = (queryPath) => {
|
|||||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
);
|
);
|
||||||
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
//return "&hash=" + hashlink;
|
|
||||||
|
|
||||||
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -37,7 +34,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||||
|
|
||||||
console.log("query: ", queryUrl, "<<<<end query");
|
//console.log("query: ", queryUrl, "<<<<end query");
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||||
|
|
||||||
console.log("query: ", queryUrl, "<<<<end query");
|
//console.log("query: ", queryUrl, "<<<<end query");
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
var token = await getToken();
|
var token = await getToken();
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
|
"incidents?$select=numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=_customerid_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3";
|
" and servicestage eq 0 and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3";
|
||||||
|
|
||||||
|
//console.log("Portal query: ", queryUrl, "<<<<end query");
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
@@ -32,6 +34,9 @@ export default async function ApiProxy(req, res) {
|
|||||||
azureHeaders(token.access_token)
|
azureHeaders(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
|
data.value.forEach(function (element) {
|
||||||
|
element.pinswg_title = element.title;
|
||||||
|
});
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
whichForm +
|
whichForm +
|
||||||
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true";
|
"')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet&$count=true";
|
||||||
|
|
||||||
|
console.log("get pick list for " + whichForm + ": ", queryUrl);
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken, azureHeaders } from "../../../actions";
|
import { getToken, azureHeaders } from "../../../actions";
|
||||||
|
import { getSelectQuery } from "../../../actions/selectQueryTypes";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
@@ -28,6 +29,8 @@ export default async function ApiProxy(req, res) {
|
|||||||
caseReference +
|
caseReference +
|
||||||
"'&$count=true";
|
"'&$count=true";
|
||||||
|
|
||||||
|
queryUrl = queryUrl + getSelectQuery(appealType);
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken, azureHeaders } from "../../../actions";
|
import {
|
||||||
|
getToken,
|
||||||
|
azureHeaders,
|
||||||
|
getBasicSearchDetails,
|
||||||
|
} from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
@@ -24,7 +28,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$count=true&$orderby=createdon desc";
|
"&$select=pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
@@ -32,6 +36,31 @@ export default async function ApiProxy(req, res) {
|
|||||||
azureHeaders(token.access_token)
|
azureHeaders(token.access_token)
|
||||||
)
|
)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
|
data.value.forEach(function (element) {
|
||||||
|
element.pinswg_title =
|
||||||
|
element[
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
];
|
||||||
|
|
||||||
|
element[
|
||||||
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] =
|
||||||
|
element.pinswg_WatchedCase[
|
||||||
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
];
|
||||||
|
element._pinswg_associatedlpa_value =
|
||||||
|
element.pinswg_WatchedCase._pinswg_associatedlpa_value;
|
||||||
|
element[
|
||||||
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] =
|
||||||
|
element.pinswg_WatchedCase[
|
||||||
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
];
|
||||||
|
element._ownerid_value =
|
||||||
|
element.pinswg_WatchedCase._ownerid_value;
|
||||||
|
|
||||||
|
delete element.pinswg_WatchedCase;
|
||||||
|
});
|
||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
var queryUrl =
|
var queryUrl =
|
||||||
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
|
||||||
loggedInUserId +
|
loggedInUserId +
|
||||||
"&$count=true&$orderby=createdon desc";
|
"&$select=pinswg_appealcasetype,pinswg_watchlistid,_pinswg_watchedcase_value,statuscode&$count=true&$orderby=createdon desc&$expand=pinswg_WatchedCase($select=pinswg_AssociatedLPA)";
|
||||||
|
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import CryptoJS from "crypto-js";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { getToken, azureHeadersPaged } from "../../../actions";
|
||||||
|
|
||||||
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
|
const WEBAPI_URL =
|
||||||
|
process.env.RELAY_ROOT ||
|
||||||
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
const hashAPIPath = (queryPath) => {
|
||||||
|
var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
queryPath,
|
||||||
|
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
);
|
||||||
|
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
//return "&hash=" + hashlink;
|
||||||
|
|
||||||
|
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ApiProxy(req, res) {
|
||||||
|
var incidentID = req.query.incidentid;
|
||||||
|
var queryUrl = "incidents(" + incidentID + ")";
|
||||||
|
var token = await getToken();
|
||||||
|
|
||||||
|
var data = JSON.stringify({
|
||||||
|
"servicestage": 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
//console.log(data, WEBAPI_URL + queryUrl);
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "patch",
|
||||||
|
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
var apiResponse = _.isEmpty(req.query)
|
||||||
|
? res.status(400).json()
|
||||||
|
: axios(config)
|
||||||
|
.then(({ data }) => {
|
||||||
|
res.status(200).json(data);
|
||||||
|
})
|
||||||
|
.catch(({ err }) => {
|
||||||
|
res.status(400).json(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
return apiResponse;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { getToken } from "../../../actions";
|
import { getToken, patchCase } from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
@@ -22,7 +22,9 @@ const hashAPIPath = (queryPath) => {
|
|||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
export default async function ApiProxy(req, res) {
|
||||||
var data = JSON.stringify(req.body);
|
var data = JSON.stringify(req.body);
|
||||||
var appealObj = rea.query.appealObj;
|
var appealObj = req.query.appealObj;
|
||||||
|
var incidentID = req.query.incident;
|
||||||
|
|
||||||
var updateFormCollection = req.query.updateFormCollection;
|
var updateFormCollection = req.query.updateFormCollection;
|
||||||
var queryUrl = updateFormCollection + "(" + appealObj + ")";
|
var queryUrl = updateFormCollection + "(" + appealObj + ")";
|
||||||
|
|
||||||
@@ -47,6 +49,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
res.status(200).json(data);
|
res.status(200).json(data);
|
||||||
})
|
})
|
||||||
.catch(({ err }) => {
|
.catch(({ err }) => {
|
||||||
|
console.log(err);
|
||||||
res.status(400).json(err);
|
res.status(400).json(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-14
@@ -1,19 +1,12 @@
|
|||||||
import _ from "lodash";
|
|
||||||
import Head from "next/head";
|
|
||||||
import Header from "../../components/header";
|
|
||||||
import Banner from "../../components/banner";
|
|
||||||
import CookieBanner from "../../components/cookieBanner";
|
|
||||||
import Breadcrumbs from "../../components/breadcrumbs";
|
|
||||||
import CaseSummary from "../../components/case";
|
|
||||||
import Footer from "../../components/footer";
|
|
||||||
import Errorpage from "../../components/errorpage";
|
|
||||||
import styles from "../../styles/Home.module.css";
|
|
||||||
import { useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import { wrapper } from "../../store/store";
|
|
||||||
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import Head from "next/head";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import Breadcrumbs from "../../components/breadcrumbs";
|
||||||
import Case from "../../components/case";
|
import Case from "../../components/case";
|
||||||
|
import CookieBanner from "../../components/cookieBanner";
|
||||||
|
import Footer from "../../components/footer";
|
||||||
|
import Header from "../../components/header";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages } = props;
|
const { footerLinks, pages } = props;
|
||||||
@@ -57,6 +50,9 @@ const Home = (props) => {
|
|||||||
props.myRepresentations.myRepresentations
|
props.myRepresentations.myRepresentations
|
||||||
}
|
}
|
||||||
watchedCases={props.watchedCases.watchedCases}
|
watchedCases={props.watchedCases.watchedCases}
|
||||||
|
watchedCasesDetails={
|
||||||
|
props.watchedCases.watchedCasesDetails
|
||||||
|
}
|
||||||
awaitingSubmission={
|
awaitingSubmission={
|
||||||
props.awaitingSubmission.awaitingSubmission
|
props.awaitingSubmission.awaitingSubmission
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,21 +78,6 @@ const Home = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
|
||||||
// (store) => async (ctx) => {
|
|
||||||
// const { query, req, res } = ctx;
|
|
||||||
|
|
||||||
// const showRepresentationsCheck =
|
|
||||||
// process.env.SHOWREPRESENTATIONS || false;
|
|
||||||
|
|
||||||
// console.log("Show representation module: ", showRepresentationsCheck);
|
|
||||||
|
|
||||||
// return {
|
|
||||||
// props: { showRepresentations: showRepresentationsCheck },
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
//console.log(state);
|
//console.log(state);
|
||||||
|
|
||||||
|
|||||||
+10
-7
@@ -22,7 +22,10 @@ import {
|
|||||||
setAccountDetails,
|
setAccountDetails,
|
||||||
setLoggedInUserId,
|
setLoggedInUserId,
|
||||||
} from "../../store/accountDetails/action";
|
} from "../../store/accountDetails/action";
|
||||||
import { setAwaitingSubmission } from "../../store/awaitingSubmission/action";
|
import {
|
||||||
|
setAwaitingSubmission,
|
||||||
|
setAwaitingSubmissionDetails,
|
||||||
|
} from "../../store/awaitingSubmission/action";
|
||||||
import { getGovGatewayConfig } from "../../store/govgateway/action";
|
import { getGovGatewayConfig } from "../../store/govgateway/action";
|
||||||
import { setMyCases, setMyCasesDetails } from "../../store/myCases/action";
|
import { setMyCases, setMyCasesDetails } from "../../store/myCases/action";
|
||||||
import {
|
import {
|
||||||
@@ -172,7 +175,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
await getMyCases(loggedInUser),
|
await getMyCases(loggedInUser),
|
||||||
await getMyRepresentations(loggedInUser),
|
await getMyRepresentations(loggedInUser),
|
||||||
await getWatchedCases(loggedInUser),
|
await getWatchedCases(loggedInUser),
|
||||||
await getAwaitingSubmission(),
|
await getAwaitingSubmission(loggedInUser),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//const cookiesMaker = nookies.get(ctx)
|
//const cookiesMaker = nookies.get(ctx)
|
||||||
@@ -194,12 +197,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
myCasesDetails,
|
myCasesDetails,
|
||||||
myRepresentationsDetails,
|
myRepresentationsDetails,
|
||||||
watchedCasesDetails,
|
watchedCasesDetails,
|
||||||
// awaitingSubmissionDetails,
|
awaitingSubmissionDetails,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
await getDetails(myCases, "myCases"),
|
await getDetails(myCases, "myCases"),
|
||||||
await getDetails(myRepresentations, "myRepresentations"),
|
await getDetails(myRepresentations, "myRepresentations"),
|
||||||
await getDetails(watchedCases, "myWatchedCases"),
|
await getDetails(watchedCases, "myWatchedCases"),
|
||||||
//await getDetails(awaitingSubmission),
|
await getDetails(awaitingSubmission, "awaitingSubmission"),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
store.dispatch(setAccountDetails(accountDetails));
|
store.dispatch(setAccountDetails(accountDetails));
|
||||||
@@ -213,9 +216,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
store.dispatch(setWatchedCases(watchedCases));
|
store.dispatch(setWatchedCases(watchedCases));
|
||||||
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||||
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
store.dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||||
// store.dispatch(
|
store.dispatch(
|
||||||
// setAwaitingSubmissionDetails(awaitingSubmissionDetails)
|
setAwaitingSubmissionDetails(awaitingSubmissionDetails)
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user