linked case now link to show them

This commit is contained in:
2021-12-08 09:47:10 +00:00
parent e1d5ea6870
commit a8442a43f0
8 changed files with 70 additions and 51 deletions
+10 -10
View File
@@ -17,11 +17,11 @@ NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459
//Test Oauth //Test Oauth
//CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa CLIENT_ID = 6619ad85-c908-490d-811b-de8c93c0f2aa
//CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj- CLIENT_SECRET = qKo7Q~5QvLEplbwnBbint_I5lXqx_-kDm8Vj-
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/ RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
//RELAYURI = "test-pedw-ns.servicebus.windows.net" RELAYURI = "test-pedw-ns.servicebus.windows.net"
//RELAYPATH = "test-pedw-hc" RELAYPATH = "test-pedw-hc"
//Preprod Oauth //Preprod Oauth
@@ -34,11 +34,11 @@ NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459
//Prod Oauth //Prod Oauth
CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2 //CLIENT_ID = 01904c07-9035-4cf9-a535-3945f6e470d2
CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk //CLIENT_SECRET = PRo7Q~GQoKSdARRqF-NOXQDx2Ka8UCINyvagk
RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/ //RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
RELAYURI = "prod-pedw-ns.servicebus.windows.net" //RELAYURI = "prod-pedw-ns.servicebus.windows.net"
RELAYPATH = "prod-pedw-hc" //RELAYPATH = "prod-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3 GOOGLE_TAG_MANAGER = GTM-T78CBC3
+7 -15
View File
@@ -601,23 +601,15 @@ const CaseSummary = (props) => {
<Link <Link
href={ href={
router.locale == "cy" router.locale == "cy"
? "/achos" ? "/canlyniadauchwilio?q=" +
: "/case" item.title +
"&lk=1"
: "/searchresults?q=" +
item.title +
"&lk=1"
} }
> >
<a <a className="">{item.title}</a>
onClick={() => {
setCurrentReference({
"currentReference": item.title,
"currentType":
"searchResultsObj",
"incidentid": item.incidentid,
});
}}
className=""
>
{item.title}
</a>
</Link> </Link>
</li> </li>
); );
+2 -2
View File
@@ -133,10 +133,10 @@ const TopThree = (props) => {
? showTopThreeArr[key] ? showTopThreeArr[key]
._pinswg_case_value ._pinswg_case_value
: showTopThreeArr[key][ : showTopThreeArr[key][
" _pinswg_watchedcase_value" "_pinswg_watchedcase_value"
] ]
: showTopThreeArr[key][ : showTopThreeArr[key][
" _pinswg_watchedcase_value" "_pinswg_watchedcase_value"
], ],
"appealType": "appealType":
+28 -20
View File
@@ -58,6 +58,7 @@ const SearchResults = (props) => {
watchedCases, watchedCases,
setWatchedCases, setWatchedCases,
setWatchedCasesDetails, setWatchedCasesDetails,
isLinkedCase,
} = props; } = props;
let { t } = useTranslation(); let { t } = useTranslation();
@@ -501,27 +502,34 @@ const SearchResults = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7"> <h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
{t("search:searchresults-title-label")} {isLinkedCase
? t("search:searchresults-title-label-linked-case")
: t("search:searchresults-title-label")}
</h1> </h1>
<p className="govuk-body">
{resultsArr.length > 200 {!isLinkedCase && (
? t("search:searchresults-max-count-label") <p className="govuk-body">
: t("search:searchresults-count-label", { {resultsArr.length > 200
count: searchResultsObj["@odata.count"], ? t("search:searchresults-max-count-label")
})} : t("search:searchresults-count-label", {
. count: searchResultsObj["@odata.count"],
{advancedSearch != true ? ( })}
<> .
<span> {advancedSearch != true ? (
{t("search:searchresults-case-count-label")}{" "} <>
{" "} <span>
<em>&quot;{searchString}&quot;</em> {t(
</span> "search:searchresults-case-count-label"
</> )}{" "}
) : ( {" "}
"" <em>&quot;{searchString}&quot;</em>
)} </span>
</p> </>
) : (
""
)}
</p>
)}
{resultsArr.length > 0 ? ( {resultsArr.length > 0 ? (
ResultsView(resultsArr) ResultsView(resultsArr)
) : ( ) : (
+2
View File
@@ -13,6 +13,7 @@ export default function Search(props) {
advancedSearch, advancedSearch,
myportal, myportal,
watchedCases, watchedCases,
isLinkedCase,
} = props; } = props;
let { t } = useTranslation(); let { t } = useTranslation();
@@ -48,6 +49,7 @@ export default function Search(props) {
} }
myportal={myportal} myportal={myportal}
watchedCases={watchedCases} watchedCases={watchedCases}
isLinkedCase={isLinkedCase}
/> />
</div> </div>
</div> </div>
+1
View File
@@ -47,6 +47,7 @@
"clear-button-label": "Cliriwch", "clear-button-label": "Cliriwch",
"clear-all-button-label": "Clirio Pob Un", "clear-all-button-label": "Clirio Pob Un",
"searchresults-title-label": "Chwilio am achos", "searchresults-title-label": "Chwilio am achos",
"searchresults-title-label-linked-case": "Achosion cysylltiedig",
"searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau", "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-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", "searchresults-case-reference-label": "Cyfeirnod yr Achos",
+1
View File
@@ -47,6 +47,7 @@
"clear-button-label": "Clear", "clear-button-label": "Clear",
"clear-all-button-label": "Clear all", "clear-all-button-label": "Clear all",
"searchresults-title-label": "Search for a case", "searchresults-title-label": "Search for a case",
"searchresults-title-label-linked-case": "Linked case",
"searchresults-count-label": "Your search returned {{count}} results", "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-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", "searchresults-case-reference-label": "Case reference",
+19 -4
View File
@@ -25,19 +25,23 @@ import { getBasicSearch, getBasicSearchDetails, getToken } from "../actions";
import { getSearchDetails } from "../components/utils"; import { getSearchDetails } from "../components/utils";
const Home = (props) => { const Home = (props) => {
const { footerLinks, pages } = props; const { footerLinks, pages, isLinkedCase } = props;
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
const router = useRouter(); const router = useRouter();
const { locale } = router; const { locale } = router;
const { appealtypes } = router.query; 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 ( return (
<div> <div>
<Head> <Head>
<title> <title>{pageTitle}</title>
{t("search:page-title")} - {t("common:service-name")}
</title>
<> <>
<link <link
rel="canonical" rel="canonical"
@@ -108,6 +112,7 @@ const Home = (props) => {
<SearchResults <SearchResults
searchString={props.search.searchString} searchString={props.search.searchString}
searchResultsObj={props.searchResultsObj} searchResultsObj={props.searchResultsObj}
isLinkedCase={isLinkedCase}
/> />
</div> </div>
<Footer footerLinks={footerLinks} /> <Footer footerLinks={footerLinks} />
@@ -121,6 +126,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
async ({ query, req, res }) => { async ({ query, req, res }) => {
console.log("query-", query); console.log("query-", query);
let isLinked =
typeof query.lk != "undefined" && query.lk == "1"
? true
: false;
console.log("is linked:", isLinked);
let token = await getToken(); let token = await getToken();
var tokenIssuedAt = new Date(); var tokenIssuedAt = new Date();
@@ -161,6 +172,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setSearchResults(searchResultsObj)); store.dispatch(setSearchResults(searchResultsObj));
store.dispatch(setSearchDetails(searchDetailsObj)); store.dispatch(setSearchDetails(searchDetailsObj));
store.dispatch(setSearch(query.q)); store.dispatch(setSearch(query.q));
return {
props: { isLinkedCase: isLinked },
};
} }
); );