added switch for login check on watch case and reps

This commit is contained in:
2024-01-26 11:52:06 +00:00
parent c5f61da8ed
commit 79da26733c
3 changed files with 178 additions and 153 deletions
+12 -11
View File
@@ -5,11 +5,11 @@ GRANT_TYPE = "client_credentials"
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
//Dev oauth ESNR //Dev oauth ESNR
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a //CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE //CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/ //RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
RELAYURI = "dev-pedw-ns.servicebus.windows.net" //RELAYURI = "dev-pedw-ns.servicebus.windows.net"
RELAYPATH = "dev-pedw-hc" //RELAYPATH = "dev-pedw-hc"
//Test Oauth ESNR //Test Oauth ESNR
@@ -30,16 +30,17 @@ RELAYPATH = "dev-pedw-hc"
//Prod Oauth WGO //Prod Oauth WGO
//CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
//CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~ //CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/ CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
//RELAYURI = "prod-pedw-ns.servicebus.windows.net" RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
//RELAYPATH = "prod-pedw-hc" RELAYURI = "prod-pedw-ns.servicebus.windows.net"
RELAYPATH = "prod-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3 GOOGLE_TAG_MANAGER = GTM-T78CBC3
SHOWLOGIN = true SHOWLOGIN = false
SHOWREPRESENTATIONS = true SHOWREPRESENTATIONS = false
SHOWFILEUPLOAD = "false" SHOWFILEUPLOAD = "false"
SHOWMAPS = "false" SHOWMAPS = "false"
API_ROOT = "http://localhost:3000" API_ROOT = "http://localhost:3000"
+22 -7
View File
@@ -411,6 +411,9 @@ const CaseSummary = (props) => {
</div> </div>
</div> </div>
*/} */}
{showLoginCheck == true && (
<>
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<div className="govuk-button-group"> <div className="govuk-button-group">
@@ -465,10 +468,12 @@ const CaseSummary = (props) => {
onClick={() => { onClick={() => {
deleteItem( deleteItem(
isWatchedCase( isWatchedCase(
props.currentView props
.currentView
.caseReference .caseReference
.incidentid .incidentid
)[0].pinswg_watchlistid, )[0]
.pinswg_watchlistid,
"watchedCases" "watchedCases"
); );
@@ -476,7 +481,8 @@ const CaseSummary = (props) => {
t( t(
"case:you-have-stopped-watching-label" "case:you-have-stopped-watching-label"
) + ) +
props.currentView props
.currentView
.caseReference .caseReference
.currentReference .currentReference
); );
@@ -485,7 +491,9 @@ const CaseSummary = (props) => {
"case:stop-watching-case-link" "case:stop-watching-case-link"
)} )}
> >
{t("case:stop-watching-case-link")}{" "} {t(
"case:stop-watching-case-link"
)}{" "}
</span> </span>
) : ( ) : (
<span <span
@@ -506,13 +514,16 @@ const CaseSummary = (props) => {
"case:you-are-watching-label" "case:you-are-watching-label"
) + ) +
" " + " " +
props.currentView props
.currentView
.caseReference .caseReference
.currentReference .currentReference
); );
}} }}
> >
{t("case:watch-this-case-link")} {t(
"case:watch-this-case-link"
)}
</span> </span>
))} ))}
@@ -532,7 +543,9 @@ const CaseSummary = (props) => {
// item.title // item.title
// ); // );
}} }}
title={t("case:watch-this-case-link")} title={t(
"case:watch-this-case-link"
)}
> >
{t("case:watch-this-case-link")} {t("case:watch-this-case-link")}
</span> </span>
@@ -561,6 +574,8 @@ const CaseSummary = (props) => {
)} )}
</div> </div>
</div> </div>
</>
)}
{/* 1{" "} {/* 1{" "}
{_.has(detailsObj, "pinswg_startdatetimeiftheevent") && {_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
detailsObj.pinswg_startdatetimeiftheevent} detailsObj.pinswg_startdatetimeiftheevent}
+9
View File
@@ -91,6 +91,15 @@ const SignIn = (props) => {
}; };
export async function getServerSideProps(context) { export async function getServerSideProps(context) {
if (process.env.SHOWLOGIN == false) {
return {
redirect: {
destination: "/404",
permanent: false,
},
};
}
const csrfToken = await getCsrfToken(context); const csrfToken = await getCsrfToken(context);
console.log( console.log(
"\n//////////////////////\n", "\n//////////////////////\n",