Skip to content

Commit 5d38523

Browse files
committed
Reverts direct pushes to master
1 parent d6b12e4 commit 5d38523

File tree

9 files changed

+62
-81
lines changed

9 files changed

+62
-81
lines changed

front-end/__tests__/components/CustomNode/__snapshots__/GraphView.test.js.snap

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Object {
2121
tabindex="-1"
2222
>
2323
<div
24-
class="modal-dialog GraphView modal-dialog-centered"
24+
class="modal-dialog modal-dialog-centered"
2525
role="document"
2626
>
2727
<div
@@ -36,21 +36,6 @@ Object {
3636
<b />
3737
View
3838
</div>
39-
<button
40-
class="close"
41-
type="button"
42-
>
43-
<span
44-
aria-hidden="true"
45-
>
46-
×
47-
</span>
48-
<span
49-
class="sr-only"
50-
>
51-
Close
52-
</span>
53-
</button>
5439
</div>
5540
<div
5641
class="modal-body"
@@ -68,7 +53,6 @@ Object {
6853
</button>
6954
<button
7055
class="btn btn-secondary"
71-
disabled=""
7256
type="button"
7357
>
7458
Load

front-end/__tests__/components/CustomNode/__snapshots__/NodeConfig.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Object {
2121
tabindex="-1"
2222
>
2323
<div
24-
class="modal-dialog NodeConfig modal-dialog-centered"
24+
class="modal-dialog modal-dialog-centered"
2525
role="document"
2626
>
2727
<div

front-end/babel.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module.exports = {
44
],
55
plugins: [
66
"@babel/plugin-syntax-dynamic-import",
7-
"@babel/plugin-proposal-class-properties",
8-
"@babel/plugin-proposal-export-default-from"
7+
"@babel/plugin-proposal-class-properties"
98
],
109
};

front-end/package-lock.json

Lines changed: 0 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front-end/package.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,25 @@
3333
"scripts": {
3434
"start": "react-scripts start",
3535
"build": "react-scripts build",
36-
"test": "jest --collect-coverage --passWithNoTests --no-cache",
36+
"test": "jest --collect-coverage --passWithNoTests",
3737
"eject": "react-scripts eject"
3838
},
39+
"jest": {
40+
"coverageThreshold": {
41+
"global": {
42+
"branches": 80,
43+
"functions": 80,
44+
"lines": 80,
45+
"statements": 80
46+
}
47+
},
48+
"moduleNameMapper": {
49+
"\\.(css|less)$": "<rootDir>/__mocks__/css/styleMock.js"
50+
},
51+
"setupFilesAfterEnv": [
52+
"./setupTests.js"
53+
]
54+
},
3955
"eslintConfig": {
4056
"extends": "react-app"
4157
},
@@ -53,10 +69,8 @@
5369
},
5470
"proxy": "http://back-end:8000",
5571
"devDependencies": {
56-
"@babel/plugin-proposal-export-default-from": "^7.8.3",
5772
"@babel/preset-env": "^7.9.5",
5873
"@babel/preset-react": "^7.9.4",
59-
"jest-canvas-mock": "^2.2.0",
6074
"react-test-renderer": "^16.13.1"
6175
}
6276
}

front-end/setupTests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import 'jest-canvas-mock';
1+
22
import 'regenerator-runtime/runtime'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as _ from 'lodash'
2+
import { Action, InputType } from '@projectstorm/react-canvas-core';
3+
4+
export interface CustomDeleteItemsActionOptions {
5+
keyCodes?: number[];
6+
}
7+
8+
/**
9+
* Deletes all selected items, but asks for confirmation first
10+
*/
11+
export class CustomDeleteItemsAction extends Action {
12+
constructor(options: CustomDeleteItemsActionOptions = {}) {
13+
options = {
14+
keyCodes: [46, 8],
15+
...options
16+
};
17+
super({
18+
type: InputType.KEY_DOWN,
19+
fire: (event: ActionEvent<React.KeyboardEvent>) => {
20+
if (options.keyCodes.indexOf(event.event.keyCode) !== -1) {
21+
const selectedEntities = this.engine.getModel().getSelectedEntities();
22+
if (selectedEntities.length > 0) {
23+
const confirm = window.confirm('Are you sure you want to delete?');
24+
25+
if (confirm) {
26+
_.forEach(selectedEntities, model => {
27+
// only delete items which are not locked
28+
if (!model.isLocked()) {
29+
model.remove();
30+
}
31+
});
32+
this.engine.repaintCanvas();
33+
}
34+
}
35+
}
36+
}
37+
});
38+
}
39+
}

front-end/src/components/CustomNode/GraphView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { VegaLite } from 'react-vega';
3-
import { Spinner } from 'react-bootstrap';
3+
import { Roller } from 'react-spinners-css';
44
import { Modal, Button } from 'react-bootstrap';
55
import propTypes from 'prop-types';
66
import { VariableSizeGrid as Grid } from 'react-window';
@@ -123,7 +123,7 @@ export default class GraphView extends React.Component {
123123

124124
if (this.state.loading) {
125125
// Print loading spinner
126-
body = (<Spinner animation="border" />);
126+
body = (<Roller color="black" />);
127127
} else if (this.state.data.length < 1) {
128128
// Print message to load respective table/graph
129129
if (this.props.node.options.node_type === "visualization") {

front-end/src/components/VPPort/VPPortModel.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ export default class VPPortModel extends DefaultPortModel {
99
}
1010

1111
canLinkToPort(port) {
12-
if (port == null) {
13-
return false;
14-
}
1512
// if connecting to flow port, make sure this is a flow port
1613
// and opposite of other's direction
1714
if (port.options.name.includes("flow")) {

0 commit comments

Comments
 (0)