diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index ee254b4..8878484 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -3359,10 +3359,52 @@ exports[`App Route /package-deploy authenticated 1`] = `
+
+ +
+ + {data && data.map((item, index) => ( + + ))} + + + ); +} \ No newline at end of file diff --git a/src/components/DigitalTwin/index.js b/src/components/DigitalTwin/index.js index 8367a10..d581c9b 100644 --- a/src/components/DigitalTwin/index.js +++ b/src/components/DigitalTwin/index.js @@ -1,7 +1,7 @@ import React from "react"; import { LocalDateTimeString } from "../../utils/dates"; -import { ValidateLocationByParam } from "../../utils/locations" +import { ValidateLocationByParam } from "../../utils/locations"; import useStyles from "../useStyles"; const keyValueTemplate = (key, value) => ( @@ -58,11 +58,10 @@ const DigitalTwin = (props) => {

Misc Windows

{Object.entries(misc_windows).map((value) => { - if (value[1] === 0) { - return keyValueTemplate(value[0], "closed"); + if (value[1] === 0 || value[1] > 100) { + return keyValueTemplate(value[0], `closed ${value[1]}%`); } else { - const percentOpen = Math.min(value[1], 100); - return keyValueTemplate(value[0], `${percentOpen}% open`); + return keyValueTemplate(value[0], `${value[1]}% open`); } })}
diff --git a/src/components/Magna/SecurityDLL/__snapshots__/index.test.jsx.snap b/src/components/Magna/SecurityDLL/__snapshots__/index.test.jsx.snap index 74b39c3..e4bddae 100644 --- a/src/components/Magna/SecurityDLL/__snapshots__/index.test.jsx.snap +++ b/src/components/Magna/SecurityDLL/__snapshots__/index.test.jsx.snap @@ -10,7 +10,7 @@ exports[`Magna Security DLL page Security DLL Result page 1`] = ` Important Note: - Certificates expire in one month from the time they are generated. They have to be re-downloaded again to connect to the Fisker cloud. + Certificates expire in 3 months from the time they are generated. They have to be re-downloaded again to connect to the Fisker cloud.

  • diff --git a/src/components/Magna/SecurityDLL/result.jsx b/src/components/Magna/SecurityDLL/result.jsx index f26ba06..c7bb3c8 100644 --- a/src/components/Magna/SecurityDLL/result.jsx +++ b/src/components/Magna/SecurityDLL/result.jsx @@ -9,7 +9,7 @@ const Result = ({ public_key, private_key }) => ( <>

    Please click the links below to download the certificate.pem, key.pem and the security.dll (either the 32-bit or 64-bit version to match your application). Install all files in the same folder, and then run your application of choice to connect to the Fisker cloud.

    -

    Important Note: Certificates expire in one month from the time they are generated. They have to be re-downloaded again to connect to the Fisker cloud.

    +

    Important Note: Certificates expire in 3 months from the time they are generated. They have to be re-downloaded again to connect to the Fisker cloud.

    • { const [updateType, setUpdateType] = useState(CAR_UPDATE); const {manifest_id} = useParams(); const {getManifests, manifests, busy} = useManifestsContext(); - const {deployCarUpdates, deployFleetUpdates} = useCarUpdatesContext(); + const {deployCarUpdates, deployFleetUpdates, getSUMSVersions, versions, updateSUMSVersion} = useCarUpdatesContext(); const { groups, providers, @@ -36,9 +37,11 @@ const MainForm = () => { const {setMessage, setTitle, setSitePath} = useStatusContext(); const [manifestName, setManifestName] = useState(""); const [version, setVersion] = useState(""); + const [sumsVersion, setSUMSersion] = useState(""); const [createDate, setCreateDate] = useState(""); const [selected, setSelected] = useState([]); const [search, setSearch] = useState(""); + const [softwareVersion, setSoftwareVersion] = useState(SELECT_VERSION); const [redirect, setRedirect] = useState(""); const classes = useStyles(); @@ -77,6 +80,10 @@ const MainForm = () => { const data = { manifest_id: parseInt(manifest_id), } + if (sumsVersion.length === 0) { + await updateSUMSVersion(manifest_id, softwareVersion, token); + } + if (updateType === CAR_UPDATE) { data.vins = selected; await deployCarUpdates(data, token); @@ -96,13 +103,18 @@ const MainForm = () => { const getData = async () => { try { - getManifests({id: parseInt(manifest_id)}, token); + await getManifests({id: parseInt(manifest_id)}, token); + await getSUMSVersions(token); } catch (e) { setMessage(e.message); logger.warn(e.stack); } }; + const changeVersion = (e) => { + setSoftwareVersion(e.target.value); + } + useEffect(() => { getData(); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -129,6 +141,7 @@ const MainForm = () => { setManifestName(data.name); setVersion(data.version); + setSUMSersion(data.sums || ""); setCreateDate(LocalDateTimeString(data.created)); }, [manifests]); @@ -162,16 +175,24 @@ const MainForm = () => { - + + {sumsVersion.length === 0 && + + } @@ -210,4 +231,4 @@ const ManifestDeployForm = () => ( ); -export default ManifestDeployForm; +export default ManifestDeployForm; \ No newline at end of file diff --git a/src/components/Manifest/List/index.jsx b/src/components/Manifest/List/index.jsx index 6cc34ad..bbb7d65 100644 --- a/src/components/Manifest/List/index.jsx +++ b/src/components/Manifest/List/index.jsx @@ -6,15 +6,15 @@ import { TableFooter, TablePagination, TableRow, - Tooltip, + Tooltip } from "@material-ui/core"; -import { - ToggleButton, - ToggleButtonGroup -} from "@mui/material" import DeleteIcon from "@material-ui/icons/Delete"; import SendIcon from "@material-ui/icons/Send"; import VisibilityIcon from "@material-ui/icons/Visibility"; +import { + ToggleButton, + ToggleButtonGroup +} from "@mui/material"; import clsx from "clsx"; import React, { useEffect, useState } from "react"; import { Link } from "react-router-dom"; @@ -26,7 +26,7 @@ import { TYPE_MANIFEST_SOFTWARE } from "../../../utils/manifest_types"; import { hasRole, Permissions } from "../../../utils/roles"; import { ManifestsProvider, - useManifestsContext, + useManifestsContext } from "../../Contexts/ManifestsContext"; import { useStatusContext } from "../../Contexts/StatusContext"; import { useUserContext } from "../../Contexts/UserContext"; @@ -50,6 +50,10 @@ const tableColumns = [ id: "version", label: "Version", }, + { + id: "sums", + label: "SUMS", + }, { id: "type", label: "Type", @@ -280,6 +284,7 @@ const MainForm = () => { )} {row.version} + {row.sums} {formatManifestType(row.type)} @@ -297,7 +302,7 @@ const MainForm = () => { ( ); -export default ManifestsList; +export default ManifestsList; \ No newline at end of file diff --git a/src/components/Manifest/Update/__snapshots__/index.test.jsx.snap b/src/components/Manifest/Update/__snapshots__/index.test.jsx.snap index 4f75dc2..fa51235 100644 --- a/src/components/Manifest/Update/__snapshots__/index.test.jsx.snap +++ b/src/components/Manifest/Update/__snapshots__/index.test.jsx.snap @@ -113,12 +113,11 @@ exports[`Manifest Details Component Render 1`] = `
@@ -128,8 +127,6 @@ exports[`Manifest Details Component Render 1`] = ` { fullWidth onChange={changeName} /> - - - Type - - - - - - Type - - - + +