File tree Expand file tree Collapse file tree 9 files changed +62
-81
lines changed
__tests__/components/CustomNode/__snapshots__ Expand file tree Collapse file tree 9 files changed +62
-81
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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} ;
Original file line number Diff line number Diff line change 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 },
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}
Original file line number Diff line number Diff line change 1- import 'jest-canvas-mock' ;
1+
22import 'regenerator-runtime/runtime'
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { VegaLite } from 'react-vega' ;
3- import { Spinner } from 'react-bootstrap ' ;
3+ import { Roller } from 'react-spinners-css ' ;
44import { Modal , Button } from 'react-bootstrap' ;
55import propTypes from 'prop-types' ;
66import { 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" ) {
Original file line number Diff line number Diff 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" ) ) {
You can’t perform that action at this time.
0 commit comments