@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.
Files changed (95) hide show
  1. package/README.md +110 -110
  2. package/assets/task/icons/defer.svg +12 -12
  3. package/assets/task/icons/drag-handle.svg +3 -3
  4. package/assets/task/icons/filter.svg +11 -11
  5. package/assets/task/icons/loop.svg +10 -10
  6. package/assets/task/icons/plus_small.svg +5 -5
  7. package/assets/task/icons/routine.svg +9 -9
  8. package/assets/task/icons/scale-minus.svg +11 -11
  9. package/assets/task/icons/scale-plus.svg +13 -13
  10. package/assets/task/icons/start.svg +11 -11
  11. package/assets/task/icons/stop.svg +8 -8
  12. package/lib/apis/core/activity.js +4 -4
  13. package/lib/apis/core/attributeDefinitions.js +55 -0
  14. package/lib/apis/core/attributeDefinitions.test.js +7 -4
  15. package/lib/apis/core/authentication.js +12 -1
  16. package/lib/apis/core/bridgeModels.test.js +46 -23
  17. package/lib/apis/core/bridgedresources.js +41 -41
  18. package/lib/apis/core/fileResources.js +2 -6
  19. package/lib/apis/core/forms.js +51 -2
  20. package/lib/apis/core/forms.test.js +32 -19
  21. package/lib/apis/core/kapps.js +49 -0
  22. package/lib/apis/core/kapps.test.js +16 -10
  23. package/lib/apis/core/notices.js +7 -0
  24. package/lib/apis/core/securityPolicyDefinitions.test.js +7 -4
  25. package/lib/apis/core/space.js +18 -0
  26. package/lib/apis/core/space.test.js +16 -10
  27. package/lib/apis/core/submissionActivities.js +38 -0
  28. package/lib/apis/core/submissions.js +62 -0
  29. package/lib/apis/core/translations.test.js +126 -55
  30. package/lib/apis/core/userPreferences.js +59 -0
  31. package/lib/apis/core/webApis.js +32 -2
  32. package/lib/apis/core/webhooks.test.js +7 -4
  33. package/lib/apis/http.js +22 -11
  34. package/lib/apis/index.js +24 -0
  35. package/lib/apis/integrator/index.js +95 -20
  36. package/lib/components/common/AttributeSelect.js +1 -0
  37. package/lib/components/common/BridgeSelect.js +1 -0
  38. package/lib/components/common/ConnectionSelect.js +2 -1
  39. package/lib/components/common/FormSelect.js +1 -0
  40. package/lib/components/common/NodeSelect.js +1 -0
  41. package/lib/components/common/StaticSelect.js +1 -0
  42. package/lib/components/common/TeamSelect.js +1 -0
  43. package/lib/components/common/ToastContainer.js +3 -3
  44. package/lib/components/common/Typeahead.js +3 -0
  45. package/lib/components/common/UserSelect.js +1 -0
  46. package/lib/components/common/authentication/AuthenticationContainer.js +121 -55
  47. package/lib/components/common/preferences/PreferencesProvider.js +461 -0
  48. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +7 -7
  49. package/lib/components/core/field_definition/FieldDefinitionForm.js +3 -3
  50. package/lib/components/core/form/FormTable.js +0 -1
  51. package/lib/components/core/integration/IntegrationTable.js +3 -0
  52. package/lib/components/core/space/SpaceForm.js +14 -14
  53. package/lib/components/core/submission/SubmissionActivityForm.js +79 -0
  54. package/lib/components/core/submission/SubmissionForm.js +12 -2
  55. package/lib/components/core/translation/EntryTable.js +8 -7
  56. package/lib/components/core/user/UserForm.js +2 -0
  57. package/lib/components/core/user/UserTable.js +4 -4
  58. package/lib/components/form/Form.js +14 -3
  59. package/lib/components/form/FormState.js +1 -1
  60. package/lib/components/form/SimpleForm.js +2 -2
  61. package/lib/components/index.js +68 -0
  62. package/lib/components/integrator/connection/ConnectionForm.js +62 -18
  63. package/lib/components/integrator/connection/ConnectionTable.js +5 -3
  64. package/lib/components/integrator/connection/config_fields/http.js +19 -19
  65. package/lib/components/integrator/connection/config_fields/sql.js +123 -0
  66. package/lib/components/integrator/integrationTypes.js +27 -5
  67. package/lib/components/integrator/operation/OperationForm.js +24 -4
  68. package/lib/components/integrator/operation/OperationTable.js +3 -5
  69. package/lib/components/integrator/operation/config_fields/http.js +3 -2
  70. package/lib/components/integrator/operation/config_fields/sql.js +81 -0
  71. package/lib/components/system/SystemUserForm.js +2 -0
  72. package/lib/components/table/Table.js +75 -15
  73. package/lib/components/table/Table.redux.js +296 -72
  74. package/lib/components/table/defaults/FilterControl.js +24 -0
  75. package/lib/components/table/defaults/index.js +2 -0
  76. package/lib/components/table/tests/Table.test.js +22 -22
  77. package/lib/components/table/tests/components.js +9 -2
  78. package/lib/components/task/builder/Connector.js +51 -41
  79. package/lib/components/task/builder/Node.js +25 -38
  80. package/lib/components/task/builder/SvgCanvas.js +3 -17
  81. package/lib/components/task/builder/TreeBuilder.js +1 -2
  82. package/lib/components/task/builder/builder.redux.js +52 -32
  83. package/lib/components/task/builder/helpers.js +35 -5
  84. package/lib/components/task/common/UsageTable.js +8 -1
  85. package/lib/components/task/handlers/HandlerTable.js +9 -18
  86. package/lib/components/task/runs/RunTable.js +6 -10
  87. package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -9
  88. package/lib/components/task/workflows/WorkflowTable.js +25 -24
  89. package/lib/helpers/index.js +18 -2
  90. package/lib/index.js +2 -1
  91. package/lib/saga.js +4 -4
  92. package/lib/store.js +2 -1
  93. package/package.json +5 -6
  94. package/proxyhelper.js +201 -201
  95. package/CHANGELOG.md +0 -116
