CEC-6031 - OTA Campaign
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
Box,
|
||||
Checkbox,
|
||||
FormControl,
|
||||
FormControlLabel,
|
||||
IconButton,
|
||||
Input,
|
||||
InputLabel,
|
||||
@@ -101,6 +103,7 @@ export default function Configure({
|
||||
handleClose();
|
||||
if (diffManifestFields(manifest, localManifest)) {
|
||||
try {
|
||||
console.log(localManifest)
|
||||
localManifest.update_duration = parseInt(localManifest.update_duration);
|
||||
localManifest.max_attempts = parseInt(localManifest.max_attempts);
|
||||
|
||||
@@ -149,6 +152,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.
|
||||
</Typography>
|
||||
<br />
|
||||
<FormControlLabel control={
|
||||
<Checkbox
|
||||
checked={localManifest.notify_sap}
|
||||
onChange={(e) => handleManifestField("notify_sap", e.target.checked)}
|
||||
/>
|
||||
} label="Notify SAP for OTA Campaign" />
|
||||
<DropDownList
|
||||
label="Sums Version"
|
||||
labelField="version"
|
||||
|
||||
@@ -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 { Redirect } from "react-router";
|
||||
import { useParams } from "react-router-dom";
|
||||
@@ -59,6 +59,7 @@ const MainForm = () => {
|
||||
const [env, setEnv] = useState("current");
|
||||
const [updateDuration, setUpdateDuration] = useState(0);
|
||||
const [maxAttempts, setMaxAttempts] = useState(0);
|
||||
const [notifySAP, setNotifySAP] = useState(false);
|
||||
|
||||
const changeName = (e) => {
|
||||
setName(e.target.value);
|
||||
@@ -98,6 +99,10 @@ const MainForm = () => {
|
||||
setMaxAttempts(value);
|
||||
}
|
||||
|
||||
const changeNotifySAP = (event) => {
|
||||
setNotifySAP(event.target.checked);
|
||||
}
|
||||
|
||||
const onSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
@@ -110,6 +115,7 @@ const MainForm = () => {
|
||||
env,
|
||||
update_duration: parseInt(updateDuration),
|
||||
max_attempts: parseInt(maxAttempts),
|
||||
notify_sap: notifySAP,
|
||||
}, token);
|
||||
if (!result || result.error) return;
|
||||
|
||||
@@ -148,6 +154,7 @@ const MainForm = () => {
|
||||
setEnv(result.env ?? "current");
|
||||
setUpdateDuration(result.update_duration);
|
||||
setMaxAttempts(result.max_attempts);
|
||||
setNotifySAP(result.notify_sap);
|
||||
}
|
||||
} catch (e) {
|
||||
setMessage(e.message);
|
||||
@@ -239,6 +246,12 @@ const MainForm = () => {
|
||||
value={maxAttempts}
|
||||
setValue={changeMaxAttempts}
|
||||
/>
|
||||
<FormControlLabel control={
|
||||
<Checkbox
|
||||
checked={notifySAP}
|
||||
onChange={changeNotifySAP}
|
||||
/>
|
||||
} label="Notify SAP for OTA Campaign" />
|
||||
<Button
|
||||
type="submit"
|
||||
aria-label="send command"
|
||||
|
||||
Reference in New Issue
Block a user