updated restriction to disallow partial reps and appeals from being submitted when not docapi

This commit is contained in:
2026-01-15 13:20:07 +00:00
parent 94861846aa
commit 9241fe0b84
17 changed files with 956 additions and 743 deletions
+2 -32
View File
@@ -5,7 +5,7 @@ import { useRouter } from "next/router";
import { useCallback, useEffect, useRef, useState } from "react";
import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import { formatDates } from "../utils";
import { formatDates, getDocLink } from "../utils";
import PaginationControl from "./pagination";
import { sendGAEvent } from "@next/third-parties/google";
@@ -90,37 +90,7 @@ const DocumentDetails = (props) => {
setCurrentPage(1)
);
};
let ShowDocLinks = false;
let checkShowDocLinks = docsOffline != false ? true : false;
const getDocLink = (docsOffline) => {
var startTime = docsOffline.split(",")[0];
var endTime = docsOffline.split(",")[1];
// console.log(startTime);
// console.log(endTime);
var currentDate = new Date();
var startDate = new Date(currentDate.getTime());
startDate.setHours(startTime.split(":")[0]);
startDate.setMinutes(startTime.split(":")[1]);
startDate.setSeconds(startTime.split(":")[2]);
var endDate = new Date(currentDate.getTime());
endDate.setHours(endTime.split(":")[0]);
endDate.setMinutes(endTime.split(":")[1]);
endDate.setSeconds(endTime.split(":")[2]);
// console.log(startDate);
// console.log(endDate);
// console.log(currentDate);
var valid = startDate < currentDate && endDate > currentDate;
ShowDocLinks = valid;
};
checkShowDocLinks && getDocLink(docsOffline);
let ShowDocLinks = getDocLink(docsOffline);
const DocumentView = (documentDetailsArr) => {
documentDetailsArr = documentDetailsArr.value;
+2
View File
@@ -66,6 +66,7 @@ let MakeRepresentation = (props) => {
initialValues,
setCurrentReference,
ticketnumber,
docsOffline,
} = props;
const formObj = props.props.form;
let setCaseQueryObj = props[currentType] || {};
@@ -1105,6 +1106,7 @@ let MakeRepresentation = (props) => {
questionnaireCount={questionnaireCount}
finaliseAppealProcess={finaliseAppealProcess}
setFinaliseAppealProcess={setFinaliseAppealProcess}
docsOffline={docsOffline}
/>
) : (
<>
@@ -13,6 +13,7 @@ import {
getThumbnailIconByExtension,
formatDates,
updateLinks,
getDocLink,
} from "../../utils";
import {
@@ -41,7 +42,11 @@ const RepCompleteSubmit = (props) => {
questionnaireCount,
finaliseAppealProcess,
setCurrentReference,
docsOffline,
} = props;
let ShowDocLinks = getDocLink(docsOffline);
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const files = acceptedFiles.map((file) => (
<li key={file.path}>
@@ -230,6 +235,7 @@ const RepCompleteSubmit = (props) => {
}
const checkRepDatePassed = () => {
return false;
if (repFormData.representationType == "Questionnaire") {
return false;
} else {
@@ -603,6 +609,7 @@ const RepCompleteSubmit = (props) => {
"myrepresentations:rep-check-tandc-para-three"
)}
</p>
{checkRepDatePassed() ? (
<div className="govuk-warning-text noticebanner">
<strong className="govuk-warning-text__text">
@@ -641,6 +648,32 @@ const RepCompleteSubmit = (props) => {
{t("myrepresentations:rep-wait-label")}
</p>
</div>
) : ShowDocLinks ? (
<>
{" "}
<div className="govuk-warning-text ">
<span
className="govuk-warning-text__icon"
aria-hidden="true"
>
!
</span>
<strong className="govuk-warning-text__text govuk-!-margin-top-2">
<span className="govuk-visually-hidden">
Notice
</span>
{t(
"myrepresentations:docsoffline-reps-label"
)}
{" "}
</strong>
</div>{" "}
<a className="govuk-link" href="/">
{t(
"myrepresentations:return-to-myportal-link"
)}
</a>
</>
) : (
<>
<div className="govuk-form-group">
-32
View File
@@ -104,38 +104,6 @@ const CaseSummary = (props) => {
? true
: false;
let ShowDocLinks = false;
let checkShowDocLinks = docsOffline != false ? true : false;
const getDocLink = (docsOffline) => {
var startTime = docsOffline.split(",")[0];
var endTime = docsOffline.split(",")[1];
// console.log(startTime);
// console.log(endTime);
var currentDate = new Date();
var startDate = new Date(currentDate.getTime());
startDate.setHours(startTime.split(":")[0]);
startDate.setMinutes(startTime.split(":")[1]);
startDate.setSeconds(startTime.split(":")[2]);
var endDate = new Date(currentDate.getTime());
endDate.setHours(endTime.split(":")[0]);
endDate.setMinutes(endTime.split(":")[1]);
endDate.setSeconds(endTime.split(":")[2]);
// console.log(startDate);
// console.log(endDate);
// console.log(currentDate);
var valid = startDate < currentDate && endDate > currentDate;
ShowDocLinks = valid;
};
checkShowDocLinks && getDocLink(docsOffline);
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
let updateBody = {
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",