@kineticdata/react 5.1.2 → 6.0.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/assets/task/icons/drag-handle.svg +3 -0
- package/assets/task/icons/plus_small.svg +2 -4
- package/lib/apis/agent/adapters.js +16 -12
- package/lib/apis/agent/bridges.js +54 -41
- package/lib/apis/agent/handlers.js +51 -38
- package/lib/apis/core/activity.js +19 -11
- package/lib/apis/core/attributeDefinitions.js +54 -46
- package/lib/apis/core/attributeDefinitions.test.js +47 -55
- package/lib/apis/core/authentication.js +58 -63
- package/lib/apis/core/backgroundJobs.js +38 -30
- package/lib/apis/core/bridgeModelAttributeMappings.js +42 -34
- package/lib/apis/core/bridgeModelAttributes.js +47 -37
- package/lib/apis/core/bridgeModelMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualificationMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualifications.js +42 -34
- package/lib/apis/core/bridgeModels.js +56 -46
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -72
- package/lib/apis/core/bridgedresources.test.js +33 -30
- package/lib/apis/core/categories.js +59 -52
- package/lib/apis/core/categories.test.js +36 -33
- package/lib/apis/core/fileResources.js +41 -33
- package/lib/apis/core/filestores.js +42 -34
- package/lib/apis/core/formTypes.js +50 -44
- package/lib/apis/core/forms.js +53 -49
- package/lib/apis/core/forms.test.js +60 -74
- package/lib/apis/core/kapps.js +45 -39
- package/lib/apis/core/kapps.test.js +45 -52
- package/lib/apis/core/logs.js +20 -16
- package/lib/apis/core/memberships.js +23 -20
- package/lib/apis/core/meta.js +31 -19
- package/lib/apis/core/notices.js +17 -9
- package/lib/apis/core/oauthClients.js +49 -45
- package/lib/apis/core/platformComponents.js +73 -57
- package/lib/apis/core/platformItems.js +22 -13
- package/lib/apis/core/profile.js +28 -21
- package/lib/apis/core/profile.test.js +20 -17
- package/lib/apis/core/securityPolicyDefinitions.js +48 -41
- package/lib/apis/core/securityPolicyDefinitions.test.js +50 -60
- package/lib/apis/core/space.js +23 -16
- package/lib/apis/core/space.test.js +31 -38
- package/lib/apis/core/submissions.js +213 -186
- package/lib/apis/core/submissions.test.js +39 -36
- package/lib/apis/core/teams.js +51 -44
- package/lib/apis/core/teams.test.js +42 -39
- package/lib/apis/core/translations.js +123 -130
- package/lib/apis/core/translations.test.js +278 -368
- package/lib/apis/core/users.js +56 -49
- package/lib/apis/core/users.test.js +42 -39
- package/lib/apis/core/version.js +20 -11
- package/lib/apis/core/webApis.js +42 -34
- package/lib/apis/core/webhooks.js +48 -41
- package/lib/apis/core/webhooks.test.js +50 -60
- package/lib/apis/core/webhooksJobs.js +30 -26
- package/lib/apis/core/workflows.js +52 -44
- package/lib/apis/http.js +89 -80
- package/lib/apis/http.test.js +37 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +228 -211
- package/lib/apis/task/index.js +280 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +12 -8
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +12 -8
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +12 -8
- package/lib/components/common/AttributeSelect.js +15 -9
- package/lib/components/common/BridgeSelect.js +48 -43
- package/lib/components/common/ComponentConfigContext.js +9 -2
- package/lib/components/common/ContentEditable.js +36 -60
- package/lib/components/common/FormSelect.js +70 -58
- package/lib/components/common/NodeSelect.js +23 -19
- package/lib/components/common/Scroller.js +24 -23
- package/lib/components/common/StaticSelect.js +57 -50
- package/lib/components/common/TableInput.js +54 -57
- package/lib/components/common/TeamSelect.js +42 -39
- package/lib/components/common/Typeahead.js +121 -138
- package/lib/components/common/UserSelect.js +42 -41
- package/lib/components/common/authentication/AuthInterceptor.js +15 -19
- package/lib/components/common/authentication/AuthInterceptor.test.js +46 -64
- package/lib/components/common/authentication/AuthenticationContainer.js +350 -454
- package/lib/components/common/authentication/RequestInterceptor.js +16 -19
- package/lib/components/common/code_input/CodeInput.js +92 -122
- package/lib/components/common/code_input/draftHelpers.js +96 -90
- package/lib/components/common/code_input/languageHelpers.js +49 -47
- package/lib/components/common/code_input/languageHelpers.test.js +21 -16
- package/lib/components/core/CoreFormModal.js +26 -24
- package/lib/components/core/CoreModal.js +37 -31
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +24 -23
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +18 -15
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +12 -8
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +17 -16
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +25 -21
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +20 -20
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +27 -22
- package/lib/components/core/category/CategoryForm.js +22 -22
- package/lib/components/core/category/CategoryTable.js +15 -10
- package/lib/components/core/core_form/CoreForm.js +209 -285
- package/lib/components/core/core_form/CoreForm.test.js +12 -10
- package/lib/components/core/core_form/defaults/index.js +52 -44
- package/lib/components/core/core_form/globals.js +14 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +23 -21
- package/lib/components/core/field_definition/FieldDefinitionTable.js +15 -10
- package/lib/components/core/file_resource/FileResourceForm.js +38 -37
- package/lib/components/core/file_resource/FileResourceTable.js +16 -12
- package/lib/components/core/form/FormForm.js +56 -61
- package/lib/components/core/form/FormTable.js +25 -22
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +12 -8
- package/lib/components/core/i18n/I18n.js +54 -61
- package/lib/components/core/i18n/I18nContext.js +9 -2
- package/lib/components/core/i18n/I18nProvider.js +40 -43
- package/lib/components/core/i18n/Moment.js +40 -50
- package/lib/components/core/index_definition/IndexDefinitionForm.js +23 -24
- package/lib/components/core/index_definition/IndexDefinitionTable.js +19 -11
- package/lib/components/core/index_job/IndexJobTable.js +20 -15
- package/lib/components/core/kapp/KappForm.js +57 -58
- package/lib/components/core/kapp/KappTable.js +17 -12
- package/lib/components/core/log/LogTable.js +35 -33
- package/lib/components/core/oauth_client/OAuthClientForm.js +17 -17
- package/lib/components/core/oauth_client/OAuthClientTable.js +12 -8
- package/lib/components/core/platform_component/AgentComponentForm.js +15 -15
- package/lib/components/core/platform_component/AgentComponentTable.js +10 -5
- package/lib/components/core/platform_component/TaskComponentForm.js +14 -14
- package/lib/components/core/profile/ProfileForm.js +40 -39
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +28 -25
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +18 -13
- package/lib/components/core/space/SpaceForm.js +79 -90
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +39 -40
- package/lib/components/core/submission/DatastoreSubmissionTable.js +37 -34
- package/lib/components/core/submission/FormSubmissionFilters.js +79 -75
- package/lib/components/core/submission/FormSubmissionTable.js +27 -20
- package/lib/components/core/submission/KappSubmissionTable.js +30 -29
- package/lib/components/core/submission/SubmissionForm.js +126 -55
- package/lib/components/core/submission/SubmissionTable.js +24 -20
- package/lib/components/core/submission/helpers.js +37 -33
- package/lib/components/core/submission/helpers.test.js +69 -20
- package/lib/components/core/team/TeamForm.js +24 -21
- package/lib/components/core/team/TeamTable.js +16 -11
- package/lib/components/core/translation/ContextForm.js +13 -10
- package/lib/components/core/translation/ContextTable.js +13 -10
- package/lib/components/core/translation/EntryForm.js +27 -24
- package/lib/components/core/translation/EntryTable.js +19 -16
- package/lib/components/core/translation/LocaleForm.js +16 -13
- package/lib/components/core/translation/LocaleTable.js +12 -8
- package/lib/components/core/user/UserForm.js +38 -37
- package/lib/components/core/user/UserTable.js +19 -15
- package/lib/components/core/webapi/WebApiForm.js +49 -61
- package/lib/components/core/webapi/WebApiTable.js +14 -10
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +22 -20
- package/lib/components/core/webhook_job/WebhookJobTable.js +19 -16
- package/lib/components/form/Form.helpers.js +102 -90
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +38 -24
- package/lib/components/form/FormState.js +8 -5
- package/lib/components/form/KitchenSinkForm.js +135 -4
- package/lib/components/form/defaults/AttributesField.js +48 -59
- package/lib/components/form/defaults/CheckboxField.js +14 -6
- package/lib/components/form/defaults/CodeField.js +15 -7
- package/lib/components/form/defaults/FormButtons.js +12 -4
- package/lib/components/form/defaults/FormError.js +12 -4
- package/lib/components/form/defaults/FormField.js +15 -7
- package/lib/components/form/defaults/FormLayout.js +12 -4
- package/lib/components/form/defaults/FormMultiField.js +15 -7
- package/lib/components/form/defaults/PasswordField.js +14 -6
- package/lib/components/form/defaults/RadioField.js +15 -7
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +17 -9
- package/lib/components/form/defaults/SelectField.js +16 -8
- package/lib/components/form/defaults/SelectMultiField.js +15 -7
- package/lib/components/form/defaults/TableField.js +14 -6
- package/lib/components/form/defaults/TeamField.js +15 -7
- package/lib/components/form/defaults/TeamMultiField.js +15 -7
- package/lib/components/form/defaults/TextField.js +14 -6
- package/lib/components/form/defaults/TextMultiField.js +26 -28
- package/lib/components/form/defaults/UserField.js +15 -7
- package/lib/components/form/defaults/UserMultiField.js +15 -7
- package/lib/components/form/defaults/index.js +48 -41
- package/lib/components/form/tests/Form.test.js +568 -864
- package/lib/components/form/tests/components.js +15 -25
- package/lib/components/form/tests/helpers.test.js +35 -33
- package/lib/components/index.js +981 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemFilestoreForm.js +28 -25
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +10 -9
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +21 -17
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +62 -60
- package/lib/components/system/helpers.test.js +16 -12
- package/lib/components/system/spaces/SystemSpaceForm.js +25 -24
- package/lib/components/system/spaces/SystemTenantForm.js +43 -40
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +211 -224
- package/lib/components/table/Table.redux.js +292 -329
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +107 -132
- package/lib/components/table/defaults/BodyCell.js +12 -6
- package/lib/components/table/defaults/BodyRow.js +10 -4
- package/lib/components/table/defaults/BooleanFilter.js +17 -11
- package/lib/components/table/defaults/EmptyBodyRow.js +12 -6
- package/lib/components/table/defaults/FilterLayout.js +17 -11
- package/lib/components/table/defaults/Footer.js +11 -5
- package/lib/components/table/defaults/FooterCell.js +10 -4
- package/lib/components/table/defaults/FooterRow.js +10 -4
- package/lib/components/table/defaults/Header.js +10 -4
- package/lib/components/table/defaults/HeaderCell.js +16 -10
- package/lib/components/table/defaults/HeaderRow.js +10 -4
- package/lib/components/table/defaults/PaginationControl.js +18 -9
- package/lib/components/table/defaults/TableBody.js +10 -4
- package/lib/components/table/defaults/TableLayout.js +12 -6
- package/lib/components/table/defaults/TextFilter.js +16 -10
- package/lib/components/table/defaults/index.js +41 -33
- package/lib/components/task/builder/Connector.js +100 -111
- package/lib/components/task/builder/ConnectorForm.js +17 -11
- package/lib/components/task/builder/Node.js +101 -83
- package/lib/components/task/builder/NodeForm.js +30 -27
- package/lib/components/task/builder/NodeParametersForm.js +27 -24
- package/lib/components/task/builder/SvgCanvas.js +67 -96
- package/lib/components/task/builder/SvgText.js +19 -134
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +27 -22
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +311 -326
- package/lib/components/task/builder/constants.js +94 -45
- package/lib/components/task/builder/helpers.js +184 -173
- package/lib/components/task/builder/helpers.test.js +20 -18
- package/lib/components/task/builder/models.js +121 -98
- package/lib/components/task/category/TaskCategoryForm.js +31 -29
- package/lib/components/task/category/TaskCategoryTable.js +12 -8
- package/lib/components/task/common/UsageTable.js +16 -12
- package/lib/components/task/engine/EngineSettingsForm.js +13 -11
- package/lib/components/task/errors/RunErrorTable.js +17 -13
- package/lib/components/task/errors/SystemErrorsTable.js +13 -9
- package/lib/components/task/handlers/HandlerForm.js +55 -55
- package/lib/components/task/handlers/HandlerTable.js +12 -8
- package/lib/components/task/handlers/MissingHandlerTable.js +12 -8
- package/lib/components/task/policy_rule/PolicyRuleForm.js +33 -32
- package/lib/components/task/policy_rule/PolicyRuleTable.js +12 -8
- package/lib/components/task/runs/CreateManualTriggerForm.js +17 -15
- package/lib/components/task/runs/RunTable.js +23 -20
- package/lib/components/task/runs/RunTaskTable.js +10 -6
- package/lib/components/task/sources/SourceForm.js +47 -47
- package/lib/components/task/sources/SourceTable.js +14 -11
- package/lib/components/task/triggers/TriggerTable.js +21 -18
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -10
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +49 -44
- package/lib/components/task/workflows/WorkflowTable.js +17 -14
- package/lib/helpers/SearchBuilder.js +73 -127
- package/lib/helpers/SearchBuilder.test.js +184 -175
- package/lib/helpers/index.js +116 -74
- package/lib/index.js +86 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +3 -28
- package/proxyhelper.js +105 -46
- package/assets/discussions/images/avi_128.png +0 -0
- package/assets/discussions/images/excel_128.png +0 -0
- package/assets/discussions/images/html_128.png +0 -0
- package/assets/discussions/images/illustrator_128.png +0 -0
- package/assets/discussions/images/indesign_128.png +0 -0
- package/assets/discussions/images/movie_128.png +0 -0
- package/assets/discussions/images/mpeg_128.png +0 -0
- package/assets/discussions/images/pdf_128.png +0 -0
- package/assets/discussions/images/photoshop_128.png +0 -0
- package/assets/discussions/images/powerpoint_128.png +0 -0
- package/assets/discussions/images/txt_128.png +0 -0
- package/assets/discussions/images/unknown_128.png +0 -0
- package/assets/discussions/images/word_128.png +0 -0
- package/assets/discussions/styles/_discussion.scss +0 -506
- package/lib/apis/discussions/index.js +0 -395
- package/lib/apis/socket/index.js +0 -77
- package/lib/apis/socket/socket.js +0 -350
- package/lib/apis/socket/socket.test.js +0 -90
- package/lib/apis/socket/timer.js +0 -45
- package/lib/apis/socket/timer.test.js +0 -51
- package/lib/apis/socket/topic.js +0 -185
- package/lib/apis/topics/index.js +0 -19
- package/lib/components/discussions/ChatInputForm.js +0 -424
- package/lib/components/discussions/DateBanner.js +0 -10
- package/lib/components/discussions/Discussion.js +0 -202
- package/lib/components/discussions/DiscussionForm.js +0 -227
- package/lib/components/discussions/InvitationForm.js +0 -107
- package/lib/components/discussions/MessageHistory.js +0 -110
- package/lib/components/discussions/MessagesByDate.js +0 -40
- package/lib/components/discussions/MessagesList.js +0 -30
- package/lib/components/discussions/MoreMessagesBanner.js +0 -26
- package/lib/components/discussions/ScrollHelper.js +0 -84
- package/lib/components/discussions/SystemMessage.js +0 -88
- package/lib/components/discussions/SystemMessageGroup.js +0 -15
- package/lib/components/discussions/UserMessage.js +0 -163
- package/lib/components/discussions/UserMessageGroup.js +0 -34
- package/lib/components/discussions/redux.js +0 -178
- package/lib/components/discussions/sagas.js +0 -500
- package/lib/helpers/discussions/canManage.js +0 -30
- package/lib/helpers/discussions/canManage.test.js +0 -69
- package/lib/helpers/discussions/generateSystemMessageContent.js +0 -131
- package/lib/helpers/discussions/generateSystemMessageContent.test.js +0 -450
- package/lib/models/discussions.js +0 -76
- package/lib/models/index.js +0 -1
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.TreeBuilderComponent = exports.TreeBuilder = void 0;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
13
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
15
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _lodashEs = require("lodash-es");
|
|
18
|
+
var _store = require("../../../store");
|
|
19
|
+
var _builder = require("./builder.redux");
|
|
20
|
+
var constants = _interopRequireWildcard(require("./constants"));
|
|
21
|
+
var _helpers = require("./helpers");
|
|
22
|
+
var _models = require("./models");
|
|
23
|
+
var _SvgCanvas = require("./SvgCanvas");
|
|
24
|
+
var _Node = require("./Node");
|
|
25
|
+
var _Connector = require("./Connector");
|
|
26
|
+
var _immutable = require("immutable");
|
|
27
|
+
var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
28
|
+
(0, _inherits2["default"])(TreeBuilderComponent, _Component);
|
|
29
|
+
var _super = (0, _createSuper2["default"])(TreeBuilderComponent);
|
|
24
30
|
function TreeBuilderComponent(props) {
|
|
25
31
|
var _this;
|
|
26
|
-
|
|
27
|
-
_classCallCheck(this, TreeBuilderComponent);
|
|
28
|
-
|
|
32
|
+
(0, _classCallCheck2["default"])(this, TreeBuilderComponent);
|
|
29
33
|
_this = _super.call(this, props);
|
|
30
|
-
|
|
31
34
|
_this.findNodeByPoint = function (point) {
|
|
32
|
-
return _this.props.tree.nodes.find(isPointInNode(point));
|
|
35
|
+
return _this.props.tree.nodes.find((0, _helpers.isPointInNode)(point));
|
|
33
36
|
};
|
|
34
|
-
|
|
35
37
|
_this.findDuplicateConnector = function (nodeId1, nodeId2) {
|
|
36
38
|
return _this.props.tree.connectors.some(function (connector) {
|
|
37
39
|
return connector.headId === nodeId1 && connector.tailId === nodeId2 || connector.headId === nodeId2 && connector.tailId === nodeId1;
|
|
38
40
|
});
|
|
39
41
|
};
|
|
40
|
-
|
|
41
42
|
_this.panTo = function (_ref) {
|
|
42
|
-
var _ref2 =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
44
|
+
type = _ref2[0],
|
|
45
|
+
id = _ref2[1];
|
|
46
46
|
if (type === 'node') {
|
|
47
47
|
var node = _this.props.tree.nodes.find(function (node) {
|
|
48
48
|
return node.name === id;
|
|
49
49
|
});
|
|
50
|
-
|
|
51
50
|
if (node) {
|
|
52
51
|
_this.canvasRef.current.focusPoint({
|
|
53
52
|
x: node.position.x + constants.NODE_CENTER_X,
|
|
@@ -58,26 +57,20 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
58
57
|
var connector = _this.props.tree.connectors.find(function (connector) {
|
|
59
58
|
return connector.id === id;
|
|
60
59
|
});
|
|
61
|
-
|
|
62
60
|
var headPosition = _this.props.tree.nodes.get(connector.headId).position;
|
|
63
|
-
|
|
64
61
|
var tailPosition = _this.props.tree.nodes.get(connector.tailId).position;
|
|
65
|
-
|
|
66
62
|
_this.canvasRef.current.focusPoint({
|
|
67
63
|
x: (headPosition.x + tailPosition.x + constants.NODE_WIDTH) / 2,
|
|
68
64
|
y: (headPosition.y + tailPosition.y + constants.NODE_HEIGHT) / 2
|
|
69
65
|
}, _this.sidebarRef.current);
|
|
70
66
|
}
|
|
71
67
|
};
|
|
72
|
-
|
|
73
68
|
_this.getConnectorsByHead = function (nodeId) {
|
|
74
69
|
return Object.values(_this.connectorMap.byHead[nodeId] || {});
|
|
75
70
|
};
|
|
76
|
-
|
|
77
71
|
_this.getConnectorsByTail = function (nodeId) {
|
|
78
72
|
return Object.values(_this.connectorMap.byTail[nodeId] || {});
|
|
79
73
|
};
|
|
80
|
-
|
|
81
74
|
_this.getChildNodes = function (nodeId) {
|
|
82
75
|
return Object.keys(_this.connectorMap.byTail[nodeId] || {}).map(function (connectorId) {
|
|
83
76
|
return _this.props.tree.connectors.get(parseInt(connectorId));
|
|
@@ -85,47 +78,84 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
85
78
|
return _this.props.tree.nodes.get(connector.headId);
|
|
86
79
|
});
|
|
87
80
|
};
|
|
88
|
-
|
|
89
81
|
_this.dragNewConnector = function (node) {
|
|
90
82
|
return function (position) {
|
|
91
83
|
if (!_this.state.newConnector) {
|
|
92
84
|
_this.setState(function (state) {
|
|
93
85
|
return {
|
|
94
|
-
newConnector: state.newConnector ||
|
|
86
|
+
newConnector: state.newConnector || (0, _models.Connector)({
|
|
95
87
|
tailId: node.id
|
|
96
88
|
})
|
|
97
89
|
};
|
|
98
90
|
});
|
|
99
91
|
}
|
|
100
|
-
|
|
101
92
|
if (_this.newConnector.current) {
|
|
102
|
-
_this.newConnector.current.setTreeBuilder(
|
|
103
|
-
|
|
93
|
+
_this.newConnector.current.setTreeBuilder((0, _assertThisInitialized2["default"])(_this));
|
|
104
94
|
_this.newConnector.current.setHead(position, true);
|
|
105
95
|
}
|
|
106
96
|
};
|
|
107
97
|
};
|
|
108
|
-
|
|
109
98
|
_this.dropNewConnector = function () {
|
|
110
99
|
if (_this.newConnector.current) {
|
|
111
100
|
_this.newConnector.current.dropHead();
|
|
112
101
|
}
|
|
113
|
-
|
|
114
102
|
_this.setState({
|
|
115
103
|
newConnector: null
|
|
116
104
|
});
|
|
117
105
|
};
|
|
118
|
-
|
|
106
|
+
_this.addNewNode = function (parentNode, nativeEvent, dx, dy) {
|
|
107
|
+
return function () {
|
|
108
|
+
var newNode = (0, _models.Node)({
|
|
109
|
+
position: parentNode.position.update('x', function (x) {
|
|
110
|
+
return x + dx;
|
|
111
|
+
}).update('y', function (y) {
|
|
112
|
+
return y + dy;
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
var newConnector = (0, _models.Connector)({
|
|
116
|
+
tailId: parentNode.id,
|
|
117
|
+
headId: newNode.id
|
|
118
|
+
});
|
|
119
|
+
_this.setState({
|
|
120
|
+
newConnector: newConnector,
|
|
121
|
+
newNode: newNode,
|
|
122
|
+
newNodeParent: parentNode
|
|
123
|
+
});
|
|
124
|
+
_this.watchDrag({
|
|
125
|
+
nativeEvent: nativeEvent,
|
|
126
|
+
onMove: _this.dragNewNode,
|
|
127
|
+
onDrop: _this.confirmNewNode,
|
|
128
|
+
onClick: _this.confirmNewNode
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
_this.dragNewNode = function (position) {
|
|
133
|
+
if (_this.newNode.current) {
|
|
134
|
+
_this.newNode.current.setTreeBuilder((0, _assertThisInitialized2["default"])(_this));
|
|
135
|
+
_this.newNode.current.move(position);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
_this.confirmNewNode = function () {
|
|
139
|
+
if ((0, _lodashEs.isFunction)(_this.props.onNew)) {
|
|
140
|
+
setTimeout(function () {
|
|
141
|
+
_this.props.onNew((0, _helpers.addNewTask)(_this.props.treeKey, _this.props.treeBuilderState.tree, _this.state.newNodeParent, _this.newNode.current.position, function () {
|
|
142
|
+
return _this.setState({
|
|
143
|
+
newConnector: null,
|
|
144
|
+
newNode: null
|
|
145
|
+
});
|
|
146
|
+
}));
|
|
147
|
+
}, 500);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
119
150
|
_this.registerConnector = function (connector) {
|
|
120
151
|
return function (connectorInstance) {
|
|
121
152
|
var headId = connector.headId,
|
|
122
|
-
|
|
123
|
-
|
|
153
|
+
id = connector.id,
|
|
154
|
+
tailId = connector.tailId;
|
|
124
155
|
_this.connectorMap.byHead[headId] = _this.connectorMap.byHead[headId] || {};
|
|
125
156
|
_this.connectorMap.byTail[tailId] = _this.connectorMap.byTail[tailId] || {};
|
|
126
|
-
|
|
127
157
|
if (connectorInstance) {
|
|
128
|
-
connectorInstance.setTreeBuilder(
|
|
158
|
+
connectorInstance.setTreeBuilder((0, _assertThisInitialized2["default"])(_this));
|
|
129
159
|
_this.connectorMap.byHead[headId][id] = connectorInstance;
|
|
130
160
|
_this.connectorMap.byTail[tailId][id] = connectorInstance;
|
|
131
161
|
} else {
|
|
@@ -134,45 +164,40 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
134
164
|
}
|
|
135
165
|
};
|
|
136
166
|
};
|
|
137
|
-
|
|
138
167
|
_this.registerNode = function (node) {
|
|
139
168
|
return function (nodeInstance) {
|
|
140
169
|
var id = node.id;
|
|
141
|
-
|
|
142
170
|
if (nodeInstance) {
|
|
143
|
-
nodeInstance.setTreeBuilder(
|
|
171
|
+
nodeInstance.setTreeBuilder((0, _assertThisInitialized2["default"])(_this));
|
|
144
172
|
_this.nodeMap[id] = nodeInstance;
|
|
145
173
|
} else {
|
|
146
174
|
delete _this.nodeMap[id];
|
|
147
175
|
}
|
|
148
176
|
};
|
|
149
177
|
};
|
|
150
|
-
|
|
151
178
|
_this.watchDrag = function () {
|
|
152
179
|
var _this$canvasRef$curre;
|
|
153
|
-
|
|
154
180
|
return (_this$canvasRef$curre = _this.canvasRef.current).watchDrag.apply(_this$canvasRef$curre, arguments);
|
|
155
181
|
};
|
|
156
|
-
|
|
157
182
|
_this.isDirty = function (treeBuilderState) {
|
|
158
|
-
return treeBuilderState && (!is(treeBuilderState.lastSave, treeBuilderState.tree) || !is(treeBuilderState.lastWebApi, treeBuilderState.webApi));
|
|
183
|
+
return treeBuilderState && (!(0, _immutable.is)(treeBuilderState.lastSave, treeBuilderState.tree) || !(0, _immutable.is)(treeBuilderState.lastWebApi, treeBuilderState.webApi));
|
|
159
184
|
};
|
|
160
|
-
|
|
161
185
|
_this.state = {
|
|
162
|
-
newConnector: null
|
|
186
|
+
newConnector: null,
|
|
187
|
+
newNode: null
|
|
163
188
|
};
|
|
164
|
-
_this.newConnector = createRef();
|
|
165
|
-
_this.
|
|
189
|
+
_this.newConnector = /*#__PURE__*/(0, _react.createRef)();
|
|
190
|
+
_this.newNode = /*#__PURE__*/(0, _react.createRef)();
|
|
191
|
+
_this.canvasRef = /*#__PURE__*/(0, _react.createRef)();
|
|
166
192
|
_this.connectorMap = {
|
|
167
193
|
byHead: {},
|
|
168
194
|
byTail: {}
|
|
169
195
|
};
|
|
170
196
|
_this.nodeMap = {};
|
|
171
|
-
_this.sidebarRef = createRef();
|
|
197
|
+
_this.sidebarRef = /*#__PURE__*/(0, _react.createRef)();
|
|
172
198
|
return _this;
|
|
173
199
|
}
|
|
174
|
-
|
|
175
|
-
_createClass(TreeBuilderComponent, [{
|
|
200
|
+
(0, _createClass2["default"])(TreeBuilderComponent, [{
|
|
176
201
|
key: "componentDidMount",
|
|
177
202
|
value: function componentDidMount() {
|
|
178
203
|
this.checkConfig();
|
|
@@ -202,20 +227,20 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
202
227
|
// placeholder then we will call configureTreeBuilder with the component's
|
|
203
228
|
// props at that time
|
|
204
229
|
if (this.props.treeBuilderState === null) {
|
|
205
|
-
configureTreeBuilder(pick(this.props, ['treeKey', 'sourceName', 'sourceGroup', 'name', 'platformSourceName']));
|
|
230
|
+
(0, _builder.configureTreeBuilder)((0, _lodashEs.pick)(this.props, ['treeKey', 'sourceName', 'sourceGroup', 'name', 'platformSourceName']));
|
|
206
231
|
}
|
|
207
232
|
}
|
|
208
233
|
}, {
|
|
209
234
|
key: "checkHighlight",
|
|
210
235
|
value: function checkHighlight() {
|
|
211
236
|
var prevProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
212
|
-
|
|
213
237
|
if (this.props.treeBuilderState && !this.props.treeBuilderState.loading) {
|
|
214
238
|
// one the first "real" render of the tree builder check for the highlight
|
|
215
239
|
// node and focus if one is specified
|
|
216
240
|
if ((!prevProps.treeBuilderState || prevProps.treeBuilderState.loading) && this.props.highlight) {
|
|
217
241
|
this.panTo(this.props.highlight);
|
|
218
|
-
}
|
|
242
|
+
}
|
|
243
|
+
// otherwise check for changes to the highlight prop and focus if it changes
|
|
219
244
|
// and its a truthy value
|
|
220
245
|
else if (this.props.highlight && !this.props.highlight.equals(prevProps.highlight)) {
|
|
221
246
|
this.panTo(this.props.highlight);
|
|
@@ -226,75 +251,72 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
226
251
|
key: "render",
|
|
227
252
|
value: function render() {
|
|
228
253
|
var _this2 = this;
|
|
229
|
-
|
|
230
254
|
var _this$props = this.props,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
255
|
+
highlight = _this$props.highlight,
|
|
256
|
+
selected = _this$props.selected,
|
|
257
|
+
treeBuilderState = _this$props.treeBuilderState,
|
|
258
|
+
treeKey = _this$props.treeKey;
|
|
236
259
|
var _ref3 = highlight || [],
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
260
|
+
_ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
261
|
+
highlightType = _ref4[0],
|
|
262
|
+
highlightId = _ref4[1];
|
|
241
263
|
if (treeBuilderState) {
|
|
242
264
|
var lastSave = treeBuilderState.lastSave,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
265
|
+
lastWebApi = treeBuilderState.lastWebApi,
|
|
266
|
+
redoStack = treeBuilderState.redoStack,
|
|
267
|
+
saving = treeBuilderState.saving,
|
|
268
|
+
tasks = treeBuilderState.tasks,
|
|
269
|
+
tree = treeBuilderState.tree,
|
|
270
|
+
undoStack = treeBuilderState.undoStack,
|
|
271
|
+
webApi = treeBuilderState.webApi;
|
|
250
272
|
return this.props.children({
|
|
251
273
|
actions: {
|
|
252
274
|
deleteConnector: function deleteConnector(id) {
|
|
253
|
-
return dispatch('TREE_REMOVE_CONNECTOR', {
|
|
275
|
+
return (0, _store.dispatch)('TREE_REMOVE_CONNECTOR', {
|
|
254
276
|
treeKey: treeKey,
|
|
255
277
|
id: id
|
|
256
278
|
});
|
|
257
279
|
},
|
|
258
280
|
deleteNode: function deleteNode(id) {
|
|
259
|
-
return dispatch('TREE_REMOVE_NODE', {
|
|
281
|
+
return (0, _store.dispatch)('TREE_REMOVE_NODE', {
|
|
260
282
|
treeKey: treeKey,
|
|
261
283
|
id: id
|
|
262
284
|
});
|
|
263
285
|
},
|
|
264
286
|
updateConnector: function updateConnector(values) {
|
|
265
|
-
return dispatch('TREE_UPDATE_CONNECTOR',
|
|
287
|
+
return (0, _store.dispatch)('TREE_UPDATE_CONNECTOR', (0, _objectSpread2["default"])({
|
|
266
288
|
treeKey: treeKey
|
|
267
289
|
}, values));
|
|
268
290
|
},
|
|
269
291
|
updateNode: function updateNode(values, dependencies) {
|
|
270
|
-
return dispatch('TREE_UPDATE_NODE',
|
|
292
|
+
return (0, _store.dispatch)('TREE_UPDATE_NODE', (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
271
293
|
treeKey: treeKey
|
|
272
294
|
}, values), {}, {
|
|
273
295
|
dependencies: dependencies
|
|
274
296
|
}));
|
|
275
297
|
},
|
|
276
298
|
updateSettings: function updateSettings(values) {
|
|
277
|
-
return dispatch('TREE_UPDATE_SETTINGS', {
|
|
299
|
+
return (0, _store.dispatch)('TREE_UPDATE_SETTINGS', {
|
|
278
300
|
treeKey: treeKey,
|
|
279
301
|
values: values
|
|
280
302
|
});
|
|
281
303
|
},
|
|
282
304
|
updateWebApi: function updateWebApi(values) {
|
|
283
|
-
return dispatch('TREE_UPDATE_WEB_API', {
|
|
305
|
+
return (0, _store.dispatch)('TREE_UPDATE_WEB_API', {
|
|
284
306
|
treeKey: treeKey,
|
|
285
307
|
values: values
|
|
286
308
|
});
|
|
287
309
|
},
|
|
288
310
|
save: function save(_ref5) {
|
|
289
311
|
var _ref5$overwrite = _ref5.overwrite,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
dispatch('TREE_SAVE', {
|
|
312
|
+
overwrite = _ref5$overwrite === void 0 ? false : _ref5$overwrite,
|
|
313
|
+
_ref5$newName = _ref5.newName,
|
|
314
|
+
newName = _ref5$newName === void 0 ? '' : _ref5$newName,
|
|
315
|
+
_ref5$onError = _ref5.onError,
|
|
316
|
+
onError = _ref5$onError === void 0 ? _this2.props.onError : _ref5$onError,
|
|
317
|
+
_ref5$onSave = _ref5.onSave,
|
|
318
|
+
onSave = _ref5$onSave === void 0 ? _this2.props.onSave : _ref5$onSave;
|
|
319
|
+
(0, _store.dispatch)('TREE_SAVE', {
|
|
298
320
|
newName: newName,
|
|
299
321
|
overwrite: overwrite,
|
|
300
322
|
onError: onError,
|
|
@@ -303,12 +325,12 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
303
325
|
});
|
|
304
326
|
},
|
|
305
327
|
undo: !undoStack.isEmpty() ? function () {
|
|
306
|
-
return dispatch('TREE_UNDO', {
|
|
328
|
+
return (0, _store.dispatch)('TREE_UNDO', {
|
|
307
329
|
treeKey: treeKey
|
|
308
330
|
});
|
|
309
331
|
} : null,
|
|
310
332
|
redo: !redoStack.isEmpty() ? function () {
|
|
311
|
-
return dispatch('TREE_REDO', {
|
|
333
|
+
return (0, _store.dispatch)('TREE_REDO', {
|
|
312
334
|
treeKey: treeKey
|
|
313
335
|
});
|
|
314
336
|
} : null,
|
|
@@ -327,10 +349,10 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
327
349
|
sidebarRef: this.sidebarRef,
|
|
328
350
|
tasks: tasks,
|
|
329
351
|
tree: tree,
|
|
330
|
-
treeBuilder: tree && /*#__PURE__*/
|
|
352
|
+
treeBuilder: tree && /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_SvgCanvas.SvgCanvas, {
|
|
331
353
|
ref: this.canvasRef
|
|
332
354
|
}, tree.connectors.map(function (connector) {
|
|
333
|
-
return /*#__PURE__*/
|
|
355
|
+
return /*#__PURE__*/_react["default"].createElement(_Connector.Connector, {
|
|
334
356
|
key: connector.id,
|
|
335
357
|
ref: _this2.registerConnector(connector),
|
|
336
358
|
treeKey: treeKey,
|
|
@@ -345,13 +367,13 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
345
367
|
}),
|
|
346
368
|
onSelect: _this2.props.onSelectConnector
|
|
347
369
|
});
|
|
348
|
-
}).toList(), this.state.newConnector && /*#__PURE__*/
|
|
370
|
+
}).toList(), this.state.newConnector && /*#__PURE__*/_react["default"].createElement(_Connector.Connector, {
|
|
349
371
|
ref: this.newConnector,
|
|
350
372
|
treeKey: treeKey,
|
|
351
373
|
connector: this.state.newConnector,
|
|
352
374
|
tailNode: tree.nodes.get(this.state.newConnector.tailId)
|
|
353
375
|
}), tree.nodes.map(function (node) {
|
|
354
|
-
return /*#__PURE__*/
|
|
376
|
+
return /*#__PURE__*/_react["default"].createElement(_Node.Node, {
|
|
355
377
|
key: node.id,
|
|
356
378
|
ref: _this2.registerNode(node),
|
|
357
379
|
treeKey: treeKey,
|
|
@@ -362,28 +384,31 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
|
|
|
362
384
|
var nodeId = _ref7.nodeId;
|
|
363
385
|
return nodeId === node.id;
|
|
364
386
|
}),
|
|
365
|
-
onNew: _this2.props.onNew,
|
|
366
387
|
onSelect: _this2.props.onSelectNode,
|
|
367
388
|
tasks: tasks,
|
|
368
389
|
tree: tree
|
|
369
390
|
});
|
|
370
|
-
}).toList()
|
|
391
|
+
}).toList(), this.state.newNode && /*#__PURE__*/_react["default"].createElement(_Node.Node, {
|
|
392
|
+
ref: this.newNode,
|
|
393
|
+
treeKey: treeKey,
|
|
394
|
+
node: this.state.newNode,
|
|
395
|
+
tasks: tasks,
|
|
396
|
+
tree: tree
|
|
397
|
+
}))),
|
|
371
398
|
webApi: webApi
|
|
372
399
|
});
|
|
373
400
|
}
|
|
374
|
-
|
|
375
401
|
return null;
|
|
376
402
|
}
|
|
377
403
|
}]);
|
|
378
|
-
|
|
379
404
|
return TreeBuilderComponent;
|
|
380
|
-
}(Component);
|
|
381
|
-
|
|
405
|
+
}(_react.Component);
|
|
406
|
+
exports.TreeBuilderComponent = TreeBuilderComponent;
|
|
382
407
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
383
408
|
return {
|
|
384
409
|
treeBuilderState: state.getIn(['trees', props.treeKey]),
|
|
385
410
|
tree: state.getIn(['trees', props.treeKey, 'tree'])
|
|
386
411
|
};
|
|
387
412
|
};
|
|
388
|
-
|
|
389
|
-
|
|
413
|
+
var TreeBuilder = (0, _store.connect)(mapStateToProps)(TreeBuilderComponent);
|
|
414
|
+
exports.TreeBuilder = TreeBuilder;
|