From a8442a43f0d1ee90f187f6281776d8f8c7c6db49 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Wed, 8 Dec 2021 09:47:10 +0000 Subject: [PATCH] linked case now link to show them --- .env.local | 20 ++++++------- components/case/summary.js | 22 +++++--------- components/myportal/topthree.js | 4 +-- components/search/searchresults.js | 48 +++++++++++++++++------------- components/searchresults.js | 2 ++ locales/cy/search.json | 1 + locales/en/search.json | 1 + pages/searchresults.js | 23 +++++++++++--- 8 files changed, 70 insertions(+), 51 deletions(-) diff --git a/.env.local b/.env.local index 9124fd15..e89f45b1 100644 --- a/.env.local +++ b/.env.local @@ -17,11 +17,11 @@ NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459 //Test Oauth -//CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa -//CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- -//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ -//RELAYURI = "test-pedw-ns.servicebus.windows.net" -//RELAYPATH = "test-pedw-hc" +CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa +CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- +RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ +RELAYURI = "test-pedw-ns.servicebus.windows.net" +RELAYPATH = "test-pedw-hc" //Preprod Oauth @@ -34,11 +34,11 @@ NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459 //Prod Oauth -CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2 -CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk -RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/ -RELAYURI = "prod-pedw-ns.servicebus.windows.net" -RELAYPATH = "prod-pedw-hc" +//CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2 +//CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk +//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/ +//RELAYURI = "prod-pedw-ns.servicebus.windows.net" +//RELAYPATH = "prod-pedw-hc" GOOGLE_TAG_MANAGER = GTM-T78CBC3 diff --git a/components/case/summary.js b/components/case/summary.js index 970f47e2..bca53295 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -601,23 +601,15 @@ const CaseSummary = (props) => { - { - setCurrentReference({ - "currentReference": item.title, - "currentType": - "searchResultsObj", - "incidentid": item.incidentid, - }); - }} - className="" - > - {item.title} - + {item.title} ); diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index a77252e8..21759c82 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -133,10 +133,10 @@ const TopThree = (props) => { ? showTopThreeArr[key] ._pinswg_case_value : showTopThreeArr[key][ - " _pinswg_watchedcase_value" + "_pinswg_watchedcase_value" ] : showTopThreeArr[key][ - " _pinswg_watchedcase_value" + "_pinswg_watchedcase_value" ], "appealType": diff --git a/components/search/searchresults.js b/components/search/searchresults.js index fad652de..67103cc2 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -58,6 +58,7 @@ const SearchResults = (props) => { watchedCases, setWatchedCases, setWatchedCasesDetails, + isLinkedCase, } = props; let { t } = useTranslation(); @@ -501,27 +502,34 @@ const SearchResults = (props) => {

- {t("search:searchresults-title-label")} + {isLinkedCase + ? t("search:searchresults-title-label-linked-case") + : t("search:searchresults-title-label")}

-

- {resultsArr.length > 200 - ? t("search:searchresults-max-count-label") - : t("search:searchresults-count-label", { - count: searchResultsObj["@odata.count"], - })} - . - {advancedSearch != true ? ( - <> - - {t("search:searchresults-case-count-label")}{" "} - {" "} - "{searchString}" - - - ) : ( - "" - )} -

+ + {!isLinkedCase && ( +

+ {resultsArr.length > 200 + ? t("search:searchresults-max-count-label") + : t("search:searchresults-count-label", { + count: searchResultsObj["@odata.count"], + })} + . + {advancedSearch != true ? ( + <> + + {t( + "search:searchresults-case-count-label" + )}{" "} + {" "} + "{searchString}" + + + ) : ( + "" + )} +

+ )} {resultsArr.length > 0 ? ( ResultsView(resultsArr) ) : ( diff --git a/components/searchresults.js b/components/searchresults.js index 0d8de4b1..7381390f 100644 --- a/components/searchresults.js +++ b/components/searchresults.js @@ -13,6 +13,7 @@ export default function Search(props) { advancedSearch, myportal, watchedCases, + isLinkedCase, } = props; let { t } = useTranslation(); @@ -48,6 +49,7 @@ export default function Search(props) { } myportal={myportal} watchedCases={watchedCases} + isLinkedCase={isLinkedCase} />
diff --git a/locales/cy/search.json b/locales/cy/search.json index e5fe91d1..cf5cfcf9 100644 --- a/locales/cy/search.json +++ b/locales/cy/search.json @@ -47,6 +47,7 @@ "clear-button-label": "Cliriwch", "clear-all-button-label": "Clirio Pob Un", "searchresults-title-label": "Chwilio am achos", + "searchresults-title-label-linked-case": "Achosion cysylltiedig", "searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau", "searchresults-max-count-label": "Dychwelodd eich chwiliad fwy na 200 o ganlyniadau. Mireiniwch eich chwiliad. Mae'r 200 achos diweddaraf yn cael eu harddangos", "searchresults-case-reference-label": "Cyfeirnod yr Achos", diff --git a/locales/en/search.json b/locales/en/search.json index f4adff21..810b28a1 100644 --- a/locales/en/search.json +++ b/locales/en/search.json @@ -47,6 +47,7 @@ "clear-button-label": "Clear", "clear-all-button-label": "Clear all", "searchresults-title-label": "Search for a case", + "searchresults-title-label-linked-case": "Linked case", "searchresults-count-label": "Your search returned {{count}} results", "searchresults-max-count-label": "Your searched returned more than 200 results. Please refine your search. The most recent 200 cases are displayed", "searchresults-case-reference-label": "Case reference", diff --git a/pages/searchresults.js b/pages/searchresults.js index 3cda8515..4fab7c5e 100644 --- a/pages/searchresults.js +++ b/pages/searchresults.js @@ -25,19 +25,23 @@ import { getBasicSearch, getBasicSearchDetails, getToken } from "../actions"; import { getSearchDetails } from "../components/utils"; const Home = (props) => { - const { footerLinks, pages } = props; + const { footerLinks, pages, isLinkedCase } = props; let { t, lang } = useTranslation(); const router = useRouter(); const { locale } = router; const { appealtypes } = router.query; + const pageTitle = isLinkedCase + ? t("search:searchresults-title-label-linked-case") + + " - " + + t("common:service-name") + : t("search:page-title") + " - " + t("common:service-name"); + return (
- - {t("search:page-title")} - {t("common:service-name")} - + {pageTitle} <> {