@@ -17,6 +17,7 @@ var _lodashEs = require("lodash-es");
17
17
  var _moment = _interopRequireDefault(require("moment"));
18
18
  var _store = require("../../../store");
19
19
  var _apis = require("../../../apis");
20
+ var _PreferencesProvider = require("../preferences/PreferencesProvider");
20
21
  var defaultLoginProps = {
21
22
  error: null,
22
23
  password: '',
@@ -42,6 +43,7 @@ var defaultLoginProps = {
42
43
  SET_AUTHENTICATED: function SET_AUTHENTICATED(state, action) {
43
44
  return state.mergeIn(['session'], {
44
45
  loggedIn: true,
46
+ timedOut: false,
45
47
  token: action.payload.token
46
48
  }).set('login', defaultLoginProps);
47
49
  },
@@ -50,6 +52,7 @@ var defaultLoginProps = {
50
52
  csrfToken: action.payload.csrfToken,
51
53
  initialized: true,
52
54
  loggedIn: !!action.payload.token,
55
+ timedOut: false,
53
56
  securityStrategies: action.payload.securityStrategies,
54
57
  spaceSlug: action.payload.spaceSlug,
55
58
  token: action.payload.token,
@@ -80,6 +83,9 @@ var defaultLoginProps = {
80
83
  },
81
84
  TIMEOUT: function TIMEOUT(state) {
82
85
  return state.setIn(['session', 'token'], null);
86
+ },
87
+ TIMEOUT_SESSION: function TIMEOUT_SESSION(state) {
88
+ return state.setIn(['session', 'timedOut'], true);
83
89
  }
84
90
  });
85
91
  (0, _store.regSaga)('WATCH_SYSTEM_AUTHENTICATION', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
@@ -313,19 +319,75 @@ var defaultLoginProps = {
313
319
  }, _callee3, null, [[0, 17]]);
314
320
  })();
315
321
  }));
