@elyra/canvas 12.42.0 → 12.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{canvas-constants-ff5cf88e.js → canvas-constants-089e7830.js} +2 -2
- package/dist/{canvas-constants-ff5cf88e.js.map → canvas-constants-089e7830.js.map} +1 -1
- package/dist/{canvas-constants-13b58448.js → canvas-constants-69e90162.js} +2 -2
- package/dist/{canvas-constants-13b58448.js.map → canvas-constants-69e90162.js.map} +1 -1
- package/dist/canvas-controller-3e6b8ce4.js +2 -0
- package/dist/canvas-controller-3e6b8ce4.js.map +1 -0
- package/dist/canvas-controller-c6274fad.js +2 -0
- package/dist/canvas-controller-c6274fad.js.map +1 -0
- package/dist/{canvas-logger-295dafe4.js → canvas-logger-6f4b2551.js} +2 -2
- package/dist/{canvas-logger-295dafe4.js.map → canvas-logger-6f4b2551.js.map} +1 -1
- package/dist/{canvas-logger-e07a0b4a.js → canvas-logger-ab9d9048.js} +2 -2
- package/dist/{canvas-logger-e07a0b4a.js.map → canvas-logger-ab9d9048.js.map} +1 -1
- package/dist/common-canvas-6ed21ab6.js +2 -0
- package/dist/common-canvas-6ed21ab6.js.map +1 -0
- package/dist/common-canvas-8abf016c.js +2 -0
- package/dist/common-canvas-8abf016c.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.es.js.map +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-canvas.js.map +1 -1
- package/dist/common-properties-88377242.js +2 -0
- package/dist/common-properties-88377242.js.map +1 -0
- package/dist/common-properties-b295acc8.js +2 -0
- package/dist/common-properties-b295acc8.js.map +1 -0
- package/dist/context-menu-wrapper-949393c7.js +2 -0
- package/dist/context-menu-wrapper-949393c7.js.map +1 -0
- package/dist/context-menu-wrapper-f62dfcdb.js +2 -0
- package/dist/context-menu-wrapper-f62dfcdb.js.map +1 -0
- package/dist/{createClass-440000a3.js → createClass-02596015.js} +2 -2
- package/dist/createClass-02596015.js.map +1 -0
- package/dist/createClass-155bf7da.js +2 -0
- package/dist/createClass-155bf7da.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-07d18e19.js +2 -0
- package/dist/{datarecord-metadata-v3-schema-98ec66e9.js.map → datarecord-metadata-v3-schema-07d18e19.js.map} +1 -1
- package/dist/datarecord-metadata-v3-schema-df939dd1.js +2 -0
- package/dist/{datarecord-metadata-v3-schema-dba0b214.js.map → datarecord-metadata-v3-schema-df939dd1.js.map} +1 -1
- package/dist/defineProperty-ad55dbff.js +2 -0
- package/dist/{defineProperty-3dc7d8d0.js.map → defineProperty-ad55dbff.js.map} +1 -1
- package/dist/{defineProperty-6d406743.js → defineProperty-bcc9968d.js} +2 -2
- package/dist/{defineProperty-6d406743.js.map → defineProperty-bcc9968d.js.map} +1 -1
- package/dist/flexible-table-c6a8b402.js +2 -0
- package/dist/{flexible-table-7c7de0f9.js.map → flexible-table-c6a8b402.js.map} +1 -1
- package/dist/flexible-table-f7b294a0.js +2 -0
- package/dist/{flexible-table-35e9922a.js.map → flexible-table-f7b294a0.js.map} +1 -1
- package/dist/{icon-9edff40c.js → icon-56b27c4f.js} +2 -2
- package/dist/{icon-9edff40c.js.map → icon-56b27c4f.js.map} +1 -1
- package/dist/{icon-e622f99b.js → icon-8ec2f0ec.js} +2 -2
- package/dist/{icon-e622f99b.js.map → icon-8ec2f0ec.js.map} +1 -1
- package/dist/index-01cbacf9.js +2 -0
- package/dist/{index-e2f8a935.js.map → index-01cbacf9.js.map} +1 -1
- package/dist/index-79543d41.js +2 -0
- package/dist/{index-94fec521.js.map → index-79543d41.js.map} +1 -1
- package/dist/inherits-42ae8426.js +2 -0
- package/dist/inherits-42ae8426.js.map +1 -0
- package/dist/inherits-75817f22.js +2 -0
- package/dist/inherits-75817f22.js.map +1 -0
- package/dist/isArrayLikeObject-04f333a5.js +1 -1
- package/dist/isArrayLikeObject-04f333a5.js.map +1 -1
- package/dist/isArrayLikeObject-7a30aa4b.js +1 -1
- package/dist/isArrayLikeObject-7a30aa4b.js.map +1 -1
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/command-stack.es.js +1 -1
- package/dist/lib/command-stack.es.js.map +1 -1
- package/dist/lib/command-stack.js +1 -1
- package/dist/lib/command-stack.js.map +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/properties/clem.es.js +2 -0
- package/dist/lib/properties/clem.es.js.map +1 -0
- package/dist/lib/properties/clem.js +2 -0
- package/dist/lib/properties/clem.js.map +1 -0
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties/flexible-table.es.js +1 -1
- package/dist/lib/properties/flexible-table.js +1 -1
- package/dist/lib/properties/getPythonHints.es.js +2 -0
- package/dist/lib/properties/getPythonHints.es.js.map +1 -0
- package/dist/lib/properties/getPythonHints.js +2 -0
- package/dist/lib/properties/getPythonHints.js.map +1 -0
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/lib/tooltip.es.js +1 -1
- package/dist/lib/tooltip.es.js.map +1 -1
- package/dist/lib/tooltip.js +1 -1
- package/dist/lib/tooltip.js.map +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/toolbar-235dfb9d.js +2 -0
- package/dist/toolbar-235dfb9d.js.map +1 -0
- package/dist/toolbar-6607e35c.js +2 -0
- package/dist/toolbar-6607e35c.js.map +1 -0
- package/package.json +3 -3
- package/rollup.config.js +2 -0
- package/src/color-picker/color-picker.jsx +5 -1
- package/src/common-canvas/canvas-controller.js +56 -1
- package/src/common-canvas/cc-central-items.jsx +0 -4
- package/src/common-canvas/cc-toolbar.jsx +35 -13
- package/src/common-canvas/common-canvas-utils.js +73 -2
- package/src/common-canvas/common-canvas.scss +8 -8
- package/src/common-canvas/constants/canvas-constants.js +1 -0
- package/src/common-canvas/svg-canvas-d3.scss +3 -2
- package/src/common-canvas/svg-canvas-renderer.js +184 -94
- package/src/common-canvas/svg-canvas-utils-external.js +1 -1
- package/src/common-canvas/svg-canvas-utils-links.js +28 -32
- package/src/common-canvas/svg-canvas-utils-nodes.js +5 -13
- package/src/common-properties/components/field-picker/field-picker.jsx +4 -0
- package/src/common-properties/controls/checkbox/checkbox.scss +0 -1
- package/src/common-properties/controls/expression/expression.jsx +3 -5
- package/src/common-properties/controls/expression/languages/python-hint.js +18 -30
- package/src/common-properties/controls/expression/languages/r-hint.js +16 -8
- package/src/common-properties/index.js +4 -2
- package/src/icons/icon.scss +1 -1
- package/src/index.js +2 -2
- package/src/notification-panel/notification-panel.jsx +82 -56
- package/src/notification-panel/notification-panel.scss +42 -40
- package/src/object-model/config-utils.js +2 -2
- package/src/object-model/layout-dimensions.js +82 -87
- package/src/object-model/object-model-utils.js +271 -0
- package/src/object-model/object-model.js +47 -245
- package/src/object-model/redux/reducers/canvasinfo.js +7 -11
- package/src/object-model/redux/reducers/canvastoolbar.js +5 -6
- package/src/palette/palette-dialog-topbar.jsx +27 -38
- package/src/palette/palette-flyout-content-category.jsx +25 -6
- package/src/palette/palette.scss +8 -40
- package/src/toolbar/index.js +18 -0
- package/src/toolbar/toolbar-action-item.jsx +42 -11
- package/src/toolbar/toolbar-button-item.jsx +49 -21
- package/src/toolbar/toolbar-divider-item.jsx +1 -1
- package/src/toolbar/toolbar-overflow-item.jsx +14 -6
- package/src/toolbar/toolbar-sub-menu-item.jsx +6 -5
- package/src/toolbar/toolbar-sub-menu.jsx +4 -6
- package/src/toolbar/toolbar-sub-panel.jsx +31 -18
- package/src/toolbar/toolbar-sub-utils.js +21 -12
- package/src/toolbar/toolbar.jsx +83 -26
- package/src/toolbar/toolbar.scss +47 -47
- package/src/tooltip/tooltip.jsx +56 -10
- package/stats.html +1 -1
- package/assets/images/palette/close_32.svg +0 -1
- package/assets/images/palette/palette_close.svg +0 -4
- package/assets/images/palette/palette_grid_deselected.svg +0 -2
- package/assets/images/palette/palette_grid_hover.svg +0 -2
- package/assets/images/palette/palette_grid_selected.svg +0 -2
- package/assets/images/palette/palette_list_deselected.svg +0 -1
- package/assets/images/palette/palette_list_hover.svg +0 -1
- package/assets/images/palette/palette_list_selected.svg +0 -1
- package/assets/images/palette/palette_open.svg +0 -4
- package/assets/images/zoom_to_fit.svg +0 -8
- package/dist/canvas-controller-a53943e4.js +0 -2
- package/dist/canvas-controller-a53943e4.js.map +0 -1
- package/dist/canvas-controller-cb1d7420.js +0 -2
- package/dist/canvas-controller-cb1d7420.js.map +0 -1
- package/dist/common-canvas-42027a3f.js +0 -2
- package/dist/common-canvas-42027a3f.js.map +0 -1
- package/dist/common-canvas-f758ff42.js +0 -2
- package/dist/common-canvas-f758ff42.js.map +0 -1
- package/dist/common-properties-2e1b7ec7.js +0 -2
- package/dist/common-properties-2e1b7ec7.js.map +0 -1
- package/dist/common-properties-5e8870e3.js +0 -2
- package/dist/common-properties-5e8870e3.js.map +0 -1
- package/dist/context-menu-wrapper-49f9a1af.js +0 -2
- package/dist/context-menu-wrapper-49f9a1af.js.map +0 -1
- package/dist/context-menu-wrapper-5d6a399f.js +0 -2
- package/dist/context-menu-wrapper-5d6a399f.js.map +0 -1
- package/dist/createClass-440000a3.js.map +0 -1
- package/dist/createClass-5ca26865.js +0 -2
- package/dist/createClass-5ca26865.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-98ec66e9.js +0 -2
- package/dist/datarecord-metadata-v3-schema-dba0b214.js +0 -2
- package/dist/defineProperty-3dc7d8d0.js +0 -2
- package/dist/flexible-table-35e9922a.js +0 -2
- package/dist/flexible-table-7c7de0f9.js +0 -2
- package/dist/index-94fec521.js +0 -2
- package/dist/index-e2f8a935.js +0 -2
- package/dist/inherits-226dfdb2.js +0 -2
- package/dist/inherits-226dfdb2.js.map +0 -1
- package/dist/inherits-41673c87.js +0 -2
- package/dist/inherits-41673c87.js.map +0 -1
- package/dist/toolbar-6acda0a2.js +0 -2
- package/dist/toolbar-6acda0a2.js.map +0 -1
- package/dist/toolbar-d5647da2.js +0 -2
- package/dist/toolbar-d5647da2.js.map +0 -1
- package/src/palette/palette-dialog-topbar-three-way-icon.jsx +0 -82
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2017-
|
|
2
|
+
* Copyright 2017-2024 Elyra Authors
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -21,6 +21,7 @@ import PipelineOutHandler from "./pipeline-out-handler.js";
|
|
|
21
21
|
import CanvasUtils from "../common-canvas/common-canvas-utils";
|
|
22
22
|
import ConfigUtils from "./config-utils.js";
|
|
23
23
|
import LocalStorage from "../common-canvas/local-storage.js";
|
|
24
|
+
import { prepareNodes, setNodeAttributesWithLayout, setCommentAttributesWithLayout } from "./object-model-utils.js";
|
|
24
25
|
import APIPipeline from "./api-pipeline.js";
|
|
25
26
|
import CanvasStore from "./redux/canvas-store.js";
|
|
26
27
|
import Logger from "../logging/canvas-logger.js";
|
|
@@ -35,7 +36,6 @@ import { upgradePalette, extractPaletteVersion, LATEST_PALETTE_VERSION } from ".
|
|
|
35
36
|
import { ASSOCIATION_LINK, COMMENT_LINK, NODE_LINK, ERROR, WARNING, SUCCESS, INFO, CREATE_PIPELINE,
|
|
36
37
|
CLONE_COMMENT, CLONE_COMMENT_LINK, CLONE_NODE, CLONE_NODE_LINK, CLONE_PIPELINE, SUPER_NODE,
|
|
37
38
|
HIGHLIGHT_BRANCH, HIGHLIGHT_UPSTREAM, HIGHLIGHT_DOWNSTREAM,
|
|
38
|
-
SNAP_TO_GRID_AFTER, SNAP_TO_GRID_DURING,
|
|
39
39
|
SAVE_ZOOM_LOCAL_STORAGE, SAVE_ZOOM_PIPELINE_FLOW
|
|
40
40
|
} from "../common-canvas/constants/canvas-constants.js";
|
|
41
41
|
|
|
@@ -85,7 +85,8 @@ export default class ObjectModel {
|
|
|
85
85
|
setLayoutHandler(layoutHandler) {
|
|
86
86
|
if (layoutHandler !== this.layoutHandler) {
|
|
87
87
|
this.layoutHandler = layoutHandler;
|
|
88
|
-
const newPipelines =
|
|
88
|
+
const newPipelines =
|
|
89
|
+
prepareNodes(this.getCanvasInfo().pipelines, this.getNodeLayout(), this.getCanvasLayout(), this.layoutHandler);
|
|
89
90
|
this.store.dispatch({ type: "REPLACE_PIPELINES", data: { pipelines: newPipelines } });
|
|
90
91
|
}
|
|
91
92
|
}
|
|
@@ -247,7 +248,7 @@ export default class ObjectModel {
|
|
|
247
248
|
: PipelineInHandler.convertPipelinesToCanvasInfoPipelines(pd, this.getCanvasLayout());
|
|
248
249
|
// Need to make sure pipeline IDs are unique.
|
|
249
250
|
newPd = this.cloneSupernodeContents(supernode, newPd);
|
|
250
|
-
newPd =
|
|
251
|
+
newPd = prepareNodes(newPd, this.getNodeLayout(), this.getCanvasLayout(), this.layoutHandler, supernode);
|
|
251
252
|
|
|
252
253
|
} else {
|
|
253
254
|
const newPipeline = this.createEmptyPipeline();
|
|
@@ -443,7 +444,7 @@ export default class ObjectModel {
|
|
|
443
444
|
// true if a pipeline flow was loaded and false if not.
|
|
444
445
|
ensurePipelineIsLoaded(data) {
|
|
445
446
|
const snPipelineUrl = this.getSupernodePipelineUrl(data.targetObject);
|
|
446
|
-
const snPipelineId =
|
|
447
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(data.targetObject);
|
|
447
448
|
|
|
448
449
|
// If the pipeline isn't loaded check to make sure the external pipeline
|
|
449
450
|
// flow provided contains the target pipeline and, if so, load the pipeline
|
|
@@ -488,7 +489,7 @@ export default class ObjectModel {
|
|
|
488
489
|
let supernodes = [];
|
|
489
490
|
pipeline.nodes.forEach((n) => {
|
|
490
491
|
if (n.type === SUPER_NODE && n.is_expanded) {
|
|
491
|
-
const subFlowPipeline = pipelines.find((p) => p.id ===
|
|
492
|
+
const subFlowPipeline = pipelines.find((p) => p.id === CanvasUtils.getSupernodePipelineId(n));
|
|
492
493
|
|
|
493
494
|
// If this expanded supernode refers to an external pipeline that is
|
|
494
495
|
// not yet loaded then save to our output.
|
|
@@ -619,7 +620,6 @@ export default class ObjectModel {
|
|
|
619
620
|
if (this.store.getCanvasConfig().schemaValidation) {
|
|
620
621
|
validatePipelineFlowAgainstSchema(pipelineFlow);
|
|
621
622
|
}
|
|
622
|
-
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
return pipelineFlow;
|
|
@@ -639,227 +639,22 @@ export default class ObjectModel {
|
|
|
639
639
|
preparePipelineFlow(newPipelineFlow, supernode) {
|
|
640
640
|
const pipelineFlow = this.validateAndUpgrade(newPipelineFlow);
|
|
641
641
|
const canvasInfo = PipelineInHandler.convertPipelineFlowToCanvasInfo(pipelineFlow, this.getCanvasLayout());
|
|
642
|
-
canvasInfo.pipelines =
|
|
642
|
+
canvasInfo.pipelines =
|
|
643
|
+
prepareNodes(canvasInfo.pipelines, this.getNodeLayout(), this.getCanvasLayout(), this.layoutHandler, supernode);
|
|
643
644
|
return canvasInfo;
|
|
644
645
|
}
|
|
645
646
|
|
|
646
|
-
// Does all preparation needed for nodes before they are saved into Redux.
|
|
647
|
-
prepareNodes(pipelines, nodeLayout, canvasLayout, supernode) {
|
|
648
|
-
const newPipelines = this.setSupernodesBindingStatus(pipelines, supernode);
|
|
649
|
-
return newPipelines.map((pipeline) => this.setPipelineObjectAttributes(pipeline, nodeLayout, canvasLayout));
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
// Loops through all the pipelines and adds the appropriate supernode binding
|
|
653
|
-
// attribute to any binding nodes that are referenced by the ports of a supernode.
|
|
654
|
-
setSupernodesBindingStatus(pipelines, supernode) {
|
|
655
|
-
// First, clear all supernode binding statuses from nodes
|
|
656
|
-
pipelines.forEach((pipeline) => {
|
|
657
|
-
if (pipeline.nodes) {
|
|
658
|
-
pipeline.nodes.forEach((node) => {
|
|
659
|
-
delete node.isSupernodeInputBinding;
|
|
660
|
-
delete node.isSupernodeOutputBinding;
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
if (supernode) {
|
|
666
|
-
this.setSupernodesBindingStatusForNode(supernode, pipelines);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
// Set the supernode binding statuses as appropriate.
|
|
670
|
-
pipelines.forEach((pipeline) => {
|
|
671
|
-
if (pipeline.nodes) {
|
|
672
|
-
CanvasUtils.filterSupernodes(pipeline.nodes).forEach((node) => {
|
|
673
|
-
this.setSupernodesBindingStatusForNode(node, pipelines);
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
});
|
|
677
|
-
return pipelines;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
setSupernodesBindingStatusForNode(node, pipelines) {
|
|
681
|
-
const snPipelineId = this.getSupernodePipelineId(node);
|
|
682
|
-
if (snPipelineId) {
|
|
683
|
-
if (node.inputs) {
|
|
684
|
-
node.inputs.forEach((input) => {
|
|
685
|
-
if (input.subflow_node_ref) {
|
|
686
|
-
const subNode = this.findNode(input.subflow_node_ref, snPipelineId, pipelines);
|
|
687
|
-
if (subNode) {
|
|
688
|
-
subNode.isSupernodeInputBinding = true;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
if (node.outputs) {
|
|
694
|
-
node.outputs.forEach((output) => {
|
|
695
|
-
if (output.subflow_node_ref) {
|
|
696
|
-
const subNode = this.findNode(output.subflow_node_ref, snPipelineId, pipelines);
|
|
697
|
-
if (subNode) {
|
|
698
|
-
subNode.isSupernodeOutputBinding = true;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
});
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
setPipelineObjectAttributes(inPipeline, nodeLayout, canvasLayout) {
|
|
707
|
-
const pipeline = Object.assign({}, inPipeline);
|
|
708
|
-
if (pipeline.nodes) {
|
|
709
|
-
pipeline.nodes = pipeline.nodes.map((node) => this.setNodeAttributesWithLayout(node, nodeLayout, canvasLayout));
|
|
710
|
-
} else {
|
|
711
|
-
pipeline.nodes = [];
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
if (pipeline.comments) {
|
|
715
|
-
pipeline.comments = pipeline.comments.map((comment) => this.setCommentAttributesWithLayout(comment, canvasLayout));
|
|
716
|
-
} else {
|
|
717
|
-
pipeline.comments = [];
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
return pipeline;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
647
|
// Returns a copy of the node passed in with additional fields which contain
|
|
724
648
|
// layout, dimension and supernode binding status info. This uses the redux
|
|
725
649
|
// layout information.
|
|
726
650
|
setNodeAttributes(node) {
|
|
727
|
-
return
|
|
651
|
+
return setNodeAttributesWithLayout(node, this.getNodeLayout(), this.getCanvasLayout());
|
|
728
652
|
}
|
|
729
653
|
|
|
730
654
|
// Returns a copy of the comment passed in with position adjusted for
|
|
731
655
|
// snap to grid, if necessary. This is called from the api-pipeline class.
|
|
732
656
|
setCommentAttributes(comment) {
|
|
733
|
-
return
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// Returns a copy of the node passed using the layout info provided. The
|
|
737
|
-
// returned node is augmented with additional fields which contain
|
|
738
|
-
// layout, dimension and supernode binding status info.
|
|
739
|
-
setNodeAttributesWithLayout(node, nodeLayout, canvasLayout) {
|
|
740
|
-
let newNode = Object.assign({}, node);
|
|
741
|
-
newNode = this.setNodeLayoutAttributes(newNode, nodeLayout);
|
|
742
|
-
if (canvasLayout.linkDirection === "TopBottom" ||
|
|
743
|
-
canvasLayout.linkDirection === "BottomTop") {
|
|
744
|
-
newNode = this.setNodeDimensionAttributesVertical(newNode, canvasLayout);
|
|
745
|
-
} else {
|
|
746
|
-
newNode = this.setNodeDimensionAttributesLeftRight(newNode, canvasLayout);
|
|
747
|
-
}
|
|
748
|
-
if (canvasLayout.snapToGridType === SNAP_TO_GRID_DURING ||
|
|
749
|
-
canvasLayout.snapToGridType === SNAP_TO_GRID_AFTER) {
|
|
750
|
-
newNode.x_pos = CanvasUtils.snapToGrid(newNode.x_pos, canvasLayout.snapToGridXPx);
|
|
751
|
-
newNode.y_pos = CanvasUtils.snapToGrid(newNode.y_pos, canvasLayout.snapToGridYPx);
|
|
752
|
-
}
|
|
753
|
-
return newNode;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
// Returns a copy of the comment passed using the layout info provided. The
|
|
757
|
-
// returned comment has its position adjusted for snap to grid, if necessary.
|
|
758
|
-
setCommentAttributesWithLayout(comment, canvasLayout) {
|
|
759
|
-
const newComment = Object.assign({}, comment);
|
|
760
|
-
if (canvasLayout.snapToGridType === SNAP_TO_GRID_DURING ||
|
|
761
|
-
canvasLayout.snapToGridType === SNAP_TO_GRID_AFTER) {
|
|
762
|
-
newComment.x_pos = CanvasUtils.snapToGrid(newComment.x_pos, canvasLayout.snapToGridXPx);
|
|
763
|
-
newComment.y_pos = CanvasUtils.snapToGrid(newComment.y_pos, canvasLayout.snapToGridYPx);
|
|
764
|
-
}
|
|
765
|
-
return newComment;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
// Returns the node passed in with additional fields which contains
|
|
769
|
-
// the layout info.
|
|
770
|
-
setNodeLayoutAttributes(node, nodeLayout) {
|
|
771
|
-
node.layout = nodeLayout;
|
|
772
|
-
|
|
773
|
-
// If using the layoutHandler we must make a copy of the layout for each node
|
|
774
|
-
// so the original layout info doesn't get overwritten.
|
|
775
|
-
if (this.layoutHandler) {
|
|
776
|
-
const customLayout = this.layoutHandler(node);
|
|
777
|
-
if (customLayout && !isEmpty(customLayout)) {
|
|
778
|
-
const decs = CanvasUtils.getCombinedDecorations(node.layout.decorations, customLayout.decorations);
|
|
779
|
-
node.layout = Object.assign({}, node.layout, customLayout, { decorations: decs });
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return node;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// Returns the node passed in with additional fields which contains
|
|
786
|
-
// the height occupied by the input ports and output ports, based on the
|
|
787
|
-
// layout info passed in, as well as the node width.
|
|
788
|
-
setNodeDimensionAttributesLeftRight(node, canvasLayout) {
|
|
789
|
-
node.inputPortsHeight = node.inputs
|
|
790
|
-
? (node.inputs.length * (node.layout.portArcRadius * 2)) + ((node.inputs.length - 1) * node.layout.portArcSpacing) + (node.layout.portArcOffset * 2)
|
|
791
|
-
: 0;
|
|
792
|
-
|
|
793
|
-
node.outputPortsHeight = node.outputs
|
|
794
|
-
? (node.outputs.length * (node.layout.portArcRadius * 2)) + ((node.outputs.length - 1) * node.layout.portArcSpacing) + (node.layout.portArcOffset * 2)
|
|
795
|
-
: 0;
|
|
796
|
-
|
|
797
|
-
if (node.layout.autoSizeNode) {
|
|
798
|
-
node.height = Math.max(node.inputPortsHeight, node.outputPortsHeight, node.layout.defaultNodeHeight);
|
|
799
|
-
|
|
800
|
-
} else {
|
|
801
|
-
node.height = node.layout.defaultNodeHeight;
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
node.width = node.layout.defaultNodeWidth;
|
|
805
|
-
|
|
806
|
-
if (node.type === SUPER_NODE && node.is_expanded) {
|
|
807
|
-
node.height += canvasLayout.supernodeTopAreaHeight + canvasLayout.supernodeSVGAreaPadding;
|
|
808
|
-
// If an expanded height is provided make sure it is at least as big
|
|
809
|
-
// as the node height.
|
|
810
|
-
if (node.expanded_height) {
|
|
811
|
-
node.expanded_height = Math.max(node.expanded_height, node.height);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
node.width = CanvasUtils.getSupernodeExpandedWidth(node, canvasLayout);
|
|
815
|
-
node.height = CanvasUtils.getSupernodeExpandedHeight(node, canvasLayout);
|
|
816
|
-
|
|
817
|
-
} else if (node.isResized) {
|
|
818
|
-
node.height = node.resizeHeight ? node.resizeHeight : node.height;
|
|
819
|
-
node.width = node.resizeWidth ? node.resizeWidth : node.width;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
return node;
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
// Returns the node passed in with additional fields which contains
|
|
826
|
-
// the width occupied by the input ports and output ports, based on the
|
|
827
|
-
// layout info passed in, as well as the node height.
|
|
828
|
-
setNodeDimensionAttributesVertical(node, canvasLayout) {
|
|
829
|
-
node.inputPortsWidth = node.inputs
|
|
830
|
-
? (node.inputs.length * (node.layout.portArcRadius * 2)) + ((node.inputs.length - 1) * node.layout.portArcSpacing) + (node.layout.portArcOffset * 2)
|
|
831
|
-
: 0;
|
|
832
|
-
|
|
833
|
-
node.outputPortsWidth = node.outputs
|
|
834
|
-
? (node.outputs.length * (node.layout.portArcRadius * 2)) + ((node.outputs.length - 1) * node.layout.portArcSpacing) + (node.layout.portArcOffset * 2)
|
|
835
|
-
: 0;
|
|
836
|
-
|
|
837
|
-
node.height = node.layout.defaultNodeHeight;
|
|
838
|
-
|
|
839
|
-
if (node.layout.autoSizeNode) {
|
|
840
|
-
node.width = Math.max(node.inputPortsWidth, node.outputPortsWidth, node.layout.defaultNodeWidth);
|
|
841
|
-
|
|
842
|
-
} else {
|
|
843
|
-
node.width = node.layout.defaultNodeWidth;
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
if (node.type === SUPER_NODE && node.is_expanded) {
|
|
847
|
-
node.width += (2 * canvasLayout.supernodeSVGAreaPadding);
|
|
848
|
-
// If an expanded width is provided make sure it is at least as big
|
|
849
|
-
// as the node width.
|
|
850
|
-
if (node.expanded_width) {
|
|
851
|
-
node.expanded_width = Math.max(node.expanded_width, node.width);
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
node.width = CanvasUtils.getSupernodeExpandedWidth(node, canvasLayout);
|
|
855
|
-
node.height = CanvasUtils.getSupernodeExpandedHeight(node, canvasLayout);
|
|
856
|
-
|
|
857
|
-
} else if (node.isResized) {
|
|
858
|
-
node.height = node.resizeHeight ? node.resizeHeight : node.height;
|
|
859
|
-
node.width = node.resizeWidth ? node.resizeWidth : node.width;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
return node;
|
|
657
|
+
return setCommentAttributesWithLayout(comment, this.getCanvasLayout());
|
|
863
658
|
}
|
|
864
659
|
|
|
865
660
|
validateAndUpgrade(newPipelineFlow) {
|
|
@@ -903,7 +698,7 @@ export default class ObjectModel {
|
|
|
903
698
|
let pipelineIds = [];
|
|
904
699
|
this.getAPIPipeline(pipelineId).getSupernodes()
|
|
905
700
|
.forEach((supernode) => {
|
|
906
|
-
const snPipelineId =
|
|
701
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(supernode);
|
|
907
702
|
if (snPipelineId) {
|
|
908
703
|
pipelineIds.push(snPipelineId);
|
|
909
704
|
pipelineIds = pipelineIds.concat(this.getDescendantPipelineIds(snPipelineId));
|
|
@@ -922,7 +717,7 @@ export default class ObjectModel {
|
|
|
922
717
|
|
|
923
718
|
getDescendantPipelinesForSupernode(supernode) {
|
|
924
719
|
let pipelines = [];
|
|
925
|
-
const snPipelineId =
|
|
720
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(supernode);
|
|
926
721
|
if (snPipelineId) {
|
|
927
722
|
const subPipeline = this.getCanvasInfoPipeline(snPipelineId);
|
|
928
723
|
if (subPipeline) {
|
|
@@ -1023,7 +818,7 @@ export default class ObjectModel {
|
|
|
1023
818
|
getDescendantSupernodeInfosForSupernode(supernode, parentPipelineId, ignoreInfo) {
|
|
1024
819
|
let supernodeInfos = [];
|
|
1025
820
|
if (this.continueNavigation(supernode, parentPipelineId, ignoreInfo)) {
|
|
1026
|
-
const pipelineId =
|
|
821
|
+
const pipelineId = CanvasUtils.getSupernodePipelineId(supernode);
|
|
1027
822
|
const pipeline = this.getCanvasInfoPipeline(pipelineId);
|
|
1028
823
|
// An external pipeline might not be loaded if the supernode is collapsed.
|
|
1029
824
|
if (pipeline) {
|
|
@@ -1084,7 +879,7 @@ export default class ObjectModel {
|
|
|
1084
879
|
let ancestors = [];
|
|
1085
880
|
this.getAPIPipeline(upperPipelineId).getSupernodes()
|
|
1086
881
|
.forEach((supernode) => {
|
|
1087
|
-
const snPipelineId =
|
|
882
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(supernode);
|
|
1088
883
|
if (snPipelineId) {
|
|
1089
884
|
if (this.isAncestorOfPipeline(snPipelineId, lowerPipelineId) || snPipelineId === lowerPipelineId) {
|
|
1090
885
|
ancestors.push({ pipelineId: snPipelineId, label: supernode.label, supernodeId: supernode.id, parentPipelineId: upperPipelineId });
|
|
@@ -1100,14 +895,6 @@ export default class ObjectModel {
|
|
|
1100
895
|
return this.getDescendantPipelineIds(ancestorId).includes(pipelineId);
|
|
1101
896
|
}
|
|
1102
897
|
|
|
1103
|
-
getSupernodePipelineId(supernode) {
|
|
1104
|
-
if (supernode.type === SUPER_NODE &&
|
|
1105
|
-
has(supernode, "subflow_ref.pipeline_id_ref")) {
|
|
1106
|
-
return supernode.subflow_ref.pipeline_id_ref;
|
|
1107
|
-
}
|
|
1108
|
-
return null;
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
898
|
getSupernodePipelineUrl(supernode) {
|
|
1112
899
|
if (supernode.type === SUPER_NODE &&
|
|
1113
900
|
has(supernode, "subflow_ref.url")) {
|
|
@@ -1122,7 +909,7 @@ export default class ObjectModel {
|
|
|
1122
909
|
let supernodeRef;
|
|
1123
910
|
if (pipelineId === this.getPrimaryPipelineId()) {
|
|
1124
911
|
const supernodes = this.getAPIPipeline(pipelineId).getSupernodes();
|
|
1125
|
-
supernodeRef = supernodes.find((supernode) =>
|
|
912
|
+
supernodeRef = supernodes.find((supernode) => CanvasUtils.getSupernodePipelineId(supernode) === pipelineId).id;
|
|
1126
913
|
} else {
|
|
1127
914
|
const ancestorPipelines = this.getAncestorPipelineIds(pipelineId);
|
|
1128
915
|
const supernodePipelineObj = ancestorPipelines.find((pipelineObj) => pipelineObj.pipelineId === pipelineId && has(pipelineObj, "supernodeId"));
|
|
@@ -1133,7 +920,8 @@ export default class ObjectModel {
|
|
|
1133
920
|
|
|
1134
921
|
setCanvasInfo(inCanvasInfo) {
|
|
1135
922
|
const canvasInfo = Object.assign({}, inCanvasInfo);
|
|
1136
|
-
canvasInfo.pipelines =
|
|
923
|
+
canvasInfo.pipelines =
|
|
924
|
+
prepareNodes(canvasInfo.pipelines, this.getNodeLayout(), this.getCanvasLayout(), this.layoutHandler);
|
|
1137
925
|
this.store.dispatch({ type: "SET_CANVAS_INFO", canvasInfo: canvasInfo, canvasInfoIdChanged: this.hasCanvasInfoIdChanged(canvasInfo) });
|
|
1138
926
|
}
|
|
1139
927
|
|
|
@@ -1216,7 +1004,7 @@ export default class ObjectModel {
|
|
|
1216
1004
|
// descendants of the supernode passed in.
|
|
1217
1005
|
cloneSupernodeContents(node, inPipelines) {
|
|
1218
1006
|
let subPipelines = [];
|
|
1219
|
-
const snPipelineId =
|
|
1007
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(node);
|
|
1220
1008
|
if (snPipelineId) {
|
|
1221
1009
|
const targetPipeline = inPipelines.find((p) => p.id === snPipelineId);
|
|
1222
1010
|
// A target pipeline may not exist if the supernode is external. In which
|
|
@@ -1364,8 +1152,8 @@ export default class ObjectModel {
|
|
|
1364
1152
|
const newConfig = ConfigUtils.mergeCanvasConfigs(oldConfig, config);
|
|
1365
1153
|
|
|
1366
1154
|
if (!ConfigUtils.compareCanvasConfigs(oldConfig, newConfig)) {
|
|
1367
|
-
const newPipelines =
|
|
1368
|
-
this.getCanvasInfo().pipelines, newConfig.enableNodeLayout, newConfig.enableCanvasLayout);
|
|
1155
|
+
const newPipelines = prepareNodes(
|
|
1156
|
+
this.getCanvasInfo().pipelines, newConfig.enableNodeLayout, newConfig.enableCanvasLayout, this.layoutHandler);
|
|
1369
1157
|
|
|
1370
1158
|
this.store.dispatch({ type: "SET_CANVAS_CONFIG_INFO", data: {
|
|
1371
1159
|
canvasConfig: newConfig,
|
|
@@ -1378,6 +1166,14 @@ export default class ObjectModel {
|
|
|
1378
1166
|
this.store.dispatch({ type: "SET_TOOLBAR_CONFIG", data: { toolbarConfig: config } });
|
|
1379
1167
|
}
|
|
1380
1168
|
|
|
1169
|
+
// The toolbar.jsx React object retrieves some display attributes from the
|
|
1170
|
+
// canvas-controller, not from Redux. This method will refresh the toolbar
|
|
1171
|
+
// config which causes mapStateToProps to run in toolbar.jsx and that
|
|
1172
|
+
// will cause the toolbar to retrieve those attributes from canvas-contoller.
|
|
1173
|
+
refreshToolbar() {
|
|
1174
|
+
this.store.dispatch({ type: "REFRESH_TOOLBAR" });
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1381
1177
|
setNotificationPanelConfig(config) {
|
|
1382
1178
|
this.store.dispatch({ type: "SET_NOTIFICATION_PANEL_CONFIG", data: { notificationPanelConfig: config } });
|
|
1383
1179
|
}
|
|
@@ -1964,14 +1760,16 @@ export default class ObjectModel {
|
|
|
1964
1760
|
|
|
1965
1761
|
setZoom(zoom, pipelineId) {
|
|
1966
1762
|
const enableSaveZoom = this.getCanvasConfig().enableSaveZoom;
|
|
1967
|
-
// This will save zoom to the pipeline if enableSaveZoom is
|
|
1968
|
-
// SAVE_ZOOM_PIPELINE_FLOW and also will cause the toolbar to be updated
|
|
1969
|
-
// so zoom icons can be enabled/disabled.
|
|
1970
|
-
this.store.dispatch({ type: "SET_ZOOM", data: { zoom: zoom, enableSaveZoom }, pipelineId });
|
|
1971
1763
|
|
|
1972
|
-
if (enableSaveZoom ===
|
|
1764
|
+
if (enableSaveZoom === SAVE_ZOOM_PIPELINE_FLOW) {
|
|
1765
|
+
this.store.dispatch({ type: "SET_ZOOM", data: { zoom: zoom, enableSaveZoom }, pipelineId });
|
|
1766
|
+
|
|
1767
|
+
} else if (enableSaveZoom === SAVE_ZOOM_LOCAL_STORAGE) {
|
|
1973
1768
|
this.setSavedZoomLocal(zoom, pipelineId);
|
|
1974
1769
|
}
|
|
1770
|
+
// This will cause the toolbar to be updated so zoom icons can
|
|
1771
|
+
// be enabled/disabled.
|
|
1772
|
+
this.refreshToolbar();
|
|
1975
1773
|
}
|
|
1976
1774
|
|
|
1977
1775
|
// Returns the saved zoom based on the enableSaveZoom config parameter.
|
|
@@ -2106,7 +1904,7 @@ export default class ObjectModel {
|
|
|
2106
1904
|
getSupernodeNodeIds(nodeId, pipelineId, highlightNodeIds, highlightLinkIds) {
|
|
2107
1905
|
const node = this.getAPIPipeline(pipelineId).getNode(nodeId);
|
|
2108
1906
|
if (node.type === SUPER_NODE) {
|
|
2109
|
-
const snPipelineId =
|
|
1907
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(node);
|
|
2110
1908
|
|
|
2111
1909
|
highlightNodeIds[snPipelineId] = highlightNodeIds[snPipelineId] || [];
|
|
2112
1910
|
highlightLinkIds[snPipelineId] = highlightLinkIds[snPipelineId] || [];
|
|
@@ -2145,7 +1943,7 @@ export default class ObjectModel {
|
|
|
2145
1943
|
|
|
2146
1944
|
const srcNodeOutputPort = this.getSupernodeOutputPortForLink(srcNode, link);
|
|
2147
1945
|
if (srcNodeOutputPort) {
|
|
2148
|
-
const snPipelineId =
|
|
1946
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(srcNode);
|
|
2149
1947
|
const bindingNode = this.getAPIPipeline(snPipelineId).getNode(srcNodeOutputPort.subflow_node_ref);
|
|
2150
1948
|
|
|
2151
1949
|
if (bindingNode) {
|
|
@@ -2184,7 +1982,7 @@ export default class ObjectModel {
|
|
|
2184
1982
|
const upstreamSupernodeOutputPort = this.getSupernodeOutputPortForLink(upstreamSupernode, supernodeLink);
|
|
2185
1983
|
if (upstreamSupernodeOutputPort) {
|
|
2186
1984
|
const bindingNodeId = upstreamSupernodeOutputPort.subflow_node_ref;
|
|
2187
|
-
this.getUpstreamObjIdsFrom(bindingNodeId,
|
|
1985
|
+
this.getUpstreamObjIdsFrom(bindingNodeId, CanvasUtils.getSupernodePipelineId(upstreamSupernode), highlightNodeIds, highlightLinkIds);
|
|
2188
1986
|
}
|
|
2189
1987
|
} else {
|
|
2190
1988
|
this.getUpstreamObjIdsFrom(supernodeLink.srcNodeId, parentPipelineId, highlightNodeIds, highlightLinkIds);
|
|
@@ -2218,7 +2016,7 @@ export default class ObjectModel {
|
|
|
2218
2016
|
|
|
2219
2017
|
const trgNodeInputPort = this.getSupernodeInputPortForLink(trgNode, link);
|
|
2220
2018
|
if (trgNodeInputPort) {
|
|
2221
|
-
const snPipelineId =
|
|
2019
|
+
const snPipelineId = CanvasUtils.getSupernodePipelineId(trgNode);
|
|
2222
2020
|
const bindingNode = this.getAPIPipeline(snPipelineId).getNode(trgNodeInputPort.subflow_node_ref);
|
|
2223
2021
|
|
|
2224
2022
|
if (bindingNode) {
|
|
@@ -2257,7 +2055,7 @@ export default class ObjectModel {
|
|
|
2257
2055
|
const downstreamSupernodeInputPort = this.getSupernodeInputPortForLink(downstreamSupernode, supernodeLink);
|
|
2258
2056
|
if (downstreamSupernodeInputPort) {
|
|
2259
2057
|
const bindingNodeId = downstreamSupernodeInputPort.subflow_node_ref;
|
|
2260
|
-
this.getDownstreamObjIdsFrom(bindingNodeId,
|
|
2058
|
+
this.getDownstreamObjIdsFrom(bindingNodeId, CanvasUtils.getSupernodePipelineId(downstreamSupernode), highlightNodeIds, highlightLinkIds);
|
|
2261
2059
|
}
|
|
2262
2060
|
} else {
|
|
2263
2061
|
this.getDownstreamObjIdsFrom(supernodeLink.trgNodeId, parentPipelineId, highlightNodeIds, highlightLinkIds);
|
|
@@ -2275,7 +2073,7 @@ export default class ObjectModel {
|
|
|
2275
2073
|
// does not have a reference to one of the node's input ports.
|
|
2276
2074
|
getSupernodeInputPortForLink(trgNode, link) {
|
|
2277
2075
|
let port = null;
|
|
2278
|
-
if (
|
|
2076
|
+
if (CanvasUtils.getSupernodePipelineId(trgNode) && link.trgNodePortId) {
|
|
2279
2077
|
trgNode.inputs.forEach((inputPort) => {
|
|
2280
2078
|
if (inputPort.id === link.trgNodePortId) {
|
|
2281
2079
|
port = inputPort;
|
|
@@ -2291,7 +2089,7 @@ export default class ObjectModel {
|
|
|
2291
2089
|
// does not have a reference to one of the node's output ports.
|
|
2292
2090
|
getSupernodeOutputPortForLink(srcNode, link) {
|
|
2293
2091
|
let port = null;
|
|
2294
|
-
if (
|
|
2092
|
+
if (CanvasUtils.getSupernodePipelineId(srcNode) && link.srcNodePortId) {
|
|
2295
2093
|
srcNode.outputs.forEach((outputPort) => {
|
|
2296
2094
|
if (outputPort.id === link.srcNodePortId) {
|
|
2297
2095
|
port = outputPort;
|
|
@@ -2432,6 +2230,10 @@ export default class ObjectModel {
|
|
|
2432
2230
|
this.store.dispatch({ type: "SET_TOOLTIP_DEF", data: { tooltipDef: tipDef } });
|
|
2433
2231
|
}
|
|
2434
2232
|
|
|
2233
|
+
getTooltip() {
|
|
2234
|
+
return this.store.getTooltip();
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2435
2237
|
isTooltipOpen() {
|
|
2436
2238
|
return this.store.isTooltipOpen();
|
|
2437
2239
|
}
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
import nodes from "./nodes.js";
|
|
19
19
|
import comments from "./comments.js";
|
|
20
20
|
import links from "./links.js";
|
|
21
|
-
import { SAVE_ZOOM_PIPELINE_FLOW } from "../../../common-canvas/constants/canvas-constants.js";
|
|
22
21
|
|
|
23
22
|
export default (state = {}, action) => {
|
|
24
23
|
switch (action.type) {
|
|
@@ -99,16 +98,13 @@ export default (state = {}, action) => {
|
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
case "SET_ZOOM": {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return Object.assign({}, state, { pipelines: canvasInfoPipelines });
|
|
110
|
-
}
|
|
111
|
-
return state;
|
|
101
|
+
const canvasInfoPipelines = state.pipelines.map((pipeline) => {
|
|
102
|
+
if (pipeline.id === action.pipelineId) {
|
|
103
|
+
return Object.assign({}, pipeline, { zoom: { "k": action.data.zoom.k, "x": action.data.zoom.x, "y": action.data.zoom.y } });
|
|
104
|
+
}
|
|
105
|
+
return pipeline;
|
|
106
|
+
});
|
|
107
|
+
return Object.assign({}, state, { pipelines: canvasInfoPipelines });
|
|
112
108
|
}
|
|
113
109
|
|
|
114
110
|
case "ADD_SUPERNODES": {
|
|
@@ -16,16 +16,15 @@
|
|
|
16
16
|
|
|
17
17
|
export default (state = {}, action) => {
|
|
18
18
|
switch (action.type) {
|
|
19
|
-
// Setting a zoom amount needs to cause toolbar to be re-rendered to
|
|
20
|
-
// enable/disable zoom buttons.
|
|
21
|
-
case "SET_ZOOM": {
|
|
22
|
-
return Object.assign({}, state);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
19
|
case "SET_TOOLBAR_CONFIG": {
|
|
26
20
|
return Object.assign({}, state, { config: action.data.toolbarConfig });
|
|
27
21
|
}
|
|
28
22
|
|
|
23
|
+
case "REFRESH_TOOLBAR": {
|
|
24
|
+
return Object.assign({}, state);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
29
28
|
default:
|
|
30
29
|
return state;
|
|
31
30
|
}
|
|
@@ -16,14 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
|
-
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
import
|
|
23
|
-
import PaletteGridDeSelectedIcon from "../../assets/images/palette/palette_grid_deselected.svg";
|
|
24
|
-
import PaletteListSelectedIcon from "../../assets/images/palette/palette_list_selected.svg";
|
|
25
|
-
import PaletteListHoverIcon from "../../assets/images/palette/palette_list_hover.svg";
|
|
26
|
-
import PaletteListDeSelectedIcon from "../../assets/images/palette/palette_list_deselected.svg";
|
|
19
|
+
|
|
20
|
+
import { CloseOutline16, Grid16, List16 } from "@carbon/icons-react";
|
|
21
|
+
|
|
22
|
+
import Toolbar from "../toolbar";
|
|
27
23
|
|
|
28
24
|
class PaletteDialogTopbar extends React.Component {
|
|
29
25
|
constructor(props) {
|
|
@@ -34,9 +30,7 @@ class PaletteDialogTopbar extends React.Component {
|
|
|
34
30
|
|
|
35
31
|
this.mouseDown = this.mouseDown.bind(this);
|
|
36
32
|
this.doubleClick = this.doubleClick.bind(this);
|
|
37
|
-
this.
|
|
38
|
-
this.gridViewSelected = this.gridViewSelected.bind(this);
|
|
39
|
-
this.listViewSelected = this.listViewSelected.bind(this);
|
|
33
|
+
this.toolbarActionHandler = this.toolbarActionHandler.bind(this);
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
mouseDown(mouseDownEvent) {
|
|
@@ -47,40 +41,35 @@ class PaletteDialogTopbar extends React.Component {
|
|
|
47
41
|
this.props.windowMaximizeMethod(doubleClickEvent);
|
|
48
42
|
}
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
toolbarActionHandler(action) {
|
|
45
|
+
if (action === "close") {
|
|
46
|
+
this.props.canvasController.closePalette();
|
|
53
47
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
48
|
+
} else if (action === "grid") {
|
|
49
|
+
this.props.showGridMethod(true);
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
} else if (action === "list") {
|
|
52
|
+
this.props.showGridMethod(false);
|
|
53
|
+
}
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
render() {
|
|
57
|
+
const config = {
|
|
58
|
+
leftBar: [
|
|
59
|
+
{ action: "grid", iconEnabled: (<Grid16 />), enable: true, isSelected: this.props.showGrid },
|
|
60
|
+
{ action: "list", iconEnabled: (<List16 />), enable: true, isSelected: !this.props.showGrid },
|
|
61
|
+
{ divider: true }
|
|
62
|
+
],
|
|
63
|
+
rightBar: [
|
|
64
|
+
{ divider: true },
|
|
65
|
+
{ action: "close", iconEnabled: (<CloseOutline16 />), enable: true }
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
|
|
63
70
|
return (
|
|
64
71
|
<div className="palette-dialog-topbar" onMouseDown={this.mouseDown} onDoubleClick={this.doubleClick}>
|
|
65
|
-
<
|
|
66
|
-
<PaletteDialogTopbarThreeWayIcon iconClickedMethod={this.gridViewSelected}
|
|
67
|
-
isSelected={this.props.showGrid}
|
|
68
|
-
selectedIconName={PaletteGridSelectedIcon}
|
|
69
|
-
hoverIconName={PaletteGridHoverIcon}
|
|
70
|
-
deselectedIconName={PaletteGridDeSelectedIcon}
|
|
71
|
-
/>
|
|
72
|
-
<PaletteDialogTopbarThreeWayIcon iconClickedMethod={this.listViewSelected}
|
|
73
|
-
isSelected={!this.props.showGrid}
|
|
74
|
-
selectedIconName={PaletteListSelectedIcon}
|
|
75
|
-
hoverIconName={PaletteListHoverIcon}
|
|
76
|
-
deselectedIconName={PaletteListDeSelectedIcon}
|
|
77
|
-
/>
|
|
78
|
-
</span>
|
|
79
|
-
<span className="right-navbar">
|
|
80
|
-
<a className="secondary-action" onClick={this.close}>
|
|
81
|
-
<img src={Close32Icon} draggable="false" className="close-icon" />
|
|
82
|
-
</a>
|
|
83
|
-
</span>
|
|
72
|
+
<Toolbar instanceId = {0} config={config} toolbarActionHandler={this.toolbarActionHandler} />
|
|
84
73
|
</div>
|
|
85
74
|
);
|
|
86
75
|
}
|