diff --git a/components/case/summary.js b/components/case/summary.js index a01ae25d..7f6dbc94 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -111,6 +111,38 @@ 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 + ")", @@ -468,31 +500,51 @@ const CaseSummary = (props) => { .appealType ) ? ( <> - - {t( - "case:summary-make-representation-label" - )} - - + {ShowDocLinks ? ( +
{t("myportal:makenewappeal-card-paragraph-two")}
-{t("myportal:makenewappeal-card-paragraph-three")}
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 2e385fda..2f67478a 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -147,7 +147,7 @@ const DNSSearchResults = (props) => { }; const [orderByState, setOrderbyState] = useState("createdon"); - const [fieldSortState, setfieldSortState] = useState("asc"); + const [fieldSortState, setfieldSortState] = useState("desc"); const [selectedOption, setSelectedOption] = useState(10); const cookies = parseCookies(); diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 70483a40..d50f1226 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -66,7 +66,7 @@ const SearchResults = (props) => { const [showSpinnerState, setShowSpinnerState] = useState(false); const [selectedOption, setSelectedOption] = useState(10); const [orderByState, setOrderbyState] = useState("createdon"); - const [fieldSortState, setfieldSortState] = useState("asc"); + const [fieldSortState, setfieldSortState] = useState("desc"); const [loginToWatch, setLoginToWatch] = useState("true"); let spinnerState = () => { diff --git a/locales/cy/case.json b/locales/cy/case.json index da629c24..c39412c1 100644 --- a/locales/cy/case.json +++ b/locales/cy/case.json @@ -104,5 +104,6 @@ "download-complete-label": "Lawrlwytho wedi'i gwblhau!", "downloading-label": "Wrthi'n llwytho i lawr", "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." } \ No newline at end of file diff --git a/locales/cy/myportal.json b/locales/cy/myportal.json index dd3254c6..bf8e2e4b 100644 --- a/locales/cy/myportal.json +++ b/locales/cy/myportal.json @@ -51,5 +51,6 @@ "date-raised": "Dyddiad codi", "representation-submitted": "Cyflwynwyd y sylw", "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." } \ No newline at end of file diff --git a/locales/en/case.json b/locales/en/case.json index 25e02d0c..3630c75e 100644 --- a/locales/en/case.json +++ b/locales/en/case.json @@ -104,5 +104,6 @@ "download-complete-label": "Download complete!", "downloading-label": "Downloading", "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." } \ No newline at end of file diff --git a/locales/en/myportal.json b/locales/en/myportal.json index 9a9fe897..1208d8d7 100644 --- a/locales/en/myportal.json +++ b/locales/en/myportal.json @@ -51,5 +51,6 @@ "date-raised": "Date raised", "representation-submitted": "Representation submitted", "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." } \ No newline at end of file diff --git a/pages/myportal/index.js b/pages/myportal/index.js index 3c0e05de..a103df47 100644 --- a/pages/myportal/index.js +++ b/pages/myportal/index.js @@ -66,6 +66,7 @@ const Home = (props) => { showLoginCheck, currentView, mySubmittedReps, + docsOffline, } = props; let { t, lang } = useTranslation(); @@ -161,6 +162,7 @@ const Home = (props) => { containerID={accountDetails.containerID} showLoginCheck={showLoginCheck} currentView={currentView} + docsOffline={docsOffline} />