From 1541652f9b6c513f7c6ea5938645b5eb5de452e5 Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 12:46:15 -0400 Subject: [PATCH 01/31] Add import sorting, same as fidesops#9de2136 --- clients/admin-ui/.eslintignore | 2 + clients/admin-ui/.eslintrc.json | 30 +-- clients/admin-ui/__tests__/index.test.tsx | 3 +- clients/admin-ui/package-lock.json | 225 ++++++---------------- clients/admin-ui/package.json | 3 +- 5 files changed, 79 insertions(+), 184 deletions(-) create mode 100644 clients/admin-ui/.eslintignore diff --git a/clients/admin-ui/.eslintignore b/clients/admin-ui/.eslintignore new file mode 100644 index 00000000000..76add878f8d --- /dev/null +++ b/clients/admin-ui/.eslintignore @@ -0,0 +1,2 @@ +node_modules +dist \ No newline at end of file diff --git a/clients/admin-ui/.eslintrc.json b/clients/admin-ui/.eslintrc.json index 447ba39d5b1..f805d8f7e88 100644 --- a/clients/admin-ui/.eslintrc.json +++ b/clients/admin-ui/.eslintrc.json @@ -5,10 +5,25 @@ "prettier", "next/core-web-vitals" ], + "plugins": [ + "simple-import-sort" + ], + "root": true, "parserOptions": { "project": "./tsconfig.json" }, "rules": { + // causes bug in re-exporting default exports, see + // https://github.com/eslint/eslint/issues/15617 + "no-restricted-exports": [ + 0 + ], + "react/function-component-definition": [ + 2, + { + "namedComponents": "arrow-function" + } + ], "react/jsx-filename-extension": [ 1, { @@ -20,18 +35,9 @@ "react/jsx-props-no-spreading": [ 0 ], - "react/function-component-definition": [ - 2, - { - "namedComponents": "arrow-function" - } - ], + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", // since we are using static site export - "@next/next/no-img-element": "off", - // causes bug in re-exporting default exports, see - // https://github.com/eslint/eslint/issues/15617 - "no-restricted-exports": [ - 0 - ] + "@next/next/no-img-element": "off" } } \ No newline at end of file diff --git a/clients/admin-ui/__tests__/index.test.tsx b/clients/admin-ui/__tests__/index.test.tsx index f0536d1cb1b..e41a355c928 100644 --- a/clients/admin-ui/__tests__/index.test.tsx +++ b/clients/admin-ui/__tests__/index.test.tsx @@ -1,7 +1,8 @@ // __tests__/index.test.tsx import { render, screen } from '@testing-library/react'; import { SessionProvider } from 'next-auth/react'; -import Home from '../pages/index'; + +import Home from '../src/pages/index'; describe('Home', () => { it('renders a logged out notification when no session is present', () => { diff --git a/clients/admin-ui/package-lock.json b/clients/admin-ui/package-lock.json index 6a12dcc5685..e4191f8325e 100644 --- a/clients/admin-ui/package-lock.json +++ b/clients/admin-ui/package-lock.json @@ -16,6 +16,7 @@ "@reduxjs/toolkit": "^1.8.0", "date-fns": "^2.28.0", "date-fns-tz": "^1.3.1", + "eslint-plugin-simple-import-sort": "^7.0.0", "formik": "^2.2.9", "framer-motion": "^5", "lodash.debounce": "^4.0.8", @@ -2612,7 +2613,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==", - "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2632,7 +2632,6 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, "engines": { "node": ">= 4" } @@ -3499,7 +3498,6 @@ "version": "0.9.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", - "dev": true, "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -3514,7 +3512,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@istanbuljs/load-nyc-config": { @@ -5044,7 +5041,6 @@ "version": "8.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -5088,7 +5084,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -5119,7 +5114,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -5195,8 +5189,7 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/aria-hidden": { "version": "1.1.3", @@ -5444,7 +5437,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -5488,7 +5480,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -5806,7 +5797,6 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, "license": "MIT" }, "node_modules/confusing-browser-globals": { @@ -5892,7 +5882,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -6057,7 +6046,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, "license": "MIT" }, "node_modules/deepmerge": { @@ -6374,7 +6362,6 @@ "version": "8.9.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz", "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==", - "dev": true, "dependencies": { "@eslint/eslintrc": "^1.1.0", "@humanwhocodes/config-array": "^0.9.2", @@ -6719,11 +6706,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz", + "integrity": "sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==", + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -6736,7 +6730,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^2.0.0" @@ -6755,7 +6748,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10" @@ -6765,7 +6757,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -6774,7 +6765,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -6787,7 +6777,6 @@ "version": "9.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", - "dev": true, "dependencies": { "acorn": "^8.7.0", "acorn-jsx": "^5.3.1", @@ -6814,7 +6803,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -6827,7 +6815,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -6839,7 +6826,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -6849,7 +6835,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -6926,8 +6911,7 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { "version": "3.2.11", @@ -6960,14 +6944,12 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true, "license": "MIT" }, "node_modules/fastq": { @@ -7014,7 +6996,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" @@ -7057,7 +7038,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.1.0", @@ -7071,7 +7051,6 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true, "license": "ISC" }, "node_modules/focus-lock": { @@ -7187,7 +7166,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -7213,7 +7191,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true, "license": "MIT" }, "node_modules/gensync": { @@ -7298,7 +7275,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -7319,7 +7295,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -7332,7 +7307,6 @@ "version": "13.12.1", "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", - "dev": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -7579,7 +7553,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 4" @@ -7633,7 +7606,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -7652,7 +7624,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -7995,7 +7966,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true, "license": "ISC" }, "node_modules/istanbul-lib-coverage": { @@ -9094,7 +9064,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -9168,14 +9137,12 @@ "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true, "license": "MIT" }, "node_modules/json5": { @@ -9244,7 +9211,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -9294,7 +9260,6 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, "license": "MIT" }, "node_modules/lodash.mergewith": { @@ -9446,7 +9411,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -9600,7 +9564,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true, "license": "MIT" }, "node_modules/next": { @@ -9881,7 +9844,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -9932,7 +9894,6 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, "license": "MIT", "dependencies": { "deep-is": "^0.1.3", @@ -10062,7 +10023,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10072,7 +10032,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10262,7 +10221,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -10307,7 +10265,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, "engines": { "node": ">=6" } @@ -10621,7 +10578,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10725,7 +10681,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -10827,7 +10782,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -10840,7 +10794,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -11142,7 +11095,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -11256,7 +11208,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true, "license": "MIT" }, "node_modules/throat": { @@ -11406,7 +11357,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -11428,7 +11378,6 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, "engines": { "node": ">=10" }, @@ -11488,7 +11437,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -11563,7 +11511,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, "license": "MIT" }, "node_modules/v8-to-istanbul": { @@ -11698,7 +11645,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -11731,7 +11677,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11757,7 +11702,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, "license": "ISC" }, "node_modules/write-file-atomic": { @@ -13858,7 +13802,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==", - "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -13874,8 +13817,7 @@ "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" } } }, @@ -14512,7 +14454,6 @@ "version": "0.9.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", - "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -14522,8 +14463,7 @@ "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -15654,8 +15594,7 @@ "acorn": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" }, "acorn-globals": { "version": "6.0.0", @@ -15685,7 +15624,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "requires": {} }, "acorn-walk": { @@ -15707,7 +15645,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -15755,8 +15692,7 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "aria-hidden": { "version": "1.1.3", @@ -15938,8 +15874,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-js": { "version": "1.5.1", @@ -15965,7 +15900,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -16185,8 +16119,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "confusing-browser-globals": { "version": "1.0.11", @@ -16246,7 +16179,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -16376,8 +16308,7 @@ "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "deepmerge": { "version": "2.2.1", @@ -16610,7 +16541,6 @@ "version": "8.9.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz", "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==", - "dev": true, "requires": { "@eslint/eslintrc": "^1.1.0", "@humanwhocodes/config-array": "^0.9.2", @@ -16653,7 +16583,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "requires": { "esutils": "^2.0.2" } @@ -16882,11 +16811,16 @@ "dev": true, "requires": {} }, + "eslint-plugin-simple-import-sort": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz", + "integrity": "sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==", + "requires": {} + }, "eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -16896,7 +16830,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" }, @@ -16904,22 +16837,19 @@ "eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" } } }, "eslint-visitor-keys": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==" }, "espree": { "version": "9.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", - "dev": true, "requires": { "acorn": "^8.7.0", "acorn-jsx": "^5.3.1", @@ -16936,7 +16866,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, "requires": { "estraverse": "^5.1.0" } @@ -16945,7 +16874,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "requires": { "estraverse": "^5.2.0" } @@ -16953,14 +16881,12 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "events": { "version": "3.3.0", @@ -17015,8 +16941,7 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "3.2.11", @@ -17045,14 +16970,12 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fastq": { "version": "1.13.0", @@ -17091,7 +17014,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, "requires": { "flat-cache": "^3.0.4" } @@ -17122,7 +17044,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, "requires": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -17131,8 +17052,7 @@ "flatted": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" }, "focus-lock": { "version": "0.9.2", @@ -17215,8 +17135,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.3.2", @@ -17232,8 +17151,7 @@ "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "gensync": { "version": "1.0.0-beta.2", @@ -17287,7 +17205,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -17301,7 +17218,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, "requires": { "is-glob": "^4.0.3" } @@ -17310,7 +17226,6 @@ "version": "13.12.1", "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", - "dev": true, "requires": { "type-fest": "^0.20.2" } @@ -17474,8 +17389,7 @@ "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "immer": { "version": "9.0.12", @@ -17504,8 +17418,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indent-string": { "version": "4.0.0", @@ -17517,7 +17430,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -17741,8 +17653,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -18594,7 +18505,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "requires": { "argparse": "^2.0.1" } @@ -18647,14 +18557,12 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json5": { "version": "1.0.1", @@ -18706,7 +18614,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, "requires": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -18745,8 +18652,7 @@ "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lodash.mergewith": { "version": "4.6.2", @@ -18854,7 +18760,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -18967,8 +18872,7 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "next": { "version": "12.1.0", @@ -19142,7 +19046,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -19176,7 +19079,6 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, "requires": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -19265,14 +19167,12 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { "version": "1.0.7", @@ -19407,8 +19307,7 @@ "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, "pretty-format": { "version": "3.8.0", @@ -19444,8 +19343,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "queue-microtask": { "version": "1.2.3", @@ -19648,8 +19546,7 @@ "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==" }, "require-directory": { "version": "2.1.1", @@ -19718,7 +19615,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -19787,7 +19683,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -19795,8 +19690,7 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "side-channel": { "version": "1.0.4", @@ -20022,8 +19916,7 @@ "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "style-value-types": { "version": "5.0.0", @@ -20093,8 +19986,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "throat": { "version": "6.0.1", @@ -20213,7 +20105,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, "requires": { "prelude-ls": "^1.2.1" } @@ -20227,8 +20118,7 @@ "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "typedarray-to-buffer": { "version": "3.1.5", @@ -20267,7 +20157,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "requires": { "punycode": "^2.1.0" } @@ -20315,8 +20204,7 @@ "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" }, "v8-to-istanbul": { "version": "8.1.1", @@ -20430,7 +20318,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -20451,8 +20338,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, "wrap-ansi": { "version": "7.0.0", @@ -20467,8 +20353,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "3.0.3", diff --git a/clients/admin-ui/package.json b/clients/admin-ui/package.json index 2962c2f9e48..0b56a36b9f8 100644 --- a/clients/admin-ui/package.json +++ b/clients/admin-ui/package.json @@ -6,7 +6,7 @@ "dev:mock": "echo '🚨 Running with mock API'; NEXT_PUBLIC_MOCK_API=true next dev", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint . --ext .ts,.tsx", "test": "jest --watch", "analyze": "cross-env ANALYZE=true next build", "analyze:server": "cross-env BUNDLE_ANALYZE=server next build", @@ -26,6 +26,7 @@ "@reduxjs/toolkit": "^1.8.0", "date-fns": "^2.28.0", "date-fns-tz": "^1.3.1", + "eslint-plugin-simple-import-sort": "^7.0.0", "formik": "^2.2.9", "framer-motion": "^5", "lodash.debounce": "^4.0.8", From 51acf141260e696c6170e1209490432d3e7e00a3 Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 12:46:25 -0400 Subject: [PATCH 02/31] Run import sorting --- clients/admin-ui/src/app/hooks.ts | 1 + clients/admin-ui/src/app/store.ts | 2 +- clients/admin-ui/src/features/common/Header.tsx | 4 +++- .../admin-ui/src/features/common/Icon/index.tsx | 2 +- clients/admin-ui/src/features/user/user.slice.ts | 1 + clients/admin-ui/src/mocks/browser.ts | 1 + clients/admin-ui/src/mocks/server.ts | 1 + clients/admin-ui/src/pages/_app.tsx | 15 ++++++++------- clients/admin-ui/src/pages/index.tsx | 1 + clients/admin-ui/src/pages/login.tsx | 2 +- 10 files changed, 19 insertions(+), 11 deletions(-) diff --git a/clients/admin-ui/src/app/hooks.ts b/clients/admin-ui/src/app/hooks.ts index 2008e46759a..316e30dbc74 100644 --- a/clients/admin-ui/src/app/hooks.ts +++ b/clients/admin-ui/src/app/hooks.ts @@ -1,4 +1,5 @@ import { TypedUseSelectorHook, useSelector } from 'react-redux'; + import type { AppState } from './store'; // eslint-disable-next-line import/prefer-default-export diff --git a/clients/admin-ui/src/app/store.ts b/clients/admin-ui/src/app/store.ts index c98b2726b4d..d86818f53e6 100644 --- a/clients/admin-ui/src/app/store.ts +++ b/clients/admin-ui/src/app/store.ts @@ -1,7 +1,7 @@ import { configureStore } from '@reduxjs/toolkit'; +import { setupListeners } from '@reduxjs/toolkit/query/react'; import { createWrapper } from 'next-redux-wrapper'; -import { setupListeners } from '@reduxjs/toolkit/query/react'; import { reducer as userReducer } from '../features/user'; const makeStore = () => { diff --git a/clients/admin-ui/src/features/common/Header.tsx b/clients/admin-ui/src/features/common/Header.tsx index 9579b30cefd..8a5ce4cd2e7 100644 --- a/clients/admin-ui/src/features/common/Header.tsx +++ b/clients/admin-ui/src/features/common/Header.tsx @@ -3,12 +3,14 @@ import { Link, Menu, MenuButton, MenuDivider, MenuItem, MenuList, Stack, Text } from '@fidesui/react'; -import { signOut } from 'next-auth/react'; import NextLink from 'next/link'; +import { signOut } from 'next-auth/react'; import React from 'react'; + import { UserIcon } from './Icon'; + interface HeaderProps { username: string; } diff --git a/clients/admin-ui/src/features/common/Icon/index.tsx b/clients/admin-ui/src/features/common/Icon/index.tsx index d8358a51ff3..2d48232ce2e 100644 --- a/clients/admin-ui/src/features/common/Icon/index.tsx +++ b/clients/admin-ui/src/features/common/Icon/index.tsx @@ -2,6 +2,6 @@ export { default as ArrowDownLineIcon } from './ArrowDownLine'; export { default as CloseSolidIcon } from './CloseSolid'; export { default as DownloadSolidIcon } from './DownloadSolid'; export { default as GearIcon } from './Gear'; -export { default as UserIcon } from './User'; export { default as MoreIcon } from './More'; export { default as SearchLineIcon } from './SearchLine'; +export { default as UserIcon } from './User'; diff --git a/clients/admin-ui/src/features/user/user.slice.ts b/clients/admin-ui/src/features/user/user.slice.ts index b88da6c6f1d..bee771d1bb8 100644 --- a/clients/admin-ui/src/features/user/user.slice.ts +++ b/clients/admin-ui/src/features/user/user.slice.ts @@ -1,5 +1,6 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { HYDRATE } from 'next-redux-wrapper'; + import type { AppState } from '../../app/store'; export interface State { diff --git a/clients/admin-ui/src/mocks/browser.ts b/clients/admin-ui/src/mocks/browser.ts index 048e0fe71ae..04416ca93cf 100644 --- a/clients/admin-ui/src/mocks/browser.ts +++ b/clients/admin-ui/src/mocks/browser.ts @@ -1,4 +1,5 @@ import { setupWorker } from 'msw'; + import { handlers } from './handlers'; // eslint-disable-next-line import/prefer-default-export diff --git a/clients/admin-ui/src/mocks/server.ts b/clients/admin-ui/src/mocks/server.ts index 5ae4e58e742..f58358b55f6 100644 --- a/clients/admin-ui/src/mocks/server.ts +++ b/clients/admin-ui/src/mocks/server.ts @@ -1,4 +1,5 @@ import { setupServer } from 'msw/node'; + import { handlers } from './handlers'; // eslint-disable-next-line import/prefer-default-export diff --git a/clients/admin-ui/src/pages/_app.tsx b/clients/admin-ui/src/pages/_app.tsx index 9ad01ccfe47..0ca79d64677 100644 --- a/clients/admin-ui/src/pages/_app.tsx +++ b/clients/admin-ui/src/pages/_app.tsx @@ -1,14 +1,15 @@ -import React from 'react'; -import type { AppProps } from 'next/app'; -import { SessionProvider } from 'next-auth/react'; -import { ChakraProvider } from '@chakra-ui/react'; -import theme from '../theme'; -import { wrapper } from '../app/store'; - import '@fontsource/inter/400.css'; import '@fontsource/inter/500.css'; import '@fontsource/inter/700.css'; +import { ChakraProvider } from '@chakra-ui/react'; +import type { AppProps } from 'next/app'; +import { SessionProvider } from 'next-auth/react'; +import React from 'react'; + +import { wrapper } from '../app/store'; +import theme from '../theme'; + if (process.env.NEXT_PUBLIC_MOCK_API) { // eslint-disable-next-line global-require require('../mocks'); diff --git a/clients/admin-ui/src/pages/index.tsx b/clients/admin-ui/src/pages/index.tsx index 9902dd3f3b2..83779c5c065 100644 --- a/clients/admin-ui/src/pages/index.tsx +++ b/clients/admin-ui/src/pages/index.tsx @@ -2,6 +2,7 @@ import { Box, Button, Flex, Heading } from '@fidesui/react'; import type { NextPage } from 'next'; import Head from 'next/head'; import React from 'react'; + import Header from '../features/common/Header'; import { ArrowDownLineIcon } from '../features/common/Icon'; diff --git a/clients/admin-ui/src/pages/login.tsx b/clients/admin-ui/src/pages/login.tsx index 16bf88f5e29..0eaee6cb04e 100644 --- a/clients/admin-ui/src/pages/login.tsx +++ b/clients/admin-ui/src/pages/login.tsx @@ -3,9 +3,9 @@ import { } from '@fidesui/react'; import { useFormik } from 'formik'; import type { NextPage } from 'next'; -import { signIn } from 'next-auth/react'; import Head from 'next/head'; import { useRouter } from 'next/router'; +import { signIn } from 'next-auth/react'; import React, { useState } from 'react'; From d70341d74dee139bce0080f90f376261e7f216b1 Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 12:46:32 -0400 Subject: [PATCH 03/31] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ff7674e77c..c5cacf23cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The types of changes are: * Initial scaffolding of management UI [#561](https://github.com/ethyca/fides/pull/624) * UI static assets are now built with the docker container [#663](https://github.com/ethyca/fides/issues/663) * Host static files via fidesapi [#621](https://github.com/ethyca/fides/pull/621) +* Minimal page for displaying datasets ### Changed From 8fdfd6470445235c3fa4747947e4e488fef88972 Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 14:06:00 -0400 Subject: [PATCH 04/31] Use baseurl for easier imports --- clients/admin-ui/src/pages/_app.tsx | 4 ++-- clients/admin-ui/src/pages/index.tsx | 7 ++----- clients/admin-ui/tsconfig.json | 27 ++++++++++++++++++++++----- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/clients/admin-ui/src/pages/_app.tsx b/clients/admin-ui/src/pages/_app.tsx index 0ca79d64677..b74d2bd3e38 100644 --- a/clients/admin-ui/src/pages/_app.tsx +++ b/clients/admin-ui/src/pages/_app.tsx @@ -7,8 +7,8 @@ import type { AppProps } from 'next/app'; import { SessionProvider } from 'next-auth/react'; import React from 'react'; -import { wrapper } from '../app/store'; -import theme from '../theme'; +import { wrapper } from '@/app/store'; +import theme from '@/theme'; if (process.env.NEXT_PUBLIC_MOCK_API) { // eslint-disable-next-line global-require diff --git a/clients/admin-ui/src/pages/index.tsx b/clients/admin-ui/src/pages/index.tsx index 83779c5c065..2c489902ae3 100644 --- a/clients/admin-ui/src/pages/index.tsx +++ b/clients/admin-ui/src/pages/index.tsx @@ -3,11 +3,8 @@ import type { NextPage } from 'next'; import Head from 'next/head'; import React from 'react'; -import Header from '../features/common/Header'; -import { ArrowDownLineIcon } from '../features/common/Icon'; - - - +import Header from '@/features/common/Header'; +import { ArrowDownLineIcon } from '@/features/common/Icon'; const Home: NextPage<{ session: { username: string } }> = ({ session }) => (
diff --git a/clients/admin-ui/tsconfig.json b/clients/admin-ui/tsconfig.json index 42e242bb59e..e59b69a1433 100644 --- a/clients/admin-ui/tsconfig.json +++ b/clients/admin-ui/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -13,8 +17,21 @@ "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", - "incremental": true + "incremental": true, + "baseUrl": ".", + "paths": { + "@/*": [ + "src/*" + ] + } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts"], - "exclude": ["node_modules"] -} + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + "**/*.d.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file From 85b32564d09366f06aafcc126f20ed4aada71f6d Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 14:27:38 -0400 Subject: [PATCH 05/31] Add prettier --- clients/admin-ui/.prettierrc.json | 3 +++ clients/admin-ui/package-lock.json | 20 ++++++++++++++++++++ clients/admin-ui/package.json | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 clients/admin-ui/.prettierrc.json diff --git a/clients/admin-ui/.prettierrc.json b/clients/admin-ui/.prettierrc.json new file mode 100644 index 00000000000..82f57e97611 --- /dev/null +++ b/clients/admin-ui/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "tabWidth": 2 +} \ No newline at end of file diff --git a/clients/admin-ui/package-lock.json b/clients/admin-ui/package-lock.json index e4191f8325e..3cf0942583b 100644 --- a/clients/admin-ui/package-lock.json +++ b/clients/admin-ui/package-lock.json @@ -24,6 +24,7 @@ "next": "12.1.0", "next-auth": "^4.2.1", "next-redux-wrapper": "^7.0.5", + "prettier": "^2.6.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-redux": "^7.2.6", @@ -10226,6 +10227,20 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-format": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", @@ -19309,6 +19324,11 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, + "prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==" + }, "pretty-format": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", diff --git a/clients/admin-ui/package.json b/clients/admin-ui/package.json index 0b56a36b9f8..fb08e17d2e1 100644 --- a/clients/admin-ui/package.json +++ b/clients/admin-ui/package.json @@ -34,6 +34,7 @@ "next": "12.1.0", "next-auth": "^4.2.1", "next-redux-wrapper": "^7.0.5", + "prettier": "^2.6.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-redux": "^7.2.6", @@ -66,4 +67,4 @@ "msw": { "workerDirectory": "public" } -} \ No newline at end of file +} From 657a1ffe79023d438bdbda6c83f8cb20fdadca99 Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 16:32:57 -0400 Subject: [PATCH 06/31] Simplify components via a Layout component --- .../admin-ui/src/features/common/Header.tsx | 27 ++++--- .../admin-ui/src/features/common/Layout.tsx | 29 ++++++++ .../admin-ui/src/features/common/NavBar.tsx | 73 +++++++++++++++++++ clients/admin-ui/src/pages/datasets/index.tsx | 15 ++++ clients/admin-ui/src/pages/index.tsx | 52 +++---------- 5 files changed, 143 insertions(+), 53 deletions(-) create mode 100644 clients/admin-ui/src/features/common/Layout.tsx create mode 100644 clients/admin-ui/src/features/common/NavBar.tsx create mode 100644 clients/admin-ui/src/pages/datasets/index.tsx diff --git a/clients/admin-ui/src/features/common/Header.tsx b/clients/admin-ui/src/features/common/Header.tsx index 8a5ce4cd2e7..486ee452f36 100644 --- a/clients/admin-ui/src/features/common/Header.tsx +++ b/clients/admin-ui/src/features/common/Header.tsx @@ -1,15 +1,20 @@ import { - Button, Flex, - Link, Menu, - MenuButton, MenuDivider, MenuItem, MenuList, Stack, Text -} from '@fidesui/react'; -import NextLink from 'next/link'; -import { signOut } from 'next-auth/react'; -import React from 'react'; - -import { UserIcon } from './Icon'; - + Button, + Flex, + Link, + Menu, + MenuButton, + MenuDivider, + MenuItem, + MenuList, + Stack, + Text, +} from "@fidesui/react"; +import NextLink from "next/link"; +import { signOut } from "next-auth/react"; +import React from "react"; +import { UserIcon } from "./Icon"; interface HeaderProps { username: string; @@ -46,7 +51,7 @@ const Header: React.FC = ({ username }) => ( signOut()} > Sign out diff --git a/clients/admin-ui/src/features/common/Layout.tsx b/clients/admin-ui/src/features/common/Layout.tsx new file mode 100644 index 00000000000..0afb6fcf12a --- /dev/null +++ b/clients/admin-ui/src/features/common/Layout.tsx @@ -0,0 +1,29 @@ +import { Box } from "@fidesui/react"; +import Head from "next/head"; +import React from "react"; + +import NavBar from "./NavBar"; + +const Layout = ({ + title, + children, +}: { + title: string; + children: React.ReactNode; +}) => ( +
+ + Fides Admin UI - {title} + + + + +
+ + {children} + +
+
+); + +export default Layout; diff --git a/clients/admin-ui/src/features/common/NavBar.tsx b/clients/admin-ui/src/features/common/NavBar.tsx new file mode 100644 index 00000000000..59cba0ca377 --- /dev/null +++ b/clients/admin-ui/src/features/common/NavBar.tsx @@ -0,0 +1,73 @@ +import { Button, Flex } from "@fidesui/react"; +import NextLink from "next/link"; +import { useRouter } from "next/router"; +import { useSession } from "next-auth/react"; +import React, { ReactElement } from "react"; + +import { ArrowDownLineIcon } from "@/features/common/Icon"; + +import Header from "./Header"; + +interface NavLinkProps { + title: string; + href: string; + disabled?: boolean; + rightIcon?: ReactElement; + exact?: boolean; +} +const NavLink = ({ title, href, disabled, rightIcon, exact }: NavLinkProps) => { + const router = useRouter(); + let isActive = false; + if (exact) { + isActive = router.pathname === href; + } else { + isActive = router.pathname.startsWith(href); + } + return ( + + + + ); +}; + +const NavBar = () => { + const { data: session } = useSession(); + const username: string | any = session?.username; + + return ( + <> +
+ + + + + + + } + disabled + /> + + + ); +}; + +export default NavBar; diff --git a/clients/admin-ui/src/pages/datasets/index.tsx b/clients/admin-ui/src/pages/datasets/index.tsx new file mode 100644 index 00000000000..29393c33e0c --- /dev/null +++ b/clients/admin-ui/src/pages/datasets/index.tsx @@ -0,0 +1,15 @@ +import { Heading } from "@fidesui/react"; +import type { NextPage } from "next"; +import React from "react"; + +import Layout from "@/features/common/Layout"; + +const DataSets: NextPage = () => ( + + + Datasets + + +); + +export default DataSets; diff --git a/clients/admin-ui/src/pages/index.tsx b/clients/admin-ui/src/pages/index.tsx index 2c489902ae3..4f4dea6534e 100644 --- a/clients/admin-ui/src/pages/index.tsx +++ b/clients/admin-ui/src/pages/index.tsx @@ -1,49 +1,17 @@ -import { Box, Button, Flex, Heading } from '@fidesui/react'; -import type { NextPage } from 'next'; -import Head from 'next/head'; -import React from 'react'; +import { Box, Heading } from "@fidesui/react"; +import type { NextPage } from "next"; +import React from "react"; -import Header from '@/features/common/Header'; -import { ArrowDownLineIcon } from '@/features/common/Icon'; - -const Home: NextPage<{ session: { username: string } }> = ({ session }) => ( -
- - Fides Admin UI - - - - -
+import Layout from "@/features/common/Layout"; +const Home: NextPage = () => ( +
- - - - - - - - - Subject Requests - - + + Welcome home! +
-
+ ); // TODO: replace auth https://github.com/ethyca/fidesui/issues/2 From 189052d7af100e0e2180c0dfc5b5ec91d9573afc Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 17:08:25 -0400 Subject: [PATCH 07/31] Add testing to the NavBar --- clients/admin-ui/.eslintrc.json | 22 +++++-------- clients/admin-ui/__tests__/index.test.tsx | 13 ++++---- clients/admin-ui/__tests__/nav.test.tsx | 33 +++++++++++++++++++ clients/admin-ui/jest.config.js | 31 ++++++++--------- .../admin-ui/src/features/common/NavBar.tsx | 25 +++++++------- clients/admin-ui/src/test-utils.tsx | 28 ++++++++++++++++ 6 files changed, 106 insertions(+), 46 deletions(-) create mode 100644 clients/admin-ui/__tests__/nav.test.tsx create mode 100644 clients/admin-ui/src/test-utils.tsx diff --git a/clients/admin-ui/.eslintrc.json b/clients/admin-ui/.eslintrc.json index f805d8f7e88..2d88a04aeaf 100644 --- a/clients/admin-ui/.eslintrc.json +++ b/clients/admin-ui/.eslintrc.json @@ -5,9 +5,7 @@ "prettier", "next/core-web-vitals" ], - "plugins": [ - "simple-import-sort" - ], + "plugins": ["simple-import-sort"], "root": true, "parserOptions": { "project": "./tsconfig.json" @@ -15,9 +13,7 @@ "rules": { // causes bug in re-exporting default exports, see // https://github.com/eslint/eslint/issues/15617 - "no-restricted-exports": [ - 0 - ], + "no-restricted-exports": [0], "react/function-component-definition": [ 2, { @@ -27,17 +23,15 @@ "react/jsx-filename-extension": [ 1, { - "extensions": [ - ".tsx" - ] + "extensions": [".tsx"] } ], - "react/jsx-props-no-spreading": [ - 0 - ], + "react/jsx-props-no-spreading": [0], "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", // since we are using static site export - "@next/next/no-img-element": "off" + "@next/next/no-img-element": "off", + // since defaultProps are deprecated for function components + "react/require-default-props": "off" } -} \ No newline at end of file +} diff --git a/clients/admin-ui/__tests__/index.test.tsx b/clients/admin-ui/__tests__/index.test.tsx index e41a355c928..edb12bfb7f9 100644 --- a/clients/admin-ui/__tests__/index.test.tsx +++ b/clients/admin-ui/__tests__/index.test.tsx @@ -1,18 +1,19 @@ // __tests__/index.test.tsx -import { render, screen } from '@testing-library/react'; -import { SessionProvider } from 'next-auth/react'; +import { render, screen } from "@testing-library/react"; +import { SessionProvider } from "next-auth/react"; -import Home from '../src/pages/index'; +import Home from "../src/pages/index"; -describe('Home', () => { - it('renders a logged out notification when no session is present', () => { +describe("Home", () => { + // skip until this is fixed in fidesops + it.skip("renders a logged out notification when no session is present", () => { render( ); - const message = screen.getByText('You are not logged in.'); + const message = screen.getByText("You are not logged in."); expect(message).toBeInTheDocument(); }); }); diff --git a/clients/admin-ui/__tests__/nav.test.tsx b/clients/admin-ui/__tests__/nav.test.tsx new file mode 100644 index 00000000000..ac54a870c56 --- /dev/null +++ b/clients/admin-ui/__tests__/nav.test.tsx @@ -0,0 +1,33 @@ +import { render } from "@testing-library/react"; +import { SessionProvider } from "next-auth/react"; + +import NavBar from "@/features/common/NavBar"; +import { mockNextUseRouter } from "@/test-utils"; + +describe("Home", () => { + it("renders a navigation bar", () => { + mockNextUseRouter({ route: "/" }); + const { getByTestId } = render( + + + + ); + expect(getByTestId("nav-link-Systems")).toBeInTheDocument(); + expect(getByTestId("nav-link-Datasets")).toBeInTheDocument(); + expect(getByTestId("nav-link-Policies")).toBeInTheDocument(); + expect(getByTestId("nav-link-Taxonomy")).toBeInTheDocument(); + expect(getByTestId("nav-link-User Management")).toBeInTheDocument(); + expect(getByTestId("nav-link-More")).toBeInTheDocument(); + }); + + it("renders a nav link as active if at the proper route", () => { + mockNextUseRouter({ route: "/datasets", pathname: "/datasets" }); + const { getByTestId } = render( + + + + ); + expect(getByTestId("nav-link-Systems")).not.toHaveAttribute("data-active"); + expect(getByTestId("nav-link-Datasets")).toHaveAttribute("data-active"); + }); +}); diff --git a/clients/admin-ui/jest.config.js b/clients/admin-ui/jest.config.js index 0b95f5a9994..2055b219b14 100644 --- a/clients/admin-ui/jest.config.js +++ b/clients/admin-ui/jest.config.js @@ -1,40 +1,41 @@ // jest.config.js module.exports = { collectCoverageFrom: [ - '**/*.{js,jsx,ts,tsx}', - '!**/*.d.ts', - '!**/node_modules/**', + "**/*.{js,jsx,ts,tsx}", + "!**/*.d.ts", + "!**/node_modules/**", ], moduleNameMapper: { // Handle CSS imports (with CSS modules) // https://jestjs.io/docs/webpack#mocking-css-modules - '^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy', + "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy", // Handle CSS imports (without CSS modules) - '^.+\\.(css|sass|scss)$': '/__mocks__/styleMock.js', + "^.+\\.(css|sass|scss)$": "/__mocks__/styleMock.js", // Handle image imports // https://jestjs.io/docs/webpack#handling-static-assets - '^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i': `/__mocks__/fileMock.js`, + "^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i": `/__mocks__/fileMock.js`, // Handle module aliases - '^@/components/(.*)$': '/components/$1', + "^@/components/(.*)$": "/components/$1", + "^@/(.*)$": "/src/$1", }, // Add more setup options before each test is run - setupFilesAfterEnv: ['/__tests__/jest.setup.ts'], + setupFilesAfterEnv: ["/__tests__/jest.setup.ts"], testPathIgnorePatterns: [ - '/node_modules/', - '/.next/', - 'jest.setup.ts', + "/node_modules/", + "/.next/", + "jest.setup.ts", ], - testEnvironment: 'jsdom', + testEnvironment: "jsdom", transform: { // Use babel-jest to transpile tests with the next/babel preset // https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object - '^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }], + "^.+\\.(js|jsx|ts|tsx)$": ["babel-jest", { presets: ["next/babel"] }], }, transformIgnorePatterns: [ - '/node_modules/', - '^.+\\.module\\.(css|sass|scss)$', + "/node_modules/", + "^.+\\.module\\.(css|sass|scss)$", ], }; diff --git a/clients/admin-ui/src/features/common/NavBar.tsx b/clients/admin-ui/src/features/common/NavBar.tsx index 59cba0ca377..eea6f3607b6 100644 --- a/clients/admin-ui/src/features/common/NavBar.tsx +++ b/clients/admin-ui/src/features/common/NavBar.tsx @@ -33,6 +33,7 @@ const NavLink = ({ title, href, disabled, rightIcon, exact }: NavLinkProps) => { colorScheme={isActive ? "complimentary" : "ghost"} rightIcon={rightIcon} data-testid={`nav-link-${title}`} + isActive={isActive} > {title} @@ -54,17 +55,19 @@ const NavBar = () => { py={1} borderColor="gray.100" > - - - - - - } - disabled - /> + ); diff --git a/clients/admin-ui/src/test-utils.tsx b/clients/admin-ui/src/test-utils.tsx new file mode 100644 index 00000000000..c12abaed81a --- /dev/null +++ b/clients/admin-ui/src/test-utils.tsx @@ -0,0 +1,28 @@ +// Mocks useRouter +const useRouter = jest.spyOn(require("next/router"), "useRouter"); + +/** + * mockNextUseRouter + * Mocks the useRouter React hook from Next.js on a test-case by test-case basis + * Adapted from https://github.com/vercel/next.js/issues/7479#issuecomment-587145429 + */ +// we will probably have more than just this in this utils file, so keep it as a non-default export for now +// eslint-disable-next-line import/prefer-default-export +export function mockNextUseRouter({ + route = "/", + pathname = "/", + query = "/", + asPath = "/", +}: { + route?: string; + pathname?: string; + query?: string; + asPath?: string; +}) { + useRouter.mockImplementation(() => ({ + route, + pathname, + query, + asPath, + })); +} From c6d43ed27f41580a096bad0a632c875dd97f3863 Mon Sep 17 00:00:00 2001 From: Allison King Date: Thu, 19 May 2022 17:21:35 -0400 Subject: [PATCH 08/31] Fix pluralization in routes --- clients/admin-ui/src/features/common/NavBar.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/admin-ui/src/features/common/NavBar.tsx b/clients/admin-ui/src/features/common/NavBar.tsx index eea6f3607b6..a0272bd8074 100644 --- a/clients/admin-ui/src/features/common/NavBar.tsx +++ b/clients/admin-ui/src/features/common/NavBar.tsx @@ -56,9 +56,9 @@ const NavBar = () => { borderColor="gray.100" >