From 0545b54daf779a1c6ecbbd66a84e992fc73de8b9 Mon Sep 17 00:00:00 2001 From: John Wu <76966357+jwu-fisker@users.noreply.github.com> Date: Mon, 9 Aug 2021 08:54:48 -0700 Subject: [PATCH] CEC-377 Create multi-file updates (#71) * Replace Deploy Package with Deploy Manifest page Stub new controls for package files * Add Release notes and ECU FIles to Create Manifest * Add Release notes and ECU FIles to Create Manifest * Oops * Replace multi release notes with single url * Implement multiple file uploads and progress * Update snapshots * Unused import * Move file to end of form Update progress layout --- package-lock.json | 32 +- package.json | 6 +- src/components/App/App.test.js | 52 +- .../App/__snapshots__/App.test.js.snap | 2698 ++++++----------- src/components/Contexts/ManifestsContext.jsx | 145 + src/components/Controls/SubList/index.jsx | 45 + src/components/Controls/SubListItem/index.jsx | 58 + src/components/Layouts/SideMenu.jsx | 11 +- .../__snapshots__/SideMenu.test.jsx.snap | 26 +- src/components/Manifest/Create/index.jsx | 253 ++ src/components/Manifest/Deploy/index.jsx | 2 +- .../Manifest/ECUFilesList/index.jsx | 37 + src/components/Manifest/List/index.jsx | 6 +- .../Manifest/ReleaseNotesList/index.jsx | 28 + src/components/Routes/SiteRoutes.jsx | 33 +- .../Create/__snapshots__/Create.test.js.snap | 16 +- src/components/useStyles.jsx | 6 +- src/services/manifests.js | 7 + src/services/uploadFile.js | 15 +- 19 files changed, 1533 insertions(+), 1943 deletions(-) create mode 100644 src/components/Controls/SubList/index.jsx create mode 100644 src/components/Controls/SubListItem/index.jsx create mode 100644 src/components/Manifest/Create/index.jsx create mode 100644 src/components/Manifest/ECUFilesList/index.jsx create mode 100644 src/components/Manifest/ReleaseNotesList/index.jsx diff --git a/package-lock.json b/package-lock.json index 1e72216..831b543 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1275,9 +1275,9 @@ "integrity": "sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==" }, "@datadog/browser-core": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@datadog/browser-core/-/browser-core-2.17.0.tgz", - "integrity": "sha512-jGIiVIzxdfQ+FnuFY+tC/j4gBFmK74xW/NIVqHIdN/hbGqA0oXOYs3Qof39ILLhXM5+zxa44RYFY6r/9JaxMIg==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@datadog/browser-core/-/browser-core-2.18.0.tgz", + "integrity": "sha512-1RvxLK8TiuAaDrwkrlOg7wM+7FilJtNbC30h5BxoGChWEBB7QsgeYGnliQ60byZUCzhbvARVzHHNZTxUiP+fPQ==", "requires": { "tslib": "^1.10.0" }, @@ -1290,11 +1290,11 @@ } }, "@datadog/browser-logs": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@datadog/browser-logs/-/browser-logs-2.17.0.tgz", - "integrity": "sha512-2S6ryflc28EErDJ+SgWo2OdkvWQ5KA5uqzzvbcnEBeFQpAV5ukAIfElHLiQrwSF4J6NkfLFA3tLt6KPGZE5F2w==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@datadog/browser-logs/-/browser-logs-2.18.0.tgz", + "integrity": "sha512-bDT5YkPNHGZmjADXtsVtwSyL+/J7MA4k2mBcHzutXK7/tKrIRiKH6ygHiBRryNHfD7/Q79tZqJzi32kSZy3AAA==", "requires": { - "@datadog/browser-core": "2.17.0", + "@datadog/browser-core": "2.18.0", "tslib": "^1.10.0" }, "dependencies": { @@ -1776,9 +1776,9 @@ } }, "@material-ui/core": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.1.tgz", - "integrity": "sha512-C6hYsjkWCTfBx9FaqxhCZCITBagh7fyCKFtHyvO3tTOcBw6NJaktdhNZ2n82jQdQdgfFvg6OOxi7OOzsAdAcBQ==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.3.tgz", + "integrity": "sha512-sdpgI/PL56QVsEJldwEe4FFaFTLUqN+rd7sSZiRCdx2E/C7z5yK0y/khAWVBH24tXwto7I1hCzNWfJGZIYJKnw==", "requires": { "@babel/runtime": "^7.4.4", "@material-ui/styles": "^4.11.4", @@ -2305,9 +2305,9 @@ "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==" }, "@types/react": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.14.tgz", - "integrity": "sha512-0WwKHUbWuQWOce61UexYuWTGuGY/8JvtUe/dtQ6lR4sZ3UiylHotJeWpf3ArP9+DSGUoLY3wbU59VyMrJps5VQ==", + "version": "17.0.15", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.15.tgz", + "integrity": "sha512-uTKHDK9STXFHLaKv6IMnwp52fm0hwU+N89w/p9grdUqcFA6WuqDyPhaWopbNyE1k/VhgzmHl8pu1L4wITtmlLw==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -12164,9 +12164,9 @@ "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==" }, "react-leaflet": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-3.2.0.tgz", - "integrity": "sha512-eHVqoRGjW8T9GxLt7jyTKP3BDQ7XQ5AD+tc/zkbaABn1dbmREDy8GojNcYjZQa3QFLQoOLQMcUC1PTtzytZpUA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-3.2.1.tgz", + "integrity": "sha512-3iS1fpOO+uaRpbuq68Euw9kgaoM9oIGBiDfeFtVb/C9PWBQvXdrv1n946Z8GrbQEhrT+hM9ND6NLLF9fGxTGRw==", "requires": { "@react-leaflet/core": "^1.1.0" } diff --git a/package.json b/package.json index 470e9c4..ba5ef47 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "version": "0.1.1", "private": true, "dependencies": { - "@datadog/browser-logs": "^2.17.0", + "@datadog/browser-logs": "^2.18.0", "@datadog/browser-rum": "^2.17.0", - "@material-ui/core": "^4.12.1", + "@material-ui/core": "^4.12.3", "@material-ui/icons": "^4.11.2", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^11.2.7", @@ -16,7 +16,7 @@ "material-ui-dropzone": "^3.5.0", "react": "^17.0.2", "react-dom": "^17.0.2", - "react-leaflet": "^3.2.0", + "react-leaflet": "^3.2.1", "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", "web-vitals": "^0.2.4" diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index e3931ff..346cb4a 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -64,18 +64,10 @@ describe("App", () => { await check("/home", "span.MuiButton-label", "Sign In"); }); - it("Route /package-upload unauthenticated", async () => { - await check("/package-upload", "span.MuiButton-label", "Sign In"); - }); - it("Route /vehicle-add unauthenticated", async () => { await check("/vehicle-add", "span.MuiButton-label", "Sign In"); }); - it("Route /updates unauthenticated", async () => { - await check("/updates", "span.MuiButton-label", "Sign In"); - }); - it("Route /carupdate-deploy unauthenticated", async () => { await check("/carupdate-deploy/1", "span.MuiButton-label", "Sign In"); }); @@ -100,16 +92,20 @@ describe("App", () => { await check("/dashboard", "span.MuiButton-label", "Sign In"); }); - it("Route /manifests unauthenticated", async () => { - await check("/manifests", "span.MuiButton-label", "Sign In"); + it("Route /packages unauthenticated", async () => { + await check("/packages", "span.MuiButton-label", "Sign In"); }); - it("Route /manifest-status unauthenticated", async () => { - await check("/manifest-status/1", "span.MuiButton-label", "Sign In"); + it("Route /package-status unauthenticated", async () => { + await check("/package-status/1", "span.MuiButton-label", "Sign In"); }); - it("Route /manifest-deploy unauthenticated", async () => { - await check("/manifest-deploy/1", "span.MuiButton-label", "Sign In"); + it("Route /package-deploy unauthenticated", async () => { + await check("/package-deploy/1", "span.MuiButton-label", "Sign In"); + }); + + it("Route /package-create unauthenticated", async () => { + await check("/package-create", "span.MuiButton-label", "Sign In"); }); it("Route / authenticated", async () => { @@ -122,21 +118,11 @@ describe("App", () => { await sleepAndCheck("/home", "h1", "Welcome John!"); }); - it("Route /package-upload authenticated", async () => { - setToken(TEST_AUTH_OBJECT); - await check("/package-upload", "h6", "Create Update Package"); - }); - it("Route /vehicle-add authenticated", async () => { setToken(TEST_AUTH_OBJECT); await check("/vehicle-add", "h6", "Add Vehicle"); }); - it("Route /updates authenticated", async () => { - setToken(TEST_AUTH_OBJECT); - await check("/updates", "h6", "Deploy Packages"); - }); - it("Route /carupdate-status authenticated", async () => { setToken(TEST_AUTH_OBJECT); await check("/carupdate-status/1", "h6", "Package Package 1.0"); @@ -176,18 +162,24 @@ describe("App", () => { await check("/dashboard", "h6", "Dashboard"); }); - it("Route /manifests authenticated", async () => { + it("Route /packages authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/manifests", "h6", "Deploy Manifest"); + await check("/packages", "h6", "Deploy Packages"); }); - it("Route /manifest-status authenticated", async () => { + it("Route /package-status authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/manifest-status/1", "h6", "Manifest Test Manifest 1.0"); + await check("/package-status/1", "h6", "Manifest Test Manifest 1.0"); }); - it("Route /manifest-deploy authenticated", async () => { + it("Route /package-deploy authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/manifest-deploy/1", "h6", "Deploy Test Manifest 1.0"); + await check("/package-deploy/1", "h6", "Deploy Test Manifest 1.0"); }); + + it("Route /package-create authenticated", async () => { + setToken(TEST_AUTH_OBJECT); + await check("/package-create", "h6", "Create Package"); + }); + }); diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index 180e523..7ee5a7c 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -6,10 +6,10 @@ exports[`App Route / authenticated 1`] = ` data-testid="mocked-userprovider" >

Welcome John!

@@ -450,10 +428,10 @@ exports[`App Route /carupdate-deploy authenticated 1`] = ` data-testid="mocked-userprovider" >

0 Selected
@@ -777,7 +733,7 @@ exports[`App Route /carupdate-deploy authenticated 1`] = ` style="text-align: right;" >
VIN sorted ascending @@ -1130,10 +1086,10 @@ exports[`App Route /carupdate-deploy unauthenticated 1`] = ` data-testid="mocked-userprovider" >
@@ -1670,10 +1604,10 @@ exports[`App Route /dashboard authenticated 1`] = ` data-testid="mocked-userprovider" >