322
+ (0, _store.regSaga)((0, _effects.takeEvery)('TIMEOUT', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
323
+ var system, token;
324
+ return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
325
+ while (1) switch (_context4.prev = _context4.next) {
326
+ case 0:
327
+ _context4.next = 2;
328
+ return (0, _effects.select)(function (state) {
329
+ return state.getIn(['session', 'system']);
330
+ });
331
+ case 2:
332
+ system = _context4.sent;
333
+ if (!system) {
334
+ _context4.next = 8;
335
+ break;
336
+ }
337
+ _context4.next = 6;
338
+ return (0, _effects.put)((0, _store.action)('TIMEOUT_SESSION'));
339
+ case 6:
340
+ _context4.next = 26;
341
+ break;
342
+ case 8:
343
+ _context4.prev = 8;
344
+ _context4.next = 11;
345
+ return (0, _effects.call)(_apis.retrieveJwt);
346
+ case 11:
347
+ token = _context4.sent;
348
+ if (!token) {
349
+ _context4.next = 17;
350
+ break;
351
+ }
352
+ _context4.next = 15;
353
+ return (0, _effects.put)((0, _store.action)('SET_AUTHENTICATED', {
354
+ token: token
355
+ }));
356
+ case 15:
357
+ _context4.next = 19;
358
+ break;
359
+ case 17:
360
+ _context4.next = 19;
361
+ return (0, _effects.put)((0, _store.action)('TIMEOUT_SESSION'));
362
+ case 19:
363
+ _context4.next = 26;
364
+ break;
365
+ case 21:
366
+ _context4.prev = 21;
367
+ _context4.t0 = _context4["catch"](8);
368
+ _context4.next = 25;
369
+ return (0, _effects.put)((0, _store.action)('TIMEOUT_SESSION'));
370
+ case 25:
371
+ console.error(_context4.t0);
372
+ case 26:
373
+ case "end":
374
+ return _context4.stop();
375
+ }
376
+ }, _callee4, null, [[8, 21]]);
377
+ })));
316
378
  var SYSTEM_TOKEN = 'kd-system';
