Skip to content

Commit 60b8d12

Browse files
authored
Merge release/0.2.0 to master
release/0.2.0
2 parents 9149aa1 + b9994c1 commit 60b8d12

File tree

21 files changed

+6119
-5560
lines changed

21 files changed

+6119
-5560
lines changed

.eslintrc.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@
1414
},
1515
"extends": ["airbnb", "prettier"],
1616
"rules": {
17-
"indent": [2, 2, {"SwitchCase": 1}]
18-
}
17+
"indent": [2, 2, {"SwitchCase": 1}],
18+
"import/extensions": [
19+
"error",
20+
"ignorePackages",
21+
{
22+
"js": "never",
23+
"jsx": "never",
24+
"ts": "never",
25+
"tsx": "never"
26+
}
27+
]
28+
},
29+
"settings": {
30+
"import/resolver": {
31+
"node": {
32+
"paths": ["src/**/*"],
33+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
34+
}
35+
}
36+
},
37+
"overrides": [{
38+
"files": ["*.ts"],
39+
"parser": "@typescript-eslint/parser",
40+
"plugins": [
41+
"@typescript-eslint"
42+
]
43+
}]
1944
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ typings/
8484
npm-debug.log*
8585
yarn-debug.log*
8686
yarn-error.log*
87+
88+
.yarnrc

