From 12d1fbc55e0b61a1cbe024978c9357acf155d32b Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 5 Feb 2024 15:26:13 +0000 Subject: [PATCH] watched cases and view all --- .env.local | 2 +- components/case.js | 2 +- .../representation/representationDetails.js | 4 ++-- .../case/representation/representationLPA.js | 4 ++-- .../representationLPAQuestionnaire_s78.js | 1 - components/case/summary.js | 6 +++++- components/myportal.js | 2 +- components/myportal/myrepresentations.js | 11 +++++++---- .../myportal/myrepresentationsfromblob.js | 11 +++++++---- components/myportal/topthree.js | 3 ++- components/myportal/viewall.js | 13 +++++-------- components/myportal/watchedcases.js | 6 ++++-- pages/myportal/case.js | 6 ++---- pages/myportal/index.js | 8 ++++++++ pages/myportal/searchresults.js | 18 ++++++++++-------- 15 files changed, 57 insertions(+), 40 deletions(-) diff --git a/.env.local b/.env.local index 648b6c0f..4b58fdf3 100644 --- a/.env.local +++ b/.env.local @@ -40,7 +40,7 @@ RELAYPATH = "dev-pedw-hc" GOOGLE_TAG_MANAGER = GTM-T78CBC3 SHOWLOGIN = true -SHOWREPRESENTATIONS = false +SHOWREPRESENTATIONS = true SHOWFILEUPLOAD = "false" SHOWMAPS = "false" API_ROOT = "http://localhost:3000" diff --git a/components/case.js b/components/case.js index 6dde13cb..9a0d97b3 100644 --- a/components/case.js +++ b/components/case.js @@ -36,7 +36,7 @@ const Case = (props) => { searchString={props.searchString} incidentid={props.incidentid} showMap={props.showMap} - showLoginCheck={props.showLoginCheck} + currentView={props.currentView} /> { ? props.myRepresentations.myRepresentations : props.searchResultsObj.searchDetailsObj : props.currentType == "watchedCases" - ? props.props.props.watchedCases.watchedCasesDetails - : props.props.searchResultsObj.searchDetailsObj; + ? props.props.props.props.watchedCases.watchedCasesDetails + : props.props.props.searchResultsObj.searchDetailsObj; var detailsObj = {}; diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index b3ef0a9f..390bf040 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -348,7 +348,7 @@ let RepLPA = (props) => { className="govuk-button" data-module="govuk-button" > - {t("common:continue-button")}ww + {t("common:continue-button")} // { className="govuk-button" data-module="govuk-button" > - {t("common:continue-button")}ww + {t("common:continue-button")} )} {showQuestionnaireSection > 1 && ( diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js index 0575ee84..5270dce2 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js @@ -999,7 +999,6 @@ let S78_Questionnaire = (props) => { dateEnd="1-y" locale={locale} /> - ss )} diff --git a/components/case/summary.js b/components/case/summary.js index 34c261be..d2f54962 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -76,9 +76,10 @@ const CaseSummary = (props) => { setWatchedCases, setWatchedCasesDetails, showMap, + currentView, } = props; - const showLoginCheck = props.currentView.caseReference.showLoginCheck; + const showLoginCheck = currentView.showLogin; const { data: session, status } = useSession(); //console.log("session status:", status, session); @@ -406,6 +407,9 @@ const CaseSummary = (props) => { currentType == "searchResultsObj" ? detailsObj.pinswg_name + : currentType == + "watchedCases" + ? casesObj.pinswg_title : casesObj.reference, }, }} diff --git a/components/myportal.js b/components/myportal.js index 84fad811..96722826 100644 --- a/components/myportal.js +++ b/components/myportal.js @@ -145,9 +145,9 @@ const MyPortal = (props) => { {props.watchedCases.watchedCases["@odata.count"] > 0 && ( )} {props.myRepresentations.myRepresentations[ diff --git a/components/myportal/myrepresentations.js b/components/myportal/myrepresentations.js index dcd1b6cb..8baefb68 100644 --- a/components/myportal/myrepresentations.js +++ b/components/myportal/myrepresentations.js @@ -46,10 +46,13 @@ const MyRepresentations = (props) => { "viewName": "My Representations", "viewKey": "myRepresentations", }); - }}> - - {t("myportal:viewall-link")} - + }} + > + {t("myportal:viewall-link")}{" "} + {props.isLPA && + props.myRepresentations.myRepresentations[ + "@odata.count" + ] + " representations"} )} diff --git a/components/myportal/myrepresentationsfromblob.js b/components/myportal/myrepresentationsfromblob.js index 4c9492e5..8f4ba3ed 100644 --- a/components/myportal/myrepresentationsfromblob.js +++ b/components/myportal/myrepresentationsfromblob.js @@ -46,10 +46,13 @@ const MyRepresentations = (props) => { "viewName": "My Representations", "viewKey": "myRepresentations", }); - }}> - - {t("myportal:viewall-link")} - + }} + > + {t("myportal:viewall-link")}{" "} + {props.isLPA && + props.myRepresentations.myRepresentations[ + "@odata.count" + ] + " representations"} )} diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index adf44ad6..e9bf9831 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -27,6 +27,7 @@ import { getFormCollectionByID } from "../../components/utils"; const TopThree = (props) => { let { t } = useTranslation(); const { + currentView, showTopThree, showDetails, setCurrentReference, @@ -194,7 +195,7 @@ const TopThree = (props) => { "appealType": showTopThreeArr[key] .pinswg_appealcasetype, - "showLoginCheck": props.showLoginCheck, + "showLoginCheck": currentView.showLogin, }); }} > diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index 925cd75f..d082b91c 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -124,14 +124,12 @@ const ViewAllResults = (props) => { resultsArr[key].pinswg_appealcasetype, "repDetails": currentView.viewKey == - "myRepresentations" && - resultsArr[key], + "myRepresentations" && resultsArr[key], }); - }}> - + }} + > - {t("search:searchresults-case-reference-label")} - : + {t("search:searchresults-case-reference-label")}: {currentView.viewKey != "watchedCases" ? currentView.viewKey == "myRepresentations" @@ -140,7 +138,6 @@ const ViewAllResults = (props) => { : resultsArr[key][ "_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue" ]} -
@@ -528,7 +525,7 @@ const ViewAllResults = (props) => {
router.back()} + onClick={() => router.replace("/myportal")} className="govuk-button" > Back diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index a87bc95e..fdcf4c73 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -19,12 +19,12 @@ const WatchedCases = (props) => { {t("myportal:watchedcases-card-title")}
-
werwrew {props.showLoginCheck}
@@ -47,7 +47,9 @@ const WatchedCases = (props) => { }); }} > - {t("myportal:viewall-link")} + {t("myportal:viewall-link")}{" "} + {props.watchedCases.watchedCases["@odata.count"] + + " cases"}
)} diff --git a/pages/myportal/case.js b/pages/myportal/case.js index dabd1c2a..c6bf2bb4 100644 --- a/pages/myportal/case.js +++ b/pages/myportal/case.js @@ -80,10 +80,8 @@ const Home = (props) => { representationsObj={ props.searchResultsObj.representationsObj } - showRepresentations={showRepresentations} - showLoginCheck={ - props.currentView.caseReference.showLogin - } + showRepresentations={props.currentView.showReps} + currentView={props.currentView} />