@kineticdata/react 5.0.16 → 5.1.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/lib/apis/core/attributeDefinitions.js +3 -2
- package/lib/apis/core/authentication.js +13 -5
- package/lib/apis/core/backgroundJobs.js +22 -39
- package/lib/apis/core/fileResources.js +36 -0
- package/lib/apis/core/filestores.js +40 -0
- package/lib/apis/core/forms.js +21 -36
- package/lib/apis/core/forms.test.js +51 -278
- package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
- package/lib/apis/core/submissions.js +46 -30
- package/lib/apis/core/webhooks.js +1 -2
- package/lib/apis/discussions/index.js +2 -1
- package/lib/apis/http.js +28 -13
- package/lib/apis/http.test.js +13 -15
- package/lib/apis/index.js +2 -0
- package/lib/apis/system/index.js +86 -1
- package/lib/apis/task/index.js +22 -14
- 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/common/code_input/languageHelpers.test.js +1 -1
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -1
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -1
- package/lib/components/core/core_form/CoreForm.js +10 -10
- package/lib/components/core/field_definition/FieldDefinitionForm.js +130 -0
- package/lib/components/core/field_definition/FieldDefinitionTable.js +86 -0
- package/lib/components/core/file_resource/FileResourceForm.js +180 -0
- package/lib/components/core/file_resource/FileResourceTable.js +71 -0
- package/lib/components/core/form/FormForm.js +12 -17
- package/lib/components/core/form/FormTable.js +3 -8
- package/lib/components/core/i18n/I18n.js +15 -15
- package/lib/components/core/index_definition/IndexDefinitionForm.js +32 -19
- package/lib/components/core/index_definition/IndexDefinitionTable.js +15 -24
- package/lib/components/core/index_job/IndexJobTable.js +12 -9
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
- package/lib/components/core/space/SpaceForm.js +59 -10
- package/lib/components/core/submission/DatastoreSubmissionTable.js +31 -1
- package/lib/components/core/submission/FormSubmissionFilters.js +378 -0
- package/lib/components/core/submission/FormSubmissionTable.js +116 -0
- package/lib/components/core/submission/KappSubmissionTable.js +250 -0
- package/lib/components/core/submission/SubmissionForm.js +124 -0
- package/lib/components/core/submission/SubmissionTable.js +35 -249
- package/lib/components/core/submission/helpers.js +95 -0
- package/lib/components/core/submission/helpers.test.js +96 -0
- package/lib/components/core/translation/ContextTable.js +1 -1
- package/lib/components/core/user/UserForm.js +2 -2
- package/lib/components/core/webapi/WebApiForm.js +111 -126
- package/lib/components/core/webhook/WebhookForm.js +1 -1
- package/lib/components/form/Form.helpers.js +1 -1
- package/lib/components/form/Form.js +200 -144
- package/lib/components/index.js +16 -6
- package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
- package/lib/components/system/SystemSecurityForm.js +69 -0
- package/lib/components/system/helpers.js +20 -6
- 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 +21 -16
- package/lib/components/table/Table.js +37 -10
- package/lib/components/table/Table.redux.js +228 -57
- package/lib/components/table/Table.redux.test.js +73 -2
- 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 +54 -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/triggers/TriggerTable.js +3 -2
- package/lib/components/task/workflows/WorkflowForm.js +67 -85
- package/lib/helpers/index.js +19 -2
- package/lib/index.js +1 -0
- package/lib/models/discussions.js +18 -2
- package/lib/models/index.js +1 -1
- package/package.json +3 -3
- package/proxyhelper.js +19 -6
|
@@ -157,34 +157,49 @@ regHandlers({
|
|
|
157
157
|
});
|
|
158
158
|
}).updateIn(['forms', formKey], digest);
|
|
159
159
|
},
|
|
160
|
-
|
|
160
|
+
TOGGLE_MULTI_VALUE: function TOGGLE_MULTI_VALUE(state, _ref5) {
|
|
161
161
|
var _ref5$payload = _ref5.payload,
|
|
162
162
|
formKey = _ref5$payload.formKey,
|
|
163
|
-
name = _ref5$payload.name
|
|
164
|
-
|
|
163
|
+
name = _ref5$payload.name,
|
|
164
|
+
value = _ref5$payload.value;
|
|
165
|
+
return state.updateIn(['forms', formKey, 'fields', name], function (field) {
|
|
166
|
+
return field.merge({
|
|
167
|
+
value: field.get('value').includes(value) ? field.get('value').filter(function (v) {
|
|
168
|
+
return v !== value;
|
|
169
|
+
}) : field.get('value').push(value),
|
|
170
|
+
touched: true,
|
|
171
|
+
dirty: !is(value, field.initialValue)
|
|
172
|
+
});
|
|
173
|
+
}).updateIn(['forms', formKey], digest);
|
|
165
174
|
},
|
|
166
|
-
|
|
175
|
+
FOCUS_FIELD: function FOCUS_FIELD(state, _ref6) {
|
|
167
176
|
var _ref6$payload = _ref6.payload,
|
|
168
177
|
formKey = _ref6$payload.formKey,
|
|
169
178
|
name = _ref6$payload.name;
|
|
179
|
+
return state.setIn(['forms', formKey, 'fields', name, 'focused'], true);
|
|
180
|
+
},
|
|
181
|
+
BLUR_FIELD: function BLUR_FIELD(state, _ref7) {
|
|
182
|
+
var _ref7$payload = _ref7.payload,
|
|
183
|
+
formKey = _ref7$payload.formKey,
|
|
184
|
+
name = _ref7$payload.name;
|
|
170
185
|
return state.mergeIn(['forms', formKey, 'fields', name], {
|
|
171
186
|
focused: false,
|
|
172
187
|
touched: true
|
|
173
188
|
});
|
|
174
189
|
},
|
|
175
|
-
CALL_DATA_SOURCE: function CALL_DATA_SOURCE(state,
|
|
176
|
-
var
|
|
177
|
-
formKey =
|
|
178
|
-
name =
|
|
190
|
+
CALL_DATA_SOURCE: function CALL_DATA_SOURCE(state, _ref8) {
|
|
191
|
+
var _ref8$payload = _ref8.payload,
|
|
192
|
+
formKey = _ref8$payload.formKey,
|
|
193
|
+
name = _ref8$payload.name;
|
|
179
194
|
return state.mergeIn(['forms', formKey, 'dataSources', name], {
|
|
180
195
|
status: DATA_SOURCE_STATUS.PENDING
|
|
181
196
|
});
|
|
182
197
|
},
|
|
183
|
-
RESOLVE_DATA_SOURCE: function RESOLVE_DATA_SOURCE(state,
|
|
184
|
-
var
|
|
185
|
-
formKey =
|
|
186
|
-
name =
|
|
187
|
-
data =
|
|
198
|
+
RESOLVE_DATA_SOURCE: function RESOLVE_DATA_SOURCE(state, _ref9) {
|
|
199
|
+
var _ref9$payload = _ref9.payload,
|
|
200
|
+
formKey = _ref9$payload.formKey,
|
|
201
|
+
name = _ref9$payload.name,
|
|
202
|
+
data = _ref9$payload.data;
|
|
188
203
|
return state.updateIn(['forms', formKey, 'dataSources', name], function (dataSource) {
|
|
189
204
|
return dataSource && dataSource.merge({
|
|
190
205
|
data: fromJS(data),
|
|
@@ -192,38 +207,38 @@ regHandlers({
|
|
|
192
207
|
});
|
|
193
208
|
}).updateIn(['forms', formKey], digest);
|
|
194
209
|
},
|
|
195
|
-
RESET: function RESET(state,
|
|
196
|
-
var formKey =
|
|
210
|
+
RESET: function RESET(state, _ref10) {
|
|
211
|
+
var formKey = _ref10.payload.formKey;
|
|
197
212
|
return state.hasIn(['forms', formKey]) ? state.updateIn(['forms', formKey, 'fields'], resetValues).updateIn(['forms', formKey], digest) : state;
|
|
198
213
|
},
|
|
199
|
-
SUBMIT: function SUBMIT(state,
|
|
200
|
-
var
|
|
201
|
-
formKey =
|
|
202
|
-
values =
|
|
214
|
+
SUBMIT: function SUBMIT(state, _ref11) {
|
|
215
|
+
var _ref11$payload = _ref11.payload,
|
|
216
|
+
formKey = _ref11$payload.formKey,
|
|
217
|
+
values = _ref11$payload.values;
|
|
203
218
|
return state.setIn(['forms', formKey, 'submitting'], true).updateIn(['forms', formKey, 'fields'], function (fields) {
|
|
204
219
|
return Map(values).reduce(function (fields, value, fieldName) {
|
|
205
220
|
return fields.setIn([fieldName, 'value'], value || FIELD_DEFAULT_VALUES.get(fields.getIn([fieldName, 'type']), ''));
|
|
206
221
|
}, fields);
|
|
207
222
|
}).updateIn(['forms', formKey], digest);
|
|
208
223
|
},
|
|
209
|
-
SUBMIT_SUCCESS: function SUBMIT_SUCCESS(state,
|
|
210
|
-
var formKey =
|
|
224
|
+
SUBMIT_SUCCESS: function SUBMIT_SUCCESS(state, _ref12) {
|
|
225
|
+
var formKey = _ref12.payload.formKey;
|
|
211
226
|
return state.setIn(['forms', formKey, 'submitting'], false).setIn(['forms', formKey, 'error'], null).updateIn(['forms', formKey, 'fields'], reinitializeFields).updateIn(['forms', formKey], digest);
|
|
212
227
|
},
|
|
213
|
-
SUBMIT_ERROR: function SUBMIT_ERROR(state,
|
|
214
|
-
var
|
|
215
|
-
formKey =
|
|
216
|
-
error =
|
|
228
|
+
SUBMIT_ERROR: function SUBMIT_ERROR(state, _ref13) {
|
|
229
|
+
var _ref13$payload = _ref13.payload,
|
|
230
|
+
formKey = _ref13$payload.formKey,
|
|
231
|
+
error = _ref13$payload.error;
|
|
217
232
|
return state.setIn(['forms', formKey, 'submitting'], false).setIn(['forms', formKey, 'error'], error);
|
|
218
233
|
},
|
|
219
|
-
CLEAR_ERROR: function CLEAR_ERROR(state,
|
|
220
|
-
var formKey =
|
|
234
|
+
CLEAR_ERROR: function CLEAR_ERROR(state, _ref14) {
|
|
235
|
+
var formKey = _ref14.payload.formKey;
|
|
221
236
|
return state.setIn(['forms', formKey, 'error'], null);
|
|
222
237
|
},
|
|
223
|
-
SUBMIT_FIELD_ERRORS: function SUBMIT_FIELD_ERRORS(state,
|
|
224
|
-
var
|
|
225
|
-
formKey =
|
|
226
|
-
fieldNames =
|
|
238
|
+
SUBMIT_FIELD_ERRORS: function SUBMIT_FIELD_ERRORS(state, _ref15) {
|
|
239
|
+
var _ref15$payload = _ref15.payload,
|
|
240
|
+
formKey = _ref15$payload.formKey,
|
|
241
|
+
fieldNames = _ref15$payload.fieldNames;
|
|
227
242
|
return state.setIn(['forms', formKey, 'submitting'], false).setIn(['forms', formKey, 'error'], 'There are invalid fields').updateIn(['forms', formKey, 'fields'], function (fields) {
|
|
228
243
|
return fields.map(function (field) {
|
|
229
244
|
return fieldNames.includes(field.name) ? field.set('touched', true) : field;
|
|
@@ -252,13 +267,13 @@ regSaga('CHECK_ON_LOAD', /*#__PURE__*/_regeneratorRuntime.mark(function _callee2
|
|
|
252
267
|
case 0:
|
|
253
268
|
checkActions = ['CONFIGURE_FORM', 'RESOLVE_DATA_SOURCE'];
|
|
254
269
|
_context2.next = 3;
|
|
255
|
-
return takeEvery(checkActions, /*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
|
270
|
+
return takeEvery(checkActions, /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref16) {
|
|
256
271
|
var formKey, formState;
|
|
257
272
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
258
273
|
while (1) {
|
|
259
274
|
switch (_context.prev = _context.next) {
|
|
260
275
|
case 0:
|
|
261
|
-
formKey =
|
|
276
|
+
formKey = _ref16.payload.formKey;
|
|
262
277
|
_context.prev = 1;
|
|
263
278
|
_context.next = 4;
|
|
264
279
|
return select(selectForm(formKey));
|
|
@@ -363,7 +378,7 @@ function runDataSource(formKey, name, dataSource) {
|
|
|
363
378
|
}
|
|
364
379
|
|
|
365
380
|
_context4.next = 9;
|
|
366
|
-
return race([take(['CONFIGURE_FORM', 'REJECT_DATA_SOURCE', 'RESET', 'RESOLVE_DATA_SOURCE', 'SET_VALUE', 'SUBMIT_SUCCESS']), take('UNMOUNT_FORM')]);
|
|
381
|
+
return race([take(['CONFIGURE_FORM', 'REJECT_DATA_SOURCE', 'RESET', 'RESOLVE_DATA_SOURCE', 'SET_VALUE', 'TOGGLE_MULTI_VALUE', 'SUBMIT_SUCCESS']), take('UNMOUNT_FORM')]);
|
|
367
382
|
|
|
368
383
|
case 9:
|
|
369
384
|
_yield$race = _context4.sent;
|
|
@@ -422,14 +437,14 @@ function runDataSource(formKey, name, dataSource) {
|
|
|
422
437
|
}, _marked);
|
|
423
438
|
}
|
|
424
439
|
|
|
425
|
-
regSaga(takeEvery('CALL_DATA_SOURCE', /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(
|
|
426
|
-
var
|
|
440
|
+
regSaga(takeEvery('CALL_DATA_SOURCE', /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref17) {
|
|
441
|
+
var _ref17$payload, formKey, name, params, _yield$select2, fn, transform, data, timestamp;
|
|
427
442
|
|
|
428
443
|
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
429
444
|
while (1) {
|
|
430
445
|
switch (_context5.prev = _context5.next) {
|
|
431
446
|
case 0:
|
|
432
|
-
|
|
447
|
+
_ref17$payload = _ref17.payload, formKey = _ref17$payload.formKey, name = _ref17$payload.name, params = _ref17$payload.params;
|
|
433
448
|
_context5.prev = 1;
|
|
434
449
|
_context5.next = 4;
|
|
435
450
|
return select(selectDataSource(formKey, name));
|
|
@@ -472,85 +487,99 @@ regSaga(takeEvery('CALL_DATA_SOURCE', /*#__PURE__*/_regeneratorRuntime.mark(func
|
|
|
472
487
|
}
|
|
473
488
|
}, _callee4, null, [[1, 17]]);
|
|
474
489
|
})));
|
|
475
|
-
regSaga(
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
490
|
+
regSaga('HANDLE_SET_VALUE', /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
491
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
479
492
|
while (1) {
|
|
480
|
-
switch (
|
|
493
|
+
switch (_context7.prev = _context7.next) {
|
|
481
494
|
case 0:
|
|
482
|
-
|
|
483
|
-
|
|
495
|
+
_context7.next = 2;
|
|
496
|
+
return takeEvery(['SET_VALUE', 'TOGGLE_MULTI_VALUE'], /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref18) {
|
|
497
|
+
var _ref18$payload, formKey, name, triggerChange, _yield$select3, bindings, fields, _fields$get, _onChange;
|
|
484
498
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
499
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
500
|
+
while (1) {
|
|
501
|
+
switch (_context6.prev = _context6.next) {
|
|
502
|
+
case 0:
|
|
503
|
+
_ref18$payload = _ref18.payload, formKey = _ref18$payload.formKey, name = _ref18$payload.name, triggerChange = _ref18$payload.triggerChange;
|
|
504
|
+
_context6.prev = 1;
|
|
489
505
|
|
|
490
|
-
|
|
491
|
-
|
|
506
|
+
if (!triggerChange) {
|
|
507
|
+
_context6.next = 12;
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
492
510
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
bindings = _yield$select3.bindings;
|
|
496
|
-
fields = _yield$select3.fields;
|
|
497
|
-
_fields$get = fields.get(name), _onChange = _fields$get.onChange;
|
|
511
|
+
_context6.next = 5;
|
|
512
|
+
return select(selectForm(formKey));
|
|
498
513
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
514
|
+
case 5:
|
|
515
|
+
_yield$select3 = _context6.sent;
|
|
516
|
+
bindings = _yield$select3.bindings;
|
|
517
|
+
fields = _yield$select3.fields;
|
|
518
|
+
_fields$get = fields.get(name), _onChange = _fields$get.onChange;
|
|
503
519
|
|
|
504
|
-
|
|
505
|
-
|
|
520
|
+
if (!_onChange) {
|
|
521
|
+
_context6.next = 12;
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
506
524
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
break;
|
|
525
|
+
_context6.next = 12;
|
|
526
|
+
return call(_onChange, bindings, bindActions(formKey));
|
|
510
527
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
console.error(_context6.t0);
|
|
528
|
+
case 12:
|
|
529
|
+
_context6.next = 17;
|
|
530
|
+
break;
|
|
515
531
|
|
|
516
|
-
|
|
532
|
+
case 14:
|
|
533
|
+
_context6.prev = 14;
|
|
534
|
+
_context6.t0 = _context6["catch"](1);
|
|
535
|
+
console.error(_context6.t0);
|
|
536
|
+
|
|
537
|
+
case 17:
|
|
538
|
+
case "end":
|
|
539
|
+
return _context6.stop();
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}, _callee5, null, [[1, 14]]);
|
|
543
|
+
}));
|
|
544
|
+
|
|
545
|
+
case 2:
|
|
517
546
|
case "end":
|
|
518
|
-
return
|
|
547
|
+
return _context7.stop();
|
|
519
548
|
}
|
|
520
549
|
}
|
|
521
|
-
},
|
|
522
|
-
}))
|
|
523
|
-
regSaga(takeEvery('REJECT_DATA_SOURCE', /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
550
|
+
}, _callee6);
|
|
551
|
+
}));
|
|
552
|
+
regSaga(takeEvery('REJECT_DATA_SOURCE', /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref19) {
|
|
524
553
|
var payload;
|
|
525
|
-
return _regeneratorRuntime.wrap(function
|
|
554
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
526
555
|
while (1) {
|
|
527
|
-
switch (
|
|
556
|
+
switch (_context8.prev = _context8.next) {
|
|
528
557
|
case 0:
|
|
529
|
-
payload =
|
|
530
|
-
|
|
558
|
+
payload = _ref19.payload;
|
|
559
|
+
_context8.next = 3;
|
|
531
560
|
return call(console.error, 'REJECT_DATA_SOURCE', payload);
|
|
532
561
|
|
|
533
562
|
case 3:
|
|
534
563
|
case "end":
|
|
535
|
-
return
|
|
564
|
+
return _context8.stop();
|
|
536
565
|
}
|
|
537
566
|
}
|
|
538
|
-
},
|
|
567
|
+
}, _callee7);
|
|
539
568
|
})));
|
|
540
|
-
regSaga(takeEvery('SUBMIT', /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
541
|
-
var
|
|
569
|
+
regSaga(takeEvery('SUBMIT', /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref20) {
|
|
570
|
+
var _ref20$payload, formKey, fieldSet, onInvalid, _yield$select4, bindings, fields, _onSubmit, onSave, onError, computedFieldSet, values, errors, result;
|
|
542
571
|
|
|
543
|
-
return _regeneratorRuntime.wrap(function
|
|
572
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
544
573
|
while (1) {
|
|
545
|
-
switch (
|
|
574
|
+
switch (_context9.prev = _context9.next) {
|
|
546
575
|
case 0:
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
576
|
+
_ref20$payload = _ref20.payload, formKey = _ref20$payload.formKey, fieldSet = _ref20$payload.fieldSet, onInvalid = _ref20$payload.onInvalid;
|
|
577
|
+
_context9.prev = 1;
|
|
578
|
+
_context9.next = 4;
|
|
550
579
|
return select(selectForm(formKey));
|
|
551
580
|
|
|
552
581
|
case 4:
|
|
553
|
-
_yield$select4 =
|
|
582
|
+
_yield$select4 = _context9.sent;
|
|
554
583
|
bindings = _yield$select4.bindings;
|
|
555
584
|
fields = _yield$select4.fields;
|
|
556
585
|
_onSubmit = _yield$select4.onSubmit;
|
|
@@ -570,54 +599,54 @@ regSaga(takeEvery('SUBMIT', /*#__PURE__*/_regeneratorRuntime.mark(function _call
|
|
|
570
599
|
});
|
|
571
600
|
|
|
572
601
|
if (!errors.isEmpty()) {
|
|
573
|
-
|
|
602
|
+
_context9.next = 33;
|
|
574
603
|
break;
|
|
575
604
|
}
|
|
576
605
|
|
|
577
|
-
|
|
578
|
-
|
|
606
|
+
_context9.prev = 14;
|
|
607
|
+
_context9.next = 17;
|
|
579
608
|
return call(_onSubmit, values, bindings);
|
|
580
609
|
|
|
581
610
|
case 17:
|
|
582
|
-
result =
|
|
611
|
+
result = _context9.sent;
|
|
583
612
|
dispatch('SUBMIT_SUCCESS', {
|
|
584
613
|
formKey: formKey
|
|
585
614
|
});
|
|
586
615
|
|
|
587
616
|
if (!onSave) {
|
|
588
|
-
|
|
617
|
+
_context9.next = 22;
|
|
589
618
|
break;
|
|
590
619
|
}
|
|
591
620
|
|
|
592
|
-
|
|
621
|
+
_context9.next = 22;
|
|
593
622
|
return call(onSave, result);
|
|
594
623
|
|
|
595
624
|
case 22:
|
|
596
|
-
|
|
625
|
+
_context9.next = 31;
|
|
597
626
|
break;
|
|
598
627
|
|
|
599
628
|
case 24:
|
|
600
|
-
|
|
601
|
-
|
|
629
|
+
_context9.prev = 24;
|
|
630
|
+
_context9.t0 = _context9["catch"](14);
|
|
602
631
|
dispatch('SUBMIT_ERROR', {
|
|
603
632
|
formKey: formKey,
|
|
604
|
-
error: typeof
|
|
633
|
+
error: typeof _context9.t0 === 'string' ? _context9.t0 : 'Unexpected error occurred'
|
|
605
634
|
});
|
|
606
635
|
|
|
607
|
-
if (typeof
|
|
608
|
-
console.error('Error handling form submit',
|
|
636
|
+
if (typeof _context9.t0 !== 'string') {
|
|
637
|
+
console.error('Error handling form submit', _context9.t0);
|
|
609
638
|
}
|
|
610
639
|
|
|
611
640
|
if (!onError) {
|
|
612
|
-
|
|
641
|
+
_context9.next = 31;
|
|
613
642
|
break;
|
|
614
643
|
}
|
|
615
644
|
|
|
616
|
-
|
|
617
|
-
return call(onError,
|
|
645
|
+
_context9.next = 31;
|
|
646
|
+
return call(onError, _context9.t0);
|
|
618
647
|
|
|
619
648
|
case 31:
|
|
620
|
-
|
|
649
|
+
_context9.next = 35;
|
|
621
650
|
break;
|
|
622
651
|
|
|
623
652
|
case 33:
|
|
@@ -631,20 +660,20 @@ regSaga(takeEvery('SUBMIT', /*#__PURE__*/_regeneratorRuntime.mark(function _call
|
|
|
631
660
|
}
|
|
632
661
|
|
|
633
662
|
case 35:
|
|
634
|
-
|
|
663
|
+
_context9.next = 40;
|
|
635
664
|
break;
|
|
636
665
|
|
|
637
666
|
case 37:
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
console.error(
|
|
667
|
+
_context9.prev = 37;
|
|
668
|
+
_context9.t1 = _context9["catch"](1);
|
|
669
|
+
console.error(_context9.t1);
|
|
641
670
|
|
|
642
671
|
case 40:
|
|
643
672
|
case "end":
|
|
644
|
-
return
|
|
673
|
+
return _context9.stop();
|
|
645
674
|
}
|
|
646
675
|
}
|
|
647
|
-
},
|
|
676
|
+
}, _callee8, null, [[1, 37], [14, 24]]);
|
|
648
677
|
})));
|
|
649
678
|
export var setValue = function setValue(formKey, name, value) {
|
|
650
679
|
var triggerChange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
@@ -655,6 +684,15 @@ export var setValue = function setValue(formKey, name, value) {
|
|
|
655
684
|
triggerChange: triggerChange
|
|
656
685
|
});
|
|
657
686
|
};
|
|
687
|
+
export var toggleMultiValue = function toggleMultiValue(formKey, name, value) {
|
|
688
|
+
var triggerChange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
689
|
+
dispatch('TOGGLE_MULTI_VALUE', {
|
|
690
|
+
formKey: formKey,
|
|
691
|
+
name: name,
|
|
692
|
+
value: value,
|
|
693
|
+
triggerChange: triggerChange
|
|
694
|
+
});
|
|
695
|
+
};
|
|
658
696
|
var actions = {
|
|
659
697
|
setValue: function setValue(formKey) {
|
|
660
698
|
return function (name, value) {
|
|
@@ -666,22 +704,33 @@ var actions = {
|
|
|
666
704
|
triggerChange: triggerChange
|
|
667
705
|
});
|
|
668
706
|
};
|
|
707
|
+
},
|
|
708
|
+
toggleMultiValue: function toggleMultiValue(formKey) {
|
|
709
|
+
return function (name, value) {
|
|
710
|
+
var triggerChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
711
|
+
return dispatch('TOGGLE_MULTI_VALUE', {
|
|
712
|
+
formKey: formKey,
|
|
713
|
+
name: name,
|
|
714
|
+
value: value,
|
|
715
|
+
triggerChange: triggerChange
|
|
716
|
+
});
|
|
717
|
+
};
|
|
669
718
|
}
|
|
670
719
|
};
|
|
671
720
|
|
|
672
721
|
var bindActions = function bindActions(formKey) {
|
|
673
|
-
return Object.entries(actions).reduce(function (acc,
|
|
674
|
-
var
|
|
675
|
-
name =
|
|
676
|
-
fn =
|
|
722
|
+
return Object.entries(actions).reduce(function (acc, _ref21) {
|
|
723
|
+
var _ref22 = _slicedToArray(_ref21, 2),
|
|
724
|
+
name = _ref22[0],
|
|
725
|
+
fn = _ref22[1];
|
|
677
726
|
|
|
678
727
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, name, fn(formKey)));
|
|
679
728
|
}, {});
|
|
680
729
|
};
|
|
681
730
|
|
|
682
|
-
export var onFocus = function onFocus(
|
|
683
|
-
var formKey =
|
|
684
|
-
name =
|
|
731
|
+
export var onFocus = function onFocus(_ref23) {
|
|
732
|
+
var formKey = _ref23.formKey,
|
|
733
|
+
name = _ref23.name;
|
|
685
734
|
return function () {
|
|
686
735
|
dispatch('FOCUS_FIELD', {
|
|
687
736
|
formKey: formKey,
|
|
@@ -689,9 +738,9 @@ export var onFocus = function onFocus(_ref22) {
|
|
|
689
738
|
});
|
|
690
739
|
};
|
|
691
740
|
};
|
|
692
|
-
export var onBlur = function onBlur(
|
|
693
|
-
var formKey =
|
|
694
|
-
name =
|
|
741
|
+
export var onBlur = function onBlur(_ref24) {
|
|
742
|
+
var formKey = _ref24.formKey,
|
|
743
|
+
name = _ref24.name;
|
|
695
744
|
return function () {
|
|
696
745
|
dispatch('BLUR_FIELD', {
|
|
697
746
|
formKey: formKey,
|
|
@@ -699,15 +748,18 @@ export var onBlur = function onBlur(_ref23) {
|
|
|
699
748
|
});
|
|
700
749
|
};
|
|
701
750
|
};
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
751
|
+
var LIST_VALUE_TYPES = ['checkbox-multi'];
|
|
752
|
+
export var onChange = function onChange(_ref25) {
|
|
753
|
+
var formKey = _ref25.formKey,
|
|
754
|
+
type = _ref25.type,
|
|
755
|
+
name = _ref25.name;
|
|
706
756
|
return function (event) {
|
|
707
757
|
var value;
|
|
708
758
|
|
|
709
759
|
if (type === 'checkbox' && event && event.target) {
|
|
710
760
|
value = event.target.checked;
|
|
761
|
+
} else if (type === 'checkbox-multi') {
|
|
762
|
+
value = event.target.value;
|
|
711
763
|
} else if (type === 'select-multi' && event && event.target && event.target.options) {
|
|
712
764
|
value = List(event.target.options).filter(function (o) {
|
|
713
765
|
return o.selected;
|
|
@@ -720,7 +772,11 @@ export var onChange = function onChange(_ref24) {
|
|
|
720
772
|
value = event;
|
|
721
773
|
}
|
|
722
774
|
|
|
723
|
-
|
|
775
|
+
if (LIST_VALUE_TYPES.includes(type)) {
|
|
776
|
+
actions.toggleMultiValue(formKey)(name, value);
|
|
777
|
+
} else {
|
|
778
|
+
actions.setValue(formKey)(name, value);
|
|
779
|
+
}
|
|
724
780
|
};
|
|
725
781
|
};
|
|
726
782
|
export var onSubmit = function onSubmit(formKey, fieldSet) {
|
|
@@ -768,10 +824,10 @@ export var reloadDataSource = function reloadDataSource(formKey, name) {
|
|
|
768
824
|
export var configureForm = function configureForm(config) {
|
|
769
825
|
return dispatch('CONFIGURE_FORM', config);
|
|
770
826
|
};
|
|
771
|
-
export var submitForm = function submitForm(formKey,
|
|
772
|
-
var fieldSet =
|
|
773
|
-
onInvalid =
|
|
774
|
-
values =
|
|
827
|
+
export var submitForm = function submitForm(formKey, _ref26) {
|
|
828
|
+
var fieldSet = _ref26.fieldSet,
|
|
829
|
+
onInvalid = _ref26.onInvalid,
|
|
830
|
+
values = _ref26.values;
|
|
775
831
|
return dispatch('SUBMIT', {
|
|
776
832
|
formKey: formKey,
|
|
777
833
|
fieldSet: fieldSet,
|
|
@@ -780,15 +836,15 @@ export var submitForm = function submitForm(formKey, _ref25) {
|
|
|
780
836
|
});
|
|
781
837
|
};
|
|
782
838
|
export var serializeForm = function serializeForm(formKey) {
|
|
783
|
-
var
|
|
784
|
-
fieldSet =
|
|
839
|
+
var _ref27 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
840
|
+
fieldSet = _ref27.fieldSet;
|
|
785
841
|
|
|
786
842
|
return serializeImpl(selectForm(formKey)(store.getState()), fieldSet);
|
|
787
843
|
};
|
|
788
844
|
|
|
789
|
-
var serializeImpl = function serializeImpl(
|
|
790
|
-
var bindings =
|
|
791
|
-
fields =
|
|
845
|
+
var serializeImpl = function serializeImpl(_ref28, fieldSet) {
|
|
846
|
+
var bindings = _ref28.bindings,
|
|
847
|
+
fields = _ref28.fields;
|
|
792
848
|
var computedFieldSet = computeFieldSet(fields, fieldSet);
|
|
793
849
|
return fields.filter(function (field) {
|
|
794
850
|
return !field["transient"] && computedFieldSet.contains(field.name);
|
|
@@ -918,8 +974,8 @@ var FormImplComponent = /*#__PURE__*/function (_Component2) {
|
|
|
918
974
|
} // else if the autoFocus prop has been changed we will also focus the new
|
|
919
975
|
// resulting focus element
|
|
920
976
|
else if (this.props.autoFocus !== prevProps.autoFocus && this.focusRef.current) {
|
|
921
|
-
|
|
922
|
-
|
|
977
|
+
this.focusRef.current.focus();
|
|
978
|
+
}
|
|
923
979
|
}
|
|
924
980
|
}, {
|
|
925
981
|
key: "render",
|
|
@@ -968,10 +1024,10 @@ var FormImplComponent = /*#__PURE__*/function (_Component2) {
|
|
|
968
1024
|
formOptions: formOptions,
|
|
969
1025
|
fields: OrderedMap(computedFieldSet.map(function (name) {
|
|
970
1026
|
return [name, fields.get(name)];
|
|
971
|
-
})).mapEntries(function (
|
|
972
|
-
var
|
|
973
|
-
name =
|
|
974
|
-
field =
|
|
1027
|
+
})).mapEntries(function (_ref29, index) {
|
|
1028
|
+
var _ref30 = _slicedToArray(_ref29, 2),
|
|
1029
|
+
name = _ref30[0],
|
|
1030
|
+
field = _ref30[1];
|
|
975
1031
|
|
|
976
1032
|
var FieldImpl = fieldComponents.get(name) || components.get(getComponentName(field), null);
|
|
977
1033
|
return [name, FieldImpl ? /*#__PURE__*/React.createElement(FieldImpl, Object.assign({
|
|
@@ -1021,11 +1077,11 @@ export var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
1021
1077
|
};
|
|
1022
1078
|
};
|
|
1023
1079
|
var FormImpl = connect(mapStateToProps)(FormImplComponent);
|
|
1024
|
-
export var generateForm = function generateForm(
|
|
1025
|
-
var dataSources =
|
|
1026
|
-
fields =
|
|
1027
|
-
handleSubmit =
|
|
1028
|
-
formOptions =
|
|
1080
|
+
export var generateForm = function generateForm(_ref31) {
|
|
1081
|
+
var dataSources = _ref31.dataSources,
|
|
1082
|
+
fields = _ref31.fields,
|
|
1083
|
+
handleSubmit = _ref31.handleSubmit,
|
|
1084
|
+
formOptions = _ref31.formOptions;
|
|
1029
1085
|
return function (configurationProps) {
|
|
1030
1086
|
return /*#__PURE__*/React.createElement(Form, {
|
|
1031
1087
|
addDataSources: configurationProps.addDataSources,
|
package/lib/components/index.js
CHANGED
|
@@ -10,16 +10,16 @@ export { TableInput } from './common/TableInput';
|
|
|
10
10
|
export { FormSelect } from './common/FormSelect';
|
|
11
11
|
export { Scroller } from './common/Scroller';
|
|
12
12
|
export { StaticSelect } from './common/StaticSelect';
|
|
13
|
-
export { getToken, logout, timedOut } from './common/authentication/AuthenticationContainer'; // Form
|
|
13
|
+
export { getCsrfToken, getToken, logout, timedOut } from './common/authentication/AuthenticationContainer'; // Form
|
|
14
14
|
|
|
15
|
-
export { mountForm, resetForm, reloadDataSource, serializeForm, submitForm, unmountForm // Don't keep.
|
|
16
|
-
|
|
15
|
+
export { mountForm, resetForm, reloadDataSource, serializeForm, submitForm, unmountForm, // Don't keep.
|
|
16
|
+
generateForm } from './form/Form';
|
|
17
17
|
export { FormState } from './form/FormState';
|
|
18
18
|
export { KitchenSinkForm } from './form/KitchenSinkForm'; // Table
|
|
19
19
|
|
|
20
20
|
export { mountTable, unmountTable, refetchTable, clearFilters, isValueEmpty } from './table/Table.redux';
|
|
21
|
-
export { Table // Don't keep.
|
|
22
|
-
|
|
21
|
+
export { Table, // Don't keep.
|
|
22
|
+
generateTable } from './table/Table'; // Tree Builder
|
|
23
23
|
|
|
24
24
|
export { mountTreeBuilder, unmountTreeBuilder } from './task/builder/builder.redux';
|
|
25
25
|
export { searchNodeResultDependencies } from './task/builder/helpers'; // Discussions
|
|
@@ -34,7 +34,9 @@ export { UserMessageGroup } from './discussions/UserMessageGroup'; // Agent
|
|
|
34
34
|
export { BridgeTable } from './agent/bridge/BridgeTable';
|
|
35
35
|
export { BridgeForm } from './agent/bridge/BridgeForm';
|
|
36
36
|
export { AgentHandlerTable } from './agent/handler/AgentHandlerTable';
|
|
37
|
-
export { AgentHandlerForm } from './agent/handler/AgentHandlerForm';
|
|
37
|
+
export { AgentHandlerForm } from './agent/handler/AgentHandlerForm';
|
|
38
|
+
export { FilestoreForm } from './agent/filestore/FilestoreForm';
|
|
39
|
+
export { FilestoreTable } from './agent/filestore/FilestoreTable'; // Core
|
|
38
40
|
|
|
39
41
|
export { AttributeDefinitionForm } from './core/attribute_definition/AttributeDefinitionForm';
|
|
40
42
|
export { AttributeDefinitionTable } from './core/attribute_definition/AttributeDefinitionTable';
|
|
@@ -53,6 +55,10 @@ export { AgentComponentForm } from './core/platform_component/AgentComponentForm
|
|
|
53
55
|
export { TaskComponentForm } from './core/platform_component/TaskComponentForm';
|
|
54
56
|
export { EntryForm } from './core/translation/EntryForm';
|
|
55
57
|
export { EntryTable } from './core/translation/EntryTable';
|
|
58
|
+
export { FieldDefinitionTable } from './core/field_definition/FieldDefinitionTable';
|
|
59
|
+
export { FieldDefinitionForm } from './core/field_definition/FieldDefinitionForm';
|
|
60
|
+
export { FileResourceTable } from './core/file_resource/FileResourceTable';
|
|
61
|
+
export { FileResourceForm } from './core/file_resource/FileResourceForm';
|
|
56
62
|
export { FormForm } from './core/form/FormForm';
|
|
57
63
|
export { FormTable } from './core/form/FormTable';
|
|
58
64
|
export { FormTypeForm } from './core/form_type/FormTypeForm';
|
|
@@ -75,6 +81,7 @@ export { SecurityDefinitionForm } from './core/security_definition/SecurityDefin
|
|
|
75
81
|
export { SecurityDefinitionTable } from './core/security_definition/SecurityDefinitionTable';
|
|
76
82
|
export { SpaceForm } from './core/space/SpaceForm';
|
|
77
83
|
export { SubmissionTable } from './core/submission/SubmissionTable';
|
|
84
|
+
export { SubmissionForm } from './core/submission/SubmissionForm';
|
|
78
85
|
export { DatastoreSubmissionTable } from './core/submission/DatastoreSubmissionTable';
|
|
79
86
|
export { TeamForm } from './core/team/TeamForm';
|
|
80
87
|
export { TeamTable } from './core/team/TeamTable';
|
|
@@ -95,13 +102,16 @@ export { SystemUserForm } from './system/SystemUserForm';
|
|
|
95
102
|
export { SystemSmtpForm } from './system/SystemSmtpForm';
|
|
96
103
|
export { SystemTaskAdapterForm } from './system/SystemTaskAdapterForm';
|
|
97
104
|
export { SystemIngressForm } from './system/SystemIngressForm';
|
|
105
|
+
export { SystemSecurityForm } from './system/SystemSecurityForm';
|
|
98
106
|
export { SystemForm } from './system/SystemForm';
|
|
107
|
+
export { SystemBackgroundTasksTable } from './system/SystemBackgroundTasksTable';
|
|
99
108
|
export { formPropertyName } from './system/helpers'; // Task
|
|
100
109
|
|
|
101
110
|
export { TreeBuilder } from './task/builder/TreeBuilder';
|
|
102
111
|
export { ConnectorForm } from './task/builder/ConnectorForm';
|
|
103
112
|
export { NodeForm } from './task/builder/NodeForm';
|
|
104
113
|
export { NodeParametersForm } from './task/builder/NodeParametersForm';
|
|
114
|
+
export { generateTaskDefinition, TaskDefinitionConfigForm } from './task/builder/TaskDefinitionConfigForm';
|
|
105
115
|
export { RunTable } from './task/runs/RunTable';
|
|
106
116
|
export { RunTaskTable } from './task/runs/RunTaskTable';
|
|
107
117
|
export { CreateManualTriggerForm } from './task/runs/CreateManualTriggerForm';
|