package.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
{
22
"name": "automata",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"homepage": "http://nihalmurmu.github.io/automata",
55
"private": true,
66
"dependencies": {
7-
"@material-ui/core": "^3.7.1",
8-
"@material-ui/icons": "^3.0.1",
7+
"@material-ui/core": "^4.9.5",
8+
"@material-ui/icons": "^4.9.1",
9+
"@material-ui/lab": "^4.0.0-alpha.45",
910
"classnames": "^2.2.6",
1011
"js-file-download": "^0.4.7",
12+
"keycharm": "^0.3.1",
1113
"prop-types": "^15.7.2",
12-
"react": "^16.6.3",
13-
"react-dom": "^16.6.3",
14+
"react": "^16.12.0",
15+
"react-dom": "^16.12.0",
1416
"react-ga": "^2.5.7",
15-
"react-scripts": "^2.1.8",
16-
"vis": "^4.21.0"
17+
"react-scripts": "3.4.1",
18+
"typescript": "^3.8.3",
19+
"uuid": "^7.0.2",
20+
"vis-data": "^6.3.5",
21+
"vis-network": "^7.4.2"
1722
},
1823
"scripts": {
1924
"start": "react-scripts start",
2025
"build": "react-scripts build",
2126
"test": "react-scripts test",
2227
"eject": "react-scripts eject",
23-
"lint": "eslint src/**/*.jsx",
24-
"pretty": "npx prettier --write src/**/*.jsx src/**/*.js",
25-
"pretty-lint": "npm run pretty && npm run lint",
26-
"predeploy": "npm run build",
28+
"lint": "yarn run eslint src/**/*.jsx src/**/*.js src/**/*.ts --fix",
29+
"pretty": "yarn run prettier --write src/**/*.jsx src/**/*.js src/**/*.ts",
30+
"pretty-lint": "yarn run pretty && yarn run lint",
31+
"predeploy": "yarn run build",
2732
"deploy": "gh-pages -d build"
2833
},
2934
"eslintConfig": {
@@ -36,12 +41,17 @@
3641
"not op_mini all"
3742
],
3843
"devDependencies": {
44+
"@types/uuid": "^7.0.2",
45+
"@typescript-eslint/eslint-plugin": "^2.28.0",
46+
"@typescript-eslint/parser": "^2.28.0",
47+
"babel-eslint": "^10.1.0",
3948
"eslint": "^5.16.0",
4049
"eslint-config-airbnb": "^17.1.0",
4150
"eslint-config-prettier": "^4.1.0",
4251
"eslint-plugin-import": "^2.17.1",
4352
"eslint-plugin-jsx-a11y": "^6.2.1",
4453
"eslint-plugin-react": "^7.12.4",
54+
"eslint-plugin-react-hooks": "^2.5.0",
4555
"gh-pages": "^2.0.1",
4656
"prettier": "^1.17.0"
4757
}

src/App.jsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
1-
import React from "react";
1+
import React, { StrictMode } from "react";
22
import "./App.css";
33
import ReactGA from "react-ga";
44
import Header from "./components/header/Header";
55
import Workspace from "./components/workspace/Workspace";
66
import Notice from "./components/notice/Notice";
77
import Footer from "./components/footer/Footer";
8+
import MuiSnackbar from "./components/snackbar/MuiSnackbar";
89

910
class App extends React.Component {
11+
muiSnackbarRef = React.createRef();
12+
1013
componentDidMount() {
11-
ReactGA.initialize("UA-138685124-2");
12-
ReactGA.pageview(window.location.pathname);
14+
if (process.env.NODE_ENV === "production") {
15+
ReactGA.initialize("UA-138685124-2");
16+
ReactGA.pageview(window.location.pathname);
17+
}
1318
}
1419

20+
/**
21+
* Displays the snackbar notification
22+
*
23+
* @param {String} variant - error, warning, info, success
24+
* @param {String} message - The notification message
25+
*/
26+
displaySnackbar = (variant, message) => {
27+
this.muiSnackbarRef.current.openSnackbar(variant, message);
28+
};
29+
1530
render() {
1631
return (
17-
<div className="App">
18-
<Header />
19-
<Workspace />
20-
<Notice />
21-
<Footer />
22-
</div>
32+
<StrictMode>
33+
<div className="App">
34+
<Header />
35+
<Workspace snackbar={this.displaySnackbar} />
36+
<Notice />
37+
<Footer />
38+
<MuiSnackbar ref={this.muiSnackbarRef} />
39+
</div>
40+
</StrictMode>
2341
);
2442
}
2543
}

src/components/drawer/TemporaryDrawer.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const styles = {
1818
class TemporaryDrawer extends Component {
1919
state = {
2020
open: false,
21-
selectedModeKey: 0,
21+
selectedModeKey: 1,
2222
selectedLinkKey: null
2323
};
2424

@@ -27,6 +27,7 @@ class TemporaryDrawer extends Component {
2727
};
2828

2929
handleModeListItemClick = (event, key) => {
30+
if (key !== 1) return;
3031
this.setState({ selectedModeKey: key, selectedLinkKey: null });
3132
};
3233

@@ -37,7 +38,6 @@ class TemporaryDrawer extends Component {
3738
render() {
3839
const { classes } = this.props;
3940
const { open, selectedModeKey, selectedLinkKey } = this.state;
40-
4141
const sideList = (
4242
<div className={classes.list}>
4343
<List>
@@ -55,7 +55,11 @@ class TemporaryDrawer extends Component {
5555
selected={selectedModeKey === key}
5656
onClick={event => this.handleModeListItemClick(event, key)}
5757
>
58-
<ListItemText primary={value} secondary="*coming soon*" />
58+
{key === 1 ? (
59+
<ListItemText primary={value} />
60+
) : (
61+
<ListItemText primary={value} secondary="*coming soon*" />
62+
)}
5963
</ListItem>
6064
);
6165
})}

src/components/footer/Footer.jsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import React from "react";
2-
import {
3-
Typography,
4-
Grid,
5-
Paper,
6-
withStyles,
7-
} from "@material-ui/core";
2+
import { Typography, Grid, Paper, withStyles } from "@material-ui/core";
83
import PropTypes from "prop-types";
94

105
const styles = theme => ({

src/components/notice/Notice.jsx

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,23 @@ const Notice = props => {
1616
<Card className={classes.root} id="notice" elevation={6}>
1717
<CardContent>
1818
<Typography variant="title" gutterBottom>
19-
How to get hands dirty
19+
How to get started.
2020
</Typography>
21-
<Typography variant="body2">Operation on States</Typography>
22-
<Typography variant="body1" gutterBottom>
23-
+ Double click to create a state.
21+
<hr />
22+
<Typography variant="body2" gutterBottom>
23+
&bull; Double click to create a state.
2424
<br />
25-
+ Double click on a non-final state to make it a final state.
25+
&bull; Double click on a state to make it a final state and
26+
vice-versa.
2627
<br />
27-
+ Double click on a final state to make it a non-final state.
28+
&bull; Press and hold down shift button, then click-drag from one
29+
state to other state you wish to join.
2830
<br />
29-
+ Select a node, and edit the node label in text field above
31+
&bull; Select a node/edge, and edit the node label in text field
32+
above
3033
<br />
31-
</Typography>
32-
<Typography variant="body2">Operation on Transition edges</Typography>
33-
<Typography variant="body1" gutterBottom>
34-
+ Press and hold down shift button, then click-drag from one node to
35-
other node you wish to join.
36-
<br />
37-
+ Select a edge, and edit the node label in text field above
38-
<br />
39-
</Typography>
40-
<Typography variant="body2">Delete ?</Typography>
41-
<Typography variant="body1">
42-
Just select the object you want to delete and press
34+
&bull; Just select the node/edge you want to delete and press
4335
&apos;delete&apos; key!
44-
<br />
4536
</Typography>
4637
</CardContent>
4738
</Card>
@@ -51,10 +42,10 @@ const Notice = props => {
5142
<Typography variant="title" gutterBottom>
5243
Alpha Release
5344
</Typography>
54-
<Typography variant="body1">
55-
Application is in active development phase
56-
<br />
57-
This web application is currently in the stages of its development.
45+
<hr />
46+
<Typography variant="body2">
47+
This Application is currently in the stages of its active
48+
development.
5849
<br />
5950
It has some quirks and many parts are not yet available.
6051
<br />

0 commit comments

Comments
 (0)