@kineticdata/react 6.1.0 → 6.1.6
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/README.md +110 -110
- package/assets/task/icons/defer.svg +12 -12
- package/assets/task/icons/drag-handle.svg +3 -3
- package/assets/task/icons/filter.svg +11 -11
- package/assets/task/icons/loop.svg +10 -10
- package/assets/task/icons/plus_small.svg +5 -5
- package/assets/task/icons/routine.svg +9 -9
- package/assets/task/icons/scale-minus.svg +11 -11
- package/assets/task/icons/scale-plus.svg +13 -13
- package/assets/task/icons/start.svg +11 -11
- package/assets/task/icons/stop.svg +8 -8
- package/lib/apis/core/activity.js +4 -4
- package/lib/apis/core/attributeDefinitions.js +55 -0
- package/lib/apis/core/attributeDefinitions.test.js +7 -4
- package/lib/apis/core/authentication.js +12 -1
- package/lib/apis/core/bridgeModels.test.js +46 -23
- package/lib/apis/core/bridgedresources.js +41 -41
- package/lib/apis/core/fileResources.js +2 -6
- package/lib/apis/core/forms.js +51 -2
- package/lib/apis/core/forms.test.js +32 -19
- package/lib/apis/core/kapps.js +49 -0
- package/lib/apis/core/kapps.test.js +16 -10
- package/lib/apis/core/notices.js +7 -0
- package/lib/apis/core/securityPolicyDefinitions.test.js +7 -4
- package/lib/apis/core/space.js +18 -0
- package/lib/apis/core/space.test.js +16 -10
- package/lib/apis/core/submissionActivities.js +38 -0
- package/lib/apis/core/submissions.js +62 -0
- package/lib/apis/core/translations.test.js +126 -55
- package/lib/apis/core/userPreferences.js +59 -0
- package/lib/apis/core/webApis.js +32 -2
- package/lib/apis/core/webhooks.test.js +7 -4
- package/lib/apis/http.js +22 -11
- package/lib/apis/index.js +24 -0
- package/lib/apis/integrator/index.js +95 -20
- package/lib/apis/system/index.js +16 -1
- package/lib/apis/task/index.js +1 -1
- package/lib/components/common/AttributeSelect.js +1 -0
- package/lib/components/common/BridgeSelect.js +1 -0
- package/lib/components/common/ConnectionSelect.js +2 -1
- package/lib/components/common/FormSelect.js +1 -0
- package/lib/components/common/NodeSelect.js +1 -0
- package/lib/components/common/StaticSelect.js +1 -0
- package/lib/components/common/TeamSelect.js +1 -0
- package/lib/components/common/ToastContainer.js +3 -3
- package/lib/components/common/Typeahead.js +3 -0
- package/lib/components/common/UserSelect.js +1 -0
- package/lib/components/common/authentication/AuthenticationContainer.js +121 -55
- package/lib/components/common/preferences/PreferencesProvider.js +461 -0
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +7 -7
- package/lib/components/core/field_definition/FieldDefinitionForm.js +3 -3
- package/lib/components/core/form/FormTable.js +0 -1
- package/lib/components/core/integration/IntegrationTable.js +3 -0
- package/lib/components/core/space/SpaceForm.js +14 -14
- package/lib/components/core/submission/SubmissionActivityForm.js +79 -0
- package/lib/components/core/submission/SubmissionForm.js +12 -2
- package/lib/components/core/translation/EntryTable.js +8 -7
- package/lib/components/core/user/UserForm.js +2 -0
- package/lib/components/core/user/UserTable.js +4 -4
- package/lib/components/form/Form.js +14 -3
- package/lib/components/form/FormState.js +1 -1
- package/lib/components/form/SimpleForm.js +2 -2
- package/lib/components/index.js +68 -0
- package/lib/components/integrator/connection/ConnectionForm.js +62 -18
- package/lib/components/integrator/connection/ConnectionTable.js +5 -3
- package/lib/components/integrator/connection/config_fields/http.js +19 -19
- package/lib/components/integrator/connection/config_fields/sql.js +123 -0
- package/lib/components/integrator/integrationTypes.js +27 -5
- package/lib/components/integrator/operation/OperationForm.js +24 -4
- package/lib/components/integrator/operation/OperationTable.js +3 -5
- package/lib/components/integrator/operation/config_fields/http.js +4 -3
- package/lib/components/integrator/operation/config_fields/sql.js +81 -0
- package/lib/components/system/SystemUserForm.js +2 -0
- package/lib/components/table/Table.js +75 -15
- package/lib/components/table/Table.redux.js +296 -72
- package/lib/components/table/defaults/FilterControl.js +24 -0
- package/lib/components/table/defaults/index.js +2 -0
- package/lib/components/table/tests/Table.test.js +22 -22
- package/lib/components/table/tests/components.js +9 -2
- package/lib/components/task/builder/Connector.js +51 -41
- package/lib/components/task/builder/Node.js +25 -38
- package/lib/components/task/builder/SvgCanvas.js +3 -17
- package/lib/components/task/builder/TreeBuilder.js +1 -2
- package/lib/components/task/builder/builder.redux.js +52 -32
- package/lib/components/task/builder/helpers.js +38 -7
- package/lib/components/task/common/UsageTable.js +8 -1
- package/lib/components/task/handlers/HandlerTable.js +9 -18
- package/lib/components/task/runs/RunTable.js +6 -10
- package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -9
- package/lib/components/task/workflows/WorkflowTable.js +25 -24
- package/lib/helpers/index.js +18 -2
- package/lib/index.js +2 -1
- package/lib/saga.js +4 -4
- package/lib/store.js +2 -1
- package/package.json +5 -6
- package/proxyhelper.js +201 -201
- package/CHANGELOG.md +0 -116
|
@@ -18,7 +18,7 @@ var _excluded = ["header", "body", "footer"],
|
|
|
18
18
|
_excluded9 = ["cells"],
|
|
19
19
|
_excluded10 = ["filters"],
|
|
20
20
|
_excluded11 = ["fields", "error", "buttons"],
|
|
21
|
-
_excluded12 = ["table", "pagination", "filter", "columnControl"];
|
|
21
|
+
_excluded12 = ["table", "pagination", "filter", "filterControl", "columnControl"];
|
|
22
22
|
var stringifyProps = function stringifyProps(props) {
|
|
23
23
|
return JSON.stringify(props,
|
|
24
24
|
// Make sure functions are stringified to an empty function string
|
|
@@ -138,6 +138,12 @@ var mockTableConfig = exports.mockTableConfig = {
|
|
|
138
138
|
type: "submit"
|
|
139
139
|
}, "Search"));
|
|
140
140
|
},
|
|
141
|
+
FilterControl: function FilterControl(props) {
|
|
142
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
|
+
"data-testid": "FilterControlMock",
|
|
144
|
+
"data-props": stringifyProps(props)
|
|
145
|
+
});
|
|
146
|
+
},
|
|
141
147
|
TextFilter: function TextFilter(props) {
|
|
142
148
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
149
|
"data-testid": "TextFilterMock",
|
|
@@ -173,10 +179,11 @@ var TableViewMock = exports.TableViewMock = function TableViewMock(_ref12) {
|
|
|
173
179
|
var table = _ref12.table,
|
|
174
180
|
pagination = _ref12.pagination,
|
|
175
181
|
filter = _ref12.filter,
|
|
182
|
+
filterControl = _ref12.filterControl,
|
|
176
183
|
columnControl = _ref12.columnControl,
|
|
177
184
|
props = (0, _objectWithoutProperties2["default"])(_ref12, _excluded12);
|
|
178
185
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
179
186
|
"data-testid": "TableViewMock",
|
|
180
187
|
"data-props": stringifyProps(props)
|
|
181
|
-
}, table, pagination, filter, columnControl);
|
|
188
|
+
}, table, pagination, filterControl, filter, columnControl);
|
|
182
189
|
};
|
|
@@ -31,23 +31,23 @@ var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
|
|
|
31
31
|
_this.setTreeBuilder = function (treeBuilder) {
|
|
32
32
|
_this.treeBuilder = treeBuilder;
|
|
33
33
|
};
|
|
34
|
-
/*****************************************************************************
|
|
35
|
-
* Click handlers *
|
|
34
|
+
/*****************************************************************************
|
|
35
|
+
* Click handlers *
|
|
36
36
|
****************************************************************************/
|
|
37
37
|
_this.onSelect = function (event) {
|
|
38
38
|
if (typeof _this.props.onSelect === 'function') {
|
|
39
39
|
_this.props.onSelect(_this.props.connector, event.shiftKey);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
/*****************************************************************************
|
|
43
|
-
* Drag-and-drop support *
|
|
44
|
-
* Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
|
|
45
|
-
* On move we update this instance's `head` or `tail` properties and set *
|
|
46
|
-
* `dragging` to either "head" or "tail" so that the `draw` method knows if *
|
|
47
|
-
* we are drawing to a dragging point or to the center of a node. *
|
|
48
|
-
* On drop we check to see if the point we are dropping at is within a node *
|
|
49
|
-
* (we check that its a valid node as well) and dispatch a redux action to *
|
|
50
|
-
* persist the change or we reset the `head` or `tail` properties and `draw` *
|
|
42
|
+
/*****************************************************************************
|
|
43
|
+
* Drag-and-drop support *
|
|
44
|
+
* Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
|
|
45
|
+
* On move we update this instance's `head` or `tail` properties and set *
|
|
46
|
+
* `dragging` to either "head" or "tail" so that the `draw` method knows if *
|
|
47
|
+
* we are drawing to a dragging point or to the center of a node. *
|
|
48
|
+
* On drop we check to see if the point we are dropping at is within a node *
|
|
49
|
+
* (we check that its a valid node as well) and dispatch a redux action to *
|
|
50
|
+
* persist the change or we reset the `head` or `tail` properties and `draw` *
|
|
51
51
|
****************************************************************************/
|
|
52
52
|
_this.dragHead = function (event) {
|
|
53
53
|
_this.treeBuilder.watchDrag({
|
|
@@ -119,49 +119,53 @@ var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
|
|
|
119
119
|
_this.tail = point;
|
|
120
120
|
_this.draw();
|
|
121
121
|
};
|
|
122
|
-
/*****************************************************************************
|
|
123
|
-
* Rendering *
|
|
124
|
-
* To make the drag-and-drop perform as fast as possible we manually *
|
|
125
|
-
* manipulate some DOM elements in the `draw` method below. Anything that *
|
|
126
|
-
* changes the instance's `head` or `tail` properties should also call *
|
|
127
|
-
* `draw` *
|
|
122
|
+
/*****************************************************************************
|
|
123
|
+
* Rendering *
|
|
124
|
+
* To make the drag-and-drop perform as fast as possible we manually *
|
|
125
|
+
* manipulate some DOM elements in the `draw` method below. Anything that *
|
|
126
|
+
* changes the instance's `head` or `tail` properties should also call *
|
|
127
|
+
* `draw` *
|
|
128
128
|
****************************************************************************/
|
|
129
129
|
_this.draw = function () {
|
|
130
130
|
_this.connector.current.parentElement.style.display = '';
|
|
131
131
|
var _getRectIntersections = (0, _helpers.getRectIntersections)((0, _assertThisInitialized2["default"])(_this)),
|
|
132
|
-
_getRectIntersections2 = (0, _slicedToArray2["default"])(_getRectIntersections,
|
|
132
|
+
_getRectIntersections2 = (0, _slicedToArray2["default"])(_getRectIntersections, 3),
|
|
133
133
|
_getRectIntersections3 = _getRectIntersections2[0],
|
|
134
134
|
x1 = _getRectIntersections3.x,
|
|
135
135
|
y1 = _getRectIntersections3.y,
|
|
136
136
|
_getRectIntersections4 = _getRectIntersections2[1],
|
|
137
137
|
x2 = _getRectIntersections4.x,
|
|
138
|
-
y2 = _getRectIntersections4.y
|
|
138
|
+
y2 = _getRectIntersections4.y,
|
|
139
|
+
nodesOverlap = _getRectIntersections2[2];
|
|
139
140
|
var dx = x2 - x1;
|
|
140
141
|
var dy = y2 - y1;
|
|
141
142
|
var length = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
|
|
142
143
|
var angle = Math.atan2(dy, dx) * 180 / Math.PI + 180;
|
|
143
|
-
var connectorValue =
|
|
144
|
-
var connectorLabelValue =
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
144
|
+
var connectorValue = "translate(".concat(x2, "px, ").concat(y2, "px) rotate(").concat(angle, "deg)");
|
|
145
|
+
var connectorLabelValue = "translate(".concat(x1 + dx / 2, "px, ").concat(y1 + dy / 2, "px)");
|
|
146
|
+
|
|
147
|
+
// If the nodes overlap, hide the connector line
|
|
148
|
+
if (nodesOverlap) {
|
|
149
|
+
_this.connector.current.style.display = 'none';
|
|
150
150
|
} else {
|
|
151
|
-
_this.connector.current.style.
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
_this.connector.current.style.display = '';
|
|
152
|
+
}
|
|
153
|
+
_this.connector.current.style.transform = connectorValue;
|
|
154
|
+
if (_this.connectorLabel.current) {
|
|
155
|
+
var _this$props$connector3;
|
|
156
|
+
_this.connectorLabel.current.style.transform = connectorLabelValue;
|
|
157
|
+
// If the nodes overlap or the connector has an id, show the label
|
|
158
|
+
if (nodesOverlap || ((_this$props$connector3 = _this.props.connector) === null || _this$props$connector3 === void 0 ? void 0 : _this$props$connector3.id) !== null) {
|
|
159
|
+
_this.connectorLabel.current.style.display = '';
|
|
160
|
+
} else {
|
|
161
|
+
// If nodes don't overlap for a new connector, hide the label
|
|
162
|
+
_this.connectorLabel.current.style.display = 'none';
|
|
154
163
|
}
|
|
155
164
|
}
|
|
156
|
-
|
|
157
|
-
// this.connector.current.setAttribute(attribute, connectorValue);
|
|
158
165
|
if (_this.connectorTail.current) {
|
|
159
166
|
_this.connectorTail.current.setAttribute('cx', length);
|
|
160
167
|
}
|
|
161
168
|
_this.connectorBody.current.setAttribute('x2', length);
|
|
162
|
-
// if (this.connectorLabel.current) {
|
|
163
|
-
// this.connectorLabel.current.setAttribute(attribute, connectorLabelValue);
|
|
164
|
-
// }
|
|
165
169
|
};
|
|
166
170
|
_this.connector = /*#__PURE__*/(0, _react.createRef)();
|
|
167
171
|
_this.connectorBody = /*#__PURE__*/(0, _react.createRef)();
|
|
@@ -172,11 +176,11 @@ var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
|
|
|
172
176
|
(0, _createClass2["default"])(Connector, [{
|
|
173
177
|
key: "shouldComponentUpdate",
|
|
174
178
|
value:
|
|
175
|
-
/*****************************************************************************
|
|
176
|
-
* React lifecycle *
|
|
177
|
-
* Check the `connector` prop for change, which should be an immutable *
|
|
178
|
-
* record. If that prop changes we need to sync the instance's `head` and *
|
|
179
|
-
* `tail` values and call `draw`. *
|
|
179
|
+
/*****************************************************************************
|
|
180
|
+
* React lifecycle *
|
|
181
|
+
* Check the `connector` prop for change, which should be an immutable *
|
|
182
|
+
* record. If that prop changes we need to sync the instance's `head` and *
|
|
183
|
+
* `tail` values and call `draw`. *
|
|
180
184
|
****************************************************************************/
|
|
181
185
|
|
|
182
186
|
function shouldComponentUpdate(nextProps) {
|
|
@@ -256,7 +260,7 @@ var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
|
|
|
256
260
|
className: "connector-head high-detail",
|
|
257
261
|
points: constants.CONNECTOR_HEAD_POINTS,
|
|
258
262
|
onMouseDown: this.dragHead
|
|
259
|
-
})), id !== null
|
|
263
|
+
})), id !== null ? /*#__PURE__*/_react["default"].createElement("g", {
|
|
260
264
|
ref: this.connectorLabel,
|
|
261
265
|
className: "connector-button",
|
|
262
266
|
onClick: this.onSelect
|
|
@@ -300,7 +304,13 @@ var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
|
|
|
300
304
|
y: -constants.ICON_CENTER,
|
|
301
305
|
height: constants.ICON_SIZE,
|
|
302
306
|
width: constants.ICON_SIZE
|
|
303
|
-
})))
|
|
307
|
+
}))) : /*#__PURE__*/_react["default"].createElement("circle", {
|
|
308
|
+
ref: this.connectorLabel,
|
|
309
|
+
className: "connector-placeholder",
|
|
310
|
+
r: constants.CONNECTOR_TAIL_RADIUS,
|
|
311
|
+
cx: "0",
|
|
312
|
+
cy: "0"
|
|
313
|
+
}));
|
|
304
314
|
}
|
|
305
315
|
}]);
|
|
306
316
|
return Connector;
|
|
@@ -28,8 +28,8 @@ var Node = exports.Node = /*#__PURE__*/function (_Component) {
|
|
|
28
28
|
var _this;
|
|
29
29
|
(0, _classCallCheck2["default"])(this, Node);
|
|
30
30
|
_this = _super.call(this, props);
|
|
31
|
-
/*****************************************************************************
|
|
32
|
-
* Click handlers *
|
|
31
|
+
/*****************************************************************************
|
|
32
|
+
* Click handlers *
|
|
33
33
|
****************************************************************************/
|
|
34
34
|
_this.onSelect = function (shiftKey) {
|
|
35
35
|
return function () {
|
|
@@ -38,15 +38,15 @@ var Node = exports.Node = /*#__PURE__*/function (_Component) {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
/*****************************************************************************
|
|
42
|
-
* Drag-and-drop support *
|
|
43
|
-
* Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
|
|
44
|
-
* On move we need to update any related connectors manually (for maximum *
|
|
45
|
-
* performance). *
|
|
46
|
-
* On drop we dispatch an action to update the node in redux to persist the *
|
|
47
|
-
* change. *
|
|
48
|
-
* We also watch for drag on the plus button, which should leverage the *
|
|
49
|
-
* `TreeBuilder` instance to start creating a new connector *
|
|
41
|
+
/*****************************************************************************
|
|
42
|
+
* Drag-and-drop support *
|
|
43
|
+
* Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
|
|
44
|
+
* On move we need to update any related connectors manually (for maximum *
|
|
45
|
+
* performance). *
|
|
46
|
+
* On drop we dispatch an action to update the node in redux to persist the *
|
|
47
|
+
* change. *
|
|
48
|
+
* We also watch for drag on the plus button, which should leverage the *
|
|
49
|
+
* `TreeBuilder` instance to start creating a new connector *
|
|
50
50
|
****************************************************************************/
|
|
51
51
|
_this.drag = function (event) {
|
|
52
52
|
_this.treeBuilder.watchDrag({
|
|
@@ -101,15 +101,15 @@ var Node = exports.Node = /*#__PURE__*/function (_Component) {
|
|
|
101
101
|
}, {
|
|
102
102
|
key: "shouldComponentUpdate",
|
|
103
103
|
value:
|
|
104
|
-
/*****************************************************************************
|
|
105
|
-
* React lifecycle *
|
|
106
|
-
* Check the `node` prop for change, which should be an immutable record. *
|
|
107
|
-
* If that prop changes we need to sync the instance's `position` value and *
|
|
108
|
-
* call `draw`. *
|
|
104
|
+
/*****************************************************************************
|
|
105
|
+
* React lifecycle *
|
|
106
|
+
* Check the `node` prop for change, which should be an immutable record. *
|
|
107
|
+
* If that prop changes we need to sync the instance's `position` value and *
|
|
108
|
+
* call `draw`. *
|
|
109
109
|
****************************************************************************/
|
|
110
110
|
|
|
111
111
|
function shouldComponentUpdate(nextProps) {
|
|
112
|
-
return !this.props.node.equals(nextProps.node) || this.props.primary !== nextProps.primary || this.props.selected !== nextProps.selected || this.props.highlighted !== nextProps.highlighted;
|
|
112
|
+
return !this.props.node.equals(nextProps.node) || this.props.primary !== nextProps.primary || this.props.selected !== nextProps.selected || this.props.highlighted !== nextProps.highlighted || this.props.missingIntegration !== nextProps.missingIntegration;
|
|
113
113
|
}
|
|
114
114
|
}, {
|
|
115
115
|
key: "componentDidMount",
|
|
@@ -124,37 +124,26 @@ var Node = exports.Node = /*#__PURE__*/function (_Component) {
|
|
|
124
124
|
this.draw();
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/*****************************************************************************
|
|
128
|
-
* Rendering *
|
|
129
|
-
* To make the drag-and-drop perform as fast as possible we manually *
|
|
130
|
-
* manipulate some DOM elements in the `draw` method below. Anything that *
|
|
131
|
-
* changes the instance's `position` property should also call `draw` *
|
|
127
|
+
/*****************************************************************************
|
|
128
|
+
* Rendering *
|
|
129
|
+
* To make the drag-and-drop perform as fast as possible we manually *
|
|
130
|
+
* manipulate some DOM elements in the `draw` method below. Anything that *
|
|
131
|
+
* changes the instance's `position` property should also call `draw` *
|
|
132
132
|
****************************************************************************/
|
|
133
133
|
}, {
|
|
134
134
|
key: "draw",
|
|
135
135
|
value: function draw() {
|
|
136
|
-
|
|
137
|
-
// const value = isIE11
|
|
138
|
-
// ? `translate(${this.position.x} ${this.position.y})`
|
|
139
|
-
// : `transform: translate(${this.position.x}px, ${this.position.y}px)`;
|
|
140
|
-
// this.el.current.setAttribute(attribute, value);
|
|
141
|
-
|
|
142
|
-
if (_helpers.isIE11) {
|
|
143
|
-
this.el.current.transform = "translate(".concat(this.position.x, " ").concat(this.position.y, ")");
|
|
144
|
-
} else {
|
|
145
|
-
this.el.current.style.transform = "translate(".concat(this.position.x, "px, ").concat(this.position.y, "px)");
|
|
146
|
-
}
|
|
136
|
+
this.el.current.style.transform = "translate(".concat(this.position.x, "px, ").concat(this.position.y, "px)");
|
|
147
137
|
}
|
|
148
138
|
}, {
|
|
149
139
|
key: "render",
|
|
150
140
|
value: function render() {
|
|
151
|
-
var _node$parameters$find;
|
|
152
141
|
var _this$props = this.props,
|
|
153
142
|
node = _this$props.node,
|
|
154
143
|
highlighted = _this$props.highlighted,
|
|
155
144
|
primary = _this$props.primary,
|
|
156
145
|
selected = _this$props.selected,
|
|
157
|
-
|
|
146
|
+
missingIntegration = _this$props.missingIntegration,
|
|
158
147
|
tasks = _this$props.tasks;
|
|
159
148
|
var defers = node.defers,
|
|
160
149
|
definitionId = node.definitionId,
|
|
@@ -163,9 +152,7 @@ var Node = exports.Node = /*#__PURE__*/function (_Component) {
|
|
|
163
152
|
var tempNode = typeof id !== 'number';
|
|
164
153
|
var isRoutine = tasks.get(definitionId) && (0, _lodashEs.isArray)(tasks.get(definitionId).inputs);
|
|
165
154
|
var isIntegration = node.definitionId.startsWith("".concat(_constants.ADVANCED_HANDLER_NAME_INTEGRATION, "_v"));
|
|
166
|
-
var missing = !tempNode && !tasks.has(node.definitionId) && !node.definitionId.startsWith('system_tree_return_v') && !node.definitionId.startsWith('system_start_v') ||
|
|
167
|
-
return p.id === 'connection';
|
|
168
|
-
})) === null || _node$parameters$find === void 0 ? void 0 : _node$parameters$find.value);
|
|
155
|
+
var missing = !tempNode && !tasks.has(node.definitionId) && !node.definitionId.startsWith('system_tree_return_v') && !node.definitionId.startsWith('system_start_v') || missingIntegration;
|
|
169
156
|
var invalid = missing || !tempNode && !name || node.parameters.some(function (parameter) {
|
|
170
157
|
return parameter.required && parameter.value === '';
|
|
171
158
|
});
|
|
@@ -12,7 +12,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inhe
|
|
|
12
12
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _lodashEs = require("lodash-es");
|
|
15
|
-
var _helpers = require("./helpers");
|
|
16
15
|
var constants = _interopRequireWildcard(require("./constants"));
|
|
17
16
|
var _models = require("./models");
|
|
18
17
|
var SvgCanvas = exports.SvgCanvas = /*#__PURE__*/function (_Component) {
|
|
@@ -218,22 +217,9 @@ var SvgCanvas = exports.SvgCanvas = /*#__PURE__*/function (_Component) {
|
|
|
218
217
|
scale = _this$viewport.scale,
|
|
219
218
|
x = _this$viewport.x,
|
|
220
219
|
y = _this$viewport.y;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
// `translate(${x} ${y}) scale(${scale})`,
|
|
225
|
-
// );
|
|
226
|
-
this.transformer.current.transform = "translate(".concat(x, " ").concat(y, ") scale(").concat(scale, ")");
|
|
227
|
-
} else {
|
|
228
|
-
var transition = duration ? "transform ".concat(duration, "ms ").concat(ease) : '';
|
|
229
|
-
// this.transformer.current.setAttribute(
|
|
230
|
-
// 'style',
|
|
231
|
-
// `transform: translate(${x}px, ${y}px) scale(${scale});${transition}`,
|
|
232
|
-
// );
|
|
233
|
-
|
|
234
|
-
this.transformer.current.style.transform = "translate(".concat(x, "px, ").concat(y, "px) scale(").concat(scale, ")");
|
|
235
|
-
this.transformer.current.style.transition = transition;
|
|
236
|
-
}
|
|
220
|
+
var transition = duration ? "transform ".concat(duration, "ms ").concat(ease) : '';
|
|
221
|
+
this.transformer.current.style.transform = "translate(".concat(x, "px, ").concat(y, "px) scale(").concat(scale, ")");
|
|
222
|
+
this.transformer.current.style.transition = transition;
|
|
237
223
|
if (this.viewport.scale < 0.26 && this.transformer.current.className.baseVal !== 'min-detail') {
|
|
238
224
|
this.transformer.current.className.baseVal = 'min-detail';
|
|
239
225
|
}
|
|
@@ -413,8 +413,8 @@ var TreeBuilderComponent = exports.TreeBuilderComponent = /*#__PURE__*/function
|
|
|
413
413
|
var nodeId = _ref7.nodeId;
|
|
414
414
|
return nodeId === node.id;
|
|
415
415
|
}),
|
|
416
|
+
missingIntegration: (0, _helpers.isNodeMissingIntegration)(node, connections),
|
|
416
417
|
onSelect: _this2.props.onSelectNode,
|
|
417
|
-
connections: connections,
|
|
418
418
|
tasks: tasks,
|
|
419
419
|
tree: tree
|
|
420
420
|
});
|
|
@@ -422,7 +422,6 @@ var TreeBuilderComponent = exports.TreeBuilderComponent = /*#__PURE__*/function
|
|
|
422
422
|
ref: this.newNode,
|
|
423
423
|
treeKey: treeKey,
|
|
424
424
|
node: this.state.newNode,
|
|
425
|
-
connections: connections,
|
|
426
425
|
tasks: tasks,
|
|
427
426
|
tree: tree
|
|
428
427
|
}))),
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.unmountTreeBuilder = exports.mountTreeBuilder = exports.configureTreeBuilder = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
9
10
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
|
|
10
|
-
var
|
|
11
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
12
13
|
var _effects = require("redux-saga/effects");
|
|
13
14
|
var _immutable = require("immutable");
|
|
@@ -44,7 +45,7 @@ var remember = function remember(state, treeKey) {
|
|
|
44
45
|
(0, _store.regSaga)((0, _effects.takeEvery)('TREE_CONFIGURE', function (_ref) {
|
|
45
46
|
var payload = _ref.payload;
|
|
46
47
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
47
|
-
var _treeObject$treeJson, _treeObject$treeJson$, name, sourceGroup, sourceName, treeKey, platformSourceName, webApiProps, workflowProps, _yield$all, _yield$all2, _yield$all2$, tree, treeError, _yield$all2$2, workflow, workflowError, categories, _yield$all2$3$connect, connections, _yield$all2$3, webApi, webApiError, kappSlug, formSlug, workflowObject, workflowObjectError, _yield$call, platformItem, platformItemError, _yield$call2, linkedWorkflow, linkedError, slugs, treeObject, loadError,
|
|
48
|
+
var _treeObject$treeJson, _treeObject$treeJson$, name, sourceGroup, sourceName, treeKey, platformSourceName, webApiProps, workflowProps, _yield$all, _yield$all2, _yield$all2$, tree, treeError, _yield$all2$2, workflow, workflowError, categories, _yield$all2$3$connect, connections, _yield$all2$3, webApi, webApiError, kappSlug, formSlug, workflowObject, workflowObjectError, _yield$call, platformItem, platformItemError, _yield$call2, linkedWorkflow, linkedError, slugs, treeObject, loadError, operations;
|
|
48
49
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
49
50
|
while (1) switch (_context.prev = _context.next) {
|
|
50
51
|
case 0:
|
|
@@ -62,15 +63,15 @@ var remember = function remember(state, treeKey) {
|
|
|
62
63
|
include: 'bindings,categories,details,treeJson,inputs,outputs'
|
|
63
64
|
}) : {},
|
|
64
65
|
// Fetch the workflow if it is a linked workflow
|
|
65
|
-
workflowProps ? (0, _effects.call)(_apis.fetchWorkflow, (0,
|
|
66
|
+
workflowProps ? (0, _effects.call)(_apis.fetchWorkflow, (0, _objectSpread3["default"])({}, workflowProps)) : {},
|
|
66
67
|
// Fetch task categories
|
|
67
68
|
(0, _effects.call)(_apis.fetchTaskCategories, {
|
|
68
|
-
include: 'handlers.results,handlers.parameters,trees.parameters,trees.inputs,trees.outputs'
|
|
69
|
+
include: 'handlers.results,handlers.parameters,handlers.details,trees.parameters,trees.inputs,trees.outputs,trees.details'
|
|
69
70
|
}),
|
|
70
71
|
// Fetch connections
|
|
71
72
|
(0, _effects.call)(_apis.fetchConnections),
|
|
72
73
|
// Fetch the webAPI if applicable
|
|
73
|
-
webApiProps ? (0, _effects.call)(_apis.fetchWebApi, (0,
|
|
74
|
+
webApiProps ? (0, _effects.call)(_apis.fetchWebApi, (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, webApiProps), {}, {
|
|
74
75
|
include: 'details,securityPolicies'
|
|
75
76
|
})) : {}]);
|
|
76
77
|
case 6:
|
|
@@ -111,7 +112,7 @@ var remember = function remember(state, treeKey) {
|
|
|
111
112
|
break;
|
|
112
113
|
}
|
|
113
114
|
_context.next = 33;
|
|
114
|
-
return (0, _effects.call)(_apis.fetchWorkflow, (0,
|
|
115
|
+
return (0, _effects.call)(_apis.fetchWorkflow, (0, _objectSpread3["default"])({
|
|
115
116
|
workflowId: sourceGroup
|
|
116
117
|
}, getPlatformItemSlugs(platformItem)));
|
|
117
118
|
case 33:
|
|
@@ -140,15 +141,20 @@ var remember = function remember(state, treeKey) {
|
|
|
140
141
|
case 42:
|
|
141
142
|
// If workflow, set sourceName to platformSourceName since the value is
|
|
142
143
|
// needed when creating new runs
|
|
143
|
-
treeObject = workflowObject ? (0,
|
|
144
|
+
treeObject = workflowObject ? (0, _objectSpread3["default"])({
|
|
144
145
|
sourceName: platformSourceName
|
|
145
146
|
}, workflowObject) : tree;
|
|
146
147
|
loadError = workflowObjectError || treeError || webApiError; // Find the operation ids of any integration nodes
|
|
147
|
-
|
|
148
|
-
var _node$parameters$find;
|
|
149
|
-
return node.definitionId.startsWith("".concat(_constants.ADVANCED_HANDLER_NAME_INTEGRATION, "_v")) ?
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
operations = (treeObject === null || treeObject === void 0 ? void 0 : (_treeObject$treeJson = treeObject.treeJson) === null || _treeObject$treeJson === void 0 ? void 0 : (_treeObject$treeJson$ = _treeObject$treeJson.nodes) === null || _treeObject$treeJson$ === void 0 ? void 0 : _treeObject$treeJson$.map(function (node) {
|
|
149
|
+
var _node$parameters$find, _node$parameters$find2;
|
|
150
|
+
return node.definitionId.startsWith("".concat(_constants.ADVANCED_HANDLER_NAME_INTEGRATION, "_v")) ? {
|
|
151
|
+
id: (_node$parameters$find = node.parameters.find(function (p) {
|
|
152
|
+
return p.id === 'operation';
|
|
153
|
+
})) === null || _node$parameters$find === void 0 ? void 0 : _node$parameters$find.value,
|
|
154
|
+
connectionId: (_node$parameters$find2 = node.parameters.find(function (p) {
|
|
155
|
+
return p.id === 'connection';
|
|
156
|
+
})) === null || _node$parameters$find2 === void 0 ? void 0 : _node$parameters$find2.value
|
|
157
|
+
} : null;
|
|
152
158
|
}).filter(Boolean)) || [];
|
|
153
159
|
_context.next = 47;
|
|
154
160
|
return (0, _effects.all)([(0, _effects.put)((0, _store.action)('TREE_LOADED', {
|
|
@@ -162,9 +168,9 @@ var remember = function remember(state, treeKey) {
|
|
|
162
168
|
treeObject && (!webApiProps || webApi) ? (0, _models.deserializeTree)(treeObject) : null,
|
|
163
169
|
webApi: webApi ? (0, _models.deserializeWebApi)(webApi, webApiProps.kappSlug) : null,
|
|
164
170
|
error: loadError ? loadError.message || loadError : null
|
|
165
|
-
})),
|
|
171
|
+
})), operations.length > 0 ? (0, _effects.put)((0, _store.action)('TREE_LOAD_OPERATIONS', {
|
|
166
172
|
treeKey: treeKey,
|
|
167
|
-
|
|
173
|
+
operations: operations
|
|
168
174
|
})) : null]);
|
|
169
175
|
case 47:
|
|
170
176
|
_context.next = 52;
|
|
@@ -217,39 +223,47 @@ var remember = function remember(state, treeKey) {
|
|
|
217
223
|
(0, _store.regSaga)((0, _effects.takeEvery)('TREE_LOAD_OPERATIONS', function (_ref3) {
|
|
218
224
|
var payload = _ref3.payload;
|
|
219
225
|
return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
220
|
-
var treeKey, connectionId, _payload$operationIds, operationIds, _yield, _yield$operations, operations;
|
|
226
|
+
var treeKey, connectionId, _payload$operationIds, operationIds, operationsToLoad, _yield, _yield$operations, operations, loadedOperationIds;
|
|
221
227
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
222
228
|
while (1) switch (_context3.prev = _context3.next) {
|
|
223
229
|
case 0:
|
|
224
230
|
_context3.prev = 0;
|
|
225
|
-
treeKey = payload.treeKey, connectionId = payload.connectionId, _payload$operationIds = payload.operationIds, operationIds = _payload$operationIds === void 0 ? [] : _payload$operationIds;
|
|
231
|
+
treeKey = payload.treeKey, connectionId = payload.connectionId, _payload$operationIds = payload.operationIds, operationIds = _payload$operationIds === void 0 ? [] : _payload$operationIds, operationsToLoad = payload.operations;
|
|
226
232
|
_context3.next = 4;
|
|
227
233
|
return connectionId ? (0, _effects.call)(_apis.fetchOperations, {
|
|
228
234
|
connectionId: connectionId
|
|
229
235
|
}) : (0, _effects.call)(_apis.fetchBulkOperations, {
|
|
230
|
-
ids:
|
|
236
|
+
ids: operationsToLoad ? operationsToLoad.map(function (op) {
|
|
237
|
+
return op.id;
|
|
238
|
+
}) : operationIds
|
|
231
239
|
});
|
|
232
240
|
case 4:
|
|
233
241
|
_yield = _context3.sent;
|
|
234
242
|
_yield$operations = _yield.operations;
|
|
235
243
|
operations = _yield$operations === void 0 ? [] : _yield$operations;
|
|
236
|
-
|
|
244
|
+
loadedOperationIds = operations.reduce(function (ids, op) {
|
|
245
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, ids), {}, (0, _defineProperty2["default"])({}, op.id, true));
|
|
246
|
+
}, {});
|
|
247
|
+
_context3.next = 10;
|
|
237
248
|
return (0, _effects.put)((0, _store.action)('TREE_INTEGRATION_DATA_LOADED', {
|
|
249
|
+
missing: operationsToLoad ? operationsToLoad.filter(function (op) {
|
|
250
|
+
return !loadedOperationIds[op.id];
|
|
251
|
+
}) : null,
|
|
238
252
|
operations: operations,
|
|
239
253
|
treeKey: treeKey
|
|
240
254
|
}));
|
|
241
|
-
case
|
|
242
|
-
_context3.next =
|
|
255
|
+
case 10:
|
|
256
|
+
_context3.next = 15;
|
|
243
257
|
break;
|
|
244
|
-
case
|
|
245
|
-
_context3.prev =
|
|
258
|
+
case 12:
|
|
259
|
+
_context3.prev = 12;
|
|
246
260
|
_context3.t0 = _context3["catch"](0);
|
|
247
261
|
console.error('Caught error loading tree integration data', _context3.t0);
|
|
248
|
-
case
|
|
262
|
+
case 15:
|
|
249
263
|
case "end":
|
|
250
264
|
return _context3.stop();
|
|
251
265
|
}
|
|
252
|
-
}, _callee3, null, [[0,
|
|
266
|
+
}, _callee3, null, [[0, 12]]);
|
|
253
267
|
})();
|
|
254
268
|
}));
|
|
255
269
|
var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
@@ -294,13 +308,13 @@ var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
|
294
308
|
// endpoint to create the workflow
|
|
295
309
|
_context4.next = 14;
|
|
296
310
|
return newName ? tree.event ? (0, _effects.call)(_apis.createWorkflow, {
|
|
297
|
-
workflow: (0,
|
|
311
|
+
workflow: (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, (0, _models.serializeTree)(tree)), {}, {
|
|
298
312
|
name: newName
|
|
299
313
|
}),
|
|
300
314
|
kappSlug: kappSlug,
|
|
301
315
|
formSlug: formSlug
|
|
302
316
|
}) : (0, _effects.call)(_apis.createTree, {
|
|
303
|
-
tree: (0,
|
|
317
|
+
tree: (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, (0, _models.serializeTree)(tree, true)), {}, {
|
|
304
318
|
name: newName
|
|
305
319
|
})
|
|
306
320
|
}) : tree.event ? (0, _effects.call)(_apis.updateWorkflow, {
|
|
@@ -464,7 +478,7 @@ var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
|
464
478
|
lastWebApi: webApi,
|
|
465
479
|
loading: false,
|
|
466
480
|
tasks: (0, _immutable.List)(categories).map(function (category) {
|
|
467
|
-
return category.name === 'System Controls' ? (0,
|
|
481
|
+
return category.name === 'System Controls' ? (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, category), {}, {
|
|
468
482
|
handlers: [].concat((0, _toConsumableArray2["default"])(category.handlers), [tree ? (0, _helpers.treeReturnTask)(tree) : null]).filter(Boolean)
|
|
469
483
|
}) : category;
|
|
470
484
|
}).flatMap(function (category) {
|
|
@@ -483,7 +497,8 @@ var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
|
483
497
|
var _ref11$payload = _ref11.payload,
|
|
484
498
|
treeKey = _ref11$payload.treeKey,
|
|
485
499
|
connections = _ref11$payload.connections,
|
|
486
|
-
operations = _ref11$payload.operations
|
|
500
|
+
operations = _ref11$payload.operations,
|
|
501
|
+
missing = _ref11$payload.missing;
|
|
487
502
|
return state.updateIn(['trees', treeKey, 'connections'], function (connectionsMap) {
|
|
488
503
|
// Update connections map in state if data was provided
|
|
489
504
|
var newConnectionsMap = connections ? (0, _immutable.fromJS)(connections).sortBy(function (conn) {
|
|
@@ -493,9 +508,14 @@ var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
|
493
508
|
}, (0, _immutable.OrderedMap)()) : connectionsMap;
|
|
494
509
|
|
|
495
510
|
// Update the operations maps in each connection if data was provided
|
|
496
|
-
|
|
511
|
+
var newConnectionsWithOperationsMap = operations ? (0, _immutable.fromJS)(operations).reduce(function (map, op) {
|
|
497
512
|
return map.setIn([op.get('connectionId'), 'operations', op.get('id')], op);
|
|
498
513
|
}, newConnectionsMap) : newConnectionsMap;
|
|
514
|
+
|
|
515
|
+
// Update the operations maps in each connection to set missing values
|
|
516
|
+
return missing ? (0, _immutable.fromJS)(missing).reduce(function (map, op) {
|
|
517
|
+
return map.has(op.get('connectionId')) ? map.setIn([op.get('connectionId'), 'operations', op.get('id')], null) : map;
|
|
518
|
+
}, newConnectionsWithOperationsMap) : newConnectionsWithOperationsMap;
|
|
499
519
|
});
|
|
500
520
|
},
|
|
501
521
|
TREE_SAVE: function TREE_SAVE(state, _ref12) {
|
|
@@ -662,7 +682,7 @@ var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
|
662
682
|
values = _ref26$payload.values;
|
|
663
683
|
// If the updated settings are for a routine we rebuild the "Tree Input"
|
|
664
684
|
// bindings.
|
|
665
|
-
var bindings = values.inputs ? (0,
|
|
685
|
+
var bindings = values.inputs ? (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, state.getIn(['trees', treeKey, 'tree', 'bindings'])), {}, {
|
|
666
686
|
'Tree Input': values.inputs.groupBy(function (input) {
|
|
667
687
|
return input.get('name');
|
|
668
688
|
}).map(function (list) {
|
|
@@ -671,7 +691,7 @@ var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
|
671
691
|
return "<%=@inputs['".concat(name, "']%>");
|
|
672
692
|
}).toJS()
|
|
673
693
|
}) : state.getIn(['trees', treeKey, 'tree', 'bindings']);
|
|
674
|
-
return remember(state, treeKey).mergeIn(['trees', treeKey, 'tree'], (0,
|
|
694
|
+
return remember(state, treeKey).mergeIn(['trees', treeKey, 'tree'], (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, values), {}, {
|
|
675
695
|
bindings: bindings
|
|
676
696
|
})).updateIn(['trees', treeKey], synchronizeRoutineDefinition);
|
|
677
697
|
},
|
|
@@ -689,7 +709,7 @@ var synchronizeRoutineDefinition = function synchronizeRoutineDefinition(treeBui
|
|
|
689
709
|
outputs = tree.outputs;
|
|
690
710
|
return treeBuilderState.update('tasks', function (tasks) {
|
|
691
711
|
return tasks.map(function (task, taskDefinitionId) {
|
|
692
|
-
return definitionId === taskDefinitionId ? (0,
|
|
712
|
+
return definitionId === taskDefinitionId ? (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, task), {}, {
|
|
693
713
|
inputs: inputs.toJS(),
|
|
694
714
|
outputs: outputs.toJS()
|
|
695
715
|
}) : taskDefinitionId === 'system_tree_return_v1' ? (0, _helpers.treeReturnTask)(tree) : task;
|