Merged PR 1987: docoffline dependant appeals and reps
docoffline dependant appeals and reps Related work items: #20166
This commit is contained in:
@@ -111,6 +111,38 @@ const CaseSummary = (props) => {
|
|||||||
? true
|
? true
|
||||||
: false;
|
: 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) => {
|
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
||||||
let updateBody = {
|
let updateBody = {
|
||||||
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
||||||
@@ -468,6 +500,25 @@ const CaseSummary = (props) => {
|
|||||||
.appealType
|
.appealType
|
||||||
) ? (
|
) ? (
|
||||||
<>
|
<>
|
||||||
|
{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(
|
||||||
|
"case:docsoffline-reps-label"
|
||||||
|
)}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div>
|
||||||
<Link
|
<Link
|
||||||
href={{
|
href={{
|
||||||
pathname:
|
pathname:
|
||||||
@@ -492,7 +543,8 @@ const CaseSummary = (props) => {
|
|||||||
"case:summary-make-representation-label"
|
"case:summary-make-representation-label"
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<a
|
<a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
//spinnerState();
|
//spinnerState();
|
||||||
@@ -802,7 +854,23 @@ const CaseSummary = (props) => {
|
|||||||
router.pathname
|
router.pathname
|
||||||
) == true ? (
|
) == true ? (
|
||||||
""
|
""
|
||||||
|
) : 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("case:docsoffline-reps-label")}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
<div>
|
||||||
<Link
|
<Link
|
||||||
href="/representation"
|
href="/representation"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
@@ -811,6 +879,7 @@ const CaseSummary = (props) => {
|
|||||||
"case:summary-make-representation-label"
|
"case:summary-make-representation-label"
|
||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
|
|||||||
import transLookup from "../data/lookuptranslations.json";
|
import transLookup from "../data/lookuptranslations.json";
|
||||||
|
|
||||||
const MyPortal = (props) => {
|
const MyPortal = (props) => {
|
||||||
const { showFileUpload, showLoginCheck } = props;
|
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -126,7 +126,9 @@ const MyPortal = (props) => {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
{!isLPA && <MakeNewAppeal />}
|
{!isLPA && (
|
||||||
|
<MakeNewAppeal docsOffline={docsOffline} />
|
||||||
|
)}
|
||||||
<SearchCases />
|
<SearchCases />
|
||||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
{/* {props.awaitingSubmission.awaitingSubmission[
|
||||||
"@odata.count"
|
"@odata.count"
|
||||||
|
|||||||
@@ -2,11 +2,46 @@ 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";
|
||||||
|
|
||||||
export default function MakeNewAppeal() {
|
export default function MakeNewAppeal(props) {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const { docsOffline } = props;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("docsOffline", docsOffline, getDocLink(docsOffline));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" id="new-appeal-card">
|
<div className="card" id="new-appeal-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -22,11 +57,29 @@ export default function MakeNewAppeal() {
|
|||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("myportal:makenewappeal-card-paragraph-two")}
|
{t("myportal:makenewappeal-card-paragraph-two")}
|
||||||
</p>
|
</p>
|
||||||
|
{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("case:docsoffline-reps-label")}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<Link href={"/newappeal"} className="govuk-button">
|
<Link href={"/newappeal"} className="govuk-button">
|
||||||
{t("myportal:makenewappeal-card-button-label")}
|
{t("myportal:makenewappeal-card-button-label")}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<p className="govuk-body-s govuk govuk-!-margin-top-5">
|
<p className="govuk-body-s govuk govuk-!-margin-top-5">
|
||||||
{t("myportal:makenewappeal-card-paragraph-three")}
|
{t("myportal:makenewappeal-card-paragraph-three")}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ const DNSSearchResults = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
|
|
||||||
const cookies = parseCookies();
|
const cookies = parseCookies();
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const SearchResults = (props) => {
|
|||||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
const [fieldSortState, setfieldSortState] = useState("desc");
|
||||||
const [loginToWatch, setLoginToWatch] = useState("true");
|
const [loginToWatch, setLoginToWatch] = useState("true");
|
||||||
|
|
||||||
let spinnerState = () => {
|
let spinnerState = () => {
|
||||||
|
|||||||
@@ -104,5 +104,6 @@
|
|||||||
"download-complete-label": "Lawrlwytho wedi'i gwblhau!",
|
"download-complete-label": "Lawrlwytho wedi'i gwblhau!",
|
||||||
"downloading-label": "Wrthi'n llwytho i lawr",
|
"downloading-label": "Wrthi'n llwytho i lawr",
|
||||||
"download-failed-label": "Methodd y lawrlwythiad",
|
"download-failed-label": "Methodd y lawrlwythiad",
|
||||||
"download-queued-label": "Wedi'i giwio"
|
"download-queued-label": "Wedi'i giwio",
|
||||||
|
"docsoffline-reps-label": "Oherwydd cynnal a chadw'r system, ni allwn dderbyn sylwadau ar hyn o bryd. Rhowch gynnig arall arni yn nes ymlaen."
|
||||||
}
|
}
|
||||||
@@ -51,5 +51,6 @@
|
|||||||
"date-raised": "Dyddiad codi",
|
"date-raised": "Dyddiad codi",
|
||||||
"representation-submitted": "Cyflwynwyd y sylw",
|
"representation-submitted": "Cyflwynwyd y sylw",
|
||||||
"submission-processing-label": "Prosesu cyflwyniad",
|
"submission-processing-label": "Prosesu cyflwyniad",
|
||||||
"appeal-pending-label": "Yn yr arfaeth"
|
"appeal-pending-label": "Yn yr arfaeth",
|
||||||
|
"docsoffline-newappeal-label": "Oherwydd gwaith cynnal a chadw'r system, ni allwn dderbyn apeliadau newydd ar hyn o bryd. Rhowch gynnig arall arni yn nes ymlaen."
|
||||||
}
|
}
|
||||||
@@ -104,5 +104,6 @@
|
|||||||
"download-complete-label": "Download complete!",
|
"download-complete-label": "Download complete!",
|
||||||
"downloading-label": "Downloading",
|
"downloading-label": "Downloading",
|
||||||
"download-failed-label": "Download failed",
|
"download-failed-label": "Download failed",
|
||||||
"download-queued-label": "Queued"
|
"download-queued-label": "Queued",
|
||||||
|
"docsoffline-reps-label": "Due to system maintenance, we are unable to accept representations at this time. Please try again later."
|
||||||
}
|
}
|
||||||
@@ -51,5 +51,6 @@
|
|||||||
"date-raised": "Date raised",
|
"date-raised": "Date raised",
|
||||||
"representation-submitted": "Representation submitted",
|
"representation-submitted": "Representation submitted",
|
||||||
"submission-processing-label": "Submission processing",
|
"submission-processing-label": "Submission processing",
|
||||||
"appeal-pending-label": "Pending"
|
"appeal-pending-label": "Pending",
|
||||||
|
"docsoffline-newappeal-label": "Due to system maintenance, we are unable to accept new appeals at this time. Please try again later."
|
||||||
}
|
}
|
||||||
@@ -66,6 +66,7 @@ const Home = (props) => {
|
|||||||
showLoginCheck,
|
showLoginCheck,
|
||||||
currentView,
|
currentView,
|
||||||
mySubmittedReps,
|
mySubmittedReps,
|
||||||
|
docsOffline,
|
||||||
} = props;
|
} = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
@@ -161,6 +162,7 @@ const Home = (props) => {
|
|||||||
containerID={accountDetails.containerID}
|
containerID={accountDetails.containerID}
|
||||||
showLoginCheck={showLoginCheck}
|
showLoginCheck={showLoginCheck}
|
||||||
currentView={currentView}
|
currentView={currentView}
|
||||||
|
docsOffline={docsOffline}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
||||||
@@ -366,6 +368,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
showFileUpload: process.env.SHOWFILEUPLOAD,
|
showFileUpload: process.env.SHOWFILEUPLOAD,
|
||||||
containerID: thisSession.user.id,
|
containerID: thisSession.user.id,
|
||||||
showLoginCheck: process.env.SHOWLOGIN,
|
showLoginCheck: process.env.SHOWLOGIN,
|
||||||
|
docsOffline: process.env.DOCAPI_OFFLINE || false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user