CEC-3672 Update manifest version on deploy (#277)
* CEC-3672 Add versions to CarUpdatesContext Stub out getSoftwareVersions and updateManifestVersion * CEC-3672 update version on deploy * Validate version before updating
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
import { Button, FormControl, TextField } from "@material-ui/core";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Redirect } from "react-router";
|
||||
import useStyles from "../../useStyles";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { ManifestsProvider, useManifestsContext } from "../../Contexts/ManifestsContext";
|
||||
import { useUserContext } from "../../Contexts/UserContext";
|
||||
import { useStatusContext } from "../../Contexts/StatusContext";
|
||||
import { Button, FormControl, InputLabel, Select, TextField } from "@material-ui/core";
|
||||
import { useUserContext } from "../../Contexts/UserContext";
|
||||
import { DropDownList } from "../../Controls/DropDownList";
|
||||
import useStyles from "../../useStyles";
|
||||
|
||||
const manifestTypes = [
|
||||
{ value: "standard", label: "Standard" },
|
||||
{ value: "forced", label: "Forced" },
|
||||
];
|
||||
|
||||
const activeStates = [
|
||||
{value: true, label: "Active" },
|
||||
{value: false, label: "Archived" },
|
||||
];
|
||||
|
||||
const emptyManifest = {
|
||||
name: "",
|
||||
version: "",
|
||||
@@ -138,53 +144,8 @@ const MainForm = () => {
|
||||
fullWidth
|
||||
onChange={changeName}
|
||||
/>
|
||||
<FormControl
|
||||
className={classes.form}
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
margin="normal"
|
||||
>
|
||||
<InputLabel htmlFor="manifest-type" className={classes.whiteBackground}>
|
||||
Type
|
||||
</InputLabel>
|
||||
<Select
|
||||
native
|
||||
value={type}
|
||||
variant="outlined"
|
||||
inputProps={{
|
||||
name: "manifest-type",
|
||||
id: "send-manifest-type",
|
||||
}}
|
||||
onChange={changeType}
|
||||
>
|
||||
{manifestTypes.map((item, index) => (
|
||||
<option key={index} value={item.value}>{item.label}</option>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
<FormControl
|
||||
className={classes.form}
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
margin="normal"
|
||||
>
|
||||
<InputLabel htmlFor="manifest-active" className={classes.whiteBackground}>
|
||||
Type
|
||||
</InputLabel>
|
||||
<Select
|
||||
native
|
||||
value={active}
|
||||
variant="outlined"
|
||||
inputProps={{
|
||||
name: "manifest-active",
|
||||
id: "send-manifest-active",
|
||||
}}
|
||||
onChange={changeActive}
|
||||
>
|
||||
<option key={0} value={true}>active</option>
|
||||
<option key={1} value={false}>archived</option>
|
||||
</Select>
|
||||
</FormControl>
|
||||
<DropDownList label="Type" data={manifestTypes} classes={classes} onChange={changeType} value={type} />
|
||||
<DropDownList label="Active" data={activeStates} classes={classes} onChange={changeActive} value={active}/>
|
||||
<Button
|
||||
type="submit"
|
||||
aria-label="send command"
|
||||
|
||||
Reference in New Issue
Block a user