Merged PR 2476: added check for inactive case deadlines
added check for inactive case deadlines Related work items: #24297
This commit is contained in:
@@ -233,35 +233,41 @@ const RepCompleteSubmit = (props) => {
|
|||||||
let filterFiles = [];
|
let filterFiles = [];
|
||||||
|
|
||||||
function showRepsEnded(endDate) {
|
function showRepsEnded(endDate) {
|
||||||
let date = new Date();
|
if (!endDate) {
|
||||||
date = new Date(date.toDateString());
|
return false;
|
||||||
let end = new Date(endDate);
|
}
|
||||||
end.setUTCHours(23);
|
|
||||||
end.setUTCMinutes(59);
|
|
||||||
end.setUTCSeconds(59);
|
|
||||||
end.toISOString();
|
|
||||||
|
|
||||||
return end > date ? false : true;
|
const end = new Date(endDate);
|
||||||
|
|
||||||
|
if (Number.isNaN(end.getTime())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
end.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
return end <= today;
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkRepDatePassed = () => {
|
const checkRepDatePassed = () => {
|
||||||
if (repFormData.representationType == "Questionnaire") {
|
if (repFormData.representationType === "Questionnaire") {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
if (repFormData.representationType == "Final comments") {
|
|
||||||
return repFormData.hasOwnProperty(
|
|
||||||
"pinswg_finalcommentsduedate"
|
|
||||||
) && showRepsEnded(repFormData.pinswg_finalcommentsduedate)
|
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
}
|
|
||||||
if (repFormData.representationType == "Statement") {
|
|
||||||
return repFormData.hasOwnProperty("pinswg_statementduedate") &&
|
|
||||||
showRepsEnded(repFormData.pinswg_statementduedate)
|
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (repFormData.representationType === "Final comments") {
|
||||||
|
return showRepsEnded(repFormData.pinswg_finalcommentsduedate);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (repFormData.representationType === "Statement") {
|
||||||
|
return (
|
||||||
|
showRepsEnded(repFormData.pinswg_statementduedate) ||
|
||||||
|
showRepsEnded(repFormData.pinswg_endofrepresentationperiod)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const triggerQuestionnaireDownload = async () => {
|
const triggerQuestionnaireDownload = async () => {
|
||||||
|
|||||||
@@ -31,14 +31,17 @@ const Pinswg_sipscase = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const extensions =
|
const activeExtensions = (
|
||||||
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips || [];
|
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips || []
|
||||||
|
).filter((extension) => extension.statecode === 0);
|
||||||
|
|
||||||
const latest = extensions.sort(
|
const latestExtension = activeExtensions
|
||||||
(a, b) =>
|
.filter((extension) => !_.isEmpty(extension.pinswg_newcasedeadline))
|
||||||
new Date(b.pinswg_newcasedeadline) -
|
.sort(
|
||||||
new Date(a.pinswg_newcasedeadline)
|
(a, b) =>
|
||||||
)[0];
|
new Date(b.pinswg_newcasedeadline) -
|
||||||
|
new Date(a.pinswg_newcasedeadline)
|
||||||
|
)[0];
|
||||||
|
|
||||||
const projectTypes = Array.isArray(
|
const projectTypes = Array.isArray(
|
||||||
detailsObj.pinswg_sips_pinswg_sipsprojecttype
|
detailsObj.pinswg_sips_pinswg_sipsprojecttype
|
||||||
@@ -398,6 +401,7 @@ const Pinswg_sipscase = (props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-deadline-label"
|
"case:summary-case-deadline-label"
|
||||||
@@ -407,12 +411,17 @@ const Pinswg_sipscase = (props) => {
|
|||||||
"case:summary-awaiting-information-label"
|
"case:summary-awaiting-information-label"
|
||||||
);
|
);
|
||||||
|
|
||||||
const extensions =
|
const activeExtensions = (
|
||||||
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips ||
|
detailsObj.pinswg_CaseDeadlineExtension_pinswg_sips ||
|
||||||
[];
|
[]
|
||||||
|
).filter(
|
||||||
|
(extension) =>
|
||||||
|
extension.statecode ===
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
const latestExtension =
|
const latestExtension =
|
||||||
extensions
|
activeExtensions
|
||||||
.filter(
|
.filter(
|
||||||
(extension) =>
|
(extension) =>
|
||||||
!_.isEmpty(
|
!_.isEmpty(
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
navigationProperty +
|
navigationProperty +
|
||||||
"($select=ticketnumber,statuscode)" +
|
"($select=ticketnumber,statuscode)" +
|
||||||
(primaryIdAttribute == "pinswg_sipscase"
|
(primaryIdAttribute == "pinswg_sipscase"
|
||||||
? ",pinswg_sipscase($select=ticketnumber),pinswg_CaseDeadlineExtension_pinswg_sips($select=pinswg_casedeadlineextensionid,pinswg_noofdaysextended,pinswg_reasonforextension,pinswg_agreedorimposedextension,pinswg_newcasedeadline),pinswg_sips_pinswg_sipsevent($select=pinswg_enddateofevent,pinswg_eventpublishflag,pinswg_linktotheevent,pinswg_linktotheeventstreamwelsh,pinswg_name,pinswg_dateeventrequested,pinswg_typeofevent,createdon,modifiedon),pinswg_sips_pinswg_sipsprojecttype($select=pinswg_sipsprojecttypeid,pinswg_name,_pinswg_sector_value)"
|
? ",pinswg_sipscase($select=ticketnumber),pinswg_CaseDeadlineExtension_pinswg_sips($select=statecode,pinswg_casedeadlineextensionid,pinswg_noofdaysextended,pinswg_reasonforextension,pinswg_agreedorimposedextension,pinswg_newcasedeadline),pinswg_sips_pinswg_sipsevent($select=pinswg_enddateofevent,pinswg_eventpublishflag,pinswg_linktotheevent,pinswg_linktotheeventstreamwelsh,pinswg_name,pinswg_dateeventrequested,pinswg_typeofevent,createdon,modifiedon),pinswg_sips_pinswg_sipsprojecttype($select=pinswg_sipsprojecttypeid,pinswg_name,_pinswg_sector_value)"
|
||||||
: "");
|
: "");
|
||||||
|
|
||||||
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
navigationProperty +
|
navigationProperty +
|
||||||
"($select=ticketnumber,statuscode)" +
|
"($select=ticketnumber,statuscode)" +
|
||||||
(primaryIdAttribute == "pinswg_sipscase"
|
(primaryIdAttribute == "pinswg_sipscase"
|
||||||
? ",pinswg_sipscase($select=ticketnumber),pinswg_CaseDeadlineExtension_pinswg_sips($select=pinswg_casedeadlineextensionid,pinswg_noofdaysextended,pinswg_reasonforextension,pinswg_agreedorimposedextension,pinswg_newcasedeadline),pinswg_sips_pinswg_sipsevent($select=pinswg_enddateofevent,pinswg_eventpublishflag,pinswg_linktotheevent,pinswg_linktotheeventstreamwelsh,pinswg_name,pinswg_dateeventrequested,pinswg_typeofevent,createdon,modifiedon)"
|
? ",pinswg_sipscase($select=ticketnumber),pinswg_CaseDeadlineExtension_pinswg_sips($select=statecode,pinswg_casedeadlineextensionid,pinswg_noofdaysextended,pinswg_reasonforextension,pinswg_agreedorimposedextension,pinswg_newcasedeadline),pinswg_sips_pinswg_sipsevent($select=pinswg_enddateofevent,pinswg_eventpublishflag,pinswg_linktotheevent,pinswg_linktotheeventstreamwelsh,pinswg_name,pinswg_dateeventrequested,pinswg_typeofevent,createdon,modifiedon)"
|
||||||
: "");
|
: "");
|
||||||
|
|
||||||
queryUrl =
|
queryUrl =
|
||||||
|
|||||||
Reference in New Issue
Block a user