@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.
Files changed (75) hide show
  1. package/lib/apis/core/attributeDefinitions.js +11 -9
  2. package/lib/apis/core/attributeDefinitions.test.js +1 -1
  3. package/lib/apis/core/authentication.js +13 -5
  4. package/lib/apis/core/backgroundJobs.js +2 -1
  5. package/lib/apis/core/bridgeModelAttributeMappings.js +1 -1
  6. package/lib/apis/core/bridgeModelAttributes.js +15 -12
  7. package/lib/apis/core/bridgeModelMappings.js +1 -1
  8. package/lib/apis/core/bridgeModelQualificationMappings.js +2 -2
  9. package/lib/apis/core/bridgeModelQualifications.js +2 -2
  10. package/lib/apis/core/bridgeModels.js +14 -8
  11. package/lib/apis/core/bridgedresources.js +3 -2
  12. package/lib/apis/core/fileResources.js +36 -0
  13. package/lib/apis/core/filestores.js +40 -0
  14. package/lib/apis/core/formTypes.js +18 -21
  15. package/lib/apis/core/oauthClients.js +11 -5
  16. package/lib/apis/core/securityPolicyDefinitions.js +1 -1
  17. package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
  18. package/lib/apis/core/submissions.js +68 -0
  19. package/lib/apis/core/webhooks.js +1 -1
  20. package/lib/apis/core/webhooks.test.js +2 -2
  21. package/lib/apis/http.js +17 -3
  22. package/lib/apis/index.js +2 -0
  23. package/lib/apis/system/index.js +86 -1
  24. package/lib/apis/task/index.js +20 -13
  25. package/lib/components/agent/filestore/FilestoreForm.js +132 -0
  26. package/lib/components/agent/filestore/FilestoreTable.js +53 -0
  27. package/lib/components/common/BridgeSelect.js +2 -1
  28. package/lib/components/common/FormSelect.js +2 -1
  29. package/lib/components/common/Scroller.js +6 -6
  30. package/lib/components/common/TableInput.js +74 -29
  31. package/lib/components/common/TeamSelect.js +2 -1
  32. package/lib/components/common/Typeahead.js +7 -4
  33. package/lib/components/common/UserSelect.js +2 -1
  34. package/lib/components/common/authentication/AuthenticationContainer.js +50 -27
  35. package/lib/components/core/core_form/CoreForm.js +10 -10
  36. package/lib/components/core/file_resource/FileResourceForm.js +180 -0
  37. package/lib/components/core/file_resource/FileResourceTable.js +71 -0
  38. package/lib/components/core/i18n/I18n.js +14 -14
  39. package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
  40. package/lib/components/core/space/SpaceForm.js +37 -8
  41. package/lib/components/core/submission/FormSubmissionFilters.js +3 -11
  42. package/lib/components/core/submission/FormSubmissionTable.js +4 -2
  43. package/lib/components/core/submission/SubmissionForm.js +124 -0
  44. package/lib/components/core/submission/helpers.js +2 -2
  45. package/lib/components/core/user/UserForm.js +2 -2
  46. package/lib/components/core/webapi/WebApiForm.js +111 -126
  47. package/lib/components/form/Form.helpers.js +1 -1
  48. package/lib/components/form/Form.js +200 -144
  49. package/lib/components/index.js +14 -6
  50. package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
  51. package/lib/components/system/SystemSecurityForm.js +69 -0
  52. package/lib/components/system/helpers.js +2 -2
  53. package/lib/components/system/spaces/SystemSpaceForm.js +44 -16
  54. package/lib/components/system/spaces/SystemTenantForm.js +15 -9
  55. package/lib/components/system/spaces/SystemTenantTable.js +15 -10
  56. package/lib/components/table/Table.js +9 -6
  57. package/lib/components/task/builder/Connector.js +21 -10
  58. package/lib/components/task/builder/ConnectorForm.js +1 -1
  59. package/lib/components/task/builder/Node.js +10 -3
  60. package/lib/components/task/builder/NodeForm.js +51 -22
  61. package/lib/components/task/builder/NodeParametersForm.js +5 -2
  62. package/lib/components/task/builder/SvgCanvas.js +13 -4
  63. package/lib/components/task/builder/TaskDefinitionConfigForm.js +113 -0
  64. package/lib/components/task/builder/TreeBuilder.js +27 -9
  65. package/lib/components/task/builder/builder.redux.js +159 -52
  66. package/lib/components/task/builder/helpers.js +5 -3
  67. package/lib/components/task/builder/models.js +84 -12
  68. package/lib/components/task/errors/RunErrorTable.js +1 -1
  69. package/lib/components/task/runs/CreateManualTriggerForm.js +15 -24
  70. package/lib/components/task/runs/RunTable.js +5 -3
  71. package/lib/components/task/workflows/WorkflowForm.js +67 -85
  72. package/lib/helpers/index.js +4 -1
  73. package/lib/index.js +1 -0
  74. package/package.json +2 -2
  75. package/proxyhelper.js +19 -6
