remove unused imports
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
import Link from "next/link";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
import { parseCookies } from "nookies";
|
||||
import {
|
||||
getWatchedCasesProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
deleteWatchedCases,
|
||||
deleteAwaitingSubmissions,
|
||||
getAwaitingSubmissionProxy,
|
||||
} from "../../actions";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import _ from "lodash";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { parseCookies } from "nookies";
|
||||
import { connect } from "react-redux";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
} from "../../store/watchedCases/action";
|
||||
deleteAwaitingSubmissions,
|
||||
deleteWatchedCases,
|
||||
getAwaitingSubmissionProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
getWatchedCasesProxy,
|
||||
} from "../../actions";
|
||||
import { getFormCollectionByID, getDetailsProxy } from "../../components/utils";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
setAwaitingSubmission,
|
||||
setAwaitingSubmissionDetails,
|
||||
} from "../../store/awaitingSubmission/action";
|
||||
import { getFormCollectionByID } from "../../components/utils";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import {
|
||||
setSearchDetails,
|
||||
setSearchResults,
|
||||
} from "../../store/searchOutput/action";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
} from "../../store/watchedCases/action";
|
||||
|
||||
const TopThree = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -79,9 +79,11 @@ const TopThree = (props) => {
|
||||
.then(() => {
|
||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||
setWatchedCases(data),
|
||||
getDetails(data, "myWatchedCases").then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
getDetailsProxy(data, "myWatchedCases").then(
|
||||
(data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -94,52 +96,21 @@ const TopThree = (props) => {
|
||||
getAwaitingSubmissionProxy(cookies.pinsUser).then(
|
||||
(data) => {
|
||||
setAwaitingSubmission(data),
|
||||
getDetails(data, "awaitingSubmission").then(
|
||||
(data) => {
|
||||
//console.log(
|
||||
// "submission get details:",
|
||||
// data
|
||||
// );
|
||||
setAwaitingSubmissionDetails(data);
|
||||
}
|
||||
);
|
||||
getDetailsProxy(
|
||||
data,
|
||||
"awaitingSubmission"
|
||||
).then((data) => {
|
||||
//console.log(
|
||||
// "submission get details:",
|
||||
// data
|
||||
// );
|
||||
setAwaitingSubmissionDetails(data);
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const getDetails = (resultsObj, detailsType) => {
|
||||
//console.log(resultsObj);
|
||||
let detailsArr = [];
|
||||
resultsObj = resultsObj.value;
|
||||
const detailsObj = resultsObj.map((searchDetail, index) => {
|
||||
if (searchDetail.pinswg_appealcasetype == null) {
|
||||
console.log(
|
||||
detailsType != "myWatchedCases"
|
||||
? searchDetail.ticketnumber
|
||||
: searchDetail[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
);
|
||||
} else {
|
||||
detailsArr.push(
|
||||
getPortalModuleDetailsProxy(
|
||||
getFormCollectionByID(
|
||||
searchDetail.pinswg_appealcasetype
|
||||
).LogicalCollectionName,
|
||||
detailsType != "myWatchedCases"
|
||||
? searchDetail.ticketnumber
|
||||
: searchDetail[
|
||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
//console.log(detailsArr);
|
||||
return Promise.all(detailsArr);
|
||||
};
|
||||
|
||||
const getIncidentId = (topThreeType, objArr) => {
|
||||
switch (topThreeType) {
|
||||
case "myCases":
|
||||
|
||||
Reference in New Issue
Block a user