From 9fe6c24f7122c11dc2abd4c0da25382eeb6a78f4 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Wed, 15 Feb 2023 11:43:38 +0000
Subject: [PATCH] cleaned ununsed dependancies and packages
---
actions/index.js | 1 -
components/breadcrumbs.js | 7 +---
components/case/documents.js | 7 +---
components/case/representationList.js | 7 +---
components/case/summary.js | 12 +------
components/elements/index.js | 1 -
components/homepage/casesearch.js | 6 ----
components/homepage/dns.js | 6 ----
components/homepage/login.js | 8 +----
components/myportal/advancedsearch.js | 7 +---
components/myportal/dns.js | 6 ----
components/myportal/searchcases.js | 6 ----
components/myportal/uploadFile.js | 2 +-
components/search/advancedsearch.js | 7 +---
components/search/dnssearchresults.js | 7 +---
components/search/searchresults.js | 6 ----
components/seo/Page.js | 21 ------------
next.config.js | 38 +++++++++++++---------
package.json | 46 +++++++++------------------
pages/api/documents/download/[id].js | 1 -
20 files changed, 47 insertions(+), 155 deletions(-)
diff --git a/actions/index.js b/actions/index.js
index 4017f5fc..b5e97169 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -1,5 +1,4 @@
import axios from "axios";
-import https from "https";
import CryptoJS from "crypto-js";
import HmacSHA256 from "crypto-js/hmac-sha256";
import { getFormCollection } from "../components/utils";
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index 293b58e4..4a480c38 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -4,7 +4,7 @@ import _ from "lodash";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import LoadingOverlay from "react-loading-overlay";
+
import { getSession, useSession } from "next-auth/react";
const Breadcrumbs = (props) => {
@@ -848,11 +848,6 @@ const Breadcrumbs = (props) => {
- {/* */}
>
);
};
diff --git a/components/case/documents.js b/components/case/documents.js
index 9194b687..e0f229f6 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -6,7 +6,7 @@ import { useState, useEffect, useRef, useCallback } from "react";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
-import LoadingOverlay from "react-loading-overlay";
+
import CryptoJS from "crypto-js";
import { setCurrentPage } from "../../store/currentView/action";
@@ -528,11 +528,6 @@ const DocumentDetails = (props) => {
- {/* */}
>
);
};
diff --git a/components/case/representationList.js b/components/case/representationList.js
index da22ec6e..24e6e19b 100644
--- a/components/case/representationList.js
+++ b/components/case/representationList.js
@@ -6,7 +6,7 @@ import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
-import LoadingOverlay from "react-loading-overlay";
+
import { getRepresentations } from "../../actions";
import { setRepresentations } from "../../store/searchOutput/action";
import PaginationControl from "./pagination";
@@ -224,11 +224,6 @@ const RepresentationList = (props) => {
- {/* */}
>
);
};
diff --git a/components/case/summary.js b/components/case/summary.js
index 24907426..d5f07bcb 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -6,7 +6,6 @@ import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
-import LoadingOverlay from "react-loading-overlay";
import { getLinkedCases } from "../../actions";
import {
@@ -833,16 +832,7 @@ const CaseSummary = (props) => {
return date > start && date > end ? true : false;
}
- return (
- <>
- {showDetailsBlock}
- {/* */}
- >
- );
+ return <>{showDetailsBlock}>;
};
const mapStateToProps = (state) => {
diff --git a/components/elements/index.js b/components/elements/index.js
index 96fc1806..e8c8e199 100644
--- a/components/elements/index.js
+++ b/components/elements/index.js
@@ -1,4 +1,3 @@
-import useSWR from "swr";
import { Field, reduxForm } from "redux-form";
import { useRouter } from "next/router";
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
diff --git a/components/homepage/casesearch.js b/components/homepage/casesearch.js
index 1448217a..e1a03631 100644
--- a/components/homepage/casesearch.js
+++ b/components/homepage/casesearch.js
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
-import LoadingOverlay from "react-loading-overlay";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -150,11 +149,6 @@ let CaseSearch = (props) => {
- {/* */}
>
);
diff --git a/components/homepage/dns.js b/components/homepage/dns.js
index 8941107a..b4dce87c 100644
--- a/components/homepage/dns.js
+++ b/components/homepage/dns.js
@@ -2,7 +2,6 @@ import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import LoadingOverlay from "react-loading-overlay";
export default function Dns() {
let { t } = useTranslation();
@@ -46,11 +45,6 @@ export default function Dns() {
- {/* */}
);
}
diff --git a/components/homepage/login.js b/components/homepage/login.js
index b0741693..ebc864af 100644
--- a/components/homepage/login.js
+++ b/components/homepage/login.js
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
-import LoadingOverlay from "react-loading-overlay";
+
import { getLogin } from "../../actions";
import { setLoggedInUserId } from "../../store/accountDetails/action";
import { parseCookies, setCookie, destroyCookie } from "nookies";
@@ -371,12 +371,6 @@ let Login = (props) => {
-
- {/* */}
>
);
diff --git a/components/myportal/advancedsearch.js b/components/myportal/advancedsearch.js
index efa1c89e..526f62b9 100644
--- a/components/myportal/advancedsearch.js
+++ b/components/myportal/advancedsearch.js
@@ -6,7 +6,7 @@ import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath";
import data from "../../data/collections.json";
-import LoadingOverlay from "react-loading-overlay";
+
import transLookup from "../../data/lookuptranslations.json";
const required = (errorMsg) => (value) =>
@@ -471,11 +471,6 @@ let AdvancedSearch = (props) => {
- {/* */}
>
);
};
diff --git a/components/myportal/dns.js b/components/myportal/dns.js
index 238490bf..955e4263 100644
--- a/components/myportal/dns.js
+++ b/components/myportal/dns.js
@@ -2,7 +2,6 @@ import Link from "next/link";
import { useState } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import LoadingOverlay from "react-loading-overlay";
export default function Dns() {
let { t } = useTranslation();
@@ -46,11 +45,6 @@ export default function Dns() {
- {/* */}
);
}
diff --git a/components/myportal/searchcases.js b/components/myportal/searchcases.js
index 552d756a..d06c69c6 100644
--- a/components/myportal/searchcases.js
+++ b/components/myportal/searchcases.js
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
-import LoadingOverlay from "react-loading-overlay";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -151,11 +150,6 @@ let CaseSearch = (props) => {
- {/* */}
>
);
diff --git a/components/myportal/uploadFile.js b/components/myportal/uploadFile.js
index 45a82ccf..8a5b96a8 100644
--- a/components/myportal/uploadFile.js
+++ b/components/myportal/uploadFile.js
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useState, useMemo } from "react";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
-import LoadingOverlay from "react-loading-overlay";
+
import DropzoneComponent from "../newappeal/fileupload";
import { Field, reduxForm } from "redux-form";
import { connect } from "react-redux";
diff --git a/components/search/advancedsearch.js b/components/search/advancedsearch.js
index 286734f3..278eae31 100644
--- a/components/search/advancedsearch.js
+++ b/components/search/advancedsearch.js
@@ -6,7 +6,7 @@ import { reduxForm, formValueSelector, Field } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath";
import data from "../../data/collections.json";
-import LoadingOverlay from "react-loading-overlay";
+
import transLookup from "../../data/lookuptranslations.json";
const required = (errorMsg) => (value) =>
@@ -613,11 +613,6 @@ let AdvancedSearch = (props) => {
- {/* */}
>
);
};
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
index 71366d13..da392c3f 100644
--- a/components/search/dnssearchresults.js
+++ b/components/search/dnssearchresults.js
@@ -7,7 +7,7 @@ import _ from "lodash";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
import { useState, useEffect, useCallback } from "react";
-import LoadingOverlay from "react-loading-overlay";
+
import {
getBasicDNSSearchPaged,
getBasicSearchDetailsPaged,
@@ -768,11 +768,6 @@ const DNSSearchResults = (props) => {
)}
- {/* */}
>
);
};
diff --git a/components/search/searchresults.js b/components/search/searchresults.js
index 07b896e3..f55cb111 100644
--- a/components/search/searchresults.js
+++ b/components/search/searchresults.js
@@ -18,7 +18,6 @@ import {
} from "../../actions";
import data from "../../data/collections.json";
import { useCallback, useState } from "react";
-import LoadingOverlay from "react-loading-overlay";
import {
setSearchResults,
@@ -769,11 +768,6 @@ const SearchResults = (props) => {
)}
- {/* */}
>
);
};
diff --git a/components/seo/Page.js b/components/seo/Page.js
index a3b9fb44..731f988d 100644
--- a/components/seo/Page.js
+++ b/components/seo/Page.js
@@ -1,5 +1,4 @@
import Head from "next/head";
-import { string } from "prop-types";
// ALl options are conditional apart from title
const PageMeta = ({
@@ -96,24 +95,4 @@ const PageMeta = ({
);
};
-PageMeta.propTypes = {
- title: string,
- createdAt: string,
- updatedAt: string,
- ogImage: string,
- ogUrl: string,
- ogTitle: string,
- ogType: string,
- ogDescription: string,
- canonicalURL: string,
- description: string,
- keywords: string,
- createdAt: string,
- updatedAt: string,
- robots: string,
- twitterDescription: string,
- twitterTitle: string,
- twitterImage: string,
-};
-
export default PageMeta;
diff --git a/next.config.js b/next.config.js
index 403fbd2f..5f85b4f8 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,22 +1,22 @@
// next.config.js
-const withStyles = require("@webdeb/next-styles");
+//const withStyles = require("@webdeb/next-styles");
//const { nextI18NextRewrites } = require("next-i18next/rewrites");
const nextTranslate = require("next-translate");
-module.exports = withStyles({
- sass: true, // use .scss files
- modules: true, // style.(m|module).css & style.(m|module).scss for module files
- sassLoaderOptions: {
- sassOptions: {
- includePaths: [
- "/styles/sass",
- "node_modules/govuk-frontend/govuk/all",
- "/styles/sass/patterns",
- "/styles/sass/prevent-training",
- ], // @import 'variables'; # loads (src/styles/varialbes.scss), you got it..
- },
- },
-});
+// module.exports = withStyles({
+// sass: true, // use .scss files
+// modules: true, // style.(m|module).css & style.(m|module).scss for module files
+// sassLoaderOptions: {
+// sassOptions: {
+// includePaths: [
+// "/styles/sass",
+// "node_modules/govuk-frontend/govuk/all",
+// "/styles/sass/patterns",
+// "/styles/sass/welshgov",
+// ], // @import 'variables'; # loads (src/styles/varialbes.scss), you got it..
+// },
+// },
+// });
const securityHeaders = [
{
@@ -54,6 +54,14 @@ const securityHeaders = [
];
module.exports = {
+ sassOptions: {
+ includePaths: [
+ "/styles/sass",
+ "node_modules/govuk-frontend/govuk/all",
+ "/styles/sass/patterns",
+ "/styles/sass/welshgov",
+ ], // @import 'variables'; # loads (src/styles/varialbes.scss), you got it..
+ },
async headers() {
return [
{
diff --git a/package.json b/package.json
index bcb4c370..8a7c144b 100644
--- a/package.json
+++ b/package.json
@@ -10,83 +10,67 @@
"lint": "next lint"
},
"dependencies": {
- "@azure/identity": "^2.0.5",
+ "@azure/identity": "^3.1.3",
"@azure/storage-blob": "^12.12.0",
"@azure/storage-queue": "^12.11.0",
- "@googlemaps/react-wrapper": "^1.1.24",
- "@magic-sdk/admin": "^1.4.0",
"@next-auth/prisma-adapter": "^1.0.4",
"@prisma/client": "^3.12.0",
- "@redux-devtools/extension": "^3.2.3",
- "@webdeb/next-styles": "^1.1.1",
+ "@redux-devtools/extension": "^3.2.5",
"applicationinsights": "^2.2.0",
"axios": "^0.24.0",
"compression": "^1.7.4",
"cookie-cutter": "^0.2.0",
- "cookies": "^0.8.0",
"crypto-js": "^4.1.1",
"date-fns": "^2.28.0",
"dom": "^0.0.3",
- "dynamics-web-api": "^1.7.4",
"express": "^4.17.2",
- "formidable": "^2.0.1",
- "fs": "^0.0.1-security",
+ "fs": "0.0.2",
"google-map-react": "^2.1.10",
"govuk-frontend": "3.13.0",
- "https": "^1.0.0",
- "hyco-https": "^1.4.5",
"jsonpath": "^1.1.1",
- "jsonpath-plus": "^6.0.1",
"leaflet": "^1.7.1",
"leaflet-defaulticon-compatibility": "^0.1.1",
"lodash": "^4.17.21",
- "magic-sdk": "^8.1.0",
"moment": "^2.29.1",
- "multer": "^1.4.4",
"multiparty": "^4.2.3",
"mysql": "^2.18.1",
"nanoid": "^3.2.0",
"next": "^12.0.8",
- "next-auth": "^4.3.4",
+ "next-auth": "4.19.2",
"next-connect": "^0.12.2",
"next-redux-wrapper": "^7.0.5",
"next-translate": "^1.2.0",
- "nodemailer": "^6.7.8",
+ "nodemailer": "^6.9.1",
"nookies": "^2.5.2",
"notifications-node-client": "^5.1.1",
"ospoint": "^0.2.1",
"path": "^0.12.7",
+ "prop-types": "^15.8.1",
"react": "17.0.2",
"react-accessible-accordion": "^4.0.0",
"react-autosuggest": "^10.1.0",
"react-cookie-consent": "^7.2.1",
- "react-datepicker": "^4.6.0",
+ "react-datepicker": "4.10.0",
"react-dom": "17.0.2",
"react-dropzone": "^11.5.1",
- "react-idle-timer": "^4.6.4",
+ "react-idle-timer": "4.6.4",
"react-leaflet": "^3.2.5",
- "react-loading-overlay": "^1.0.1",
"react-quill": "^2.0.0",
"react-redux": "^7.2.6",
- "react-xml-parser": "^1.1.8",
- "redux-form": "^8.3.8",
+ "redux": "^4.2.1",
+ "redux-form": "^8.3.9",
"redux-persist": "^6.0.0",
- "redux-thunk": "^2.4.1",
+ "redux-thunk": "^2.4.2",
"sass": "1.32",
- "sass-loader": "^12.4.0",
- "swr": "^1.1.2",
- "typeorm": "^0.3.5",
- "uuid": "^8.3.2",
+ "sass-loader": "13.2.0",
+ "typescript": "^4.9.5",
+ "uuid": "9.0.0",
"webpack": "^5.66.0",
- "xml2js": "^0.4.23",
- "xmldom": "^0.6.0",
- "xmlhttprequest": "^1.8.0",
"xpath": "^0.0.32"
},
"devDependencies": {
"eslint": "^8.6.0",
- "eslint-config-next": "^12.0.8",
- "prettier": "2.5.1",
+ "eslint-config-next": "^13.1.6",
"prisma": "^3.12.0"
}
}
diff --git a/pages/api/documents/download/[id].js b/pages/api/documents/download/[id].js
index ac991720..7dbf66f9 100644
--- a/pages/api/documents/download/[id].js
+++ b/pages/api/documents/download/[id].js
@@ -1,5 +1,4 @@
import axios from "axios";
-import https from "https";
import CryptoJS from "crypto-js";
import { getToken, consoleLogger } from "../../../../actions";