From fcba17c81f3f38971b7e87aeffce2cfe7dacc2be Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 14 Aug 2025 10:54:59 +0100 Subject: [PATCH 1/3] updated watch case filter on dashboard --- components/myportal.js | 1 + components/myportal/topthree.js | 33 +++++++++++++++++++++++------ components/myportal/watchedcases.js | 1 + 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/components/myportal.js b/components/myportal.js index 495bb19d..6a15097b 100644 --- a/components/myportal.js +++ b/components/myportal.js @@ -168,6 +168,7 @@ const MyPortal = (props) => { watchedCases={props.watchedCases} isLPA={isLPA} myReps={false} + accountDetails={props.accountDetails} /> )} {props.myRepresentations.hasOwnProperty( diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index 2617bb34..f9c2dbb8 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -114,13 +114,32 @@ const TopThree = (props) => { deleteWatchedCases(caseID) .then((data) => data) .then(() => { - getWatchedCasesProxy(cookies.pinsUser).then((data) => { - setWatchedCases(data), - getDetailsProxy(data, "myWatchedCases").then( - (data) => { - setWatchedCasesDetails(data); - } - ); + getWatchedCasesProxy( + props.accountDetails.loggedinUserId + ).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, + }); + }; + + let filteredWatchedCases = showWatchedCases(data); + + setWatchedCases(filteredWatchedCases), + getDetailsProxy( + filteredWatchedCases, + "myWatchedCases" + ).then((data) => { + setWatchedCasesDetails(data); + }); }); }); diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index c48a14f4..40a328c2 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -31,6 +31,7 @@ const WatchedCases = (props) => { currentView={props.currentView} myReps={props.myReps} props={props} + accountDetails={props.accountDetails} /> From 1d1adf017ab2734f2ed7d479edbd512792f765b5 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 14 Aug 2025 12:18:35 +0100 Subject: [PATCH 2/3] tidied up view all and icon --- components/myportal/topthree_reps.js | 4 +-- components/myportal/viewall.js | 27 +++++++++++------ locales/cy/case.json | 1 + locales/en/case.json | 1 + styles/sass/welshgov/_application.scss | 40 ++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 10 deletions(-) diff --git a/components/myportal/topthree_reps.js b/components/myportal/topthree_reps.js index 5191c2aa..aa40f0de 100644 --- a/components/myportal/topthree_reps.js +++ b/components/myportal/topthree_reps.js @@ -234,13 +234,13 @@ const TopThree = (props) => {
{showSpinnerState == true ? (
diff --git a/locales/cy/case.json b/locales/cy/case.json index e5dae20e..a0490f05 100644 --- a/locales/cy/case.json +++ b/locales/cy/case.json @@ -96,6 +96,7 @@ "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-rep-label": "Ydych chi eisiau dileu cynrychiolaeth sy'n aros i'w chyflwyno", "do-you-want-to-delete-case-disclaimer-label": "Ar ôl dileu, bydd yr holl wybodaeth a gyflwynwyd gennych yn cael ei cholli.", "representation-date-passed-label": "Mae'r cyfnod cyflwyno sylwadau ar gyfer yr apêl hon rhwng {{startDate}} a {{endDate}}", "representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,", diff --git a/locales/en/case.json b/locales/en/case.json index 4d4c6be7..fac349c1 100644 --- a/locales/en/case.json +++ b/locales/en/case.json @@ -96,6 +96,7 @@ "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-rep-label": "Do you want to delete representation awaiting submission", "do-you-want-to-delete-case-disclaimer-label": "Once deleted all information you have submited, will be lost.", "representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}", "representation-date-passed-additional-label": "You can make a representation by emailing,", diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss index 9bf26103..b80401b7 100644 --- a/styles/sass/welshgov/_application.scss +++ b/styles/sass/welshgov/_application.scss @@ -2502,6 +2502,46 @@ ul#sharePageLinks.active { top: 3px; background-color: #aa1111; } + + & .cardModuleRemoveCase { + border: 1px solid $red; + padding: 5px; + height: 20px; + padding-top: 0px; + padding-bottom: 0px; + border-radius: 5px; + width: auto; + color: white !important; + font-weight: bold; + background-color: $red; + font-size: 15px; + cursor: pointer; + + &:active { + top: 2px; + } + + &:hover { + background-color: $lightred; + color: $white !important; + text-decoration: none; + } + + &:focus { + border-color: #ffdd00; + outline: 3px solid transparent; + -webkit-box-shadow: inset 0 0 0 1px #ffdd00; + box-shadow: inset 0 0 0 1px #ffdd00; + } + + &:focus:not(:active):not(:hover) { + border-color: #ffdd00; + color: #0b0c0c; + // background-color: #ffdd00; + // -webkit-box-shadow: 0 2px 0 #0b0c0c; + // box-shadow: 0 2px 0 #0b0c0c; + } + } } From 5cf5a64ad57e906e4c196625113bc1ac03d46c52 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Thu, 14 Aug 2025 12:20:22 +0100 Subject: [PATCH 3/3] added count for orphaned reps --- pages/storageAdmin.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/pages/storageAdmin.js b/pages/storageAdmin.js index 6c2d4927..7be543c3 100644 --- a/pages/storageAdmin.js +++ b/pages/storageAdmin.js @@ -111,7 +111,7 @@ const deleteCaseItem = (containerID, caseID) => { }; export default function StoragePage(props) { - const { data, userData } = props; + const { data, userData, repCompleteCount } = props; const [showRepJson, setShowRepJson] = useState(true); const [showTmpFile, setShowTmpFile] = useState(true); const [whichTab, setWhichTab] = useState("storage"); @@ -174,6 +174,12 @@ export default function StoragePage(props) { id="storage" >

Storage Account Contents

+ {repCompleteCount > 0 && ( +

+ Number of Orphaned Reps:{" "} + {repCompleteCount} +

+ )} {/* Toggle buttons */}
@@ -712,5 +718,25 @@ export async function getServerSideProps({ req }) { })) ); - return { props: { data: data.filter(Boolean), userData: userData } }; + let repCompleteCount = 0; + + data = data.filter(Boolean); + + data.forEach((user) => { + user.containers.forEach((container) => { + container.folders.forEach((folder) => { + if (folder.repComplete === true) { + repCompleteCount++; + } + }); + }); + }); + + return { + props: { + data: data, + userData: userData, + repCompleteCount, + }, + }; }