Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidballester committed Nov 4, 2019
2 parents 8d3bff4 + e8dc727 commit d8b750a
Show file tree
Hide file tree
Showing 38 changed files with 435 additions and 320 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@material-ui/core": "^4.5.2",
"@material-ui/icons": "4.2.0",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "4.0.0-alpha.16",
"@material-ui/styles": "^4.5.2",
"clx": "1.0.0",
Expand Down
6 changes: 2 additions & 4 deletions src/app.component.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React, { Component } from 'react';
import { Route } from 'react-router-dom';

import NewGraph from './scenes/new-graph';
import Canvas from './components/canvas';
import Graph from './scenes/graph';
import { ROUTES } from './constants';
import GraphList from './scenes/graph-list';
import Welcome from './scenes/welcome';
import Import from './scenes/graph-import';

export class App extends Component {
render() {
return (
<React.Fragment>
<Route path={[ROUTES.BASE, ROUTES.GRAPHS]} exact render={() => [<GraphList key="GraphList" />, <Canvas key="Canvas" />]} />
<Route path={[ROUTES.BASE, ROUTES.GRAPHS]} exact render={() => <Welcome />} />
<Route path={ROUTES.IMPORT_GRAPH} exact render={() => [<Import key="Import" />, <Canvas key="Canvas" />]} />
<Route path={ROUTES.NEW_GRAPH} exact render={() => [<NewGraph key="NewGraph" />, <Canvas key="Canvas" />]} />
<Route path={ROUTES.GRAPH} exact render={() => <Graph key="Graph" />} />
</React.Fragment>
);
Expand Down
1 change: 0 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const MAX_SELECTED_NODES = 2;
export const ROUTES = {
BASE: '/',
GRAPHS: '/graphs',
NEW_GRAPH: '/new',
GRAPH: '/graphs/:graphId',
IMPORT_GRAPH: '/import',
};
1 change: 1 addition & 0 deletions src/ducks/dialog.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const DIALOG_IDS = {
EDIT_GRAPH: 'editgraph',
CONFIRM_DELETE_GRAPH: 'confirmdeletegraph',
EXPORT_GRAPH: 'exportgraph',
NEW_GRAPH: 'newgraph',
};

export const DIALOG_OPEN = 'grapher/EditGraph/OPEN';
Expand Down
13 changes: 1 addition & 12 deletions src/ducks/navigation.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ROUTES } from '../constants';

// Actions
export const GRAPH_IMPORT_OPEN = 'grapher/Navigation/GRAPH_IMPORT_OPEN';
export const NEW_GRAPH_OPEN = 'grapher/Navigation/NEW_GRAPH_OPEN';
export const GRAPH_OPEN = 'grapher/Navigation/GRAPH_OPEN';
export const GRAPH_LIST_OPEN = 'grapher/Navigation/GRAPH_LIST_OPEN';

Expand All @@ -17,12 +16,6 @@ export function openImportGraph() {
};
}

export function openNewGraph() {
return {
type: NEW_GRAPH_OPEN,
};
}

export function openGraph(id) {
return {
type: GRAPH_OPEN,
Expand All @@ -39,10 +32,6 @@ export function openGraphList() {
// Sagas
export function* navigate({ type, payload }) {
switch (type) {
case NEW_GRAPH_OPEN: {
yield call([history, 'push'], ROUTES.NEW_GRAPH);
break;
}
case GRAPH_LIST_OPEN:
case GRAPH_DELETE: {
yield call([history, 'push'], ROUTES.BASE);
Expand Down Expand Up @@ -71,5 +60,5 @@ export function* navigate({ type, payload }) {
}

export function* navigateSaga() {
yield takeLatest([NEW_GRAPH_OPEN, GRAPH_LIST_OPEN, GRAPH_OPEN, GRAPH_CREATE, GRAPH_DELETE, GRAPH_IMPORT_OPEN, GRAPH_IMPORT_SUCCESS], navigate);
yield takeLatest([GRAPH_LIST_OPEN, GRAPH_OPEN, GRAPH_CREATE, GRAPH_DELETE, GRAPH_IMPORT_OPEN, GRAPH_IMPORT_SUCCESS], navigate);
}
17 changes: 2 additions & 15 deletions src/ducks/navigation.duck.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
navigate,
openImportGraph,
GRAPH_IMPORT_OPEN,
NEW_GRAPH_OPEN,
openNewGraph,
GRAPH_OPEN,
openGraph,
Expand All @@ -36,13 +35,6 @@ describe('navigation', () => {
});
});

describe(openNewGraph.name, () => {
it('creates the action with the `NEW_GRAPH_OPEN` type', () => {
const action = openNewGraph();
expect(action.type).toEqual(NEW_GRAPH_OPEN);
});
});

describe(openGraph.name, () => {
it('creates the action with the `GRAPH_OPEN` type', () => {
const action = openGraph();
Expand All @@ -66,20 +58,15 @@ describe('navigation', () => {

describe('sagas', () => {
describe(navigateSaga.name, () => {
it('invokes take latest with `NEW_GRAPH_OPEN`, `GRAPH_LIST_OPEN`, `GRAPH_OPEN`, `GRAPH_CREATE`, `GRAPH_DELETE`', () => {
it('invokes take latest with `GRAPH_LIST_OPEN`, `GRAPH_OPEN`, `GRAPH_CREATE`, `GRAPH_DELETE`', () => {
const gen = cloneableGenerator(navigateSaga)({});
expect(gen.next().value).toEqual(
takeLatest([NEW_GRAPH_OPEN, GRAPH_LIST_OPEN, GRAPH_OPEN, GRAPH_CREATE, GRAPH_DELETE, GRAPH_IMPORT_OPEN, GRAPH_IMPORT_SUCCESS], navigate)
takeLatest([GRAPH_LIST_OPEN, GRAPH_OPEN, GRAPH_CREATE, GRAPH_DELETE, GRAPH_IMPORT_OPEN, GRAPH_IMPORT_SUCCESS], navigate)
);
});
});

describe(navigate.name, () => {
it(`pushes '${ROUTES.NEW_GRAPH}' to 'history' if a 'NEW_GRAPH_OPEN' action is received`, () => {
const gen = cloneableGenerator(navigate)({ type: NEW_GRAPH_OPEN });
expect(gen.next().value).toEqual(call([history, 'push'], ROUTES.NEW_GRAPH));
});

it(`pushes '${ROUTES.BASE}' to 'history' if a 'GRAPH_LIST_OPEN' action is received`, () => {
const gen = cloneableGenerator(navigate)({ type: GRAPH_LIST_OPEN });
expect(gen.next().value).toEqual(call([history, 'push'], ROUTES.BASE));
Expand Down
1 change: 0 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
body {
margin: 0;
overflow: hidden;
}

div:focus {
Expand Down
69 changes: 0 additions & 69 deletions src/scenes/graph-list/graph-list.component.js

This file was deleted.

68 changes: 0 additions & 68 deletions src/scenes/graph-list/graph-list.component.spec.js

This file was deleted.

28 changes: 0 additions & 28 deletions src/scenes/graph-list/graph-list.container.js

This file was deleted.

16 changes: 0 additions & 16 deletions src/scenes/graph-list/graph-list.duck.spec.js

This file was deleted.

1 change: 0 additions & 1 deletion src/scenes/graph-list/index.js

This file was deleted.

Loading

0 comments on commit d8b750a

Please sign in to comment.