@@ -99,24 +99,24 @@ export var I18n = /*#__PURE__*/function (_React$Component) {
99
99
  }, _this3.props.children);
100
100
  } // Otherwise wrap children in a new instance of I18nProvider with the new context
101
101
  else if (_this3.state.context) {
102
- return /*#__PURE__*/React.createElement(I18nContext.Provider, {
103
- value: {
104
- context: _this3.state.context,
105
- locale: locale,
106
- translations: translations,
107
- loadTranslations: loadTranslations
108
- }
109
- }, /*#__PURE__*/React.createElement(I18nTranslate, {
102
+ return /*#__PURE__*/React.createElement(I18nContext.Provider, {
103
+ value: {
110
104
  context: _this3.state.context,
111
105
  locale: locale,
112
106
  translations: translations,
113
- loadTranslations: loadTranslations,
114
- "public": _this3.props["public"]
115
- }, _this3.props.children));
116
- } // Otherwise return children
117
- else {
118
- return _this3.props.children;
107
+ loadTranslations: loadTranslations
119
108
  }
109
+ }, /*#__PURE__*/React.createElement(I18nTranslate, {
110
+ context: _this3.state.context,
111
+ locale: locale,
112
+ translations: translations,
113
+ loadTranslations: loadTranslations,
114
+ "public": _this3.props["public"]
115
+ }, _this3.props.children));
116
+ } // Otherwise return children
117
+ else {
118
+ return _this3.props.children;
119
+ }
120
120
  }) : null;
121
121
  }
122
122
  }]);
@@ -1,7 +1,7 @@
1
1
  import { generateForm } from '../../form/Form';
2
2
  import { fetchSecurityPolicyDefinition, createSecurityPolicyDefinition, updateSecurityPolicyDefinition, fetchSpace, fetchKapp, fetchProfile } from '../../../apis';
3
3
  import { buildBindings } from '../../../helpers';
4
- export var SPACE_SECURITY_DEFINITION_TYPES = ['Space', 'Team', 'User'];
4
+ export var SPACE_SECURITY_DEFINITION_TYPES = ['Space', 'File Resource', 'Team', 'User'];
5
5
  export var KAPP_SECURITY_DEFINITION_TYPES = ['Kapp', 'Form', 'Submission'];
6
6
  var SPACE_INCLUDES = 'datastoreFormAttributeDefinitions,spaceAttributeDefinitions,teamAttributeDefinitions,userAttributeDefinitions,userProfileAttributeDefinitions';
7
7
  var KAPP_INCLUDES = 'formAttributeDefinitions,kappAttributeDefinitions,fields';
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import { get, Map } from 'immutable';
3
+ import { fromJS, get, Map } from 'immutable';
4
4
  import t from 'prop-types';
5
5
  import { generateForm } from '../../form/Form';
6
6
  import { updateSpace, fetchSpace, fetchAttributeDefinitions, fetchLocales, fetchTimezones, fetchSecurityPolicyDefinitions } from '../../../apis';
