@elyra/canvas 12.10.0 → 12.11.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-7f93e705.js +2 -0
- package/dist/canvas-constants-7f93e705.js.map +1 -0
- package/dist/canvas-constants-ac5daafb.js +2 -0
- package/dist/canvas-constants-ac5daafb.js.map +1 -0
- package/dist/canvas-controller-183ff6a7.js +2 -0
- package/dist/canvas-controller-183ff6a7.js.map +1 -0
- package/dist/canvas-controller-d70a731e.js +2 -0
- package/dist/canvas-controller-d70a731e.js.map +1 -0
- package/dist/canvas-logger-815781bb.js +2 -0
- package/dist/canvas-logger-815781bb.js.map +1 -0
- package/dist/canvas-logger-a0f1beaa.js +2 -0
- package/dist/canvas-logger-a0f1beaa.js.map +1 -0
- package/dist/common-canvas-3e832a84.js +2 -0
- package/dist/common-canvas-3e832a84.js.map +1 -0
- package/dist/common-canvas-c50cb3f3.js +2 -0
- package/dist/common-canvas-c50cb3f3.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-4f471b2b.js +2 -0
- package/dist/common-properties-4f471b2b.js.map +1 -0
- package/dist/common-properties-9161cd27.js +2 -0
- package/dist/common-properties-9161cd27.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-bda88f2e.js +2 -0
- package/dist/datarecord-metadata-v3-schema-bda88f2e.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-d7ad05cd.js +2 -0
- package/dist/datarecord-metadata-v3-schema-d7ad05cd.js.map +1 -0
- package/dist/en-2ed89528.js +2 -0
- package/dist/en-2ed89528.js.map +1 -0
- package/dist/en-e93855cc.js +2 -0
- package/dist/en-e93855cc.js.map +1 -0
- package/dist/extends-39f57612.js +7 -0
- package/dist/extends-39f57612.js.map +1 -0
- package/dist/extends-51d9ddcc.js +7 -0
- package/dist/extends-51d9ddcc.js.map +1 -0
- package/dist/flexible-table-154a3359.js +2 -0
- package/dist/flexible-table-154a3359.js.map +1 -0
- package/dist/flexible-table-5e4a1e6d.js +2 -0
- package/dist/flexible-table-5e4a1e6d.js.map +1 -0
- package/dist/icon-811ffddd.js +2 -0
- package/dist/icon-811ffddd.js.map +1 -0
- package/dist/icon-d6909a68.js +2 -0
- package/dist/icon-d6909a68.js.map +1 -0
- package/dist/index-4fd90a14.js +2 -0
- package/dist/index-4fd90a14.js.map +1 -0
- package/dist/index-6d138021.js +2 -0
- package/dist/index-6d138021.js.map +1 -0
- package/dist/isArrayLikeObject-31e5e646.js +2 -0
- package/dist/isArrayLikeObject-31e5e646.js.map +1 -0
- package/dist/isArrayLikeObject-7c33c7fd.js +2 -0
- package/dist/isArrayLikeObject-7c33c7fd.js.map +1 -0
- package/dist/lib/canvas-controller.es.js +2 -0
- package/dist/lib/canvas-controller.es.js.map +1 -0
- package/dist/lib/canvas-controller.js +2 -0
- package/dist/lib/canvas-controller.js.map +1 -0
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.es.js.map +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/context-menu.js.map +1 -1
- 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.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-335252dd.js +2 -0
- package/dist/toolbar-335252dd.js.map +1 -0
- package/dist/toolbar-85e6c77b.js +2 -0
- package/dist/toolbar-85e6c77b.js.map +1 -0
- package/locales/command-actions/locales/en.json +7 -1
- package/locales/command-actions/locales/eo.json +7 -1
- package/locales/command-actions/locales/index.js +3 -1
- package/locales/command-actions/locales/ko.json +9 -0
- package/locales/common-canvas/locales/en.json +1 -0
- package/locales/common-canvas/locales/eo.json +1 -0
- package/locales/common-canvas/locales/index.js +3 -1
- package/locales/common-canvas/locales/ko.json +32 -0
- package/locales/common-properties/locales/index.js +3 -1
- package/locales/common-properties/locales/ko.json +93 -0
- package/locales/palette/locales/index.js +3 -1
- package/locales/palette/locales/ko.json +10 -0
- package/locales/toolbar/locales/index.js +3 -1
- package/locales/toolbar/locales/ko.json +8 -0
- package/package.json +7 -3
- package/rollup.config.js +10 -7
- package/src/color-picker/color-picker-panel.jsx +61 -0
- package/src/color-picker/color-picker.jsx +37 -0
- package/src/color-picker/color-picker.scss +46 -0
- package/src/command-actions/colorSelectedObjectsAction.js +72 -0
- package/src/command-actions/deleteObjectsAction.js +16 -11
- package/src/command-actions/pasteAction.js +50 -21
- package/src/common-canvas/canvas-controller.js +32 -5
- package/src/common-canvas/cc-bottom-panel.jsx +34 -37
- package/src/common-canvas/cc-contents.jsx +114 -12
- package/src/common-canvas/cc-toolbar.jsx +3 -2
- package/src/common-canvas/common-canvas-utils.js +39 -78
- package/src/common-canvas/common-canvas.scss +28 -14
- package/src/common-canvas/constants/canvas-constants.js +17 -16
- package/src/common-canvas/label-util.js +1 -1
- package/src/common-canvas/svg-canvas-d3.js +20 -107
- package/src/common-canvas/svg-canvas-d3.scss +67 -6
- package/src/common-canvas/svg-canvas-pipeline.js +201 -0
- package/src/common-canvas/svg-canvas-renderer.js +155 -164
- package/src/common-canvas/svg-canvas-utils-links.js +3 -3
- package/src/common-canvas/svg-canvas-utils-nodes.js +22 -34
- package/src/common-properties/actions.js +4 -0
- package/src/common-properties/components/field-picker/field-picker.jsx +33 -36
- package/src/common-properties/components/field-picker/field-picker.scss +20 -23
- package/src/common-properties/components/flexible-table/flexible-table.jsx +46 -31
- package/src/common-properties/components/flexible-table/flexible-table.scss +14 -17
- package/src/common-properties/components/properties-buttons/properties-buttons.jsx +28 -21
- package/src/common-properties/components/table-buttons/table-buttons.jsx +3 -1
- package/src/common-properties/components/table-buttons/table-buttons.scss +8 -8
- package/src/common-properties/components/title-editor/title-editor.jsx +31 -4
- package/src/common-properties/components/title-editor/title-editor.scss +30 -5
- package/src/common-properties/components/virtualized-table/virtualized-table.jsx +120 -29
- package/src/common-properties/components/virtualized-table/virtualized-table.scss +72 -8
- package/src/common-properties/constants/constants.js +5 -1
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/abstract-table.jsx +12 -11
- package/src/common-properties/controls/abstract-table.scss +6 -2
- package/src/common-properties/controls/dropdown/dropdown.scss +4 -0
- package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +2 -2
- package/src/common-properties/controls/passwordfield/passwordfield.jsx +2 -2
- package/src/common-properties/controls/readonlytable/readonlytable.jsx +4 -2
- package/src/common-properties/controls/selectcolumns/selectcolumns.scss +0 -19
- package/src/common-properties/controls/someofselect/someofselect.scss +2 -2
- package/src/common-properties/form/ControlInfo.js +8 -0
- package/src/common-properties/form/EditorForm.js +4 -0
- package/src/common-properties/form/ParameterInfo.js +4 -0
- package/src/common-properties/panels/sub-panel/cell.jsx +18 -23
- package/src/common-properties/panels/sub-panel/sub-panel.scss +5 -22
- package/src/common-properties/properties-controller.js +18 -0
- package/src/common-properties/properties-main/properties-main.jsx +15 -9
- package/src/common-properties/properties-main/properties-main.scss +9 -2
- package/src/common-properties/properties-store.js +27 -1
- package/src/common-properties/reducers/properties-settings.js +17 -1
- package/src/context-menu/common-context-menu.jsx +74 -29
- package/src/context-menu/context-menu-wrapper.jsx +2 -2
- package/src/icons/icon.jsx +5 -46
- package/src/index.scss +1 -0
- package/src/object-model/api-pipeline.js +25 -42
- package/src/object-model/object-model.js +27 -3
- package/src/object-model/redux/canvas-store.js +68 -0
- package/src/object-model/redux/reducers/canvasinfo.js +36 -0
- package/src/object-model/redux/reducers/comments.js +58 -10
- package/src/object-model/redux/reducers/externalpipelineflows.js +1 -0
- package/src/object-model/redux/reducers/links.js +9 -7
- package/src/object-model/redux/reducers/selectioninfo.js +2 -1
- package/src/palette/palette-content-list-item.jsx +8 -1
- package/src/palette/palette-dialog-content-grid-node.jsx +8 -1
- package/src/palette/palette-flyout-utils.js +3 -3
- package/src/toolbar/toolbar-action-item.jsx +77 -14
- package/src/toolbar/toolbar-overflow-item.jsx +2 -3
- package/src/tooltip/tooltip.jsx +4 -1
- package/stats.html +1 -1
- package/dist/canvas-controller-5c90a709.js +0 -2
- package/dist/canvas-controller-5c90a709.js.map +0 -1
- package/dist/canvas-controller-a851a663.js +0 -2
- package/dist/canvas-controller-a851a663.js.map +0 -1
- package/dist/common-properties-3758e3b2.js +0 -2
- package/dist/common-properties-3758e3b2.js.map +0 -1
- package/dist/common-properties-6334cca1.js +0 -2
- package/dist/common-properties-6334cca1.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-3a2957c3.js +0 -2
- package/dist/datarecord-metadata-v3-schema-3a2957c3.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-82f2b977.js +0 -2
- package/dist/datarecord-metadata-v3-schema-82f2b977.js.map +0 -1
- package/dist/en-9e368daa.js +0 -2
- package/dist/en-9e368daa.js.map +0 -1
- package/dist/en-a3710fcf.js +0 -2
- package/dist/en-a3710fcf.js.map +0 -1
- package/dist/extends-41535aa9.js +0 -7
- package/dist/extends-41535aa9.js.map +0 -1
- package/dist/extends-76e6b8d2.js +0 -8
- package/dist/extends-76e6b8d2.js.map +0 -1
- package/dist/flexible-table-2bbb9e48.js +0 -2
- package/dist/flexible-table-2bbb9e48.js.map +0 -1
- package/dist/flexible-table-756ff86a.js +0 -2
- package/dist/flexible-table-756ff86a.js.map +0 -1
- package/dist/index-1eff5860.js +0 -2
- package/dist/index-1eff5860.js.map +0 -1
- package/dist/index-7fba99b9.js +0 -2
- package/dist/index-7fba99b9.js.map +0 -1
- package/dist/isEmpty-3550e76f.js +0 -2
- package/dist/isEmpty-3550e76f.js.map +0 -1
- package/dist/isEmpty-c6f783dd.js +0 -2
- package/dist/isEmpty-c6f783dd.js.map +0 -1
|
@@ -20,6 +20,7 @@ import PropTypes from "prop-types";
|
|
|
20
20
|
import { MenuItem, SubMenu } from "react-contextmenu";
|
|
21
21
|
import Icon from "../icons/icon.jsx";
|
|
22
22
|
import { CONTEXT_MENU_CARBON_ICONS } from "../common-canvas/constants/canvas-constants";
|
|
23
|
+
import ColorPickerPanel from "../color-picker/color-picker-panel.jsx";
|
|
23
24
|
|
|
24
25
|
// context-menu sizing
|
|
25
26
|
const CONTEXT_MENU_WIDTH = 160; // see context-menu.css .react-context-menu margin
|
|
@@ -33,6 +34,7 @@ class CommonContextMenu extends React.Component {
|
|
|
33
34
|
super(props);
|
|
34
35
|
this.state = {};
|
|
35
36
|
this.itemSelected = this.itemSelected.bind(this);
|
|
37
|
+
this.colorClicked = this.colorClicked.bind(this);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
onContextMenu(e) {
|
|
@@ -48,6 +50,10 @@ class CommonContextMenu extends React.Component {
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
|
|
53
|
+
colorClicked(color) {
|
|
54
|
+
this.props.contextHandler("colorSelectedObjects", { color });
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
calculateMenuSize(menu) {
|
|
52
58
|
var numDividers = 0;
|
|
53
59
|
for (let i = 0; i < menu.length; ++i) {
|
|
@@ -129,40 +135,28 @@ class CommonContextMenu extends React.Component {
|
|
|
129
135
|
|
|
130
136
|
} else if (submenu) {
|
|
131
137
|
previousDivider = false;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// Ensure that the combined menu position, plus the menu width,
|
|
138
|
-
// plus the submenu width, does not exceed the viewport bounds.
|
|
139
|
-
if (menuPos.x + menuSize.width + submenuSize.width > canvasRect.right) {
|
|
140
|
-
rtl = true;
|
|
141
|
-
}
|
|
138
|
+
if (menuDefinition[i].menu === "colorPicker") {
|
|
139
|
+
const disabled = false;
|
|
140
|
+
const subMenuSize = { width: CONTEXT_MENU_WIDTH, height: 50 };
|
|
141
|
+
const subMenuContent = this.buildColorPickerPanel();
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
const subMenu = this.buildSubMenu(
|
|
144
|
+
menuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);
|
|
145
|
+
menuItems.push(subMenu);
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
// submenu will not be moved. Otherwise, y will be used to move the
|
|
148
|
-
// submenu up fully into the view port.
|
|
149
|
-
const offset = (y > 0) ? 0 : y - EXTRA_OFFSET;
|
|
147
|
+
runningYPos += CONTEXT_MENU_LINK_HEIGHT;
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
} else {
|
|
150
|
+
const disabled = { disabled: this.areAllSubmenuItemsDisabled(menuDefinition[i].menu) };
|
|
151
|
+
const subMenuSize = this.calculateMenuSize(menuDefinition[i].menu);
|
|
152
|
+
const subMenuContent = this.buildMenu(menuDefinition[i].menu, menuSize, menuPos, canvasRect);
|
|
154
153
|
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
const subMenu = this.buildSubMenu(
|
|
155
|
+
menuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);
|
|
156
|
+
menuItems.push(subMenu);
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<div key={i + 1} style={subMenuPosStyle} className="context-menu-popover">
|
|
161
|
-
{submenuItems}
|
|
162
|
-
</div>
|
|
163
|
-
</SubMenu>
|
|
164
|
-
);
|
|
165
|
-
runningYPos += CONTEXT_MENU_LINK_HEIGHT;
|
|
158
|
+
runningYPos += CONTEXT_MENU_LINK_HEIGHT;
|
|
159
|
+
}
|
|
166
160
|
|
|
167
161
|
} else {
|
|
168
162
|
previousDivider = false;
|
|
@@ -178,6 +172,57 @@ class CommonContextMenu extends React.Component {
|
|
|
178
172
|
return menuItems;
|
|
179
173
|
}
|
|
180
174
|
|
|
175
|
+
buildColorPickerPanel() {
|
|
176
|
+
return (
|
|
177
|
+
<ColorPickerPanel clickActionHandler={this.colorPickHandler} clickActionHandler={this.colorClicked} />
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
buildSubMenu(menuDefinition, index, subMenuContent, runningYPos, menuPos,
|
|
182
|
+
menuSize, subMenuSize, canvasRect, disabled) {
|
|
183
|
+
const rtl = this.buildRtlState(menuPos, menuSize, subMenuSize, canvasRect);
|
|
184
|
+
const subMenuPosStyle = this.buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect);
|
|
185
|
+
|
|
186
|
+
const icon = <Icon type={CONTEXT_MENU_CARBON_ICONS.CHEVRONARROWS.RIGHT} disabled={false} className={"react-contextmenu-submenu-icon"} />;
|
|
187
|
+
const menuItem = <div>{menuDefinition[index].label}{icon} </div>;
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<SubMenu title={menuItem} key={index + 1} className="contextmenu-submenu" rtl={rtl} {...disabled}>
|
|
191
|
+
<div key={index + 1} style={subMenuPosStyle} className="context-menu-popover">
|
|
192
|
+
{subMenuContent}
|
|
193
|
+
</div>
|
|
194
|
+
</SubMenu>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Returns a boolean to indicate whether the submenu should appear on the
|
|
199
|
+
// right of the context menu (rtl === false) or on the left of the context
|
|
200
|
+
// menu (rtl === true).
|
|
201
|
+
buildRtlState(menuPos, menuSize, subMenuSize, canvasRect) {
|
|
202
|
+
// Ensure that the combined menu position, plus the menu width,
|
|
203
|
+
// plus the submenu width, does not exceed the viewport bounds.
|
|
204
|
+
return (menuPos.x + menuSize.width + subMenuSize.width > canvasRect.right);
|
|
205
|
+
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Returns a style object that can be applied to the sub-menu to adjust
|
|
209
|
+
// its vertical (y) position. This may be necessary if the submenu is tall
|
|
210
|
+
// enough that it would be displayed off the bottom of the canvas area.
|
|
211
|
+
buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect) {
|
|
212
|
+
// Does the submenu go below the bottom of the viewport?
|
|
213
|
+
const y = canvasRect.bottom - (menuPos.y + runningYPos + subMenuSize.height);
|
|
214
|
+
|
|
215
|
+
// If submenu is not below the viewport bottom set offset to 0 so the
|
|
216
|
+
// submenu will not be moved. Otherwise, y will be used to move the
|
|
217
|
+
// submenu up fully into the view port.
|
|
218
|
+
const offset = (y > 0) ? 0 : y - EXTRA_OFFSET;
|
|
219
|
+
|
|
220
|
+
const subMenuPosStyle = {
|
|
221
|
+
top: offset + "px" // Use negative to push the menu up
|
|
222
|
+
};
|
|
223
|
+
return subMenuPosStyle;
|
|
224
|
+
}
|
|
225
|
+
|
|
181
226
|
render() {
|
|
182
227
|
// Reposition contextMenu so that it does not show off the screen
|
|
183
228
|
const menuSize = this.calculateMenuSize(this.props.menuDefinition);
|
|
@@ -83,8 +83,8 @@ export default class ContextMenuWrapper extends React.Component {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
contextMenuClicked(action) {
|
|
87
|
-
this.props.contextMenuActionHandler(action);
|
|
86
|
+
contextMenuClicked(action, param) {
|
|
87
|
+
this.props.contextMenuActionHandler(action, param);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
render() {
|
package/src/icons/icon.jsx
CHANGED
|
@@ -19,30 +19,21 @@ import PropTypes from "prop-types";
|
|
|
19
19
|
import classNames from "classnames";
|
|
20
20
|
import SVG from "react-inlinesvg";
|
|
21
21
|
|
|
22
|
-
import ArrangeHorizontally from "./../../assets/images/arrange_horizontally.svg";
|
|
23
|
-
import ArrangeVertically from "./../../assets/images/arrange_vertically.svg";
|
|
24
22
|
import Double from "./../../assets/images/double.svg";
|
|
25
23
|
import Integer from "./../../assets/images/integer.svg";
|
|
26
24
|
import StringIcon from "./../../assets/images/string.svg";
|
|
27
|
-
import ToggleNotificationPanel from "./../../assets/images/notification_counter_icon.svg";
|
|
28
|
-
import PaletteClose from "./../../assets/images/palette/palette_close.svg";
|
|
29
|
-
import PaletteOpen from "./../../assets/images/palette/palette_open.svg";
|
|
30
|
-
import ZoomToFit from "./../../assets/images/zoom_to_fit.svg";
|
|
31
25
|
|
|
32
26
|
import { WarningFilled16, ErrorFilled16, CheckmarkFilled16, InformationFilled16, Information16,
|
|
33
27
|
ChevronDown16, ChevronUp16, ChevronLeft16, ChevronRight16,
|
|
34
|
-
OverflowMenuVertical16,
|
|
35
28
|
AddAlt16,
|
|
36
29
|
Settings16,
|
|
37
30
|
Search16,
|
|
38
31
|
Warning16,
|
|
39
32
|
Edit16,
|
|
40
|
-
StopFilledAlt16, Play16, Undo16, Redo16, Cut16, Copy16, Paste16, AddComment16, TrashCan16,
|
|
41
|
-
ZoomIn16, ZoomOut16,
|
|
42
33
|
CircleDash16, RulerAlt16, ListNumbered16, ListBulleted16, Flag16, ChartVennDiagram16,
|
|
43
34
|
Calendar16, Time16, EventSchedule16 } from "@carbon/icons-react";
|
|
44
35
|
|
|
45
|
-
import { ERROR, WARNING, INFO, SUCCESS, CANVAS_CARBON_ICONS, CONTEXT_MENU_CARBON_ICONS
|
|
36
|
+
import { ERROR, WARNING, INFO, SUCCESS, CANVAS_CARBON_ICONS, CONTEXT_MENU_CARBON_ICONS } from "../common-canvas/constants/canvas-constants";
|
|
46
37
|
import { CONDITION_MESSAGE_TYPE, CARBON_ICONS, DATA_TYPE } from "../common-properties/constants/constants";
|
|
47
38
|
|
|
48
39
|
const iconClassName = "properties-icon";
|
|
@@ -51,20 +42,14 @@ export default class Icon extends React.Component {
|
|
|
51
42
|
constructor() {
|
|
52
43
|
super();
|
|
53
44
|
this.canvasIcons = {
|
|
54
|
-
arrangeHorizontally: ArrangeHorizontally,
|
|
55
|
-
arrangeVertically: ArrangeVertically,
|
|
56
45
|
double: Double,
|
|
57
46
|
integer: Integer,
|
|
58
|
-
string: StringIcon
|
|
59
|
-
toggleNotificationPanel: ToggleNotificationPanel,
|
|
60
|
-
paletteClose: PaletteClose,
|
|
61
|
-
paletteOpen: PaletteOpen,
|
|
62
|
-
zoomToFit: ZoomToFit
|
|
47
|
+
string: StringIcon
|
|
63
48
|
};
|
|
64
49
|
}
|
|
65
50
|
|
|
66
51
|
getCarbonIcon(type, customClassName) {
|
|
67
|
-
const className =
|
|
52
|
+
const className = iconClassName + " " + customClassName;
|
|
68
53
|
|
|
69
54
|
switch (type) {
|
|
70
55
|
case (ERROR):
|
|
@@ -97,8 +82,6 @@ export default class Icon extends React.Component {
|
|
|
97
82
|
case (CARBON_ICONS.EDIT):
|
|
98
83
|
return <Edit16 className={className} disabled={this.props.disabled} />;
|
|
99
84
|
|
|
100
|
-
case (CANVAS_CARBON_ICONS.OVERFLOWMENU):
|
|
101
|
-
return <OverflowMenuVertical16 className={className} disabled={this.props.disabled} />;
|
|
102
85
|
case (CANVAS_CARBON_ICONS.SEARCH):
|
|
103
86
|
return <Search16 className={className} disabled={this.props.disabled} />;
|
|
104
87
|
case (CANVAS_CARBON_ICONS.WARNING_UNFILLED):
|
|
@@ -107,29 +90,6 @@ export default class Icon extends React.Component {
|
|
|
107
90
|
case (CONTEXT_MENU_CARBON_ICONS.CHEVRONARROWS.RIGHT):
|
|
108
91
|
return <ChevronRight16 className={className} disabled={this.props.disabled} />;
|
|
109
92
|
|
|
110
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_STOP):
|
|
111
|
-
return <StopFilledAlt16 className={className} disabled={this.props.disabled} />;
|
|
112
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_RUN):
|
|
113
|
-
return <Play16 className={className} disabled={this.props.disabled} />;
|
|
114
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_UNDO):
|
|
115
|
-
return <Undo16 className={className} disabled={this.props.disabled} />;
|
|
116
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_REDO):
|
|
117
|
-
return <Redo16 className={className} disabled={this.props.disabled} />;
|
|
118
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_CUT):
|
|
119
|
-
return <Cut16 className={className} disabled={this.props.disabled} />;
|
|
120
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_COPY):
|
|
121
|
-
return <Copy16 className={className} disabled={this.props.disabled} />;
|
|
122
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_PASTE):
|
|
123
|
-
return <Paste16 className={className} disabled={this.props.disabled} />;
|
|
124
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_CREATE_AUTO_COMMENT):
|
|
125
|
-
return <AddComment16 className={className} disabled={this.props.disabled} />;
|
|
126
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_DELETE_SELECTED_OBJECTS):
|
|
127
|
-
return <TrashCan16 className={className} disabled={this.props.disabled} />;
|
|
128
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_ZOOM_IN):
|
|
129
|
-
return <ZoomIn16 className={className} disabled={this.props.disabled} />;
|
|
130
|
-
case (TOOLBAR_ACTIONS.TOOLBAR_ZOOM_OUT):
|
|
131
|
-
return <ZoomOut16 className={className} disabled={this.props.disabled} />;
|
|
132
|
-
|
|
133
93
|
case (CARBON_ICONS.MEASUREMENTS.EMPTY):
|
|
134
94
|
return <CircleDash16 className={className} disabled={this.props.disabled} />;
|
|
135
95
|
case (CARBON_ICONS.MEASUREMENTS.SCALE):
|
|
@@ -163,7 +123,7 @@ export default class Icon extends React.Component {
|
|
|
163
123
|
if (!icon) {
|
|
164
124
|
icon = this.getCanvasIcon(this.props.type);
|
|
165
125
|
if (typeof icon !== "undefined") {
|
|
166
|
-
const className =
|
|
126
|
+
const className = classNames("canvas-icon", iconClassName, this.props.className);
|
|
167
127
|
icon = <SVG src={icon} className={className} disabled={this.props.disabled} />;
|
|
168
128
|
} else {
|
|
169
129
|
icon = <div />;
|
|
@@ -181,6 +141,5 @@ Icon.defaultProps = {
|
|
|
181
141
|
Icon.propTypes = {
|
|
182
142
|
type: PropTypes.string.isRequired,
|
|
183
143
|
className: PropTypes.string,
|
|
184
|
-
disabled: PropTypes.bool
|
|
185
|
-
noAddedClasses: PropTypes.bool
|
|
144
|
+
disabled: PropTypes.bool
|
|
186
145
|
};
|
package/src/index.scss
CHANGED
|
@@ -100,6 +100,18 @@ export default class APIPipeline {
|
|
|
100
100
|
}, data);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
addPastedObjects(data) {
|
|
104
|
+
this.objectModel.executeWithSelectionChange((inData) => {
|
|
105
|
+
this.store.dispatch({ type: "ADD_PASTED_OBJECTS", data: inData, pipelineId: this.pipelineId });
|
|
106
|
+
}, data);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
deletePastedObjects(data) {
|
|
110
|
+
this.objectModel.executeWithSelectionChange((inData) => {
|
|
111
|
+
this.store.dispatch({ type: "DELETE_PASTED_OBJECTS", data: inData, pipelineId: this.pipelineId });
|
|
112
|
+
}, data);
|
|
113
|
+
}
|
|
114
|
+
|
|
103
115
|
// Returns an object containing and array of nodes and an array of comments
|
|
104
116
|
// that match the array of objectIds passed in.
|
|
105
117
|
filterNodesAndComments(objectIds) {
|
|
@@ -128,6 +140,10 @@ export default class APIPipeline {
|
|
|
128
140
|
this.store.dispatch({ type: "SET_OBJECTS_CLASS_NAME", data: { objIds: objectIds, newClassName: newClassName }, pipelineId: this.pipelineId });
|
|
129
141
|
}
|
|
130
142
|
|
|
143
|
+
setObjectsColorClassName(objectIds, newColorClass) {
|
|
144
|
+
this.store.dispatch({ type: "SET_OBJECTS_COLOR_CLASS_NAME", data: { objIds: objectIds, newColorClass: newColorClass }, pipelineId: this.pipelineId });
|
|
145
|
+
}
|
|
146
|
+
|
|
131
147
|
disconnectObjects(objectIds) {
|
|
132
148
|
let linksToDelete = [];
|
|
133
149
|
objectIds.forEach((id) => {
|
|
@@ -607,26 +623,16 @@ export default class APIPipeline {
|
|
|
607
623
|
}
|
|
608
624
|
|
|
609
625
|
getNodes() {
|
|
610
|
-
|
|
611
|
-
if (pipeline) {
|
|
612
|
-
return pipeline.nodes;
|
|
613
|
-
}
|
|
614
|
-
return [];
|
|
626
|
+
return this.store.getNodes(this.pipelineId);
|
|
615
627
|
}
|
|
616
628
|
|
|
617
629
|
// Returns the IDs of all nodes in the pipeline.
|
|
618
630
|
getNodeIds() {
|
|
619
|
-
|
|
620
|
-
if (pipeline) {
|
|
621
|
-
return pipeline.nodes.map((node) => node.id);
|
|
622
|
-
}
|
|
623
|
-
return [];
|
|
631
|
+
return this.getNodes().map((n) => n.id);
|
|
624
632
|
}
|
|
625
633
|
|
|
626
634
|
getNode(nodeId) {
|
|
627
|
-
return this.
|
|
628
|
-
return (node.id === nodeId);
|
|
629
|
-
});
|
|
635
|
+
return this.store.getNode(nodeId, this.pipelineId);
|
|
630
636
|
}
|
|
631
637
|
|
|
632
638
|
getSupernodes() {
|
|
@@ -634,8 +640,7 @@ export default class APIPipeline {
|
|
|
634
640
|
}
|
|
635
641
|
|
|
636
642
|
isDataNode(objId) {
|
|
637
|
-
|
|
638
|
-
return (typeof node !== "undefined"); // node will be undefined if objId references a comment
|
|
643
|
+
return this.getNode(objId);
|
|
639
644
|
}
|
|
640
645
|
|
|
641
646
|
sizeAndPositionObjects(objectsInfo, linksInfo) {
|
|
@@ -987,7 +992,6 @@ export default class APIPipeline {
|
|
|
987
992
|
createComment(source) {
|
|
988
993
|
let comment = {
|
|
989
994
|
id: this.objectModel.getUniqueId(CREATE_COMMENT),
|
|
990
|
-
class_name: "d3-comment-rect",
|
|
991
995
|
content: "",
|
|
992
996
|
height: 42,
|
|
993
997
|
width: 175,
|
|
@@ -1011,9 +1015,6 @@ export default class APIPipeline {
|
|
|
1011
1015
|
}
|
|
1012
1016
|
|
|
1013
1017
|
addComment(data) {
|
|
1014
|
-
if (typeof data.selectedObjectIds === "undefined") {
|
|
1015
|
-
data.selectedObjectIds = [];
|
|
1016
|
-
}
|
|
1017
1018
|
this.store.dispatch({ type: "ADD_COMMENT", data: data, pipelineId: this.pipelineId });
|
|
1018
1019
|
}
|
|
1019
1020
|
|
|
@@ -1058,18 +1059,11 @@ export default class APIPipeline {
|
|
|
1058
1059
|
}
|
|
1059
1060
|
|
|
1060
1061
|
getComments() {
|
|
1061
|
-
|
|
1062
|
-
if (pipeline) {
|
|
1063
|
-
return pipeline.comments;
|
|
1064
|
-
}
|
|
1065
|
-
return [];
|
|
1066
|
-
|
|
1062
|
+
return this.store.getComments(this.pipelineId);
|
|
1067
1063
|
}
|
|
1068
1064
|
|
|
1069
1065
|
getComment(commentId) {
|
|
1070
|
-
return this.
|
|
1071
|
-
return (comment.id === commentId);
|
|
1072
|
-
});
|
|
1066
|
+
return this.store.getComment(commentId, this.pipelineId);
|
|
1073
1067
|
}
|
|
1074
1068
|
|
|
1075
1069
|
editComment(data) {
|
|
@@ -1233,21 +1227,12 @@ export default class APIPipeline {
|
|
|
1233
1227
|
}
|
|
1234
1228
|
|
|
1235
1229
|
getLinks() {
|
|
1236
|
-
|
|
1237
|
-
if (pipeline) {
|
|
1238
|
-
return pipeline.links;
|
|
1239
|
-
}
|
|
1240
|
-
return [];
|
|
1241
|
-
|
|
1230
|
+
return this.store.getLinks(this.pipelineId);
|
|
1242
1231
|
}
|
|
1243
1232
|
|
|
1244
1233
|
// Returns the IDs of all links in the pipeline.
|
|
1245
1234
|
getLinkIds() {
|
|
1246
|
-
|
|
1247
|
-
if (pipeline) {
|
|
1248
|
-
return pipeline.links.map((link) => link.id);
|
|
1249
|
-
}
|
|
1250
|
-
return [];
|
|
1235
|
+
return this.getLinks().map((l) => l.id);
|
|
1251
1236
|
}
|
|
1252
1237
|
|
|
1253
1238
|
// Returns an array of links from canvas info links which link
|
|
@@ -1419,9 +1404,7 @@ export default class APIPipeline {
|
|
|
1419
1404
|
}
|
|
1420
1405
|
|
|
1421
1406
|
getLink(linkId) {
|
|
1422
|
-
return this.
|
|
1423
|
-
return (link.id === linkId);
|
|
1424
|
-
});
|
|
1407
|
+
return this.store.getLink(linkId, this.pipelineId);
|
|
1425
1408
|
}
|
|
1426
1409
|
|
|
1427
1410
|
setLinkProperties(linkId, linkProperties) {
|
|
@@ -246,6 +246,7 @@ export default class ObjectModel {
|
|
|
246
246
|
: PipelineInHandler.convertPipelinesToCanvasInfoPipelines(pd, this.getCanvasLayout());
|
|
247
247
|
// Need to make sure pipeline IDs are unique.
|
|
248
248
|
newPd = this.cloneSupernodeContents(supernode, newPd);
|
|
249
|
+
newPd = this.prepareNodes(newPd, this.getNodeLayout(), this.getCanvasLayout(), supernode);
|
|
249
250
|
|
|
250
251
|
} else {
|
|
251
252
|
const newPipeline = this.createEmptyPipeline();
|
|
@@ -256,6 +257,28 @@ export default class ObjectModel {
|
|
|
256
257
|
return supernode;
|
|
257
258
|
}
|
|
258
259
|
|
|
260
|
+
// Returns an object containing nodes and pipelines. The nodes are the
|
|
261
|
+
// same as the array of nodes passed in except that, any supernodes within
|
|
262
|
+
// the array will have their app_data.pipeline_data fields removed. The
|
|
263
|
+
// pipelines returned will be any pipelines that were contained within the
|
|
264
|
+
// app_data.pipeline_data fields.
|
|
265
|
+
extractAddDataPipelines(inNodes) {
|
|
266
|
+
const pipelines = [];
|
|
267
|
+
const nodes = [];
|
|
268
|
+
inNodes.forEach((n) => {
|
|
269
|
+
if (CanvasUtils.isSupernode(n)) {
|
|
270
|
+
const pDataArray = get(n, "app_data.pipeline_data");
|
|
271
|
+
if (pDataArray) {
|
|
272
|
+
pipelines.push(...pDataArray);
|
|
273
|
+
delete n.app_data.pipeline_data;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
nodes.push(n);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
return { nodes, pipelines };
|
|
280
|
+
}
|
|
281
|
+
|
|
259
282
|
getPaletteNode(nodeOpIdRef) {
|
|
260
283
|
let outNodeType = null;
|
|
261
284
|
if (nodeOpIdRef && !isEmpty(this.getPaletteData())) {
|
|
@@ -1636,7 +1659,9 @@ export default class ObjectModel {
|
|
|
1636
1659
|
setSelections(newSelections, pipelineId) {
|
|
1637
1660
|
// This will return the default API pipeline if a pipelineId is not provided.
|
|
1638
1661
|
const selPipelineId = this.getAPIPipeline(pipelineId).pipelineId;
|
|
1639
|
-
this.executeWithSelectionChange(
|
|
1662
|
+
this.executeWithSelectionChange(
|
|
1663
|
+
this.store.dispatch, { type: "SET_SELECTIONS", data: { selections: newSelections }, pipelineId: selPipelineId }
|
|
1664
|
+
);
|
|
1640
1665
|
}
|
|
1641
1666
|
|
|
1642
1667
|
deleteSelectedObjects() {
|
|
@@ -1732,11 +1757,10 @@ export default class ObjectModel {
|
|
|
1732
1757
|
return connectedNodesIdsGroup.length === nodeIds.length;
|
|
1733
1758
|
}
|
|
1734
1759
|
|
|
1735
|
-
// Returns true if all the selected
|
|
1760
|
+
// Returns true if all the selected objects are links.
|
|
1736
1761
|
areAllSelectedObjectsLinks() {
|
|
1737
1762
|
const nonLinkIndex = this.getSelectedObjects().findIndex((selObj) => !this.isLink(selObj));
|
|
1738
1763
|
return nonLinkIndex === -1;
|
|
1739
|
-
|
|
1740
1764
|
}
|
|
1741
1765
|
|
|
1742
1766
|
// Recursive function to add all connected nodes into the group.
|
|
@@ -105,6 +105,74 @@ export default class CanavasStore {
|
|
|
105
105
|
return cloneDeep(this.store.getState().canvasinfo);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
// This is a service method for retrieving the internal pipeline. It does NOT
|
|
109
|
+
// clone the pipeline therefore it should NOT be called from outside this
|
|
110
|
+
// class because we don't want to surface the intenal data in redux to
|
|
111
|
+
// the outside world.
|
|
112
|
+
getNonClonedPipeline(pipelineId) {
|
|
113
|
+
return this.store.getState().canvasinfo.pipelines.find((p) => p.id === pipelineId);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
getNodes(pipelineId) {
|
|
117
|
+
const pipeline = this.getNonClonedPipeline(pipelineId);
|
|
118
|
+
if (pipeline && pipeline.nodes) {
|
|
119
|
+
return cloneDeep(pipeline.nodes);
|
|
120
|
+
}
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
getNode(nodeId, pipelineId) {
|
|
125
|
+
const pipeline = this.getNonClonedPipeline(pipelineId);
|
|
126
|
+
let node = null;
|
|
127
|
+
if (pipeline && pipeline.nodes) {
|
|
128
|
+
const internalNode = pipeline.nodes.find((n) => (n.id === nodeId));
|
|
129
|
+
if (internalNode) {
|
|
130
|
+
node = cloneDeep(internalNode);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return node;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
getComments(pipelineId) {
|
|
137
|
+
const pipeline = this.getNonClonedPipeline(pipelineId);
|
|
138
|
+
if (pipeline && pipeline.comments) {
|
|
139
|
+
return cloneDeep(pipeline.comments);
|
|
140
|
+
}
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getComment(commentId, pipelineId) {
|
|
145
|
+
const pipeline = this.getNonClonedPipeline(pipelineId);
|
|
146
|
+
let com = null;
|
|
147
|
+
if (pipeline && pipeline.comments) {
|
|
148
|
+
const internalCom = pipeline.comments.find((c) => (c.id === commentId));
|
|
149
|
+
if (internalCom) {
|
|
150
|
+
com = cloneDeep(internalCom);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return com;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
getLinks(pipelineId) {
|
|
157
|
+
const pipeline = this.getNonClonedPipeline(pipelineId);
|
|
158
|
+
if (pipeline && pipeline.links) {
|
|
159
|
+
return cloneDeep(pipeline.links);
|
|
160
|
+
}
|
|
161
|
+
return [];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
getLink(linkId, pipelineId) {
|
|
165
|
+
const pipeline = this.getNonClonedPipeline(pipelineId);
|
|
166
|
+
let link = null;
|
|
167
|
+
if (pipeline && pipeline.links) {
|
|
168
|
+
const internalLink = pipeline.links.find((l) => (l.id === linkId));
|
|
169
|
+
if (internalLink) {
|
|
170
|
+
link = cloneDeep(internalLink);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return link;
|
|
174
|
+
}
|
|
175
|
+
|
|
108
176
|
getBreadcrumbs() {
|
|
109
177
|
return cloneDeep(this.store.getState().breadcrumbs);
|
|
110
178
|
}
|
|
@@ -162,6 +162,7 @@ export default (state = {}, action) => {
|
|
|
162
162
|
case "REMOVE_NODE_ATTR":
|
|
163
163
|
case "SET_NODE_LABEL":
|
|
164
164
|
case "SET_OBJECTS_CLASS_NAME":
|
|
165
|
+
case "SET_OBJECTS_COLOR_CLASS_NAME":
|
|
165
166
|
case "SET_INPUT_PORT_LABEL":
|
|
166
167
|
case "SET_OUTPUT_PORT_LABEL":
|
|
167
168
|
case "SET_INPUT_PORT_SUBFLOW_NODE_REF":
|
|
@@ -236,6 +237,7 @@ export default (state = {}, action) => {
|
|
|
236
237
|
return Object.assign({}, state, { pipelines: canvasInfoPipelines });
|
|
237
238
|
}
|
|
238
239
|
|
|
240
|
+
case "ADD_PASTED_OBJECTS":
|
|
239
241
|
case "ADD_AND_UPDATE_OBJECTS": {
|
|
240
242
|
let canvasInfoPipelines = state.pipelines
|
|
241
243
|
.map((pipeline) => {
|
|
@@ -277,6 +279,36 @@ export default (state = {}, action) => {
|
|
|
277
279
|
return Object.assign({}, state, { pipelines: canvasInfoPipelines });
|
|
278
280
|
}
|
|
279
281
|
|
|
282
|
+
case "DELETE_PASTED_OBJECTS": {
|
|
283
|
+
const canvasInfoPipelines = state.pipelines
|
|
284
|
+
// Filter out the pipelines to delete
|
|
285
|
+
.filter((pipeline) => (!isPipelineToDelete(pipeline, action.data.pipelinesToDelete)))
|
|
286
|
+
// Modify the pipeline to remove nodes, comments and links
|
|
287
|
+
.map((pipeline) => {
|
|
288
|
+
if (pipeline.id === action.pipelineId) {
|
|
289
|
+
// Remove pasted nodes
|
|
290
|
+
const newNodes = nodes(pipeline.nodes,
|
|
291
|
+
{ type: "DELETE_NODES", data: action.data });
|
|
292
|
+
|
|
293
|
+
// Remove pasted comments
|
|
294
|
+
const newComments = comments(pipeline.comments,
|
|
295
|
+
{ type: "DELETE_COMMENTS", data: action.data });
|
|
296
|
+
|
|
297
|
+
// Remove pasted links
|
|
298
|
+
const newLinks = links(pipeline.links,
|
|
299
|
+
{ type: "REMOVE_LINKS", data: action.data });
|
|
300
|
+
|
|
301
|
+
return Object.assign({}, pipeline, {
|
|
302
|
+
nodes: newNodes,
|
|
303
|
+
comments: newComments,
|
|
304
|
+
links: newLinks });
|
|
305
|
+
}
|
|
306
|
+
return pipeline;
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
return Object.assign({}, state, { pipelines: canvasInfoPipelines });
|
|
310
|
+
}
|
|
311
|
+
|
|
280
312
|
case "SET_SUPERNODE_EXPAND_STATE": {
|
|
281
313
|
const canvasInfoPipelines = state.pipelines
|
|
282
314
|
.map((pipeline) => {
|
|
@@ -476,3 +508,7 @@ export default (state = {}, action) => {
|
|
|
476
508
|
return state;
|
|
477
509
|
}
|
|
478
510
|
};
|
|
511
|
+
|
|
512
|
+
function isPipelineToDelete(pipeline, pipelinesToDelete) {
|
|
513
|
+
return (pipelinesToDelete.some((p) => p.id === pipeline.id));
|
|
514
|
+
}
|