17025 unsub issues

This commit is contained in:
2025-06-10 11:25:32 +01:00
parent 5dee64dfec
commit 193da6af2f
9 changed files with 412 additions and 25 deletions
+31 -8
View File
@@ -759,9 +759,7 @@ const ViewAllResults = (props) => {
style={{ display: "flex", flexDirection: "column" }}
>
<button
title={t(
"case:do-you-want-to-delete-case-label"
)}
title={t("case:stop-watching-case-link")}
className=" govuk-summary-list__actionLink watched_link"
onClick={() => {
confirm(
@@ -778,15 +776,17 @@ const ViewAllResults = (props) => {
);
}}
>
&mdash;
<span className="eye"></span>
</button>
{item.pinswg_emailnotifications == true ? (
<button
className="govuk-summary-list__actionLink mailLink watched_link"
title="Unsubscribe to email updates"
title={t("common:unsubscribe-title-label")}
onClick={() => {
confirm(
" Do you want to unsubscribe to email updates for " +
t(
"case:summary-unsubscribe-mail-label"
) +
item.pinswg_title +
"?"
) &&
@@ -807,10 +807,12 @@ const ViewAllResults = (props) => {
) : (
<button
className="govuk-summary-list__actionLink mailLink"
title="Email about changes"
title={t("common:subscribe-title-label")}
onClick={() => {
confirm(
" Do you want to be sent email updates for " +
t(
"case:summary-subscribe-mail-label"
) +
item.pinswg_title +
"?"
) &&
@@ -937,6 +939,27 @@ const ViewAllResults = (props) => {
.then((data) => data)
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
let showWatchedCases = (submittedArr) => {
const required = submittedArr.value.filter((el) => {
return (
el.pinswg_representationsubmitted == null
);
});
let newObj = {};
return Object.assign(newObj, {
"@odata.count": required.length,
"value": required,
});
};
data = showWatchedCases(data);
data.value.sort(function compare(a, b) {
var dateA = new Date(a.createdon);
var dateB = new Date(b.createdon);
return dateB - dateA;
});
setWatchedCases(data),
getDetailsProxy(data, "myWatchedCases")
.then((data) => {