Merged PR 1825: updated watched case filter on dashboard to not count reps
Related work items: #18356
This commit is contained in:
@@ -168,6 +168,7 @@ const MyPortal = (props) => {
|
|||||||
watchedCases={props.watchedCases}
|
watchedCases={props.watchedCases}
|
||||||
isLPA={isLPA}
|
isLPA={isLPA}
|
||||||
myReps={false}
|
myReps={false}
|
||||||
|
accountDetails={props.accountDetails}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{props.myRepresentations.hasOwnProperty(
|
{props.myRepresentations.hasOwnProperty(
|
||||||
|
|||||||
@@ -114,13 +114,32 @@ const TopThree = (props) => {
|
|||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
getWatchedCasesProxy(
|
||||||
setWatchedCases(data),
|
props.accountDetails.loggedinUserId
|
||||||
getDetailsProxy(data, "myWatchedCases").then(
|
).then((data) => {
|
||||||
(data) => {
|
let showWatchedCases = (submittedArr) => {
|
||||||
setWatchedCasesDetails(data);
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -234,13 +234,13 @@ const TopThree = (props) => {
|
|||||||
<div className="deleteCase">
|
<div className="deleteCase">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-case-label"
|
"case:do-you-want-to-delete-rep-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
"case:do-you-want-to-delete-case-label"
|
"case:do-you-want-to-delete-rep-label"
|
||||||
) +
|
) +
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
.pinswg_name +
|
.pinswg_name +
|
||||||
|
|||||||
@@ -270,6 +270,9 @@ const ViewAllResults = (props) => {
|
|||||||
? currentView.viewKey ==
|
? currentView.viewKey ==
|
||||||
"myRepresentations"
|
"myRepresentations"
|
||||||
? resultsArr[key].caseRef
|
? resultsArr[key].caseRef
|
||||||
|
: currentView.viewKey ==
|
||||||
|
"awaitingSubmissionDetails"
|
||||||
|
? resultsArr[key].title
|
||||||
: resultsArr[key].pinswg_title
|
: resultsArr[key].pinswg_title
|
||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -690,12 +693,12 @@ const ViewAllResults = (props) => {
|
|||||||
] || "N/A"}
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" && (
|
{currentView.viewKey == "awaitingSubmissionDetails" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-case-label"
|
"case:do-you-want-to-delete-case-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
className=" cardModuleRemoveCase govuk-summary-list__actionLink"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
@@ -718,12 +721,12 @@ const ViewAllResults = (props) => {
|
|||||||
</dd>
|
</dd>
|
||||||
)}
|
)}
|
||||||
{currentView.viewKey == "myRepresentations" && (
|
{currentView.viewKey == "myRepresentations" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-case-label"
|
"case:do-you-want-to-delete-rep-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
@@ -748,12 +751,12 @@ const ViewAllResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{currentView.viewKey == "watchedCases" && (
|
{currentView.viewKey == "watchedCases" && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 cardModuleItem ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<button
|
<button
|
||||||
title={t(
|
title={t(
|
||||||
"case:do-you-want-to-delete-case-label"
|
"case:you-have-stopped-watching-label"
|
||||||
)}
|
)}
|
||||||
className=" cardModuleRemoveCase govuk-link govuk-link--no-underline govuk-link--inverse "
|
className=" cardModuleRemoveCase govuk-summary-list__actionLink "
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
confirm(
|
confirm(
|
||||||
t(
|
t(
|
||||||
@@ -1094,6 +1097,14 @@ const ViewAllResults = (props) => {
|
|||||||
t("search:searchresults-status-label")
|
t("search:searchresults-status-label")
|
||||||
)}
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
{(currentView.viewKey == "watchedCases" ||
|
||||||
|
currentView.viewKey ==
|
||||||
|
"awaitingSubmissionDetails" ||
|
||||||
|
currentView.viewKey ==
|
||||||
|
"myRepresentations") && (
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-16 govuk-summary-list__action"></dd>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{showSpinnerState == true ? (
|
{showSpinnerState == true ? (
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const WatchedCases = (props) => {
|
|||||||
currentView={props.currentView}
|
currentView={props.currentView}
|
||||||
myReps={props.myReps}
|
myReps={props.myReps}
|
||||||
props={props}
|
props={props}
|
||||||
|
accountDetails={props.accountDetails}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
"trying-to-watch-case-redirect-label": "Fe'ch anogir nawr i fewngofnodi",
|
"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 ",
|
"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-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.",
|
"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-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,",
|
"representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,",
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
"trying-to-watch-case-redirect-label": "You will now be prompted to sign in",
|
"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 ",
|
"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-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.",
|
"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-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}",
|
||||||
"representation-date-passed-additional-label": "You can make a representation by emailing,",
|
"representation-date-passed-additional-label": "You can make a representation by emailing,",
|
||||||
|
|||||||
+28
-2
@@ -111,7 +111,7 @@ const deleteCaseItem = (containerID, caseID) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function StoragePage(props) {
|
export default function StoragePage(props) {
|
||||||
const { data, userData } = props;
|
const { data, userData, repCompleteCount } = props;
|
||||||
const [showRepJson, setShowRepJson] = useState(true);
|
const [showRepJson, setShowRepJson] = useState(true);
|
||||||
const [showTmpFile, setShowTmpFile] = useState(true);
|
const [showTmpFile, setShowTmpFile] = useState(true);
|
||||||
const [whichTab, setWhichTab] = useState("storage");
|
const [whichTab, setWhichTab] = useState("storage");
|
||||||
@@ -174,6 +174,12 @@ export default function StoragePage(props) {
|
|||||||
id="storage"
|
id="storage"
|
||||||
>
|
>
|
||||||
<h1>Storage Account Contents</h1>
|
<h1>Storage Account Contents</h1>
|
||||||
|
{repCompleteCount > 0 && (
|
||||||
|
<p>
|
||||||
|
Number of Orphaned Reps:{" "}
|
||||||
|
{repCompleteCount}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Toggle buttons */}
|
{/* Toggle buttons */}
|
||||||
<div style={{ marginBottom: "0.2rem" }}>
|
<div style={{ marginBottom: "0.2rem" }}>
|
||||||
@@ -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,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2502,6 +2502,46 @@ ul#sharePageLinks.active {
|
|||||||
top: 3px;
|
top: 3px;
|
||||||
background-color: #aa1111;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user