Merged PR 2395: helpers for dashboard domain layer
Related work items: #23754
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user