updated watched cases with language and confirm

This commit is contained in:
2024-01-29 15:11:23 +00:00
parent 888ddf60bd
commit 3e83332d28
13 changed files with 216 additions and 167 deletions
+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>
);
})