@kineticdata/react 5.1.0-rc.1 → 5.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/lib/apis/core/attributeDefinitions.js +11 -9
- package/lib/apis/core/attributeDefinitions.test.js +1 -1
- package/lib/apis/core/authentication.js +13 -5
- package/lib/apis/core/backgroundJobs.js +2 -1
- package/lib/apis/core/bridgeModelAttributeMappings.js +1 -1
- package/lib/apis/core/bridgeModelAttributes.js +15 -12
- package/lib/apis/core/bridgeModelMappings.js +1 -1
- package/lib/apis/core/bridgeModelQualificationMappings.js +2 -2
- package/lib/apis/core/bridgeModelQualifications.js +2 -2
- package/lib/apis/core/bridgeModels.js +14 -8
- package/lib/apis/core/bridgedresources.js +3 -2
- package/lib/apis/core/fileResources.js +36 -0
- package/lib/apis/core/filestores.js +40 -0
- package/lib/apis/core/formTypes.js +18 -21
- package/lib/apis/core/oauthClients.js +11 -5
- package/lib/apis/core/securityPolicyDefinitions.js +1 -1
- package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
- package/lib/apis/core/submissions.js +68 -0
- package/lib/apis/core/webhooks.js +1 -1
- package/lib/apis/core/webhooks.test.js +2 -2
- package/lib/apis/http.js +17 -3
- package/lib/apis/index.js +2 -0
- package/lib/apis/system/index.js +86 -1
- package/lib/apis/task/index.js +20 -13
- package/lib/components/agent/filestore/FilestoreForm.js +132 -0
- package/lib/components/agent/filestore/FilestoreTable.js +53 -0
- package/lib/components/common/BridgeSelect.js +2 -1
- package/lib/components/common/FormSelect.js +2 -1
- package/lib/components/common/Scroller.js +6 -6
- package/lib/components/common/TableInput.js +74 -29
- package/lib/components/common/TeamSelect.js +2 -1
- package/lib/components/common/Typeahead.js +7 -4
- package/lib/components/common/UserSelect.js +2 -1
- package/lib/components/common/authentication/AuthenticationContainer.js +50 -27
- package/lib/components/core/core_form/CoreForm.js +10 -10
- package/lib/components/core/file_resource/FileResourceForm.js +180 -0
- package/lib/components/core/file_resource/FileResourceTable.js +71 -0
- package/lib/components/core/i18n/I18n.js +14 -14
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
- package/lib/components/core/space/SpaceForm.js +37 -8
- package/lib/components/core/submission/FormSubmissionFilters.js +3 -11
- package/lib/components/core/submission/FormSubmissionTable.js +4 -2
- package/lib/components/core/submission/SubmissionForm.js +124 -0
- package/lib/components/core/submission/helpers.js +2 -2
- package/lib/components/core/user/UserForm.js +2 -2
- package/lib/components/core/webapi/WebApiForm.js +111 -126
- package/lib/components/form/Form.helpers.js +1 -1
- package/lib/components/form/Form.js +200 -144
- package/lib/components/index.js +14 -6
- package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
- package/lib/components/system/SystemSecurityForm.js +69 -0
- package/lib/components/system/helpers.js +2 -2
- package/lib/components/system/spaces/SystemSpaceForm.js +44 -16
- package/lib/components/system/spaces/SystemTenantForm.js +15 -9
- package/lib/components/system/spaces/SystemTenantTable.js +15 -10
- package/lib/components/table/Table.js +9 -6
- package/lib/components/task/builder/Connector.js +21 -10
- package/lib/components/task/builder/ConnectorForm.js +1 -1
- package/lib/components/task/builder/Node.js +10 -3
- package/lib/components/task/builder/NodeForm.js +51 -22
- package/lib/components/task/builder/NodeParametersForm.js +5 -2
- package/lib/components/task/builder/SvgCanvas.js +13 -4
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +113 -0
- package/lib/components/task/builder/TreeBuilder.js +27 -9
- package/lib/components/task/builder/builder.redux.js +159 -52
- package/lib/components/task/builder/helpers.js +5 -3
- package/lib/components/task/builder/models.js +84 -12
- package/lib/components/task/errors/RunErrorTable.js +1 -1
- package/lib/components/task/runs/CreateManualTriggerForm.js +15 -24
- package/lib/components/task/runs/RunTable.js +5 -3
- package/lib/components/task/workflows/WorkflowForm.js +67 -85
- package/lib/helpers/index.js +4 -1
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/proxyhelper.js +19 -6
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
5
|
import { generateForm } from '../../form/Form';
|
|
6
6
|
import { get, Map } from 'immutable';
|
|
7
|
-
import {
|
|
7
|
+
import { createWebApi, updateWebApi, fetchSecurityPolicyDefinitions, createTree, updateTree, fetchSpace } from '../../../apis';
|
|
8
8
|
export var WEB_API_METHODS = ['GET', 'POST', 'PUT', 'DELETE'];
|
|
9
9
|
var securityEndpoints = {
|
|
10
10
|
webApiExecution: {
|
|
@@ -15,136 +15,116 @@ var securityEndpoints = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
var dataSources = function dataSources(_ref) {
|
|
18
|
-
var
|
|
19
|
-
|
|
18
|
+
var kappSlug = _ref.kappSlug,
|
|
19
|
+
webApi = _ref.webApi;
|
|
20
20
|
return {
|
|
21
|
-
webApi: {
|
|
22
|
-
fn: fetchWebApi,
|
|
23
|
-
params: slug && [{
|
|
24
|
-
slug: slug,
|
|
25
|
-
kappSlug: kappSlug,
|
|
26
|
-
include: 'details,securityPolicies'
|
|
27
|
-
}],
|
|
28
|
-
transform: function transform(result) {
|
|
29
|
-
return result.webApi;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
21
|
securityPolicyDefinitions: {
|
|
33
22
|
fn: fetchSecurityPolicyDefinitions,
|
|
34
|
-
params: kappSlug ? [{
|
|
35
|
-
kappSlug: kappSlug
|
|
23
|
+
params: kappSlug || webApi && webApi.get('kappSlug') ? [{
|
|
24
|
+
kappSlug: kappSlug || webApi && webApi.get('kappSlug')
|
|
36
25
|
}] : [],
|
|
37
26
|
transform: function transform(result) {
|
|
38
27
|
return result.securityPolicyDefinitions;
|
|
39
28
|
}
|
|
40
|
-
},
|
|
41
|
-
sourceName: {
|
|
42
|
-
fn: fetchSpace,
|
|
43
|
-
params: [{
|
|
44
|
-
include: 'platformComponents'
|
|
45
|
-
}],
|
|
46
|
-
transform: function transform(result) {
|
|
47
|
-
return result.space.platformComponents.task.config.platformSourceName;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
sourceGroup: {
|
|
51
|
-
fn: function fn() {
|
|
52
|
-
return kappSlug ? "WebApis > ".concat(kappSlug) : 'WebApis';
|
|
53
|
-
},
|
|
54
|
-
params: []
|
|
55
|
-
},
|
|
56
|
-
tree: {
|
|
57
|
-
fn: fetchTree,
|
|
58
|
-
params: function params(_ref2) {
|
|
59
|
-
var sourceName = _ref2.sourceName,
|
|
60
|
-
sourceGroup = _ref2.sourceGroup,
|
|
61
|
-
webApi = _ref2.webApi;
|
|
62
|
-
return webApi && sourceName && [{
|
|
63
|
-
sourceName: sourceName,
|
|
64
|
-
sourceGroup: sourceGroup,
|
|
65
|
-
name: webApi.get('slug')
|
|
66
|
-
}];
|
|
67
|
-
},
|
|
68
|
-
transform: function transform(result) {
|
|
69
|
-
return result.error && result.error.notFound ? {} : result.tree;
|
|
70
|
-
}
|
|
71
29
|
}
|
|
72
30
|
};
|
|
73
31
|
};
|
|
74
32
|
|
|
75
|
-
var handleSubmit = function handleSubmit(
|
|
76
|
-
var slug =
|
|
77
|
-
kappSlug =
|
|
33
|
+
var handleSubmit = function handleSubmit(_ref2) {
|
|
34
|
+
var slug = _ref2.slug,
|
|
35
|
+
kappSlug = _ref2.kappSlug,
|
|
36
|
+
webApi = _ref2.webApi;
|
|
78
37
|
return /*#__PURE__*/function () {
|
|
79
|
-
var
|
|
80
|
-
var
|
|
38
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(values) {
|
|
39
|
+
var _yield$fetchSpace, space, sourceName, sourceGroup, _ref4, _webApi, error1, _ref5, tree, error2;
|
|
81
40
|
|
|
82
41
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
83
42
|
while (1) {
|
|
84
43
|
switch (_context.prev = _context.next) {
|
|
85
44
|
case 0:
|
|
86
|
-
|
|
45
|
+
if (webApi) {
|
|
46
|
+
_context.next = 38;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
|
|
87
50
|
_context.next = 3;
|
|
88
|
-
return (
|
|
89
|
-
|
|
90
|
-
slug: slug,
|
|
91
|
-
webApi: values.toJS(),
|
|
92
|
-
include: 'securityPolicies'
|
|
51
|
+
return fetchSpace({
|
|
52
|
+
include: 'platformComponents'
|
|
93
53
|
});
|
|
94
54
|
|
|
95
55
|
case 3:
|
|
96
|
-
_yield = _context.sent;
|
|
97
|
-
|
|
98
|
-
|
|
56
|
+
_yield$fetchSpace = _context.sent;
|
|
57
|
+
space = _yield$fetchSpace.space;
|
|
58
|
+
sourceName = space.platformComponents.task.config.platformSourceName;
|
|
59
|
+
sourceGroup = kappSlug ? "WebApis > ".concat(kappSlug) : 'WebApis';
|
|
99
60
|
|
|
100
|
-
if (!
|
|
101
|
-
_context.next =
|
|
61
|
+
if (!slug) {
|
|
62
|
+
_context.next = 13;
|
|
102
63
|
break;
|
|
103
64
|
}
|
|
104
65
|
|
|
105
|
-
|
|
66
|
+
_context.next = 10;
|
|
67
|
+
return updateWebApi({
|
|
68
|
+
kappSlug: kappSlug,
|
|
69
|
+
slug: slug,
|
|
70
|
+
webApi: values.toJS(),
|
|
71
|
+
include: 'securityPolicies'
|
|
72
|
+
});
|
|
106
73
|
|
|
107
|
-
case
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
74
|
+
case 10:
|
|
75
|
+
_context.t0 = _context.sent;
|
|
76
|
+
_context.next = 16;
|
|
77
|
+
break;
|
|
112
78
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
79
|
+
case 13:
|
|
80
|
+
_context.next = 15;
|
|
81
|
+
return createWebApi({
|
|
82
|
+
kappSlug: kappSlug,
|
|
83
|
+
webApi: values.toJS(),
|
|
84
|
+
include: 'securityPolicies'
|
|
120
85
|
});
|
|
121
86
|
|
|
122
|
-
case
|
|
123
|
-
|
|
124
|
-
|
|
87
|
+
case 15:
|
|
88
|
+
_context.t0 = _context.sent;
|
|
89
|
+
|
|
90
|
+
case 16:
|
|
91
|
+
_ref4 = _context.t0;
|
|
92
|
+
_webApi = _ref4.webApi;
|
|
93
|
+
error1 = _ref4.error;
|
|
125
94
|
|
|
126
|
-
if (!
|
|
127
|
-
_context.next =
|
|
95
|
+
if (!error1) {
|
|
96
|
+
_context.next = 21;
|
|
128
97
|
break;
|
|
129
98
|
}
|
|
130
99
|
|
|
131
|
-
throw
|
|
132
|
-
|
|
133
|
-
case 15:
|
|
134
|
-
_context.next = 24;
|
|
135
|
-
break;
|
|
100
|
+
throw error1.statusCode === 400 && error1.message || 'There was an error saving the WebAPI';
|
|
136
101
|
|
|
137
|
-
case
|
|
138
|
-
if (!
|
|
139
|
-
_context.next =
|
|
102
|
+
case 21:
|
|
103
|
+
if (!slug) {
|
|
104
|
+
_context.next = 27;
|
|
140
105
|
break;
|
|
141
106
|
}
|
|
142
107
|
|
|
143
|
-
_context.next =
|
|
108
|
+
_context.next = 24;
|
|
144
109
|
return updateTree({
|
|
145
110
|
sourceName: sourceName,
|
|
146
111
|
sourceGroup: sourceGroup,
|
|
147
112
|
name: slug,
|
|
113
|
+
tree: {
|
|
114
|
+
sourceName: sourceName,
|
|
115
|
+
sourceGroup: sourceGroup,
|
|
116
|
+
name: values.get('slug')
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
case 24:
|
|
121
|
+
_context.t1 = _context.sent;
|
|
122
|
+
_context.next = 30;
|
|
123
|
+
break;
|
|
124
|
+
|
|
125
|
+
case 27:
|
|
126
|
+
_context.next = 29;
|
|
127
|
+
return createTree({
|
|
148
128
|
tree: {
|
|
149
129
|
sourceGroup: sourceGroup,
|
|
150
130
|
sourceName: sourceName,
|
|
@@ -152,21 +132,31 @@ var handleSubmit = function handleSubmit(_ref3) {
|
|
|
152
132
|
}
|
|
153
133
|
});
|
|
154
134
|
|
|
155
|
-
case
|
|
156
|
-
|
|
157
|
-
|
|
135
|
+
case 29:
|
|
136
|
+
_context.t1 = _context.sent;
|
|
137
|
+
|
|
138
|
+
case 30:
|
|
139
|
+
_ref5 = _context.t1;
|
|
140
|
+
tree = _ref5.tree;
|
|
141
|
+
error2 = _ref5.error;
|
|
158
142
|
|
|
159
|
-
if (!
|
|
160
|
-
_context.next =
|
|
143
|
+
if (!error2) {
|
|
144
|
+
_context.next = 35;
|
|
161
145
|
break;
|
|
162
146
|
}
|
|
163
147
|
|
|
164
|
-
throw
|
|
148
|
+
throw error2.statusCode === 400 && error2.message || 'There was an error saving the WebAPI tree';
|
|
165
149
|
|
|
166
|
-
case
|
|
167
|
-
return _context.abrupt("return",
|
|
150
|
+
case 35:
|
|
151
|
+
return _context.abrupt("return", {
|
|
152
|
+
tree: tree,
|
|
153
|
+
webApi: _webApi
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
case 38:
|
|
157
|
+
return _context.abrupt("return", values.toObject());
|
|
168
158
|
|
|
169
|
-
case
|
|
159
|
+
case 39:
|
|
170
160
|
case "end":
|
|
171
161
|
return _context.stop();
|
|
172
162
|
}
|
|
@@ -174,18 +164,17 @@ var handleSubmit = function handleSubmit(_ref3) {
|
|
|
174
164
|
}, _callee);
|
|
175
165
|
}));
|
|
176
166
|
|
|
177
|
-
return function (_x
|
|
178
|
-
return
|
|
167
|
+
return function (_x) {
|
|
168
|
+
return _ref3.apply(this, arguments);
|
|
179
169
|
};
|
|
180
170
|
}();
|
|
181
171
|
};
|
|
182
172
|
|
|
183
|
-
var fields = function fields(
|
|
184
|
-
var
|
|
185
|
-
return function (
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
return (!slug || webApi && tree) && [{
|
|
173
|
+
var fields = function fields(_ref6) {
|
|
174
|
+
var webApi = _ref6.webApi;
|
|
175
|
+
return function (_ref7) {
|
|
176
|
+
var securityPolicyDefinitions = _ref7.securityPolicyDefinitions;
|
|
177
|
+
return securityPolicyDefinitions && [{
|
|
189
178
|
name: 'slug',
|
|
190
179
|
label: 'Slug',
|
|
191
180
|
type: 'text',
|
|
@@ -203,17 +192,17 @@ var fields = function fields(_ref5) {
|
|
|
203
192
|
};
|
|
204
193
|
}),
|
|
205
194
|
initialValue: get(webApi, 'method') || ''
|
|
206
|
-
}].concat(_toConsumableArray(Object.entries(securityEndpoints).map(function (
|
|
207
|
-
var
|
|
208
|
-
endpointFieldName =
|
|
209
|
-
endpoint =
|
|
195
|
+
}].concat(_toConsumableArray(Object.entries(securityEndpoints).map(function (_ref8) {
|
|
196
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
197
|
+
endpointFieldName = _ref9[0],
|
|
198
|
+
endpoint = _ref9[1];
|
|
210
199
|
|
|
211
200
|
return {
|
|
212
201
|
name: endpointFieldName,
|
|
213
202
|
label: endpoint.label,
|
|
214
203
|
type: 'select',
|
|
215
|
-
options: function options(
|
|
216
|
-
var securityPolicyDefinitions =
|
|
204
|
+
options: function options(_ref10) {
|
|
205
|
+
var securityPolicyDefinitions = _ref10.securityPolicyDefinitions;
|
|
217
206
|
return securityPolicyDefinitions ? securityPolicyDefinitions.filter(function (definition) {
|
|
218
207
|
return endpoint.types.includes(definition.get('type'));
|
|
219
208
|
}).map(function (definition) {
|
|
@@ -233,20 +222,16 @@ var fields = function fields(_ref5) {
|
|
|
233
222
|
label: 'Security Policies',
|
|
234
223
|
type: null,
|
|
235
224
|
visible: false,
|
|
236
|
-
serialize: function serialize(
|
|
237
|
-
var values =
|
|
238
|
-
return
|
|
239
|
-
|
|
240
|
-
endpointFieldName = _ref12[0],
|
|
241
|
-
policy = _ref12[1];
|
|
242
|
-
|
|
243
|
-
return {
|
|
225
|
+
serialize: function serialize(_ref11) {
|
|
226
|
+
var values = _ref11.values;
|
|
227
|
+
return Map(securityEndpoints).map(function (policy, endpointFieldName) {
|
|
228
|
+
return Map({
|
|
244
229
|
endpoint: policy.endpoint,
|
|
245
230
|
name: values.get(endpointFieldName)
|
|
246
|
-
};
|
|
247
|
-
}).filter(function (
|
|
248
|
-
return
|
|
249
|
-
});
|
|
231
|
+
});
|
|
232
|
+
}).valueSeq().filter(function (policy) {
|
|
233
|
+
return policy.get('name') !== '';
|
|
234
|
+
}).toList();
|
|
250
235
|
},
|
|
251
236
|
initialValue: get(webApi, 'securityPolicies')
|
|
252
237
|
}]);
|
|
@@ -254,7 +239,7 @@ var fields = function fields(_ref5) {
|
|
|
254
239
|
};
|
|
255
240
|
|
|
256
241
|
export var WebApiForm = generateForm({
|
|
257
|
-
formOptions: ['slug', '
|
|
242
|
+
formOptions: ['kappSlug', 'slug', 'webApi'],
|
|
258
243
|
dataSources: dataSources,
|
|
259
244
|
fields: fields,
|
|
260
245
|
handleSubmit: handleSubmit
|
|
@@ -257,7 +257,7 @@ export var getFieldComponentProps = function getFieldComponentProps(field, readO
|
|
|
257
257
|
onBlur: field.eventHandlers.get('onBlur'),
|
|
258
258
|
onChange: field.eventHandlers.get('onChange'),
|
|
259
259
|
onFocus: field.eventHandlers.get('onFocus'),
|
|
260
|
-
options: ['attributes', 'code', 'form', 'form-multi', 'map', 'radio', 'select', 'select-multi', 'table', 'text', 'text-multi'].includes(field.type) ? field.options : undefined,
|
|
260
|
+
options: ['attributes', 'checkbox-multi', 'code', 'form', 'form-multi', 'map', 'radio', 'select', 'select-multi', 'table', 'text', 'text-multi'].includes(field.type) ? field.options : undefined,
|
|
261
261
|
placeholder: field.placeholder,
|
|
262
262
|
renderAttributes: field.renderAttributes,
|
|
263
263
|
required: field.required,
|