@@ -12,7 +12,7 @@ var dataSources = function dataSources() {
12
12
  space: {
13
13
  fn: fetchSpace,
14
14
  params: [{
15
- include: 'attributesMap,securityPolicies,details'
15
+ include: 'allowedIps,attributesMap,securityPolicies,details'
16
16
  }],
17
17
  transform: function transform(result) {
18
18
  return result.space;
@@ -117,22 +117,22 @@ var securityEndpoints = {
117
117
  defaultFormDisplay: {
118
118
  endpoint: 'Default Form Display',
119
119
  label: 'Default Form Display',
120
- types: ['Space', 'Form']
120
+ types: ['Form']
121
121
  },
122
122
  defaultFormModification: {
123
123
  endpoint: 'Default Form Modification',
124
124
  label: 'Default Form Modification',
125
- types: ['Space', 'Form']
125
+ types: ['Form']
126
126
  },
127
127
  defaultSubmissionAccess: {
128
128
  endpoint: 'Default Submission Access',
129
129
  label: 'Default Submission Access',
130
- types: ['Space', 'Form', 'Submission']
130
+ types: ['Form', 'Submission']
131
131
  },
132
132
  defaultSubmissionModification: {
133
133
  endpoint: 'Default Submission Modification',
134
134
  label: 'Default Submission Modification',
135
- types: ['Space', 'Form', 'Submission']
135
+ types: ['Form', 'Submission']
136
136
  }
137
137
  };
138
138
 
@@ -446,13 +446,42 @@ var fields = function fields() {
446
446
  });
447
447
  },
448
448
  initialValue: get(space, 'securityPolicies')
449
+ }, {
450
+ name: 'allowedIps',
451
+ label: 'Allowed IPs',
452
+ type: 'select',
453
+ options: function options() {
454
+ return fromJS([{
455
+ name: 'description',
456
+ label: 'Description',
457
+ type: 'text'
458
+ }, {
459
+ name: 'value',
460
+ label: 'IP Range',
461
+ type: 'text'
462
+ }]);
463
+ },
464
+ visible: function visible(_ref34) {
465
+ var values = _ref34.values;
466
+ return values.get('allowedIpsEnabled', false);
467
+ },
468
+ initialValue: get(space, 'allowedIps', []),
469
+ serialize: function serialize(_ref35) {
470
+ var values = _ref35.values;
471
+ return values.get('allowedIpsEnabled', false) ? values.get('allowedIps') : [];
472
+ }
473
+ }, {
474
+ name: 'allowedIpsEnabled',
475
+ label: 'Enabled Allowed IP Restrictions?',
476
+ type: 'checkbox',
477
+ initialValue: get(space, 'allowedIpsEnabled', false) || false
449
478
  }, {
450
479
  name: 'attributesMap',
451
480
  label: 'Attributes',
452
481
  type: 'attributes',
453
482
  required: false,
454
- options: function options(_ref34) {
455
- var attributeDefinitions = _ref34.attributeDefinitions;
483
+ options: function options(_ref36) {
484
+ var attributeDefinitions = _ref36.attributeDefinitions;
456
485
  return attributeDefinitions;
457
486
  },
458
487
  initialValue: get(space, 'attributesMap')
@@ -165,7 +165,7 @@ var orderVisibleFn = function orderVisibleFn(partIndex) {
165
165
  };
166
166
  };
167
167
 
168
- var availableOptions = function availableOptions(partType, partIndex) {
168
+ export var availableOptions = function availableOptions(partType, partIndex) {
169
169
  return function (bindings) {
170
170
  var values = bindings.values,
171
171
  indexDefinitions = bindings.indexDefinitions;
@@ -354,7 +354,7 @@ export var filters = function filters() {
354
354
  label: 'DESC',
355
355
  value: 'DESC'
356
356
  }],
357
- initialValue: 'ASC',
357
+ initialValue: 'DESC',
358
358
  required: true
359
359
  }], _toConsumableArray(Range(0, MAX_PART_LENGTH).flatMap(function (i) {
360
360
  return [{
@@ -369,15 +369,7 @@ export var filters = function filters() {
369
369
  options: availableOptions('orderBy', i),
370
370
  visible: orderVisibleFn(i)
371
371
  }];
372
- }).toArray()), [// {
373
- // name: 'timeline',
374
- // transient: true,
375
- // type: 'select',
376
- // options: TIMELINES.map(t => Map({ label: t, value: t })),
377
- // visible: ({ values }) => values.get('timeline') !== '',
378
- // enabled: ({ values }) => !TIMELINES.includes(values.get('range-part')),
379
- // },
380
- {
372
+ }).toArray()), [{
381
373
  name: 'query',
382
374
  type: null,
383
375
  serialize: serializeQuery
@@ -16,6 +16,8 @@ var dataSource = function dataSource(_ref) {
16
16
  return searchSubmissions(options);
17
17
  },
18
18
  params: function params(paramData) {
19
+ var q = paramData.filters.getIn(['query', 'q']) || undefined;
20
+ var orderBy = paramData.filters.getIn(['query', 'orderBy']) || 'createdAt';
19
21
  return [{
20
22
  form: formSlug,
21
23
  kapp: kappSlug,
@@ -24,8 +26,8 @@ var dataSource = function dataSource(_ref) {
24
26
  include: Set([].concat(_toConsumableArray(typeof include === 'string' ? include.split(',') : Array.isArray(include) ? include : []), ['details'])).toJS(),
25
27
  // need to pass undefined instead of null so the `q` parameter is not
26
28
  // added to the query string with empty value
27
- q: paramData.filters.getIn(['query', 'q']) || undefined,
28
- orderBy: paramData.filters.getIn(['query', 'orderBy']) || paramData.filters.getIn(['query', 'q']) ? undefined : 'updatedAt'
29
+ q: q,
30
+ orderBy: orderBy
29
31
  }, generatePaginationParams(paramData)),
30
32
  count: count ? true : undefined
31
33
  }];
@@ -0,0 +1,124 @@
1
+ import { List, getIn } from 'immutable';
2
+ import { fetchSubmission, updateSubmission } from '../../../apis';
3
+ import { generateForm } from '../../form/Form';
4
+ import moment from 'moment';
5
+
6
+ var dataSources = function dataSources(_ref) {
7
+ var submissionId = _ref.submissionId;
8
+ return {
9
+ submission: {
10
+ fn: fetchSubmission,
11
+ params: [{
12
+ id: submissionId,
13
+ include: 'details,values,form,form.fields,form.fields.details,form.pages'
14
+ }],
15
+ transform: function transform(result) {
16
+ return result.submission;
17
+ }
18
+ }
19
+ };
20
+ };
21
+
22
+ var handleSubmit = function handleSubmit(_ref2) {
23
+ var id = _ref2.submissionId;
24
+ return function (values) {
25
+ return updateSubmission({
26
+ id: id,
27
+ values: values.toJS()
28
+ }).then(function (_ref3) {
29
+ var submission = _ref3.submission,
30
+ error = _ref3.error;
31
+
32
+ if (error) {
33
+ throw error.statusCode === 400 && error.message || 'There was an error saving the submission';
34
+ }
35
+
36
+ return submission;
37
+ });
38
+ };
39
+ };
40
+
41
+ var traverseElement = function traverseElement(traverse, iteratee, acc) {
42
+ var element = traverse.get(0);
43
+ var elements = traverse.shift();
44
+ var childElements = element.get('elements', List());
45
+ var result = iteratee(element, acc); // If the current element has child elements make a recursive call.
46
+
47
+ if (childElements.size > 0) {
48
+ result = traverseElement(childElements, iteratee, result);
49
+ }
50
+
51
+ if (elements.size > 0) {
52
+ return traverseElement(elements, iteratee, result);
53
+ }
54
+
55
+ return result;
56
+ };
57
+
58
+ var convertRenderType = function convertRenderType(element) {
59
+ if (element.get('renderType') === 'dropdown') {
60
+ return element.get('choicesResourceName') ? 'text' : 'select';
61
+ } else if (element.get('renderType') === 'checkbox') {
62
+ return 'text-multi';
63
+ } else if (element.get('renderType') === 'attachment') {
64
+ return 'text';
65
+ }
66
+
67
+ return element.get('renderType');
68
+ };
69
+
70
+ var getInitialValue = function getInitialValue(submission, element, type) {
71
+ var name = element.get('name');
72
+ var isAttachment = element.get('renderType') === 'attachment';
73
+ var value = getIn(submission, ['values', name], element.get('renderType') === 'checkbox' ? List() : '') || '';
74
+ return isAttachment ? JSON.stringify(List.isList(value) ? value.toJS() : value) : type === 'datetime' ? moment(value).format('yyyy-MM-DDThh:mm') : type === 'date' ? moment(value).format('yyyy-MM-DD') : value;
75
+ };
76
+
77
+ var serializer = function serializer(element, type) {
78
+ return function (_ref4) {
79
+ var values = _ref4.values;
80
+ var name = element.get('name');
81
+ return type === 'datetime' ? moment(values.get(name)).format() : values.get(name);
82
+ };
83
+ }; // If the element uses bridged options then the `choices` value represents the
84
+ // label/value mapping from and not actual choices.
85
+
86
+
87
+ var getChoices = function getChoices(element) {
88
+ return !!element.get('choicesResourceName') ? List() : element.get('choices');
89
+ };
90
+
91
+ var fields = function fields() {
92
+ return function (_ref5) {
93
+ var submission = _ref5.submission;
94
+
95
+ if (submission) {
96
+ var pages = submission.getIn(['form', 'pages'], List());
97
+ var values = traverseElement(pages, function (element, values) {
98
+ var name = element.get('name');
99
+ var type = convertRenderType(element);
100
+ var initialValue = getInitialValue(submission, element, type);
101
+ var isAttachment = element.get('renderType') === 'attachment';
102
+ return element.get('type') === 'field' ? values.push({
103
+ name: name,
104
+ label: name,
105
+ type: type,
106
+ options: getChoices(element, initialValue),
107
+ initialValue: initialValue,
108
+ enabled: !isAttachment,
109
+ "transient": isAttachment,
110
+ serialize: serializer(element, type)
111
+ }) : values;
112
+ }, List());
113
+ return values.toJS();
114
+ }
115
+ };
116
+ };
117
+
118
+ export var SubmissionForm = generateForm({
119
+ formOptions: ['submissionId'],
120
+ dataSources: dataSources,
121
+ fields: fields,
122
+ handleSubmit: handleSubmit
123
+ });
124
+ SubmissionForm.displayName = 'SubmissionForm';
@@ -67,13 +67,13 @@ export var availableParts = function availableParts(values, indexes, equalityFie
67
67
  var rangeRemaining = remainingParts.filter(function (index) {
68
68
  return index && index.size === 1;
69
69
  });
70
- return rangeRemaining.concat(rangePart && rangeRemaining.size === 0 && values.get('orderby0-part') && values.get('orderby0-part') !== rangePart ? List() : timelinesAvailable);
70
+ return rangeRemaining.concat(rangePart && rangeRemaining.size === 0 && values.get('orderby0-part') && values.get('orderby0-part') !== rangePart ? List([]) : timelinesAvailable || List([]));
71
71
  } else if (partType === 'orderBy') {
72
72
  return (rangePart ? List([rangePart]) : remainingParts.filter(function (index) {
73
73
  return index && index.size > 0;
74
74
  }).map(function (index) {
75
75
  return index.first();
76
- })).concat(TIMELINES.includes(rangePart) ? List([rangePart]) : timelinesAvailable).toSet().toList();
76
+ })).concat(TIMELINES.includes(rangePart) ? List([rangePart]) : anyAtLast ? fromJS(TIMELINES) : equalityFields.size === 0 ? fromJS(TIMELINES) : List()).toSet().toList();
77
77
  } else {
78
78
  return remainingParts.filterNot(function (index) {
79
79
  return !index || index.size === 0;
@@ -2,8 +2,8 @@ import { get, List, Map } from 'immutable';
2
2
  import { generateForm } from '../../form/Form';
3
3
  import { createUser, fetchAttributeDefinitions, fetchUser, updateUser, fetchLocales, fetchTimezones } from '../../../apis';
4
4
  import { handleFormErrors } from '../../form/Form.helpers';
5
- var USER_INCLUDES = 'attributesMap,authorization,memberships,profileAttributesMap';
6
- var EMAIL_REGEX = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
5
+ var USER_INCLUDES = 'details,attributesMap,authorization,memberships,profileAttributesMap';
6
+ var EMAIL_REGEX = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i;
7
7
 
8
8
  var dataSources = function dataSources(_ref) {
9
9
  var username = _ref.username,