@kineticdata/react 6.1.0 → 6.1.1
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/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 +3 -2
- 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 +35 -5
- 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
|
@@ -49,15 +49,16 @@ var filterDataSources = function filterDataSources() {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
var filters = function filters() {
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
var filters = function filters(_ref2) {
|
|
53
|
+
var shared = _ref2.shared;
|
|
54
|
+
return function (_ref3) {
|
|
55
|
+
var locales = _ref3.locales;
|
|
55
56
|
return [{
|
|
56
57
|
name: 'locale',
|
|
57
58
|
label: 'Locale',
|
|
58
59
|
type: 'select',
|
|
59
|
-
options: function options(
|
|
60
|
-
var locales =
|
|
60
|
+
options: function options(_ref4) {
|
|
61
|
+
var locales = _ref4.locales;
|
|
61
62
|
return locales && locales.map(function (loc) {
|
|
62
63
|
return (0, _immutable.Map)({
|
|
63
64
|
value: loc.get('code'),
|
|
@@ -65,7 +66,7 @@ var filters = function filters() {
|
|
|
65
66
|
});
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
}, {
|
|
69
|
+
}, !shared && {
|
|
69
70
|
name: 'context',
|
|
70
71
|
label: 'Context',
|
|
71
72
|
type: 'text'
|
|
@@ -73,7 +74,7 @@ var filters = function filters() {
|
|
|
73
74
|
name: 'key',
|
|
74
75
|
label: 'Key',
|
|
75
76
|
type: 'text'
|
|
76
|
-
}];
|
|
77
|
+
}].filter(Boolean);
|
|
77
78
|
};
|
|
78
79
|
};
|
|
79
80
|
var columns = [{
|
|
@@ -83,6 +83,8 @@ var fields = function fields(_ref3) {
|
|
|
83
83
|
label: 'Username',
|
|
84
84
|
type: 'text',
|
|
85
85
|
required: true,
|
|
86
|
+
pattern: /^[^/&?=:%]*$/,
|
|
87
|
+
patternMessage: 'The characters / & ? = : % are not allowed.',
|
|
86
88
|
enabled: !username,
|
|
87
89
|
initialValue: (0, _immutable.get)(user, 'username') || ''
|
|
88
90
|
}, {
|
|
@@ -52,10 +52,10 @@ var filters = function filters() {
|
|
|
52
52
|
type: 'select',
|
|
53
53
|
options: [{
|
|
54
54
|
label: 'Yes',
|
|
55
|
-
value: true
|
|
55
|
+
value: 'true'
|
|
56
56
|
}, {
|
|
57
57
|
label: 'No',
|
|
58
|
-
value: false
|
|
58
|
+
value: 'false'
|
|
59
59
|
}]
|
|
60
60
|
}, {
|
|
61
61
|
name: 'spaceAdmin',
|
|
@@ -63,10 +63,10 @@ var filters = function filters() {
|
|
|
63
63
|
type: 'select',
|
|
64
64
|
options: [{
|
|
65
65
|
label: 'Yes',
|
|
66
|
-
value: true
|
|
66
|
+
value: 'true'
|
|
67
67
|
}, {
|
|
68
68
|
label: 'No',
|
|
69
|
-
value: false
|
|
69
|
+
value: 'false'
|
|
70
70
|
}]
|
|
71
71
|
}];
|
|
72
72
|
};
|
|
@@ -907,7 +907,9 @@ var Form = exports.Form = /*#__PURE__*/function (_Component) {
|
|
|
907
907
|
}(_react.Component);
|
|
908
908
|
var computeFieldSet = function computeFieldSet(fields, fieldSetProp) {
|
|
909
909
|
var defaultFieldSet = (0, _immutable.OrderedSet)(fields.keySeq());
|
|
910
|
-
return (0, _immutable.OrderedSet)(!fieldSetProp ? defaultFieldSet : typeof fieldSetProp === 'function' ? fieldSetProp(defaultFieldSet) : fieldSetProp)
|
|
910
|
+
return (0, _immutable.OrderedSet)(!fieldSetProp ? defaultFieldSet : typeof fieldSetProp === 'function' ? fieldSetProp(defaultFieldSet) : fieldSetProp.filter(function (field) {
|
|
911
|
+
return defaultFieldSet.has(field);
|
|
912
|
+
}));
|
|
911
913
|
};
|
|
912
914
|
var evaluateReadOnly = function evaluateReadOnly(readOnlyProp, bindings) {
|
|
913
915
|
return typeof readOnlyProp === 'boolean' ? readOnlyProp : typeof readOnlyProp === 'function' ? readOnlyProp(bindings) : false;
|
|
@@ -967,6 +969,7 @@ var FormImplComponent = /*#__PURE__*/function (_Component2) {
|
|
|
967
969
|
alterFields = _this$props2.alterFields,
|
|
968
970
|
autoFocus = _this$props2.autoFocus,
|
|
969
971
|
components = _this$props2.components,
|
|
972
|
+
renderers = _this$props2.renderers,
|
|
970
973
|
fieldsFn = _this$props2.fields,
|
|
971
974
|
fieldSet = _this$props2.fieldSet,
|
|
972
975
|
formKey = _this$props2.formKey,
|
|
@@ -1016,11 +1019,13 @@ var FormImplComponent = /*#__PURE__*/function (_Component2) {
|
|
|
1016
1019
|
focusRef: name === autoFocus || index === autoFocus ? _this4.focusRef : null
|
|
1017
1020
|
}, (0, _Form2.getFieldComponentProps)(field, readOnlyResult))) : null];
|
|
1018
1021
|
}),
|
|
1022
|
+
fieldSet: computedFieldSet.toJS(),
|
|
1019
1023
|
dirty: dirty,
|
|
1020
1024
|
error: error && /*#__PURE__*/_react["default"].createElement(FormError, {
|
|
1021
1025
|
error: error,
|
|
1022
1026
|
clear: clearError(formKey)
|
|
1023
1027
|
}),
|
|
1028
|
+
submit: onSubmit(formKey, fieldSet),
|
|
1024
1029
|
buttons: !readOnlyResult && /*#__PURE__*/_react["default"].createElement(FormButtons, {
|
|
1025
1030
|
formOptions: formOptions,
|
|
1026
1031
|
fields: fields,
|
|
@@ -1036,10 +1041,15 @@ var FormImplComponent = /*#__PURE__*/function (_Component2) {
|
|
|
1036
1041
|
meta: fields.map(function (field) {
|
|
1037
1042
|
var _field$errors;
|
|
1038
1043
|
return (0, _immutable.Map)({
|
|
1044
|
+
label: field.label,
|
|
1045
|
+
value: typeof field.serialize === 'function' && field.serialize(bindings) || field.value,
|
|
1046
|
+
options: field.options,
|
|
1047
|
+
type: field.type,
|
|
1039
1048
|
visible: field.visible,
|
|
1040
1049
|
hasErrors: ((_field$errors = field.errors) === null || _field$errors === void 0 ? void 0 : _field$errors.size) > 0
|
|
1041
1050
|
});
|
|
1042
|
-
})
|
|
1051
|
+
}),
|
|
1052
|
+
renderers: renderers
|
|
1043
1053
|
});
|
|
1044
1054
|
}
|
|
1045
1055
|
return typeof this.props.children === 'function' ? this.props.children({
|
|
@@ -1081,7 +1091,8 @@ var generateForm = exports.generateForm = function generateForm(_ref33) {
|
|
|
1081
1091
|
onError: configurationProps.onError,
|
|
1082
1092
|
onLoad: configurationProps.onLoad,
|
|
1083
1093
|
uncontrolled: configurationProps.uncontrolled,
|
|
1084
|
-
readOnly: configurationProps.readOnly
|
|
1094
|
+
readOnly: configurationProps.readOnly,
|
|
1095
|
+
renderers: configurationProps.renderers
|
|
1085
1096
|
}, configurationProps.children);
|
|
1086
1097
|
};
|
|
1087
1098
|
};
|
|
@@ -20,7 +20,7 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
var FormStateComopnent = function FormStateComopnent(props) {
|
|
23
|
-
return props.children(selectFormState(props.formState));
|
|
23
|
+
return props.children((props.selector || selectFormState)(props.formState));
|
|
24
24
|
};
|
|
25
25
|
var FormState = exports.FormState = (0, _store.connect)(mapStateToProps)(FormStateComopnent);
|
|
26
26
|
FormState.get = function (formKey) {
|
|
@@ -273,8 +273,8 @@ var resetSimpleForm = exports.resetSimpleForm = function resetSimpleForm(formKey
|
|
|
273
273
|
// to do this because we need to use the form key in the mapStateToProps of the
|
|
274
274
|
// wrapped component.
|
|
275
275
|
|
|
276
|
-
/**
|
|
277
|
-
* @component
|
|
276
|
+
/**
|
|
277
|
+
* @component
|
|
278
278
|
*/
|
|
279
279
|
var SimpleForm = exports.SimpleForm = /*#__PURE__*/function (_Component) {
|
|
280
280
|
(0, _inherits2["default"])(SimpleForm, _Component);
|
package/lib/components/index.js
CHANGED
|
@@ -513,6 +513,12 @@ Object.defineProperty(exports, "StaticSelect", {
|
|
|
513
513
|
return _StaticSelect.StaticSelect;
|
|
514
514
|
}
|
|
515
515
|
});
|
|
516
|
+
Object.defineProperty(exports, "SubmissionActivityForm", {
|
|
517
|
+
enumerable: true,
|
|
518
|
+
get: function get() {
|
|
519
|
+
return _SubmissionActivityForm.SubmissionActivityForm;
|
|
520
|
+
}
|
|
521
|
+
});
|
|
516
522
|
Object.defineProperty(exports, "SubmissionForm", {
|
|
517
523
|
enumerable: true,
|
|
518
524
|
get: function get() {
|
|
@@ -777,6 +783,12 @@ Object.defineProperty(exports, "clearToasts", {
|
|
|
777
783
|
return _ToastContainer.clearToasts;
|
|
778
784
|
}
|
|
779
785
|
});
|
|
786
|
+
Object.defineProperty(exports, "findTableKey", {
|
|
787
|
+
enumerable: true,
|
|
788
|
+
get: function get() {
|
|
789
|
+
return _Table.findTableKey;
|
|
790
|
+
}
|
|
791
|
+
});
|
|
780
792
|
Object.defineProperty(exports, "formPropertyName", {
|
|
781
793
|
enumerable: true,
|
|
782
794
|
get: function get() {
|
|
@@ -837,6 +849,12 @@ Object.defineProperty(exports, "getToken", {
|
|
|
837
849
|
return _AuthenticationContainer.getToken;
|
|
838
850
|
}
|
|
839
851
|
});
|
|
852
|
+
Object.defineProperty(exports, "hasTableFiltersApplied", {
|
|
853
|
+
enumerable: true,
|
|
854
|
+
get: function get() {
|
|
855
|
+
return _Table.hasTableFiltersApplied;
|
|
856
|
+
}
|
|
857
|
+
});
|
|
840
858
|
Object.defineProperty(exports, "hideToast", {
|
|
841
859
|
enumerable: true,
|
|
842
860
|
get: function get() {
|
|
@@ -921,6 +939,18 @@ Object.defineProperty(exports, "reloadDataSources", {
|
|
|
921
939
|
return _Form.reloadDataSources;
|
|
922
940
|
}
|
|
923
941
|
});
|
|
942
|
+
Object.defineProperty(exports, "reloadTablePage", {
|
|
943
|
+
enumerable: true,
|
|
944
|
+
get: function get() {
|
|
945
|
+
return _Table.reloadTablePage;
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
Object.defineProperty(exports, "resetFilterForm", {
|
|
949
|
+
enumerable: true,
|
|
950
|
+
get: function get() {
|
|
951
|
+
return _Table.resetFilterForm;
|
|
952
|
+
}
|
|
953
|
+
});
|
|
924
954
|
Object.defineProperty(exports, "resetForm", {
|
|
925
955
|
enumerable: true,
|
|
926
956
|
get: function get() {
|
|
@@ -939,6 +969,30 @@ Object.defineProperty(exports, "serializeForm", {
|
|
|
939
969
|
return _Form.serializeForm;
|
|
940
970
|
}
|
|
941
971
|
});
|
|
972
|
+
Object.defineProperty(exports, "setFormValue", {
|
|
973
|
+
enumerable: true,
|
|
974
|
+
get: function get() {
|
|
975
|
+
return _Form.setValue;
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
Object.defineProperty(exports, "setPreference", {
|
|
979
|
+
enumerable: true,
|
|
980
|
+
get: function get() {
|
|
981
|
+
return _PreferencesProvider.setPreference;
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
Object.defineProperty(exports, "setPreferenceBool", {
|
|
985
|
+
enumerable: true,
|
|
986
|
+
get: function get() {
|
|
987
|
+
return _PreferencesProvider.setPreferenceBool;
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
Object.defineProperty(exports, "setPreferenceJSON", {
|
|
991
|
+
enumerable: true,
|
|
992
|
+
get: function get() {
|
|
993
|
+
return _PreferencesProvider.setPreferenceJSON;
|
|
994
|
+
}
|
|
995
|
+
});
|
|
942
996
|
Object.defineProperty(exports, "showToast", {
|
|
943
997
|
enumerable: true,
|
|
944
998
|
get: function get() {
|
|
@@ -957,6 +1011,12 @@ Object.defineProperty(exports, "timedOut", {
|
|
|
957
1011
|
return _AuthenticationContainer.timedOut;
|
|
958
1012
|
}
|
|
959
1013
|
});
|
|
1014
|
+
Object.defineProperty(exports, "toggleFilterField", {
|
|
1015
|
+
enumerable: true,
|
|
1016
|
+
get: function get() {
|
|
1017
|
+
return _Table.toggleFilterField;
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
960
1020
|
Object.defineProperty(exports, "unlockSubmission", {
|
|
961
1021
|
enumerable: true,
|
|
962
1022
|
get: function get() {
|
|
@@ -981,6 +1041,12 @@ Object.defineProperty(exports, "unmountTreeBuilder", {
|
|
|
981
1041
|
return _builder.unmountTreeBuilder;
|
|
982
1042
|
}
|
|
983
1043
|
});
|
|
1044
|
+
Object.defineProperty(exports, "usePreferences", {
|
|
1045
|
+
enumerable: true,
|
|
1046
|
+
get: function get() {
|
|
1047
|
+
return _PreferencesProvider.usePreferences;
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
984
1050
|
Object.defineProperty(exports, "validateForm", {
|
|
985
1051
|
enumerable: true,
|
|
986
1052
|
get: function get() {
|
|
@@ -1000,6 +1066,7 @@ var _Scroller = require("./common/Scroller");
|
|
|
1000
1066
|
var _StaticSelect = require("./common/StaticSelect");
|
|
1001
1067
|
var _ConnectionSelect = require("./common/ConnectionSelect");
|
|
1002
1068
|
var _AuthenticationContainer = require("./common/authentication/AuthenticationContainer");
|
|
1069
|
+
var _PreferencesProvider = require("./common/preferences/PreferencesProvider");
|
|
1003
1070
|
var _ToastContainer = require("./common/ToastContainer");
|
|
1004
1071
|
var _Form = require("./form/Form");
|
|
1005
1072
|
var _FormState = require("./form/FormState");
|
|
@@ -1061,6 +1128,7 @@ var _SecurityDefinitionTable = require("./core/security_definition/SecurityDefin
|
|
|
1061
1128
|
var _SpaceForm = require("./core/space/SpaceForm");
|
|
1062
1129
|
var _SubmissionTable = require("./core/submission/SubmissionTable");
|
|
1063
1130
|
var _SubmissionForm = require("./core/submission/SubmissionForm");
|
|
1131
|
+
var _SubmissionActivityForm = require("./core/submission/SubmissionActivityForm");
|
|
1064
1132
|
var _DatastoreSubmissionTable = require("./core/submission/DatastoreSubmissionTable");
|
|
1065
1133
|
var _TeamForm = require("./core/team/TeamForm");
|
|
1066
1134
|
var _TeamTable = require("./core/team/TeamTable");
|
|
@@ -7,15 +7,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ConnectionForm = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
11
|
var _immutable = require("immutable");
|
|
11
12
|
var _Form = require("../../form/Form");
|
|
12
13
|
var _apis = require("../../../apis");
|
|
13
14
|
var _integrationTypes = _interopRequireDefault(require("../integrationTypes"));
|
|
14
15
|
var _http = require("./config_fields/http");
|
|
16
|
+
var _sql = require("./config_fields/sql");
|
|
15
17
|
var dataSources = function dataSources(_ref) {
|
|
16
|
-
var id = _ref.id
|
|
18
|
+
var id = _ref.id,
|
|
19
|
+
clone = _ref.clone,
|
|
20
|
+
importData = _ref.importData,
|
|
21
|
+
importOverwrite = _ref.importOverwrite;
|
|
17
22
|
return {
|
|
18
|
-
connection:
|
|
23
|
+
connection:
|
|
24
|
+
// If importing and overwriting an existing connection, set the import data
|
|
25
|
+
// into the bindings. Otherwise, fetch the connection if an id is provided.
|
|
26
|
+
importData && importOverwrite === true ? {
|
|
27
|
+
fn: function fn() {
|
|
28
|
+
return importData;
|
|
29
|
+
},
|
|
30
|
+
params: []
|
|
31
|
+
} : {
|
|
19
32
|
fn: _apis.fetchConnection,
|
|
20
33
|
params: id && [{
|
|
21
34
|
id: id
|
|
@@ -23,16 +36,25 @@ var dataSources = function dataSources(_ref) {
|
|
|
23
36
|
transform: function transform(result) {
|
|
24
37
|
return result.connection;
|
|
25
38
|
}
|
|
39
|
+
},
|
|
40
|
+
isClone: {
|
|
41
|
+
fn: function fn() {
|
|
42
|
+
return clone;
|
|
43
|
+
},
|
|
44
|
+
params: []
|
|
26
45
|
}
|
|
27
46
|
};
|
|
28
47
|
};
|
|
29
48
|
var handleSubmit = function handleSubmit(_ref2) {
|
|
30
49
|
var id = _ref2.id,
|
|
31
|
-
clone = _ref2.clone
|
|
50
|
+
clone = _ref2.clone,
|
|
51
|
+
importData = _ref2.importData,
|
|
52
|
+
importOverwrite = _ref2.importOverwrite;
|
|
32
53
|
return function (values) {
|
|
33
|
-
return (id && !clone ? _apis.updateConnection : _apis.createConnection)({
|
|
34
|
-
id: id,
|
|
35
|
-
connection: values.toJS()
|
|
54
|
+
return (importData ? _apis.importConnection : id && !clone ? _apis.updateConnection : _apis.createConnection)({
|
|
55
|
+
id: importData ? undefined : id,
|
|
56
|
+
connection: importData && importOverwrite !== false ? values.set('id', importData.id).toJS() : values.toJS(),
|
|
57
|
+
force: importData ? importOverwrite : undefined
|
|
36
58
|
}).then(function (_ref3) {
|
|
37
59
|
var connection = _ref3.connection,
|
|
38
60
|
error = _ref3.error;
|
|
@@ -43,23 +65,45 @@ var handleSubmit = function handleSubmit(_ref2) {
|
|
|
43
65
|
});
|
|
44
66
|
};
|
|
45
67
|
};
|
|
68
|
+
var getFieldConfigByType = function getFieldConfigByType(type, connection, options) {
|
|
69
|
+
switch (type) {
|
|
70
|
+
case 'http':
|
|
71
|
+
var configFieldsHTTP = (0, _http.generateHttpConnectionConfigFields)((0, _immutable.get)(connection, 'config'), options);
|
|
72
|
+
return [configFieldsHTTP, (0, _http.serializeHttpConnectionConfigFields)(configFieldsHTTP)];
|
|
73
|
+
case 'postgres':
|
|
74
|
+
case 'mssql':
|
|
75
|
+
var configFieldsSQL = (0, _sql.generateSQLConnectionConfigFields)((0, _immutable.get)(connection, 'config'), type, options);
|
|
76
|
+
return [configFieldsSQL, (0, _sql.serializeSQLConnectionConfigFields)(configFieldsSQL)];
|
|
77
|
+
default:
|
|
78
|
+
return [[], undefined];
|
|
79
|
+
}
|
|
80
|
+
};
|
|
46
81
|
var fields = function fields(_ref4) {
|
|
47
82
|
var id = _ref4.id,
|
|
48
83
|
type = _ref4.type,
|
|
49
|
-
clone = _ref4.clone
|
|
84
|
+
clone = _ref4.clone,
|
|
85
|
+
importData = _ref4.importData,
|
|
86
|
+
importOverwrite = _ref4.importOverwrite;
|
|
50
87
|
return function (_ref5) {
|
|
51
88
|
var connection = _ref5.connection;
|
|
52
89
|
// Must provide an id of an existing connection, or a type
|
|
53
|
-
if (id ? connection : type) {
|
|
54
|
-
var
|
|
55
|
-
var
|
|
90
|
+
if (importData || (id ? connection : type)) {
|
|
91
|
+
var record = connection || (0, _immutable.fromJS)(importData);
|
|
92
|
+
var typeValue = (0, _immutable.getIn)(record, ['config', 'configType']) || type;
|
|
93
|
+
var _getFieldConfigByType = getFieldConfigByType(typeValue, record, {
|
|
94
|
+
isClone: clone,
|
|
95
|
+
isNewImport: importData && importOverwrite !== true
|
|
96
|
+
}),
|
|
97
|
+
_getFieldConfigByType2 = (0, _slicedToArray2["default"])(_getFieldConfigByType, 2),
|
|
98
|
+
configFields = _getFieldConfigByType2[0],
|
|
99
|
+
configSerialize = _getFieldConfigByType2[1];
|
|
56
100
|
return [{
|
|
57
101
|
name: 'name',
|
|
58
102
|
label: 'Connection Name',
|
|
59
103
|
type: 'text',
|
|
60
|
-
initialValue: !clone ? (0, _immutable.get)(
|
|
104
|
+
initialValue: !clone ? (0, _immutable.get)(record, 'name') : '',
|
|
61
105
|
required: true,
|
|
62
|
-
placeholder: !clone ? 'Enter a name to find your connection easily' : "Clone of ".concat((0, _immutable.get)(
|
|
106
|
+
placeholder: !clone ? 'Enter a name to find your connection easily' : "Clone of ".concat((0, _immutable.get)(record, 'name'))
|
|
63
107
|
}, {
|
|
64
108
|
name: 'type',
|
|
65
109
|
label: 'Type',
|
|
@@ -72,19 +116,19 @@ var fields = function fields(_ref4) {
|
|
|
72
116
|
name: 'documentationLink',
|
|
73
117
|
label: 'API Documentation Link',
|
|
74
118
|
type: 'text',
|
|
75
|
-
initialValue: (0, _immutable.get)(
|
|
119
|
+
initialValue: (0, _immutable.get)(record, 'documentationLink') || '',
|
|
76
120
|
placeholder: 'Optional (but recommended)'
|
|
77
121
|
}, {
|
|
78
122
|
name: 'description',
|
|
79
123
|
label: 'Description',
|
|
80
124
|
type: 'text',
|
|
81
|
-
initialValue: (0, _immutable.get)(
|
|
125
|
+
initialValue: (0, _immutable.get)(record, 'description') || '',
|
|
82
126
|
placeholder: 'Enter a short description for the connection'
|
|
83
127
|
}, {
|
|
84
128
|
name: 'secrets',
|
|
85
129
|
label: 'Secrets',
|
|
86
130
|
type: 'map',
|
|
87
|
-
initialValue: (0, _immutable.get)(
|
|
131
|
+
initialValue: (0, _immutable.get)(record, 'secrets') || {},
|
|
88
132
|
placeholder: 'Secret Key',
|
|
89
133
|
helpText: 'Secrets are key-value pairs that define sensitive values that will be hidden from view, but can be referenced in other parts of the connection by their keys.'
|
|
90
134
|
}, {
|
|
@@ -92,9 +136,9 @@ var fields = function fields(_ref4) {
|
|
|
92
136
|
label: 'Config',
|
|
93
137
|
type: null,
|
|
94
138
|
visible: false,
|
|
95
|
-
initialValue: (0, _immutable.get)(
|
|
139
|
+
initialValue: (0, _immutable.get)(record, 'config'),
|
|
96
140
|
// Serialize the transient config fields into a single config object
|
|
97
|
-
serialize:
|
|
141
|
+
serialize: configSerialize
|
|
98
142
|
}].concat((0, _toConsumableArray2["default"])(configFields.map(function (field) {
|
|
99
143
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, field), {}, {
|
|
100
144
|
"transient": true
|
|
@@ -104,7 +148,7 @@ var fields = function fields(_ref4) {
|
|
|
104
148
|
};
|
|
105
149
|
};
|
|
106
150
|
var ConnectionForm = exports.ConnectionForm = (0, _Form.generateForm)({
|
|
107
|
-
formOptions: ['id', 'type', 'clone'],
|
|
151
|
+
formOptions: ['id', 'type', 'clone', 'importData', 'importOverwrite'],
|
|
108
152
|
dataSources: dataSources,
|
|
109
153
|
fields: fields,
|
|
110
154
|
handleSubmit: handleSubmit
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ConnectionTable = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
8
|
var _apis = require("../../../apis");
|
|
10
9
|
var _Table = require("../../table/Table");
|
|
11
10
|
var _integrationTypes = _interopRequireDefault(require("../integrationTypes"));
|
|
@@ -29,8 +28,8 @@ var dataSource = function dataSource() {
|
|
|
29
28
|
return {
|
|
30
29
|
fn: _apis.fetchConnections,
|
|
31
30
|
clientSide: clientSide,
|
|
32
|
-
params: function params(
|
|
33
|
-
return [
|
|
31
|
+
params: function params() {
|
|
32
|
+
return [];
|
|
34
33
|
},
|
|
35
34
|
transform: function transform(result) {
|
|
36
35
|
return {
|
|
@@ -45,6 +44,9 @@ var columns = [{
|
|
|
45
44
|
sortable: true
|
|
46
45
|
}, {
|
|
47
46
|
value: 'type',
|
|
47
|
+
valueTransform: function valueTransform(_value, row) {
|
|
48
|
+
return row.getIn(['config', 'configType']);
|
|
49
|
+
},
|
|
48
50
|
title: 'Type',
|
|
49
51
|
sortable: true,
|
|
50
52
|
toggleable: true
|
|
@@ -46,7 +46,7 @@ var serializeHttpConnectionConfigFields = exports.serializeHttpConnectionConfigF
|
|
|
46
46
|
}, (0, _immutable.Map)());
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
var generateHttpConnectionConfigFields = exports.generateHttpConnectionConfigFields = function generateHttpConnectionConfigFields(config) {
|
|
49
|
+
var generateHttpConnectionConfigFields = exports.generateHttpConnectionConfigFields = function generateHttpConnectionConfigFields(config, options) {
|
|
50
50
|
return [{
|
|
51
51
|
name: 'configType',
|
|
52
52
|
label: 'Type',
|
|
@@ -73,9 +73,9 @@ var generateHttpConnectionConfigFields = exports.generateHttpConnectionConfigFie
|
|
|
73
73
|
label: 'Trusted CA Certificate',
|
|
74
74
|
type: 'text',
|
|
75
75
|
initialValue: (0, _immutable.get)(config, 'caCert') || ''
|
|
76
|
-
}].concat((0, _toConsumableArray2["default"])(generateHttpConnectionConfigAuthFields((0, _immutable.get)(config, 'auth'),
|
|
76
|
+
}].concat((0, _toConsumableArray2["default"])(generateHttpConnectionConfigAuthFields((0, _immutable.get)(config, 'auth'), options)));
|
|
77
77
|
};
|
|
78
|
-
var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConfigAuthFields(auth) {
|
|
78
|
+
var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConfigAuthFields(auth, options) {
|
|
79
79
|
return [{
|
|
80
80
|
name: 'auth.authType',
|
|
81
81
|
label: 'Authentication',
|
|
@@ -117,13 +117,13 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
117
117
|
type: 'toggle',
|
|
118
118
|
// Set to true if there is no auth config or if the current auth config is
|
|
119
119
|
// set to a different type
|
|
120
|
-
initialValue: !auth || (0, _immutable.get)(auth, 'authType') !== 'basic',
|
|
120
|
+
initialValue: !auth || options.isClone || options.isNewImport || (0, _immutable.get)(auth, 'authType') !== 'basic',
|
|
121
121
|
// Show if we're editing a connection and the selected auth type matches
|
|
122
122
|
// the currently saved auth type
|
|
123
123
|
visible: function visible(_ref5) {
|
|
124
124
|
var values = _ref5.values,
|
|
125
125
|
connection = _ref5.connection;
|
|
126
|
-
return !!connection && values.get('auth.authType') === 'basic' && connection.getIn(['config', 'auth', 'authType']) === 'basic';
|
|
126
|
+
return !!connection && !options.isClone && values.get('auth.authType') === 'basic' && connection.getIn(['config', 'auth', 'authType']) === 'basic';
|
|
127
127
|
}
|
|
128
128
|
}, {
|
|
129
129
|
name: 'auth.password',
|
|
@@ -138,13 +138,13 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
138
138
|
enabled: function enabled(_ref7) {
|
|
139
139
|
var values = _ref7.values,
|
|
140
140
|
connection = _ref7.connection;
|
|
141
|
-
return !connection || !!values.get('auth.password.toggle');
|
|
141
|
+
return !connection || options.isClone || !!values.get('auth.password.toggle');
|
|
142
142
|
},
|
|
143
143
|
// Show the placeholder if there is a connection and it matches the saved type
|
|
144
144
|
placeholder: function placeholder(_ref8) {
|
|
145
145
|
var values = _ref8.values,
|
|
146
146
|
connection = _ref8.connection;
|
|
147
|
-
return !!connection && connection.getIn(['config', 'auth', 'authType']) === 'basic' && !values.get('auth.password.toggle') ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : undefined;
|
|
147
|
+
return !!connection && !options.isClone && connection.getIn(['config', 'auth', 'authType']) === 'basic' && !values.get('auth.password.toggle') ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : undefined;
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
// client_credentials
|
|
@@ -181,13 +181,13 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
181
181
|
type: 'toggle',
|
|
182
182
|
// Set to true if there is no auth config or if the current auth config is
|
|
183
183
|
// set to a different type
|
|
184
|
-
initialValue: !auth || (0, _immutable.get)(auth, 'authType') !== 'client_credentials',
|
|
184
|
+
initialValue: !auth || options.isClone || options.isNewImport || (0, _immutable.get)(auth, 'authType') !== 'client_credentials',
|
|
185
185
|
// Show if we're editing a connection and the selected auth type matches
|
|
186
186
|
// the currently saved auth type
|
|
187
187
|
visible: function visible(_ref13) {
|
|
188
188
|
var values = _ref13.values,
|
|
189
189
|
connection = _ref13.connection;
|
|
190
|
-
return !!connection && values.get('auth.authType') === 'client_credentials' && connection.getIn(['config', 'auth', 'authType']) === 'client_credentials';
|
|
190
|
+
return !!connection && !options.isClone && values.get('auth.authType') === 'client_credentials' && connection.getIn(['config', 'auth', 'authType']) === 'client_credentials';
|
|
191
191
|
}
|
|
192
192
|
}, {
|
|
193
193
|
name: 'auth.clientSecret',
|
|
@@ -201,13 +201,13 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
201
201
|
enabled: function enabled(_ref15) {
|
|
202
202
|
var values = _ref15.values,
|
|
203
203
|
connection = _ref15.connection;
|
|
204
|
-
return !connection || !!values.get('auth.clientSecret.toggle');
|
|
204
|
+
return !connection || options.isClone || !!values.get('auth.clientSecret.toggle');
|
|
205
205
|
},
|
|
206
206
|
// Show the placeholder if there is a connection and it matches the saved type
|
|
207
207
|
placeholder: function placeholder(_ref16) {
|
|
208
208
|
var values = _ref16.values,
|
|
209
209
|
connection = _ref16.connection;
|
|
210
|
-
return !!connection && connection.getIn(['config', 'auth', 'authType']) === 'client_credentials' && !values.get('auth.clientSecret.toggle') ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : undefined;
|
|
210
|
+
return !!connection && !options.isClone && connection.getIn(['config', 'auth', 'authType']) === 'client_credentials' && !values.get('auth.clientSecret.toggle') ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : undefined;
|
|
211
211
|
}
|
|
212
212
|
}, {
|
|
213
213
|
name: 'auth.scope',
|
|
@@ -282,13 +282,13 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
282
282
|
type: 'toggle',
|
|
283
283
|
// Set to true if there is no auth config or if the current auth config is
|
|
284
284
|
// set to a different type
|
|
285
|
-
initialValue: !auth || (0, _immutable.get)(auth, 'authType') !== 'raw_bearer_token',
|
|
285
|
+
initialValue: !auth || options.isClone || options.isNewImport || (0, _immutable.get)(auth, 'authType') !== 'raw_bearer_token',
|
|
286
286
|
// Show if we're editing a connection and the selected auth type matches
|
|
287
287
|
// the currently saved auth type
|
|
288
288
|
visible: function visible(_ref25) {
|
|
289
289
|
var values = _ref25.values,
|
|
290
290
|
connection = _ref25.connection;
|
|
291
|
-
return !!connection && values.get('auth.authType') === 'raw_bearer_token' && connection.getIn(['config', 'auth', 'authType']) === 'raw_bearer_token';
|
|
291
|
+
return !!connection && !options.isClone && values.get('auth.authType') === 'raw_bearer_token' && connection.getIn(['config', 'auth', 'authType']) === 'raw_bearer_token';
|
|
292
292
|
}
|
|
293
293
|
}, {
|
|
294
294
|
name: 'auth.token',
|
|
@@ -303,15 +303,15 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
303
303
|
enabled: function enabled(_ref27) {
|
|
304
304
|
var values = _ref27.values,
|
|
305
305
|
connection = _ref27.connection;
|
|
306
|
-
return !connection || !!values.get('auth.token.toggle');
|
|
306
|
+
return !connection || options.isClone || !!values.get('auth.token.toggle');
|
|
307
307
|
},
|
|
308
308
|
// Show the placeholder if there is a connection and it matches the saved type
|
|
309
309
|
placeholder: function placeholder(_ref28) {
|
|
310
310
|
var values = _ref28.values,
|
|
311
311
|
connection = _ref28.connection;
|
|
312
|
-
return !!connection && connection.getIn(['config', 'auth', 'authType']) === 'raw_bearer_token' && !values.get('auth.token.toggle') ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : undefined;
|
|
312
|
+
return !!connection && !options.isClone && connection.getIn(['config', 'auth', 'authType']) === 'raw_bearer_token' && !values.get('auth.token.toggle') ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : undefined;
|
|
313
313
|
}
|
|
314
|
-
}].concat((0, _toConsumableArray2["default"])(generateHttpConnectionConfigAuthTokenOperationFields((0, _immutable.getIn)(auth, ['token', 'operation']))), [{
|
|
314
|
+
}].concat((0, _toConsumableArray2["default"])(generateHttpConnectionConfigAuthTokenOperationFields((0, _immutable.getIn)(auth, ['token', 'operation']), options)), [{
|
|
315
315
|
name: 'auth.tokenHttpConn',
|
|
316
316
|
"transient": true,
|
|
317
317
|
label: 'Use different connection for auth',
|
|
@@ -321,7 +321,7 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
321
321
|
var values = _ref29.values;
|
|
322
322
|
return values.get('auth.authType') === 'http_bearer_token';
|
|
323
323
|
}
|
|
324
|
-
}], (0, _toConsumableArray2["default"])(generateHttpConnectionConfigAuthTokenConnectionFields((0, _immutable.getIn)(auth, ['token', 'connection']))), [{
|
|
324
|
+
}], (0, _toConsumableArray2["default"])(generateHttpConnectionConfigAuthTokenConnectionFields((0, _immutable.getIn)(auth, ['token', 'connection']), options)), [{
|
|
325
325
|
name: 'auth.token.tokenOutput',
|
|
326
326
|
label: 'Token',
|
|
327
327
|
type: 'code',
|
|
@@ -353,7 +353,7 @@ var generateHttpConnectionConfigAuthFields = function generateHttpConnectionConf
|
|
|
353
353
|
helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Define a JavaScript expression that maps the response to a numeric expiration value in seconds. Press ", /*#__PURE__*/React.createElement("code", null, "Ctrl + Space"), " to see the available properties in the field.")
|
|
354
354
|
}]);
|
|
355
355
|
};
|
|
356
|
-
var generateHttpConnectionConfigAuthTokenOperationFields = function generateHttpConnectionConfigAuthTokenOperationFields(operation) {
|
|
356
|
+
var generateHttpConnectionConfigAuthTokenOperationFields = function generateHttpConnectionConfigAuthTokenOperationFields(operation, options) {
|
|
357
357
|
return [{
|
|
358
358
|
name: 'auth.token.operation.configType',
|
|
359
359
|
label: 'Type',
|
|
@@ -532,7 +532,7 @@ var generateHttpConnectionConfigAuthTokenOperationFields = function generateHttp
|
|
|
532
532
|
helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{secretKey}}'), " format to insert secrets that have been defined for this connection.")
|
|
533
533
|
}];
|
|
534
534
|
};
|
|
535
|
-
var generateHttpConnectionConfigAuthTokenConnectionFields = function generateHttpConnectionConfigAuthTokenConnectionFields(connection) {
|
|
535
|
+
var generateHttpConnectionConfigAuthTokenConnectionFields = function generateHttpConnectionConfigAuthTokenConnectionFields(connection, options) {
|
|
536
536
|
return [{
|
|
537
537
|
name: 'auth.token.connection.baseUrl',
|
|
538
538
|
label: 'Token Base URL',
|