Change main UI layout and add VINs to add and upload forms (#16)

* Add new upload update package form
Add new add vehicle form
Add new side menu layout
Add new toolbar layout
Update and add unit tests

* Enable add get and add vehicles

* Integration issues with ota_update service

* Update get vehicle JSON format

* Fix related unit test
Add release notes field

* Add StatusContext to display error and status messages
This commit is contained in:
John Wu
2021-03-11 12:53:29 -08:00
committed by GitHub
parent 39e779dc1d
commit 2e1f4a7a7c
31 changed files with 2666 additions and 377 deletions

View File

@@ -1,5 +1,9 @@
import { makeStyles } from "@material-ui/core/styles";
const MENUITEM_HEIGHT = 48;
const MENUITEM_PADDING_TOP = 8;
const DRAWER_WIDTH = 240;
const useStyles = makeStyles((theme) => ({
paper: {
marginTop: theme.spacing(8),
@@ -17,6 +21,89 @@ const useStyles = makeStyles((theme) => ({
},
submit: {
margin: theme.spacing(3, 0, 2),
textAlign: "center",
},
formControl: {
margin: theme.spacing(1),
width: "100%",
minWidth: 120,
},
chips: {
display: "flex",
flexWrap: "wrap",
},
chip: {
margin: 2,
},
menuProps: {
PaperProps: {
style: {
maxHeight: MENUITEM_HEIGHT * 4.5 + MENUITEM_PADDING_TOP,
width: 250,
},
},
},
previewChip: {
minWidth: 160,
maxWidth: 210,
},
root: {
display: "flex",
},
appBar: {
transition: theme.transitions.create(["margin", "width"], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
},
appBarShift: {
width: `calc(100% - ${DRAWER_WIDTH}px)`,
marginLeft: DRAWER_WIDTH,
transition: theme.transitions.create(["margin", "width"], {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
},
menuButton: {
marginRight: theme.spacing(2),
},
hide: {
display: "none",
},
drawer: {
width: DRAWER_WIDTH,
flexShrink: 0,
},
drawerPaper: {
width: DRAWER_WIDTH,
},
drawerHeader: {
display: "flex",
alignItems: "center",
padding: theme.spacing(0, 1),
// necessary for content to be below app bar
...theme.mixins.toolbar,
justifyContent: "flex-end",
},
content: {
flexGrow: 1,
padding: theme.spacing(3),
transition: theme.transitions.create("margin", {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
marginLeft: -DRAWER_WIDTH,
},
contentShift: {
transition: theme.transitions.create("margin", {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
marginLeft: 0,
},
rightToolbar: {
marginLeft: "auto",
marginRight: -12,
},
}));