Merged PR 2395: helpers for dashboard domain layer

Related work items: #23754
This commit is contained in:
Robert Bond
2026-06-17 16:06:09 +00:00
parent 0b66a0e1d4
commit 475aa965b4
11 changed files with 1375 additions and 77 deletions
+4 -15
View File
@@ -41,6 +41,7 @@ import { sendGAEvent } from "@next/third-parties/google";
import RepsOnResults from "./repsonresults";
import LiveLink from "./liveLink";
import { query } from "jsonpath";
import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy/splitWatchedCasesBySubmissionState";
const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -220,21 +221,9 @@ const SearchResults = (props) => {
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
});
};
data = showWatchedCases(data);
data = splitWatchedCasesBySubmissionState(
data.value
).watchedCases;
data.value.sort(function compare(a, b) {
var dateA = new Date(a.createdon);