16003 Sips Documents, 16010 Role baes reps for sips
This commit is contained in:
@@ -19,9 +19,13 @@ import {
|
||||
} from "../../../store/currentView/action";
|
||||
import RepAgent from "./representationAgent";
|
||||
import RepAppellant from "./representationAppellant";
|
||||
import ConsultationAppellant from "./consultationAppellant";
|
||||
import ConsultationAgent from "./consultationAgent";
|
||||
import RepCapacitySelection from "./representationCapacitySelection";
|
||||
import RepCompleteSubmit from "./representationCompleteSubmit";
|
||||
import RepInterestedPartyPerson from "./representationInterestedPartyPerson";
|
||||
import ConsultationInterestedPartyPerson from "./consultationInterestedPartyPerson";
|
||||
|
||||
import RepLPA from "./representationLPA";
|
||||
import RepLPACapacitySelection from "./representationLPACapacitySelection";
|
||||
import RepLandOwner from "./representationLandowner";
|
||||
@@ -67,9 +71,13 @@ let MakeRepresentation = (props) => {
|
||||
let setCaseQueryObj = props[currentType] || {};
|
||||
var casesObj = {};
|
||||
|
||||
const appealType = currentView.caseReference.appealType;
|
||||
const accountDetails = props.props.accountDetails.accountDetails;
|
||||
const caseReferenceObj = props.props.currentView.caseReference;
|
||||
|
||||
const updateQuestionnaireCount = () => {
|
||||
{
|
||||
switch (currentView.caseReference.appealType) {
|
||||
switch (appealType) {
|
||||
case 846040000:
|
||||
case 846040001:
|
||||
case 846040025:
|
||||
@@ -95,12 +103,22 @@ let MakeRepresentation = (props) => {
|
||||
let questionnaireCount = updateQuestionnaireCount();
|
||||
|
||||
const isLPA =
|
||||
props.props.accountDetails.accountDetails[
|
||||
accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
] == "LPA"
|
||||
? true
|
||||
: false;
|
||||
|
||||
// const isNRW = accountDetails.emailaddress1.includes(
|
||||
// "@cyfoethnaturiolcymru.gov.uk"
|
||||
// )
|
||||
// ? true
|
||||
// : false;
|
||||
|
||||
const isNRW = accountDetails.emailaddress1.includes("@rdbtech.co.uk")
|
||||
? true
|
||||
: false;
|
||||
|
||||
const setRepFileName = (values) => {
|
||||
//console.log("---------------\n", values);
|
||||
if (
|
||||
@@ -132,6 +150,8 @@ let MakeRepresentation = (props) => {
|
||||
case "lpa":
|
||||
case "LPA":
|
||||
repCap = "LPA";
|
||||
case "NRW":
|
||||
repCap = "NRW";
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -156,8 +176,14 @@ let MakeRepresentation = (props) => {
|
||||
case "Final comments":
|
||||
repType = "Comments";
|
||||
break;
|
||||
case "Consultation Response":
|
||||
repType = "Consultation_Response";
|
||||
break;
|
||||
case "Local Impact Report":
|
||||
repType = "Impact";
|
||||
repType = "Local_Impact_Report";
|
||||
break;
|
||||
case "Marine Impact Report":
|
||||
repType = "Marine_Impact_Report";
|
||||
break;
|
||||
|
||||
case "Other":
|
||||
@@ -235,12 +261,11 @@ let MakeRepresentation = (props) => {
|
||||
t("myrepresentations:capacity-options-arr-agent"),
|
||||
];
|
||||
|
||||
props.props.currentView.caseReference.appealType != 846040017
|
||||
appealType != 846040017
|
||||
? capacityOptionsArr.push(
|
||||
t("myrepresentations:capacity-options-arr-interested")
|
||||
)
|
||||
: props.props.currentView.caseReference.specialistProcess !=
|
||||
846040000 &&
|
||||
: caseReferenceObj.specialistProcess != 846040000 &&
|
||||
capacityOptionsArr.push(
|
||||
t("myrepresentations:capacity-options-arr-interested")
|
||||
);
|
||||
@@ -308,11 +333,13 @@ let MakeRepresentation = (props) => {
|
||||
const buildRepsArr = (detailsObj) => {
|
||||
let buildArr = [];
|
||||
|
||||
// console.log(currentView.caseReference.appealType, "");
|
||||
// console.log(appealType, "");
|
||||
|
||||
let todaysDate = new Date();
|
||||
|
||||
const isDNS = currentView.caseReference.appealType == 846040011;
|
||||
const isDNS = appealType == 846040011;
|
||||
|
||||
const isSIPS = appealType == 846040002;
|
||||
|
||||
let startDate;
|
||||
let questionnaireDate;
|
||||
@@ -365,30 +392,30 @@ let MakeRepresentation = (props) => {
|
||||
)));
|
||||
|
||||
isLPA &&
|
||||
currentView.caseReference.appealType != 846040019 &&
|
||||
currentView.caseReference.appealType != 846040011 &&
|
||||
currentView.caseReference.appealType != 846040015 &&
|
||||
currentView.caseReference.appealType != 846040016 &&
|
||||
appealType != 846040019 &&
|
||||
appealType != 846040011 &&
|
||||
appealType != 846040015 &&
|
||||
appealType != 846040016 &&
|
||||
todaysDate >= startDate &&
|
||||
todaysDate <= finalCommentsDate &&
|
||||
buildArr.push("Questionnaire");
|
||||
|
||||
isLPA &&
|
||||
isDNS &&
|
||||
currentView.caseReference.appealType != 846040019 &&
|
||||
appealType != 846040019 &&
|
||||
todaysDate >= startDate &&
|
||||
todaysDate <= finalCommentsDate &&
|
||||
buildArr.push("Local Impact Report");
|
||||
|
||||
isLPA &&
|
||||
isDNS &&
|
||||
currentView.caseReference.appealType != 846040019 &&
|
||||
appealType != 846040019 &&
|
||||
todaysDate >= startDate &&
|
||||
todaysDate <= finalCommentsDate &&
|
||||
buildArr.push("Statement");
|
||||
|
||||
!isDNS &&
|
||||
currentView.caseReference.appealType != 846040004 &&
|
||||
appealType != 846040004 &&
|
||||
todaysDate >= startDate &&
|
||||
todaysDate <= statementDueDate &&
|
||||
buildArr.push("Statement");
|
||||
@@ -399,14 +426,14 @@ let MakeRepresentation = (props) => {
|
||||
todaysDate <= statementDueDate &&
|
||||
buildArr.push("Statement");
|
||||
|
||||
(currentView.caseReference.appealType != 846040004 ||
|
||||
(currentView.caseReference.appealType == 846040015 &&
|
||||
(appealType != 846040004 ||
|
||||
(appealType == 846040015 &&
|
||||
currentView.caseReference.specialistProcess != 846040001)) &&
|
||||
todaysDate >= statementDueDate &&
|
||||
todaysDate <= finalCommentsDate &&
|
||||
buildArr.push("Final comments");
|
||||
|
||||
currentView.caseReference.appealType == 846040004 &&
|
||||
appealType == 846040004 &&
|
||||
currentView.caseReference.specialistProcess != 846040001 &&
|
||||
todaysDate >= statementDueDate &&
|
||||
todaysDate <= finalCommentsDate &&
|
||||
@@ -414,10 +441,16 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
//is LPA Advert part 3 no statement
|
||||
isLPA &&
|
||||
currentView.caseReference.appealType == 846040018 &&
|
||||
appealType == 846040018 &&
|
||||
currentView.caseReference.specialistProcess == 846040000 &&
|
||||
buildArr.pop("Statements");
|
||||
|
||||
console.log("is this a sip......", isSIPS, !isLPA);
|
||||
|
||||
isSIPS && buildArr.push("Consultation Response");
|
||||
isSIPS && buildArr.push("Local Impact Report");
|
||||
isSIPS && isNRW && buildArr.push("Marine Impact Report");
|
||||
|
||||
return buildArr;
|
||||
};
|
||||
|
||||
@@ -436,6 +469,7 @@ let MakeRepresentation = (props) => {
|
||||
};
|
||||
|
||||
const whichControl = () => {
|
||||
let SipsOrRep;
|
||||
if (
|
||||
isLPA &&
|
||||
_.isEmpty(currentView.representationCapacity)
|
||||
@@ -502,8 +536,13 @@ let MakeRepresentation = (props) => {
|
||||
"myrepresentations:capacity-options-arr-appellant"
|
||||
).toLocaleLowerCase():
|
||||
//setRepresentationCapacity("appellant");
|
||||
|
||||
SipsOrRep =
|
||||
appealType == 846040002
|
||||
? ConsultationAppellant
|
||||
: RepAppellant;
|
||||
return (
|
||||
<RepAppellant
|
||||
<SipsOrRep
|
||||
formObj={formObj}
|
||||
appellantApplicantRepresentationArr={buildRepsArr(
|
||||
detailsObj
|
||||
@@ -532,7 +571,7 @@ let MakeRepresentation = (props) => {
|
||||
// setRepresentationCapacity("LPA");
|
||||
// }, []);
|
||||
|
||||
console.log(currentView.caseReference.appealType);
|
||||
console.log(appealType);
|
||||
return (
|
||||
<RepLPA
|
||||
formObj={formObj}
|
||||
@@ -568,8 +607,12 @@ let MakeRepresentation = (props) => {
|
||||
"myrepresentations:capacity-options-arr-agent"
|
||||
).toLowerCase():
|
||||
//setRepresentationCapacity("agent");
|
||||
|
||||
SipsOrRep =
|
||||
appealType == 846040002 ? ConsultationAgent : RepAgent;
|
||||
|
||||
return (
|
||||
<RepAgent
|
||||
<SipsOrRep
|
||||
formObj={formObj}
|
||||
appellantApplicantRepresentationArr={buildRepsArr(
|
||||
detailsObj
|
||||
@@ -595,8 +638,14 @@ let MakeRepresentation = (props) => {
|
||||
"myrepresentations:capacity-options-arr-interested"
|
||||
).toLowerCase():
|
||||
// setRepresentationCapacity("interestedpartyperson");
|
||||
|
||||
SipsOrRep =
|
||||
appealType == 846040002
|
||||
? ConsultationInterestedPartyPerson
|
||||
: RepInterestedPartyPerson;
|
||||
|
||||
return (
|
||||
<RepInterestedPartyPerson
|
||||
<SipsOrRep
|
||||
formObj={formObj}
|
||||
interestedPersonRepresentationArr={buildRepsArr(
|
||||
detailsObj
|
||||
@@ -666,7 +715,7 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
const whichProgress = () => {
|
||||
{
|
||||
switch (currentView.caseReference.appealType) {
|
||||
switch (appealType) {
|
||||
case 846040000:
|
||||
case 846040001:
|
||||
case 846040025:
|
||||
@@ -781,15 +830,12 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
Object.assign(values, {
|
||||
"containerID": props.props.accountDetails.containerID,
|
||||
"appealType":
|
||||
props.props.currentView.caseReference.appealType ||
|
||||
props.props.currentView.caseReference.repDetails.appealType,
|
||||
"appealType": appealType || caseReferenceObj.repDetails.appealType,
|
||||
"incidentID":
|
||||
props.props.currentView.caseReference.incidentid ||
|
||||
props.props.currentView.caseReference.repDetails.incidentid,
|
||||
"caseRef": props.props.currentView.caseReference.currentReference,
|
||||
"casereference":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
caseReferenceObj.incidentid ||
|
||||
caseReferenceObj.repDetails.incidentid,
|
||||
"caseRef": caseReferenceObj.currentReference,
|
||||
"casereference": caseReferenceObj.currentReference,
|
||||
"pinswg_questionnaireduedate":
|
||||
detailsObj.pinswg_questionnaireduedate,
|
||||
"pinswg_statementduedate":
|
||||
@@ -801,12 +847,10 @@ let MakeRepresentation = (props) => {
|
||||
"pinswg_finalcommentsduedate":
|
||||
detailsObj.pinswg_finalcommentsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod,
|
||||
"pinswg_name":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"firstname": props.props.accountDetails.accountDetails.firstname,
|
||||
"lastname": props.props.accountDetails.accountDetails.lastname,
|
||||
"emailAddress":
|
||||
props.props.accountDetails.accountDetails.emailaddress1,
|
||||
"pinswg_name": caseReferenceObj.currentReference,
|
||||
"firstname": accountDetails.firstname,
|
||||
"lastname": accountDetails.lastname,
|
||||
"emailAddress": accountDetails.emailaddress1,
|
||||
"siteAddress":
|
||||
detailsObj.pinswg_siteaddressline1 +
|
||||
(detailsObj.pinswg_siteaddressline2 != null
|
||||
@@ -850,18 +894,14 @@ let MakeRepresentation = (props) => {
|
||||
updateBody = setRepFileName(values);
|
||||
|
||||
Object.assign(updateBody, {
|
||||
"pinswg_name":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"pinswg_name": caseReferenceObj.currentReference,
|
||||
"containerID": props.props.accountDetails.containerID,
|
||||
"appealType":
|
||||
props.props.currentView.caseReference.appealType ||
|
||||
props.props.currentView.caseReference.repDetails.appealType,
|
||||
"casereference":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"appealType": appealType || caseReferenceObj.repDetails.appealType,
|
||||
"casereference": caseReferenceObj.currentReference,
|
||||
"incidentID":
|
||||
props.props.currentView.caseReference.incidentid ||
|
||||
props.props.currentView.caseReference.repDetails.incidentid,
|
||||
"caseRef": props.props.currentView.caseReference.currentReference,
|
||||
caseReferenceObj.incidentid ||
|
||||
caseReferenceObj.repDetails.incidentid,
|
||||
"caseRef": caseReferenceObj.currentReference,
|
||||
});
|
||||
|
||||
updateBody = JSON.stringify(updateBody);
|
||||
@@ -965,15 +1005,12 @@ let MakeRepresentation = (props) => {
|
||||
Object.assign(values, {
|
||||
"containerID": props.props.accountDetails.containerID,
|
||||
"appealType":
|
||||
props.props.currentView.caseReference.appealType ||
|
||||
props.props.currentView.caseReference.repDetails.appealType,
|
||||
appealType || caseReferenceObj.repDetails.appealType,
|
||||
"incidentID":
|
||||
props.props.currentView.caseReference.incidentid ||
|
||||
props.props.currentView.caseReference.repDetails.incidentid,
|
||||
"caseRef":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"casereference":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
caseReferenceObj.incidentid ||
|
||||
caseReferenceObj.repDetails.incidentid,
|
||||
"caseRef": caseReferenceObj.currentReference,
|
||||
"casereference": caseReferenceObj.currentReference,
|
||||
"pinswg_questionnaireduedate":
|
||||
detailsObj.pinswg_questionnaireduedate,
|
||||
"pinswg_endofrepresentationperiod":
|
||||
@@ -984,13 +1021,10 @@ let MakeRepresentation = (props) => {
|
||||
"pinswg_statementsduedate": detailsObj.pinswg_statementsduedate,
|
||||
"pinswg_finalcommentsduedate":
|
||||
detailsObj.pinswg_finalcommentsduedate,
|
||||
"pinswg_name":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"firstname":
|
||||
props.props.accountDetails.accountDetails.firstname,
|
||||
"lastname": props.props.accountDetails.accountDetails.lastname,
|
||||
"emailAddress":
|
||||
props.props.accountDetails.accountDetails.emailaddress1,
|
||||
"pinswg_name": caseReferenceObj.currentReference,
|
||||
"firstname": accountDetails.firstname,
|
||||
"lastname": accountDetails.lastname,
|
||||
"emailAddress": accountDetails.emailaddress1,
|
||||
"siteAddress":
|
||||
detailsObj.pinswg_siteaddressline1 +
|
||||
(detailsObj.pinswg_siteaddressline2 != null
|
||||
@@ -1208,9 +1242,13 @@ let MakeRepresentation = (props) => {
|
||||
) : (
|
||||
<>
|
||||
<h1 className="govuk-heading-l">
|
||||
{t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{appealType == 846040002
|
||||
? t(
|
||||
"myrepresentations:make-a-consultation-on-label"
|
||||
)
|
||||
: t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{currentView.caseReference.currentReference}{" "}
|
||||
</h1>
|
||||
<div id="rep-form">
|
||||
@@ -1230,7 +1268,9 @@ let MakeRepresentation = (props) => {
|
||||
<div className="govuk-summary-list">
|
||||
<div className="govuk-body-s">
|
||||
{currentView.caseReference
|
||||
.appealType == 846040011
|
||||
.appealType == 846040011 ||
|
||||
currentView.caseReference
|
||||
.appealType == 846040002
|
||||
? t(
|
||||
"myrepresentations:local-impact-report"
|
||||
)
|
||||
@@ -1245,43 +1285,86 @@ let MakeRepresentation = (props) => {
|
||||
) ||
|
||||
detailsObj.hasOwnProperty(
|
||||
"pinswg_endofrepresentationperiod"
|
||||
) ||
|
||||
detailsObj.hasOwnProperty(
|
||||
"pinswg_consultationclose"
|
||||
)
|
||||
? formatDates(
|
||||
detailsObj.pinswg_questionnaireduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
detailsObj.pinswg_endofrepresentationperiod ||
|
||||
detailsObj.pinswg_consultationclose
|
||||
)
|
||||
: "N/A"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:statements-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{currentView.caseReference
|
||||
.appealType != 846040011 && (
|
||||
.appealType != 846040002 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:final-comments-due-label"
|
||||
"myrepresentations:statements-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_finalcommentsduedate
|
||||
detailsObj.pinswg_statementduedate ||
|
||||
detailsObj.pinswg_statementsduedate ||
|
||||
detailsObj.pinswg_endofrepresentationperiod
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{currentView.caseReference
|
||||
.appealType == 846040002 &&
|
||||
isNRW && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:marine-impact-report"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_consultationclose
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{currentView.caseReference
|
||||
.appealType == 846040002 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:consultation-close-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_consultationclose
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{currentView.caseReference
|
||||
.appealType != 846040011 ||
|
||||
(currentView.caseReference
|
||||
.appealType !=
|
||||
846040002 && (
|
||||
<div className="govuk-body-s">
|
||||
{t(
|
||||
"myrepresentations:final-comments-due-label"
|
||||
)}
|
||||
:
|
||||
<span className="govuk-body-s">
|
||||
{" "}
|
||||
{formatDates(
|
||||
detailsObj.pinswg_finalcommentsduedate
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user