show submitted reps on dashboard

This commit is contained in:
2024-05-28 18:44:52 +01:00
parent 229e21cdb0
commit f8b7d22802
15 changed files with 174 additions and 19 deletions
+2
View File
@@ -38,6 +38,7 @@ import {
uploadRepFiles,
sendEmail,
generateRepPDF,
createWatchedCases,
} from "../../../actions";
import { formatDates } from "../../../components/utils";
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
@@ -527,6 +528,7 @@ let MakeRepresentation = (props) => {
case 846040003:
case 846040009:
case 846040008:
case 846040017:
return (
<RepresentationProgress_s78
props={props}
@@ -4,7 +4,11 @@ import { useRouter } from "next/router";
import { useEffect } from "react";
import { useDropzone } from "react-dropzone";
import { sendEmail, sendRepCompleteMessage } from "../../../actions";
import {
sendEmail,
sendRepCompleteMessage,
createWatchedCases,
} from "../../../actions";
import { setRepresentationReset } from "../../../store/currentView/action";
const RepComplete = (props) => {
@@ -51,6 +55,22 @@ const RepComplete = (props) => {
props.repFormData.repfile_name
),
sendEmail(templateId, emailAddress, personalisation, reference),
createWatchedCases({
"pinswg_WatchedCase@odata.bind":
"/incidents(" +
props.props.currentView.caseReference.incidentid +
")",
"pinswg_Contact@odata.bind":
"/contacts(" +
props.props.props.props.accountDetails.loggedinUserId +
")",
"pinswg_appealcasetype":
props.props.currentView.caseReference.appealType,
"pinswg_representationsubmitted": new Date(Date.now()),
"pinswg_representationtype":
props.props.currentView.caseReference.repDetails
.representationType,
}),
setRepresentationMessageSent(true));
});
return (
@@ -107,6 +107,7 @@ const RepCompleteSubmit = (props) => {
case 846040003:
case 846040009:
case 846040008:
case 846040017:
return (
<RepLPAQuestionnaireCheck_s78
props={props}
@@ -156,6 +156,7 @@ let RepLPA = (props) => {
case 846040003:
case 846040009:
case 846040008:
case 846040017:
return (
<RepresentationProgress_s78
props={props}
@@ -489,7 +490,7 @@ let RepLPA = (props) => {
}}
className="govuk-link"
>
{t("common:back-link")}ss
{t("common:back-link")}
</a>
</>
)}
+13 -1
View File
@@ -147,6 +147,7 @@ const MyPortal = (props) => {
currentView={props.currentView}
watchedCases={props.watchedCases}
isLPA={isLPA}
myReps={false}
/>
)}
{props.myRepresentations.myRepresentations[
@@ -157,8 +158,19 @@ const MyPortal = (props) => {
isLPA={isLPA}
/>
)}
{!isLPA && <Dns />}
{props.myRepresentations.mySubmittedReps
.mySubmittedReps.length > 0 && (
<WatchedCases
currentView={props.currentView}
watchedCases={
props.myRepresentations.mySubmittedReps
}
isLPA={isLPA}
myReps={true}
/>
)}
{!isLPA && <Dns />}
{/* <YourAccount /> */}
</div>
</div>
+27 -4
View File
@@ -44,7 +44,9 @@ const TopThree = (props) => {
let topthreeRow = [];
let showTopThreeArr = showTopThree.value;
let showTopThreeArr;
showTopThreeArr = props.myReps ? showTopThree : showTopThree.value;
Object.keys(showTopThreeArr).map((key, index) => {
let createdDate = parseInt(showTopThreeArr[key].createdon);
@@ -236,8 +238,6 @@ const TopThree = (props) => {
</Link>
)}
</div>
{/* {(topThreeType == "awaitingSubmission" ||
topThreeType == "watchedCases") && ( */}
<div>
<b>{t("myportal:appeal-type-label")}:</b>{" "}
{router.locale == "cy"
@@ -336,8 +336,31 @@ const TopThree = (props) => {
{" "}
{raisedDate(showTopThreeArr[key].createdon)}
</div>{" "}
{topThreeType == "watchedCases" &&
props.myReps &&
showTopThreeArr[key].pinswg_representationsubmitted !=
null && (
<div className="cardModuleReference">
<b>{t("myportal:representation-submitted")}:</b>
{" "}
{raisedDate(
showTopThreeArr[key]
.pinswg_representationsubmitted
)}
</div>
)}
{topThreeType == "watchedCases" &&
props.myReps &&
showTopThreeArr[key].pinswg_representationtype !=
null && (
<div className="cardModuleReference">
<b>{t("myportal:representation-type")}:</b>
{" "}
{showTopThreeArr[key].pinswg_representationtype}
</div>
)}
</div>
{topThreeType == "watchedCases" && (
{topThreeType == "watchedCases" && !props.myReps && (
<div className="">
<button
title={t("case:you-have-stopped-watching-label")}
+21 -7
View File
@@ -12,23 +12,36 @@ const WatchedCases = (props) => {
const { locale } = router;
const { setCurrentView } = props;
let recordCountVar = props.myReps
? props.watchedCases.mySubmittedReps
: props.watchedCases.watchedCases;
return (
<div className="card" id="my-watched-cases-card">
<div className="card-body">
<h3 className="heading-small card-heading">
{t("myportal:watchedcases-card-title")}
{props.myReps
? "Submitted representations"
: t("myportal:watchedcases-card-title")}
</h3>
<div className="cardModuleContainer">
<TopThree
showTopThree={props.watchedCases.watchedCases}
showTopThree={
props.myReps
? props.watchedCases.mySubmittedReps
: props.watchedCases.watchedCases
}
showDetails={props.watchedCases.watchedCasesDetails}
topThreeType={"watchedCases"}
showLoginCheck={props.showLoginCheck}
currentView={props.currentView}
myReps={props.myReps}
/>
</div>
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
{(props.myReps
? recordCountVar.length > 3
: recordCountVar["@odata.count"] > 3) && (
<div className="cardVieAll">
<Link
href={
@@ -38,7 +51,6 @@ const WatchedCases = (props) => {
"/fymhorth/gweldpopeth"
: "/myportal/viewall"
}
shallow
className="govuk-link--no-underline"
onClick={() => {
setCurrentView({
@@ -51,9 +63,11 @@ const WatchedCases = (props) => {
{props.watchedCases.watchedCases["@odata.count"] +
" cases"} */}
{t("myportal:viewall-link-count", {
count: props.watchedCases.watchedCases[
"@odata.count"
],
count: props.myReps
? props.watchedCases.mySubmittedReps.length
: props.watchedCases.watchedCases[
"@odata.count"
],
})}
</Link>
</div>
+1 -1
View File
@@ -78,7 +78,7 @@ export default function BuildField(props) {
break;
default:
return <>ss{fieldValue}</>;
return <>{fieldValue}</>;
}
};