Merge pull request #527 from Fisker-Inc/CEC-6031
CEC-6031 - OTA Campaign
This commit is contained in:
@@ -23,7 +23,6 @@ import {
|
|||||||
} from "../../../../Contexts/FleetContext";
|
} from "../../../../Contexts/FleetContext";
|
||||||
import { useStatusContext } from "../../../../Contexts/StatusContext";
|
import { useStatusContext } from "../../../../Contexts/StatusContext";
|
||||||
import { useUserContext } from "../../../../Contexts/UserContext";
|
import { useUserContext } from "../../../../Contexts/UserContext";
|
||||||
import { VehicleProvider } from "../../../../Contexts/VehicleContext";
|
|
||||||
import SearchField from "../../../../Controls/SearchField";
|
import SearchField from "../../../../Controls/SearchField";
|
||||||
import TableHeaderSortable from "../../../../Table/HeaderSortable";
|
import TableHeaderSortable from "../../../../Table/HeaderSortable";
|
||||||
import { useLocalStorage } from "../../../../useLocalStorage";
|
import { useLocalStorage } from "../../../../useLocalStorage";
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
|
Checkbox,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormControlLabel,
|
||||||
IconButton,
|
IconButton,
|
||||||
Input,
|
Input,
|
||||||
InputLabel,
|
InputLabel,
|
||||||
@@ -149,6 +151,12 @@ export default function Configure({
|
|||||||
{manifest.name ? (<i>{manifest.name}</i>) : `This manifest`} is incomplete, and cannot be deployed without all required fields filled out.
|
{manifest.name ? (<i>{manifest.name}</i>) : `This manifest`} is incomplete, and cannot be deployed without all required fields filled out.
|
||||||
</Typography>
|
</Typography>
|
||||||
<br />
|
<br />
|
||||||
|
<FormControlLabel control={
|
||||||
|
<Checkbox
|
||||||
|
checked={localManifest.notify_sap}
|
||||||
|
onChange={(e) => handleManifestField("notify_sap", e.target.checked)}
|
||||||
|
/>
|
||||||
|
} label="Notify SAP for OTA Campaign" />
|
||||||
<DropDownList
|
<DropDownList
|
||||||
label="Sums Version"
|
label="Sums Version"
|
||||||
labelField="version"
|
labelField="version"
|
||||||
|
|||||||
@@ -433,6 +433,43 @@ exports[`Manifest Details Component Render 1`] = `
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<label
|
||||||
|
class="MuiFormControlLabel-root"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-disabled="false"
|
||||||
|
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-0 MuiCheckbox-root MuiCheckbox-colorSecondary MuiIconButton-colorSecondary"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiIconButton-label"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="PrivateSwitchBase-input-0"
|
||||||
|
data-indeterminate="false"
|
||||||
|
type="checkbox"
|
||||||
|
value=""
|
||||||
|
/>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
class="MuiSvgIcon-root"
|
||||||
|
focusable="false"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTouchRipple-root"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="MuiTypography-root MuiFormControlLabel-label MuiTypography-body1"
|
||||||
|
>
|
||||||
|
Notify SAP for OTA Campaign
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
<button
|
<button
|
||||||
aria-label="send command"
|
aria-label="send command"
|
||||||
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained makeStyles-submit-0 MuiButton-containedPrimary MuiButton-fullWidth"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button, FormControl, TextField } from "@material-ui/core";
|
import { Button, Checkbox, FormControl, FormControlLabel, TextField } from "@material-ui/core";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Redirect } from "react-router";
|
import { Redirect } from "react-router";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
@@ -59,6 +59,7 @@ const MainForm = () => {
|
|||||||
const [env, setEnv] = useState("current");
|
const [env, setEnv] = useState("current");
|
||||||
const [updateDuration, setUpdateDuration] = useState(0);
|
const [updateDuration, setUpdateDuration] = useState(0);
|
||||||
const [maxAttempts, setMaxAttempts] = useState(0);
|
const [maxAttempts, setMaxAttempts] = useState(0);
|
||||||
|
const [notifySAP, setNotifySAP] = useState(false);
|
||||||
|
|
||||||
const changeName = (e) => {
|
const changeName = (e) => {
|
||||||
setName(e.target.value);
|
setName(e.target.value);
|
||||||
@@ -98,6 +99,10 @@ const MainForm = () => {
|
|||||||
setMaxAttempts(value);
|
setMaxAttempts(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const changeNotifySAP = (event) => {
|
||||||
|
setNotifySAP(event.target.checked);
|
||||||
|
}
|
||||||
|
|
||||||
const onSubmit = async (e) => {
|
const onSubmit = async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
try {
|
try {
|
||||||
@@ -110,6 +115,7 @@ const MainForm = () => {
|
|||||||
env,
|
env,
|
||||||
update_duration: parseInt(updateDuration),
|
update_duration: parseInt(updateDuration),
|
||||||
max_attempts: parseInt(maxAttempts),
|
max_attempts: parseInt(maxAttempts),
|
||||||
|
notify_sap: notifySAP,
|
||||||
}, token);
|
}, token);
|
||||||
if (!result || result.error) return;
|
if (!result || result.error) return;
|
||||||
|
|
||||||
@@ -148,6 +154,7 @@ const MainForm = () => {
|
|||||||
setEnv(result.env ?? "current");
|
setEnv(result.env ?? "current");
|
||||||
setUpdateDuration(result.update_duration);
|
setUpdateDuration(result.update_duration);
|
||||||
setMaxAttempts(result.max_attempts);
|
setMaxAttempts(result.max_attempts);
|
||||||
|
setNotifySAP(result.notify_sap);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setMessage(e.message);
|
setMessage(e.message);
|
||||||
@@ -239,6 +246,12 @@ const MainForm = () => {
|
|||||||
value={maxAttempts}
|
value={maxAttempts}
|
||||||
setValue={changeMaxAttempts}
|
setValue={changeMaxAttempts}
|
||||||
/>
|
/>
|
||||||
|
<FormControlLabel control={
|
||||||
|
<Checkbox
|
||||||
|
checked={notifySAP}
|
||||||
|
onChange={changeNotifySAP}
|
||||||
|
/>
|
||||||
|
} label="Notify SAP for OTA Campaign" />
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
aria-label="send command"
|
aria-label="send command"
|
||||||
|
|||||||
Reference in New Issue
Block a user