Merged PR 1071: updated watched cases with language and confirm

updated watched cases with language and confirm

Related work items: #9442, #9443, #9446, #9447, #9448, #9449, #9450, #9451, #9452, #9453, #9454, #9455
This commit is contained in:
Robert Bond
2024-01-29 15:14:44 +00:00
13 changed files with 216 additions and 167 deletions
+11 -11
View File
@@ -5,11 +5,11 @@ GRANT_TYPE = "client_credentials"
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
//Dev oauth ESNR
//CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
//CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
//RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
//RELAYURI = "dev-pedw-ns.servicebus.windows.net"
//RELAYPATH = "dev-pedw-hc"
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
RELAYPATH = "dev-pedw-hc"
//Test Oauth ESNR
@@ -30,12 +30,12 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
//Prod Oauth WGO
CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
//CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
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 = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
////CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
//CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
//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
+50 -30
View File
@@ -411,8 +411,7 @@ const CaseSummary = (props) => {
</div>
</div>
*/}
{showLoginCheck == true && (
{showLoginCheck == "true" && (
<>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
@@ -466,26 +465,27 @@ const CaseSummary = (props) => {
<span
className="govuk-link"
onClick={() => {
deleteItem(
isWatchedCase(
props
.currentView
.caseReference
.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
alert(
confirm(
t(
"case:you-have-stopped-watching-label"
) +
props
.currentView
.caseReference
.currentReference
);
.currentReference +
"?"
) &&
deleteItem(
isWatchedCase(
props
.currentView
.caseReference
.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
}}
title={t(
"case:stop-watching-case-link"
@@ -499,17 +499,7 @@ const CaseSummary = (props) => {
<span
className=" govuk-link"
onClick={() => {
selectWatchedCase(
props.accountDetails
.loggedinUserId,
props.currentView
.caseReference
.incidentid,
props.currentView
.caseReference
.appealType
);
alert(
confirm(
t(
"case:you-are-watching-label"
) +
@@ -517,8 +507,22 @@ const CaseSummary = (props) => {
props
.currentView
.caseReference
.currentReference
);
.currentReference +
"?"
) &&
selectWatchedCase(
props
.accountDetails
.loggedinUserId,
props
.currentView
.caseReference
.incidentid,
props
.currentView
.caseReference
.appealType
);
}}
>
{t(
@@ -532,7 +536,7 @@ const CaseSummary = (props) => {
className="govuk-link"
onClick={() => {
// signIn("email");
signIn();
// signIn();
// selectWatchedCase(
// cookies.pinsUser,
// item.incidentid,
@@ -542,6 +546,21 @@ const CaseSummary = (props) => {
// "Trying to watch case " +
// item.title
// );
confirm(
"Trying to watch case " +
props.currentView
.caseReference
.currentReference +
"\n\nYou will now be prompted to sign in"
) &&
signIn("email", {
callbackUrl:
"/myportal/searchresults?q=" +
props
.currentView
.caseReference
.currentReference,
});
}}
title={t(
"case:watch-this-case-link"
@@ -576,6 +595,7 @@ const CaseSummary = (props) => {
</div>
</>
)}
{/* 1{" "}
{_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
detailsObj.pinswg_startdatetimeiftheevent}
@@ -92,10 +92,9 @@ const AwaitingSubmissionFromBlob = (props) => {
showTopThreeArr[key]
.pinswg_appealcasetype,
});
}}>
}}
>
{showTopThreeArr[index].pinswg_name}
</Link>
</div>
<div>
@@ -174,23 +173,26 @@ const AwaitingSubmissionFromBlob = (props) => {
: showTopThreeArrDets[key]["pinswg_lpaname"] || ""}
</div>
<div className="">
<a
<span
href="#"
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
event.preventDefault();
deleteCaseItem(
props.containerID,
showTopThreeArr[key].pinswg_name
);
alert(
"You have deleted case " +
confirm(
t("case:do-you-want-to-delete-case-label") +
showTopThreeArr[key].pinswg_name +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteCaseItem(
props.containerID,
showTopThreeArr[key].pinswg_name
);
);
}}
>
&mdash;
</a>
</span>
</div>
</div>
);
@@ -226,10 +228,9 @@ const AwaitingSubmissionFromBlob = (props) => {
"viewName": "Awaiting Submission",
"viewKey": "awaitingSubmissionDetails",
});
}}>
}}
>
{t("myportal:viewall-link")}
</Link>
</div>
)}
+25 -25
View File
@@ -194,8 +194,8 @@ const TopThree = (props) => {
showTopThreeArr[key]
.pinswg_appealcasetype,
});
}}>
}}
>
{topThreeType != "watchedCases"
? topThreeType != "myRepresentations"
? showTopThreeArr[key].ticketnumber
@@ -205,7 +205,6 @@ const TopThree = (props) => {
: showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]}{" "}
</Link>
</div>
{/* {(topThreeType == "awaitingSubmission" ||
@@ -301,46 +300,47 @@ const TopThree = (props) => {
</div>
{topThreeType == "watchedCases" && (
<div className="">
<a
<span
href="#"
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
event.preventDefault();
deleteItem(
showTopThreeArr[key].pinswg_watchlistid,
"watchedCases"
);
alert(
"You have stopped watching case " +
confirm(
t("case:you-have-stopped-watching-label") +
showTopThreeArr[key][
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
]
);
) &&
deleteItem(
showTopThreeArr[key].pinswg_watchlistid,
"watchedCases"
);
}}
>
&mdash;
</a>
</span>
</div>
)}
{topThreeType == "awaitingSubmission" && (
<div className="">
<a
href="#"
<span
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
onClick={() => {
event.preventDefault();
deleteItem(
showTopThreeArr[key].incidentid,
"awaitingSubmission"
);
alert(
"You have deleted case " +
showTopThreeArr[key].ticketnumber
);
confirm(
t("case:do-you-want-to-delete-case-label") +
showTopThreeArr[key].ticketnumber +
"?\n" +
t(
"case:do-you-want-to-delete-case-disclaimer-label"
)
) &&
deleteItem(
showTopThreeArr[key].incidentid,
"awaitingSubmission"
);
}}
>
&mdash;
</a>
</span>
</div>
)}
</div>
+2 -3
View File
@@ -43,10 +43,9 @@ const WatchedCases = (props) => {
"viewName": "Watched Cases",
"viewKey": "watchedCases",
});
}}>
}}
>
{t("myportal:viewall-link")}
</Link>
</div>
)}
+25 -22
View File
@@ -369,8 +369,8 @@ const DNSSearchResults = (props) => {
item.pinswg_appealcasetype,
"showMap": showMap,
});
}}>
}}
>
<span className="results-visually-hidden">
{t(
"search:searchresults-case-reference-label"
@@ -378,7 +378,6 @@ const DNSSearchResults = (props) => {
:
</span>
{item.title}
</Link>
</dd>
<dd className="govuk-summary-list__value govuk-!-font-size-16">
@@ -531,19 +530,21 @@ const DNSSearchResults = (props) => {
<span
className="govuk-summary-list__actionLink watched_link"
onClick={() => {
deleteItem(
isWatchedCase(
item.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
alert(
confirm(
t(
"case:you-have-stopped-watching-label"
) + item.title
);
) +
item.title +
"?"
) &&
deleteItem(
isWatchedCase(
item.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
}}
title={t(
"case:stop-watching-case-link"
@@ -555,16 +556,18 @@ const DNSSearchResults = (props) => {
<span
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
selectWatchedCase(
cookies.pinsUser,
item.incidentid,
item.pinswg_appealcasetype
);
alert(
confirm(
t(
"case:you-are-watching-label"
) + item.title
);
) +
item.title +
"?"
) &&
selectWatchedCase(
cookies.pinsUser,
item.incidentid,
item.pinswg_appealcasetype
);
}}
title={t(
"case:watch-this-case-link"
+69 -53
View File
@@ -309,6 +309,8 @@ const SearchResults = (props) => {
item.incidentid,
"appealType":
item.pinswg_appealcasetype,
"showLoginCheck":
props.showLoginCheck,
});
}}
>
@@ -498,19 +500,21 @@ const SearchResults = (props) => {
<span
className="govuk-summary-list__actionLink watched_link"
onClick={() => {
deleteItem(
isWatchedCase(
item.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
alert(
confirm(
t(
"case:you-have-stopped-watching-label"
) + item.title
);
) +
item.title +
"?"
) &&
deleteItem(
isWatchedCase(
item.incidentid
)[0]
.pinswg_watchlistid,
"watchedCases"
);
}}
title={t(
"case:stop-watching-case-link"
@@ -522,17 +526,20 @@ const SearchResults = (props) => {
<span
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
selectWatchedCase(
props.accountDetails
.loggedinUserId,
item.incidentid,
item.pinswg_appealcasetype
);
alert(
confirm(
t(
"case:you-are-watching-label"
) + item.title
);
) +
item.title +
"?"
) &&
selectWatchedCase(
props
.accountDetails
.loggedinUserId,
item.incidentid,
item.pinswg_appealcasetype
);
}}
title={t(
"case:watch-this-case-link"
@@ -543,39 +550,48 @@ const SearchResults = (props) => {
)}
</dd>
)}
{showLoginCheck == "true" && !session && (
<dd>
<span
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
// signIn("email");
signIn(undefined, {
callbackUrl:
"/myportal/searchresults?q=" +
searchString +
"&toWatch=" +
item.incidentid +
"_" +
item.pinswg_appealcasetype,
});
// selectWatchedCase(
// props.accountDetails.loggedinUserId,
// item.incidentid,
// item.pinswg_appealcasetype
// );
alert(
"Trying to watch case " +
item.title
);
}}
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</span>
</dd>
)}
{(showLoginCheck == "true" ||
showLoginCheck == true) &&
!session && (
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
<span className="results-visually-hidden">
{t(
"case:watch-this-case-link"
)}
</span>
<span
className="govuk-summary-list__actionLink watchLink"
onClick={() => {
confirm(
t(
"case:trying-to-watch-case-label"
) +
item.title +
"\n\n" +
t(
"case:trying-to-watch-case-redirect-label"
)
) &&
// signIn("email");
signIn(undefined, {
callbackUrl:
"/myportal/searchresults?q=" +
searchString +
"&toWatch=" +
item.incidentid +
"_" +
item.pinswg_appealcasetype,
});
}}
title={t(
"case:watch-this-case-link"
)}
>
<span className="eye"></span>
</span>
</dd>
)}
</div>
);
})
+1 -1
View File
@@ -12,7 +12,7 @@ module.exports = {
"*": ["common", "newappeal", "search"],
"/": ["common", "home", "case"],
"/error": ["common", "home", "myportal"],
"/myportal": ["myportal", "common", "home"],
"/myportal": ["myportal", "common", "home", "case"],
"/myportal/viewall": ["search", "myportal"],
"/myportal/advancedsearch": ["search", "myportal"],
"/myportal/advancedsearchresults": ["search", "myportal"],
+6 -2
View File
@@ -88,6 +88,10 @@
"representation-period-ended-on-label": "Daeth y Cyfnod Cynrychiolaeth i ben ar ",
"stop-watching-case-link": "Stopiwch wylio'r achos hwn",
"watch-this-case-link": "Gwyliwch yr achos hwn",
"you-are-watching-label": "Rydych chi'n gwylio achos ",
"you-have-stopped-watching-label": "Rydych chi wedi rhoi'r gorau i wylio'r achos "
"you-are-watching-label": "Ydych chi eisiau gwylio achos ",
"trying-to-watch-case-label": "Ceisio gwylio achos ",
"trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi",
"you-have-stopped-watching-label": "Ydych chi am roi'r gorau i wylio achos ",
"do-you-want-to-delete-case-label": "Ydych chi am ddileu achos",
"do-you-want-to-delete-case-disclaimer-label": "Unwaith y caiff ei dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli."
}
+6 -2
View File
@@ -88,6 +88,10 @@
"representation-period-ended-on-label": "Representation Period ended on ",
"stop-watching-case-link": "Stop watching this case",
"watch-this-case-link": "Watch this case",
"you-are-watching-label": "You are watching case ",
"you-have-stopped-watching-label": "You have stopped watching case "
"you-are-watching-label": "Do you want to watch case ",
"trying-to-watch-case-label": "Trying to watch case ",
"trying-to-watch-case-redirect-label": "You will now be prompted to sign in",
"you-have-stopped-watching-label": "Do you want to stop watching case ",
"do-you-want-to-delete-case-label": "Do you want to delete case ",
"do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost."
}
+1 -2
View File
@@ -66,7 +66,7 @@ const CaseHome = (props) => {
representationsObj={
props.searchResultsObj.representationsObj
}
showLoginCheck={props.showLoginCheck}
showLoginCheck={props.currentView.showLogin}
/>
</div>
<Footer footerLinks={footerLinks} />
@@ -89,7 +89,6 @@ const mapStateToProps = (state) => {
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
showLoginCheck: process.env.SHOWLOGIN || false,
};
};
+1
View File
@@ -76,6 +76,7 @@ const CaseHome = (props) => {
representationsObj={
props.searchResultsObj.representationsObj
}
showLoginCheck={props.currentView.showLogin}
/>
</div>
<Footer footerLinks={footerLinks} />
+2
View File
@@ -81,6 +81,7 @@ const Home = (props) => {
props.searchResultsObj.representationsObj
}
showRepresentations={showRepresentations}
showLoginCheck={props.currentView.showLogin}
/>
</div>
<Footer footerLinks={footerLinks} />
@@ -105,6 +106,7 @@ const mapStateToProps = (state) => {
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
accountDetails: state.accountDetails,
showLoginCheck: process.env.SHOWLOGIN || false,
};
};