317
379
  (0, _store.regSaga)((0, _effects.takeEvery)('INITIALIZE', function (_ref3) {
318
380
  var _ref3$payload = _ref3.payload,
319
381
  system = _ref3$payload.system,
320
382
  skipInit = _ref3$payload.skipInit;
321
- return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
383
+ return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
322
384
  var token, localToken, parsedToken, isValid, _yield$call4, securityStrategies, _yield$call4$session, _yield$call4$session2, csrfToken, isAuthenticated, spaceSlug, error, _token;
323
- return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
324
- while (1) switch (_context4.prev = _context4.next) {
385
+ return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
386
+ while (1) switch (_context5.prev = _context5.next) {
325
387
  case 0:
326
- _context4.prev = 0;
388
+ _context5.prev = 0;
327
389
  if (!system) {
328
- _context4.next = 8;
390
+ _context5.next = 8;
329
391
  break;
330
392
  }
331
393
  localToken = localStorage ? localStorage.getItem(SYSTEM_TOKEN) : null;
@@ -334,19 +396,19 @@ var SYSTEM_TOKEN = 'kd-system';
334
396
  isValid = _moment["default"].unix(parsedToken.exp).isAfter(new Date());
335
397
  token = isValid ? localToken : null;
336
398
  }
337
- _context4.next = 6;
399
+ _context5.next = 6;
338
400
  return (0, _effects.put)((0, _store.action)('SET_INITIALIZED', {
339
401
  system: system,
340
402
  token: token
341
403
  }));
342
404
  case 6:
343
- _context4.next = 33;
405
+ _context5.next = 33;
344
406
  break;
345
407
  case 8:
346
- _context4.next = 10;
408
+ _context5.next = 10;
347
409
  return (0, _effects.call)(_apis.fetchSpaMeta);
348
410
  case 10:
349
- _yield$call4 = _context4.sent;
411
+ _yield$call4 = _context5.sent;
350
412
  securityStrategies = _yield$call4.securityStrategies;
351
413
  _yield$call4$session = _yield$call4.session;
352
414
  _yield$call4$session2 = _yield$call4$session === void 0 ? {} : _yield$call4$session;
@@ -355,30 +417,30 @@ var SYSTEM_TOKEN = 'kd-system';
355
417
  spaceSlug = _yield$call4.spaceSlug;
356
418
  error = _yield$call4.error;
357
419
  if (!error) {
358
- _context4.next = 23;
420
+ _context5.next = 23;
359
421
  break;
360
422
  }
361
- _context4.next = 21;
423
+ _context5.next = 21;
362
424
  return (0, _effects.put)((0, _store.action)('SET_SERVER_ERROR', error));
363
425
  case 21:
364
- _context4.next = 33;
426
+ _context5.next = 33;
365
427
  break;
366
428
  case 23:
367
429
  if (!(isAuthenticated && !skipInit)) {
368
- _context4.next = 29;
430
+ _context5.next = 29;
369
431
  break;
370
432
  }
371
- _context4.next = 26;
433
+ _context5.next = 26;
372
434
  return (0, _effects.call)(_apis.retrieveJwt);
373
435
  case 26:
374
- _context4.t0 = _context4.sent;
375
- _context4.next = 30;
436
+ _context5.t0 = _context5.sent;
437
+ _context5.next = 30;
376
438
  break;
377
439
  case 29:
378
- _context4.t0 = null;
440
+ _context5.t0 = null;
379
441
  case 30:
380
- _token = _context4.t0;
381
- _context4.next = 33;
442
+ _token = _context5.t0;
443
+ _context5.next = 33;
382
444
  return (0, _effects.put)((0, _store.action)('SET_INITIALIZED', {
383
445
  csrfToken: csrfToken,
384
446
  securityStrategies: securityStrategies,
@@ -386,87 +448,87 @@ var SYSTEM_TOKEN = 'kd-system';
386
448
  token: _token
387
449
  }));
388
450
  case 33:
389
- _context4.next = 38;
451
+ _context5.next = 38;
390
452
  break;
391
453
  case 35:
392
- _context4.prev = 35;
393
- _context4.t1 = _context4["catch"](0);
394
- console.error(_context4.t1);
454
+ _context5.prev = 35;
455
+ _context5.t1 = _context5["catch"](0);
456
+ console.error(_context5.t1);
395
457
  case 38:
396
458
  case "end":
397
- return _context4.stop();
459
+ return _context5.stop();
398
460
  }
399
- }, _callee4, null, [[0, 35]]);
461
+ }, _callee5, null, [[0, 35]]);
400
462
  })();
401
463
  }));
402
464
  (0, _store.regSaga)((0, _effects.takeEvery)('LOGOUT_START', function (_ref4) {
403
465
  var payload = _ref4.payload;
404
- return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
466
+ return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
405
467
  var callback, isSaml, system, loggedIn;
406
- return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
407
- while (1) switch (_context5.prev = _context5.next) {
468
+ return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
469
+ while (1) switch (_context6.prev = _context6.next) {
408
470
  case 0:
409
471
  callback = payload.callback, isSaml = payload.isSaml;
410
- _context5.prev = 1;
411
- _context5.next = 4;
472
+ _context6.prev = 1;
473
+ _context6.next = 4;
412
474
  return (0, _effects.select)(function (state) {
413
475
  return state.getIn(['session', 'system']);
414
476
  });
415
477
  case 4:
416
- system = _context5.sent;
417
- _context5.next = 7;
478
+ system = _context6.sent;
479
+ _context6.next = 7;
418
480
  return (0, _effects.select)(function (state) {
419
481
  return state.getIn(['session', 'token']);
420
482
  });
421
483
  case 7:
422
- loggedIn = _context5.sent;
484
+ loggedIn = _context6.sent;
423
485
  if (!(!system && loggedIn)) {
424
- _context5.next = 11;
486
+ _context6.next = 11;
425
487
  break;
426
488
  }
427
- _context5.next = 11;
489
+ _context6.next = 11;
428
490
  return (0, _effects.call)(_apis.logoutDirect, isSaml);
429
491
  case 11:
430
- _context5.next = 13;
492
+ _context6.next = 13;
431
493
  return (0, _effects.put)((0, _store.action)('LOGOUT'));
432
494
  case 13:
433
495
  if (!(0, _lodashEs.isFunction)(callback)) {
434
- _context5.next = 16;
496
+ _context6.next = 16;
435
497
  break;
436
498
  }
437
- _context5.next = 16;
499
+ _context6.next = 16;
438
500
  return (0, _effects.call)(callback);
439
501
  case 16:
440
- _context5.next = 21;
502
+ _context6.next = 21;
441
503
  break;
442
504
  case 18:
443
- _context5.prev = 18;
444
- _context5.t0 = _context5["catch"](1);
445
- console.error(_context5.t0);
505
+ _context6.prev = 18;
506
+ _context6.t0 = _context6["catch"](1);
507
+ console.error(_context6.t0);
446
508
  case 21:
447
509
  case "end":
448
- return _context5.stop();
510
+ return _context6.stop();
449
511
  }
450
- }, _callee5, null, [[1, 18]]);
512
+ }, _callee6, null, [[1, 18]]);
451
513
  })();
