Merged PR 666: linked case now link to show them

linked case now link to show them

Related work items: #6909
This commit is contained in:
Robert Bond
2021-12-08 09:51:28 +00:00
8 changed files with 70 additions and 51 deletions
+10 -10
View File
@@ -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
+7 -15
View File
@@ -601,23 +601,15 @@ const CaseSummary = (props) => {
<Link
href={
router.locale == "cy"
? "/achos"
: "/case"
? "/canlyniadauchwilio?q=" +
item.title +
"&lk=1"
: "/searchresults?q=" +
item.title +
"&lk=1"
}
>
<a
onClick={() => {
setCurrentReference({
"currentReference": item.title,
"currentType":
"searchResultsObj",
"incidentid": item.incidentid,
});
}}
className=""
>
{item.title}
</a>
<a className="">{item.title}</a>
</Link>
</li>
);
+2 -2
View File
@@ -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":
+28 -20
View File
@@ -58,6 +58,7 @@ const SearchResults = (props) => {
watchedCases,
setWatchedCases,
setWatchedCasesDetails,
isLinkedCase,
} = props;
let { t } = useTranslation();
@@ -501,27 +502,34 @@ const SearchResults = (props) => {
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<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>
<p className="govuk-body">
{resultsArr.length > 200
? t("search:searchresults-max-count-label")
: t("search:searchresults-count-label", {
count: searchResultsObj["@odata.count"],
})}
.
{advancedSearch != true ? (
<>
<span>
{t("search:searchresults-case-count-label")}{" "}
{" "}
<em>&quot;{searchString}&quot;</em>
</span>
</>
) : (
""
)}
</p>
{!isLinkedCase && (
<p className="govuk-body">
{resultsArr.length > 200
? t("search:searchresults-max-count-label")
: t("search:searchresults-count-label", {
count: searchResultsObj["@odata.count"],
})}
.
{advancedSearch != true ? (
<>
<span>
{t(
"search:searchresults-case-count-label"
)}{" "}
{" "}
<em>&quot;{searchString}&quot;</em>
</span>
</>
) : (
""
)}
</p>
)}
{resultsArr.length > 0 ? (
ResultsView(resultsArr)
) : (
+2
View File
@@ -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}
/>
</div>
</div>
+1
View File
@@ -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",
+1
View File
@@ -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",
+19 -4
View File
@@ -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 (
<div>
<Head>
<title>
{t("search:page-title")} - {t("common:service-name")}
</title>
<title>{pageTitle}</title>
<>
<link
rel="canonical"
@@ -108,6 +112,7 @@ const Home = (props) => {
<SearchResults
searchString={props.search.searchString}
searchResultsObj={props.searchResultsObj}
isLinkedCase={isLinkedCase}
/>
</div>
<Footer footerLinks={footerLinks} />
@@ -121,6 +126,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
async ({ query, req, res }) => {
console.log("query-", query);
let isLinked =
typeof query.lk != "undefined" && query.lk == "1"
? true
: false;
console.log("is linked:", isLinked);
let token = await getToken();
var tokenIssuedAt = new Date();
@@ -161,6 +172,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setSearchResults(searchResultsObj));
store.dispatch(setSearchDetails(searchDetailsObj));
store.dispatch(setSearch(query.q));
return {
props: { isLinkedCase: isLinked },
};
}
);