Merged PR 2395: helpers for dashboard domain layer
Related work items: #23754
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
getPortalModuleDetailsProxy,
|
||||
getWatchedCasesProxy
|
||||
} from "../../actions/services/portalService";
|
||||
import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy";
|
||||
import { getFormCollectionByID, getDetailsProxy } from "../../components/utils";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
@@ -122,21 +123,10 @@ const TopThree = (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
|
||||
});
|
||||
};
|
||||
|
||||
let filteredWatchedCases = showWatchedCases(data);
|
||||
let filteredWatchedCases =
|
||||
splitWatchedCasesBySubmissionState(
|
||||
data.value
|
||||
).watchedCases;
|
||||
|
||||
(setWatchedCases(filteredWatchedCases),
|
||||
getDetailsProxy(
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
getWatchedCases,
|
||||
getWatchedCasesProxy
|
||||
} from "../../actions/services/portalService";
|
||||
import { splitWatchedCasesBySubmissionState } from "../../lib/domain/dashboard-policy";
|
||||
import { consoleLogger } from "../../actions/core/logger";
|
||||
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
@@ -929,21 +930,10 @@ const ViewAllResults = (props) => {
|
||||
.then((data) => data)
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(cookies.pinsUser).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);
|
||||
let filteredWatchedCases =
|
||||
splitWatchedCasesBySubmissionState(
|
||||
data.value
|
||||
).watchedCases;
|
||||
(setWatchedCases(filteredWatchedCases),
|
||||
getDetailsProxy(
|
||||
filteredWatchedCases,
|
||||
@@ -995,24 +985,9 @@ const ViewAllResults = (props) => {
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(props.accountDetails.loggedinUserId).then(
|
||||
(data) => {
|
||||
let showWatchedCases = (submittedArr) => {
|
||||
const required = submittedArr.value.filter((el) => {
|
||||
return (
|
||||
el.pinswg_representationsubmitted ===
|
||||
null ||
|
||||
el.pinswg_representationsubmitted ===
|
||||
undefined
|
||||
);
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
@@ -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