remove unused imports

This commit is contained in:
2024-06-19 06:32:38 +01:00
parent e4a1903b48
commit b0e2bb6e14
263 changed files with 1458 additions and 2693 deletions
+3 -10
View File
@@ -1,14 +1,7 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { JSONPath as jsonpath } from "jsonpath-plus";
import data from "../../data/collections.json";
import transLookup from "../../data/lookuptranslations.json";
import { values } from "lodash";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
+4 -7
View File
@@ -1,11 +1,8 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { JSONPath as jsonpath } from "jsonpath-plus";
import data from "../../data/collections.json";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
import transLookup from "../../data/lookuptranslations.json";
+2 -2
View File
@@ -1,9 +1,9 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
import TopThree from "./topthree";
const AwaitingSubmission = (props) => {
let { t } = useTranslation();
@@ -1,25 +1,23 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
import { parseCookies } from "nookies";
import { connect } from "react-redux";
import {
setCurrentView,
setCurrentReference,
} from "../../store/currentView/action";
import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
import {
deleteAwaitingSubmissionsFromBlob,
getAwaitingSubmissionFromBlobProxy,
} from "../../actions";
import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { getFormCollectionByID } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
import {
setAwaitingSubmission,
setAwaitingSubmissionDetails,
setAwaitingSubmissionFromBlob,
} from "../../store/awaitingSubmission/action";
import {
setCurrentReference,
setCurrentView,
} from "../../store/currentView/action";
const AwaitingSubmissionFromBlob = (props) => {
let { t } = useTranslation();
+2 -3
View File
@@ -1,7 +1,6 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
export default function Dns() {
let { t } = useTranslation();
+1 -1
View File
@@ -1,6 +1,6 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function MakeNewAppeal() {
let { t } = useTranslation();
+2 -2
View File
@@ -1,9 +1,9 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
import TopThree from "./topthree";
const MyCases = (props) => {
let { t } = useTranslation();
+2 -2
View File
@@ -1,9 +1,9 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree_reps";
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
import TopThree from "./topthree_reps";
const MyRepresentations = (props) => {
let { t } = useTranslation();
@@ -1,9 +1,9 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree_reps";
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
import TopThree from "./topthree_reps";
const MyRepresentations = (props) => {
let { t } = useTranslation();
+2 -3
View File
@@ -1,7 +1,6 @@
import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
+34 -63
View File
@@ -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":
+28 -60
View File
@@ -1,3 +1,4 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -5,35 +6,31 @@ import { parseCookies } from "nookies";
import { connect } from "react-redux";
import {
deleteAwaitingSubmissions,
deleteMyRepresentationsFromBlob,
deleteWatchedCases,
getAwaitingSubmissionProxy,
getPortalModuleDetailsProxy,
getWatchedCasesProxy,
deleteMyRepresentationsFromBlob,
getRepsFromBlobProxy,
getWatchedCasesProxy,
} from "../../actions";
import transLookup from "../../data/lookuptranslations.json";
import {
setAwaitingSubmission,
setAwaitingSubmissionDetails,
} from "../../store/awaitingSubmission/action";
import {
setWatchedCases,
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import { getFormCollectionByID } from "../utils";
import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
import {
setMyRepresentations,
setMyRepresentationsDetails,
setMySubmittedReps,
setMySubmittedRepsDetails,
} from "../../store/myRepresentations/action";
import {
setCurrentLinkedCases,
setCurrentReference,
setCurrentView,
} from "../../store/currentView/action";
import {
setMyRepresentations,
setMyRepresentationsDetails,
} from "../../store/myRepresentations/action";
import {
setWatchedCases,
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import { getFormCollectionByID, getDetailsProxy } from "../utils";
const TopThree = (props) => {
let { t } = useTranslation();
@@ -78,9 +75,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);
}
);
});
});
@@ -93,15 +92,16 @@ 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);
});
}
);
});
@@ -134,38 +134,6 @@ const TopThree = (props) => {
});
};
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":
+5 -13
View File
@@ -1,19 +1,11 @@
import Link from "next/link";
import { useState, useMemo } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import DropzoneComponent from "../newappeal/fileupload";
import { Field, reduxForm } from "redux-form";
import { useRouter } from "next/router";
import { useMemo, useState } from "react";
import Dropzone from "react-dropzone";
import { connect } from "react-redux";
import Dropzone, { useDropzone } from "react-dropzone";
import { Field, reduxForm } from "redux-form";
import { uploadFiles } from "../../actions";
import { getContainers } from "../../actions/azurestorage";
import {
getFormCollectionByID,
getThumbnailIconByExtension,
bytesToSize,
} from "../utils";
import { bytesToSize } from "../utils";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
+14 -54
View File
@@ -1,48 +1,39 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { JSONPath as jsonpath } from "jsonpath-plus";
import transLookup from "../../data/lookuptranslations.json";
import { getFormCollectionByID } from "../../components/utils";
import { parseCookies } from "nookies";
import { useCallback, useState } from "react";
import { connect } from "react-redux";
import {
setSearchResults,
setSearchDetails,
} from "../../store/searchOutput/action";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import {
getWatchedCasesProxy,
getPortalModuleDetailsProxy,
deleteWatchedCases,
deleteAwaitingSubmissions,
deleteAwaitingSubmissionsFromBlob,
deleteMyRepresentationsFromBlob,
deleteWatchedCases,
getAwaitingSubmissionFromBlobProxy,
getAwaitingSubmissionProxy,
getRepsFromBlobProxy,
getWatchedCasesProxy,
} from "../../actions";
import { getDetailsProxy, getFormCollectionByID } from "../../components/utils";
import transLookup from "../../data/lookuptranslations.json";
import { setAwaitingSubmissionFromBlob } from "../../store/awaitingSubmission/action";
import {
setSearchDetails,
setSearchResults,
} from "../../store/searchOutput/action";
import { setAwaitingSubmissionDetails } from "../../store/awaitingSubmission/action";
import {
setWatchedCases,
setWatchedCasesDetails,
} from "../../store/watchedCases/action";
import {
setAwaitingSubmission,
setAwaitingSubmissionDetails,
} from "../../store/awaitingSubmission/action";
import {
setCurrentLinkedCases,
setCurrentReference,
setCurrentView,
} from "../../store/currentView/action";
import {
setMyRepresentations,
setMyRepresentationsDetails,
setMySubmittedReps,
setMySubmittedRepsDetails,
} from "../../store/myRepresentations/action";
const ViewAllResults = (props) => {
@@ -808,7 +799,7 @@ const ViewAllResults = (props) => {
.then(() => {
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
setWatchedCases(data),
getDetails(data, "myWatchedCases")
getDetailsProxy(data, "myWatchedCases")
.then((data) => {
setWatchedCasesDetails(data);
})
@@ -822,37 +813,6 @@ const ViewAllResults = (props) => {
});
};
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);
};
return (
<>
<div className="govuk-grid-row">
+2 -3
View File
@@ -1,9 +1,9 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import TopThree from "./topthree";
import { connect } from "react-redux";
import { setCurrentView } from "../../store/currentView/action";
import TopThree from "./topthree";
const WatchedCases = (props) => {
let { t } = useTranslation();
@@ -81,7 +81,6 @@ const WatchedCases = (props) => {
const mapDispatchToProps = (dispatch) => {
return {
setCurrentView: (currentView) => {
//console.log(currentView);
dispatch(setCurrentView(currentView));
},
};
+1 -1
View File
@@ -1,6 +1,6 @@
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
export default function YourAccount() {
let { t } = useTranslation();