452
514
  }));
453
515
  (0, _store.regSaga)((0, _effects.takeEvery)('SET_AUTHENTICATED', function (_ref5) {
454
516
  var payload = _ref5.payload;
455
- return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
456
- return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
457
- while (1) switch (_context6.prev = _context6.next) {
517
+ return /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee7() {
518
+ return (0, _regeneratorRuntime2["default"])().wrap(function _callee7$(_context7) {
519
+ while (1) switch (_context7.prev = _context7.next) {
458
520
  case 0:
459
521
  if (!(0, _lodashEs.isFunction)(payload.callback)) {
460
- _context6.next = 3;
522
+ _context7.next = 3;
461
523
  break;
462
524
  }
463
- _context6.next = 3;
525
+ _context7.next = 3;
464
526
  return (0, _effects.call)(payload.callback);
465
527
  case 3:
466
528
  case "end":
467
- return _context6.stop();
529
+ return _context7.stop();
468
530
  }
469
- }, _callee6);
531
+ }, _callee7);
470
532
  })();
471
533
  }));
472
534
  var onChangeUsername = function onChangeUsername(e) {
@@ -520,15 +582,15 @@ var AuthenticationComponent = exports.AuthenticationComponent = /*#__PURE__*/fun
520
582
  var _this$props = this.props,
521
583
  initialized = _this$props.initialized,
522
584
  loggedIn = _this$props.loggedIn,
585
+ timedOut = _this$props.timedOut,
523
586
  login = _this$props.login,
524
587
  securityStrategies = _this$props.securityStrategies,
525
588
  serverError = _this$props.serverError,
526
- spaceSlug = _this$props.spaceSlug,
527
- token = _this$props.token;
528
- return this.props.children({
589
+ spaceSlug = _this$props.spaceSlug;
590
+ var content = this.props.children({
529
591
  serverError: serverError,
530
592
  initialized: initialized,
531
- timedOut: loggedIn && !token,
593
+ timedOut: loggedIn && timedOut,
532
594
  loggedIn: loggedIn,
533
595
  loginProps: (0, _objectSpread2["default"])({
534
596
  onChangeUsername: onChangeUsername,
@@ -542,6 +604,9 @@ var AuthenticationComponent = exports.AuthenticationComponent = /*#__PURE__*/fun
542
604
  } : null
543
605
  }, login)
544
606
  });
607
+ return this.props.preferences ? /*#__PURE__*/React.createElement(_PreferencesProvider.PreferencesProvider, {
608
+ loggedIn: loggedIn
609
+ }, content) : content;
545
610
  }
546
611
  }]);
547
612
  return AuthenticationComponent;
@@ -550,6 +615,7 @@ var mapStateToProps = function mapStateToProps(state) {
550
615
  return {
551
616
  initialized: state.getIn(['session', 'initialized'], false),
552
617
  loggedIn: state.getIn(['session', 'loggedIn'], false),
618
+ timedOut: state.getIn(['session', 'timedOut'], false),
553
619
  token: state.getIn(['session', 'token'], null),
554
620
  login: state.get('login', defaultLoginProps),
555
621
  spaceSlug: state.getIn(['session', 'spaceSlug'], ''),