@kineticdata/react 6.0.4 → 6.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +116 -86
  2. package/lib/apis/core/attributeDefinitions.js +9 -6
  3. package/lib/apis/core/integrations.js +61 -0
  4. package/lib/apis/core/submissions.js +52 -15
  5. package/lib/apis/http.js +16 -2
  6. package/lib/apis/index.js +24 -0
  7. package/lib/apis/integrator/index.js +262 -0
  8. package/lib/apis/system/index.js +64 -12
  9. package/lib/apis/task/index.js +9 -2
  10. package/lib/components/agent/filestore/FilestoreForm.js +1 -1
  11. package/lib/components/common/AttributeSelect.js +10 -2
  12. package/lib/components/common/BridgeSelect.js +2 -1
  13. package/lib/components/common/ConnectionSelect.js +72 -0
  14. package/lib/components/common/FormSelect.js +2 -1
  15. package/lib/components/common/StaticSelect.js +15 -6
  16. package/lib/components/common/TableInput.js +4 -1
  17. package/lib/components/common/TeamSelect.js +2 -1
  18. package/lib/components/common/ToastContainer.js +34 -10
  19. package/lib/components/common/Typeahead.js +59 -23
  20. package/lib/components/common/UserSelect.js +2 -1
  21. package/lib/components/common/authentication/RequestInterceptor.js +1 -1
  22. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +3 -0
  23. package/lib/components/core/bridge_model/BridgeModelTable.js +19 -0
  24. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +6 -9
  25. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +0 -4
  26. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +7 -10
  27. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +2 -15
  28. package/lib/components/core/category/CategoryForm.js +4 -1
  29. package/lib/components/core/category/CategoryTable.js +2 -2
  30. package/lib/components/core/core_form/CoreForm.js +18 -10
  31. package/lib/components/core/file_resource/FileResourceForm.js +2 -1
  32. package/lib/components/core/file_resource/FileResourceTable.js +14 -7
  33. package/lib/components/core/form/FormForm.js +42 -19
  34. package/lib/components/core/form/FormTable.js +14 -14
  35. package/lib/components/core/form_type/FormTypeForm.js +3 -0
  36. package/lib/components/core/i18n/Moment.js +1 -0
  37. package/lib/components/core/integration/IntegrationForm.js +232 -0
  38. package/lib/components/core/integration/IntegrationTable.js +139 -0
  39. package/lib/components/core/kapp/KappForm.js +56 -67
  40. package/lib/components/core/kapp/KappTable.js +3 -3
  41. package/lib/components/core/log/LogTable.js +1 -1
  42. package/lib/components/core/security_definition/SecurityDefinitionForm.js +48 -10
  43. package/lib/components/core/space/SpaceForm.js +97 -111
  44. package/lib/components/core/submission/DatastoreSubmissionTable.js +4 -4
  45. package/lib/components/core/submission/FormSubmissionTable.js +12 -7
  46. package/lib/components/core/submission/KappSubmissionTable.js +4 -4
  47. package/lib/components/core/submission/SubmissionForm.js +3 -1
  48. package/lib/components/core/team/TeamTable.js +17 -7
  49. package/lib/components/core/user/UserTable.js +18 -18
  50. package/lib/components/core/webapi/WebApiForm.js +5 -2
  51. package/lib/components/core/webapi/WebApiTable.js +2 -2
  52. package/lib/components/core/webhook/WebhookForm.js +43 -33
  53. package/lib/components/core/webhook/WebhookTable.js +16 -16
  54. package/lib/components/core/webhook_job/WebhookJobTable.js +17 -6
  55. package/lib/components/form/Form.helpers.js +10 -4
  56. package/lib/components/form/Form.js +250 -168
  57. package/lib/components/form/Form.models.js +6 -1
  58. package/lib/components/form/FormState.js +9 -5
  59. package/lib/components/form/defaults/CodeField.js +44 -1
  60. package/lib/components/index.js +84 -3
  61. package/lib/components/integrator/connection/ConnectionForm.js +112 -0
  62. package/lib/components/integrator/connection/ConnectionTable.js +80 -0
  63. package/lib/components/integrator/connection/config_fields/http.js +570 -0
  64. package/lib/components/integrator/integrationTypes.js +98 -0
  65. package/lib/components/integrator/operation/OperationForm.js +128 -0
  66. package/lib/components/integrator/operation/OperationTable.js +64 -0
  67. package/lib/components/integrator/operation/config_fields/http.js +184 -0
  68. package/lib/components/system/SystemSecurityForm.js +1 -1
  69. package/lib/components/system/SystemTaskAdapterForm.js +9 -9
  70. package/lib/components/system/helpers.js +123 -100
  71. package/lib/components/system/spaces/SystemSpaceForm.js +9 -37
  72. package/lib/components/system/spaces/SystemTenantForm.js +276 -104
  73. package/lib/components/system/spaces/SystemTenantMigrateForm.js +449 -0
  74. package/lib/components/system/spaces/SystemTenantTable.js +20 -16
  75. package/lib/components/table/Table.redux.js +1 -1
  76. package/lib/components/task/builder/ConnectorForm.js +11 -7
  77. package/lib/components/task/builder/Node.js +11 -2
  78. package/lib/components/task/builder/NodeForm.js +93 -22
  79. package/lib/components/task/builder/NodeParametersForm.js +29 -17
  80. package/lib/components/task/builder/TaskDefinitionConfigForm.js +18 -50
  81. package/lib/components/task/builder/TreeBuilder.js +32 -5
  82. package/lib/components/task/builder/builder.redux.js +399 -205
  83. package/lib/components/task/builder/constants.js +10 -2
  84. package/lib/components/task/builder/helpers.js +199 -79
  85. package/lib/components/task/builder/models.js +11 -9
  86. package/lib/components/task/category/TaskCategoryTable.js +3 -3
  87. package/lib/components/task/common/UsageTable.js +1 -1
  88. package/lib/components/task/handlers/HandlerTable.js +35 -19
  89. package/lib/components/task/policy_rule/PolicyRuleTable.js +3 -3
  90. package/lib/components/task/runs/CreateManualTriggerForm.js +2 -0
  91. package/lib/components/task/runs/RunTable.js +4 -4
  92. package/lib/components/task/runs/RunTaskTable.js +1 -1
  93. package/lib/components/task/sources/SourceTable.js +2 -2
  94. package/lib/components/task/triggers/TriggerTable.js +2 -2
  95. package/lib/components/task/workflows/LinkedWorkflowTable.js +2 -2
  96. package/lib/components/task/workflows/WorkflowForm.js +29 -9
  97. package/lib/components/task/workflows/WorkflowTable.js +2 -2
  98. package/lib/helpers/index.js +289 -72
  99. package/package.json +5 -3
  100. package/proxyhelper.js +28 -3
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.showToast = exports.hideToast = exports.clearToasts = exports.ToastState = exports.ToastContainer = void 0;
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _store = require("../../store");
@@ -51,22 +52,40 @@ var ToastState = exports.ToastState = (0, _immutable.Record)({
51
52
  }
52
53
  });
53
54
 
54
- // Adds toast to state and shows it after 100ms delay to trigger animation
55
- var showToast = exports.showToast = function showToast(toast) {
55
+ /**
56
+ * @param {object} toast Options for the toast
57
+ * @param {'success'|'error'} [presetType] Preset for styles
58
+ */
59
+ var showToast = exports.showToast = function showToast(toast, presetType) {
60
+ // If presetType is provided, add some default toast properties
61
+ if (presetType) return showToast((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, presetType === 'success' ? {
62
+ color: 'success',
63
+ icon: 'check-circle'
64
+ } : presetType === 'error' ? {
65
+ color: 'danger',
66
+ icon: 'alert-circle'
67
+ } : {}), toast));
56
68
  var toastKey = (0, _react2.generateKey)();
57
- (0, _store.dispatch)('ADD_TOAST', {
69
+ var payload = {
58
70
  containerKey: toast.containerKey,
59
71
  toast: ToastState(toast).update(
60
72
  // Make sure duration is a number, or set to a default numeric value
61
73
  'duration', function (duration) {
62
- return typeof duration === 'number' ? Math.max(duration, 4000) : toast.content ? 7000 : 4000;
74
+ return typeof duration === 'number' ? Math.max(duration, 4000) : toast.title && toast.content ? 7000 : 4000;
63
75
  }),
64
76
  toastKey: toastKey,
65
77
  show: false
66
- });
78
+ };
79
+ // Use set timeout so that if we're redirecting and showing a toast, the
80
+ // toast is added second so that it's not immediately cleared by the redirect
67
81
  setTimeout(function () {
68
- (0, _store.dispatch)('SHOW_TOAST', toastKey);
69
- }, 100);
82
+ (0, _store.dispatch)('ADD_TOAST', payload);
83
+ // Use set timeout to delay showing the toast by 100ms so that it renders
84
+ // into the dom before being shown so it animates correctly
85
+ setTimeout(function () {
86
+ (0, _store.dispatch)('SHOW_TOAST', toastKey);
87
+ }, 100);
88
+ }, 0);
70
89
  return toastKey;
71
90
  };
72
91
 
@@ -103,13 +122,18 @@ var ToastWrapper = function ToastWrapper(_ref) {
103
122
  }), content);
104
123
  };
105
124
  var ToastContainerComponent = function ToastContainerComponent(_ref2) {
106
- var components = _ref2.components,
125
+ var containerKey = _ref2.containerKey,
126
+ components = _ref2.components,
107
127
  toasts = _ref2.toasts,
108
128
  persistentToasts = _ref2.persistentToasts;
109
129
  (0, _react.useEffect)(function () {
110
130
  (0, _store.dispatch)('INIT_TOASTS');
111
- return function () {};
112
- }, []);
131
+ return function () {
132
+ if (containerKey) {
133
+ (0, _store.dispatch)('CLEAR_TOASTS', containerKey);
134
+ }
135
+ };
136
+ }, [containerKey]);
113
137
  return /*#__PURE__*/_react["default"].createElement(_ComponentConfigContext.ComponentConfigContext.Consumer, null, function (componentConfig) {
114
138
  var component = (0, _immutable.get)(components, 'Toast', componentConfig.get('Toast'));
115
139
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.Typeahead = void 0;
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
11
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
12
13
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
@@ -64,6 +65,7 @@ var Typeahead = exports.Typeahead = /*#__PURE__*/function (_React$Component) {
64
65
  error = _ref2.error,
65
66
  nextPageToken = _ref2.nextPageToken;
66
67
  if (searchedValue === _this.state.searchValue) {
68
+ var _this$props$action;
67
69
  // when multiple mode is enabled we don't want to allow the same
68
70
  // suggestion to be selected twice, we compare existing selections to
69
71
  // suggestions using the getSuggestionValue function that returns a string
@@ -81,11 +83,17 @@ var Typeahead = exports.Typeahead = /*#__PURE__*/function (_React$Component) {
81
83
  filtered.filter(function (suggestion) {
82
84
  return _this.props.getSuggestionValue(suggestion) === _this.state.searchValue;
83
85
  }).length === 0 && (0, _immutable.fromJS)(_this.props.custom(_this.state.searchValue));
86
+
87
+ // If an action object was provided, create a suggestion that will be
88
+ // used to trigger this action
89
+ var actionSuggestion = typeof ((_this$props$action = _this.props.action) === null || _this$props$action === void 0 ? void 0 : _this$props$action.fn) === 'function' && (0, _immutable.fromJS)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, _this.props.action), {}, {
90
+ __isAction: true
91
+ }));
84
92
  _this.setState({
85
93
  result: {
86
94
  error: error,
87
95
  nextPageToken: nextPageToken,
88
- suggestions: customSuggestion ? [].concat((0, _toConsumableArray2["default"])(filtered), [customSuggestion]) : filtered,
96
+ suggestions: [].concat((0, _toConsumableArray2["default"])(filtered), [customSuggestion, actionSuggestion]).filter(Boolean),
89
97
  customSuggestion: customSuggestion
90
98
  }
91
99
  });
@@ -109,7 +117,7 @@ var Typeahead = exports.Typeahead = /*#__PURE__*/function (_React$Component) {
109
117
  editing: true,
110
118
  searchValue: searchValue
111
119
  });
112
- } else if (!_this.props.multiple) {
120
+ } else if (!_this.props.multiple && !!searchValue) {
113
121
  _this.setState({
114
122
  refocus: true
115
123
  });
@@ -145,7 +153,13 @@ var Typeahead = exports.Typeahead = /*#__PURE__*/function (_React$Component) {
145
153
  searchValue: ''
146
154
  } : initialState);
147
155
  }
148
- _this.props.onChange(_this.props.multiple ? _this.props.value.push(suggestion) : suggestion);
156
+ // If this is an action suggestion, trigger the action and skip triggering
157
+ // the on change event
158
+ if (suggestion.get('__isAction')) {
159
+ suggestion.get('fn')();
160
+ } else {
161
+ _this.props.onChange(_this.props.multiple ? _this.props.value.push(suggestion) : suggestion);
162
+ }
149
163
  };
150
164
  _this.state = initialState;
151
165
  _this.autosuggest = /*#__PURE__*/(0, _react.createRef)();
@@ -240,6 +254,7 @@ function renderSuggestionsContainer(_ref5) {
240
254
  var containerProps = _ref5.containerProps,
241
255
  children = _ref5.children;
242
256
  var _this$props2 = this.props,
257
+ action = _this$props2.action,
243
258
  _this$props2$componen = _this$props2.components,
244
259
  _this$props2$componen2 = _this$props2$componen.Status,
245
260
  Status = _this$props2$componen2 === void 0 ? StatusDefault : _this$props2$componen2,
@@ -258,11 +273,14 @@ function renderSuggestionsContainer(_ref5) {
258
273
  setSearchField: setSearchField,
259
274
  error: state.result && state.result.error,
260
275
  value: state.searchValue,
261
- empty: state.result && state.result.suggestions.length === 0,
276
+ empty: state.result && !state.result.suggestions.some(function (suggestion) {
277
+ return !suggestion.get('__isAction');
278
+ }),
262
279
  more: state.result && !!state.result.nextPageToken,
263
280
  "short": minSearchLength && state.searchValue.length < minSearchLength,
264
281
  pending: !state.result,
265
- custom: !!custom
282
+ custom: !!custom,
283
+ action: !!action
266
284
  })), children);
267
285
  }
268
286
 
@@ -270,24 +288,38 @@ function renderSuggestionsContainer(_ref5) {
270
288
  function renderSuggestion(suggestion, _ref6) {
271
289
  var isHighlighted = _ref6.isHighlighted;
272
290
  var _this$props3 = this.props,
273
- _this$props3$componen = _this$props3.components.Suggestion,
274
- Suggestion = _this$props3$componen === void 0 ? SuggestionDefault : _this$props3$componen,
291
+ _this$props3$componen = _this$props3.components,
292
+ _this$props3$componen2 = _this$props3$componen.Suggestion,
293
+ Suggestion = _this$props3$componen2 === void 0 ? SuggestionDefault : _this$props3$componen2,
294
+ _this$props3$componen3 = _this$props3$componen.SuggestionAction,
295
+ SuggestionAction = _this$props3$componen3 === void 0 ? SuggestionDefault : _this$props3$componen3,
275
296
  getSuggestionValue = _this$props3.getSuggestionValue;
276
297
  var custom = this.state.result && this.state.result.customSuggestion === suggestion;
277
- return /*#__PURE__*/_react["default"].createElement(Suggestion, {
298
+ var action = !!suggestion.get('__isAction');
299
+ return !action ? /*#__PURE__*/_react["default"].createElement(Suggestion, {
278
300
  active: isHighlighted,
279
301
  custom: custom,
280
302
  suggestion: suggestion,
281
303
  suggestionValue: getSuggestionValue(suggestion)
282
- });
304
+ }) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("hr", null), /*#__PURE__*/_react["default"].createElement(SuggestionAction, {
305
+ active: isHighlighted,
306
+ custom: custom,
307
+ suggestion: suggestion,
308
+ suggestionValue: suggestion.get('label')
309
+ }));
283
310
  }
284
311
 
285
312
  // https://github.com/moroshko/react-autosuggest#renderinputcomponent-optional
286
313
  function renderInputComponent(inputProps) {
287
- var _this$props$component2 = this.props.components.Input,
288
- Input = _this$props$component2 === void 0 ? TypeaheadInputDefault : _this$props$component2;
314
+ var _this$props4 = this.props,
315
+ _this$props4$componen = _this$props4.components.Input,
316
+ Input = _this$props4$componen === void 0 ? TypeaheadInputDefault : _this$props4$componen,
317
+ invalid = _this$props4.invalid,
318
+ minSearchLength = _this$props4.minSearchLength;
289
319
  return /*#__PURE__*/_react["default"].createElement(Input, {
290
- inputProps: inputProps
320
+ inputProps: inputProps,
321
+ invalid: invalid,
322
+ minSearchLength: minSearchLength
291
323
  });
292
324
  }
293
325
 
@@ -296,16 +328,18 @@ function renderInputComponent(inputProps) {
296
328
  function renderSelections() {
297
329
  var edit = this.edit,
298
330
  focusRef = this.focusRef,
299
- _this$props4 = this.props,
300
- _this$props4$componen = _this$props4.components.Selection,
301
- Selection = _this$props4$componen === void 0 ? SelectionDefault : _this$props4$componen,
302
- disabled = _this$props4.disabled,
303
- getSuggestionValue = _this$props4.getSuggestionValue,
304
- multiple = _this$props4.multiple,
305
- value = _this$props4.value,
306
- placeholder = _this$props4.placeholder,
307
- id = _this$props4.id,
308
- form = _this$props4.form,
331
+ _this$props5 = this.props,
332
+ _this$props5$componen = _this$props5.components.Selection,
333
+ Selection = _this$props5$componen === void 0 ? SelectionDefault : _this$props5$componen,
334
+ disabled = _this$props5.disabled,
335
+ getSuggestionValue = _this$props5.getSuggestionValue,
336
+ multiple = _this$props5.multiple,
337
+ value = _this$props5.value,
338
+ placeholder = _this$props5.placeholder,
339
+ id = _this$props5.id,
340
+ form = _this$props5.form,
341
+ invalid = _this$props5.invalid,
342
+ minSearchLength = _this$props5.minSearchLength,
309
343
  remove = this.remove;
310
344
  return (multiple ? value : _immutable.List.of(value)).map(function (selection, i) {
311
345
  var suggestionValue = getSuggestionValue(selection);
@@ -319,7 +353,9 @@ function renderSelections() {
319
353
  suggestionValue: suggestionValue,
320
354
  placeholder: !multiple ? placeholder : null,
321
355
  id: !multiple ? id : null,
322
- form: form
356
+ invalid: invalid,
357
+ form: form,
358
+ minSearchLength: minSearchLength
323
359
  });
324
360
  });
325
361
  }
@@ -112,6 +112,7 @@ var UserSelect = exports.UserSelect = function UserSelect(props) {
112
112
  onBlur: props.onBlur,
113
113
  placeholder: props.placeholder,
114
114
  id: props.id,
115
- form: props.form
115
+ form: props.form,
116
+ invalid: props.invalid
116
117
  });
117
118
  };
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
10
- var tokenEndpointPattern = /\/app\/(loghub|system-coordinator)\/(refresh|components|api\/v\d)/;
10
+ var tokenEndpointPattern = /\/app\/(loghub|system-coordinator|integrator)\/(refresh|components|api)/;
11
11
  var RequestInterceptor = exports["default"] = /*#__PURE__*/function () {
12
12
  function RequestInterceptor(store) {
13
13
  (0, _classCallCheck2["default"])(this, RequestInterceptor);
@@ -23,6 +23,9 @@ var dataSources = function dataSources(_ref) {
23
23
  }],
24
24
  transform: function transform(result) {
25
25
  return result.attributeDefinition;
26
+ },
27
+ errorTransform: function errorTransform(result) {
28
+ return result.error;
26
29
  }
27
30
  }
28
31
  };
@@ -56,6 +56,25 @@ var columns = [{
56
56
  title: 'Status',
57
57
  sortable: true,
58
58
  toggleable: true
59
+ }, {
60
+ value: 'createdAt',
61
+ title: 'Created At',
62
+ sortable: true,
63
+ toggleable: true
64
+ }, {
65
+ value: 'createdBy',
66
+ title: 'Created By',
67
+ toggleable: true
68
+ }, {
69
+ value: 'updatedAt',
70
+ title: 'Updated At',
71
+ toggleable: true,
72
+ sortable: true
73
+ }, {
74
+ value: 'updatedBy',
75
+ title: 'Updated By',
76
+ toggleable: true,
77
+ sortable: true
59
78
  }];
60
79
  var BridgeModelTable = exports.BridgeModelTable = (0, _Table.generateTable)({
61
80
  columns: columns,
@@ -87,15 +87,12 @@ var fields = function fields(_ref6) {
87
87
  language: 'js-template',
88
88
  required: true,
89
89
  initialValue: bridgeModelAttribute && bridgeModelAttribute.get('structureField') || '',
90
- options: {
91
- 'Add Field': {
92
- value: 'fields("NAME")',
93
- selection: {
94
- start: 8,
95
- end: 12
96
- }
97
- }
98
- }
90
+ options: [{
91
+ label: 'fields',
92
+ type: 'function',
93
+ quoteType: 'double',
94
+ detail: 'Add Field Mapping'
95
+ }]
99
96
  }];
100
97
  };
101
98
  };
@@ -71,9 +71,6 @@ var dataSource = function dataSource(_ref5) {
71
71
  transform: transform
72
72
  };
73
73
  };
74
-
75
- // const filters = () => () => [{ name: 'name', label: 'Name', type: 'text' }];
76
-
77
74
  var columns = [{
78
75
  value: 'name',
79
76
  title: 'Name',
@@ -85,7 +82,6 @@ var columns = [{
85
82
  }];
86
83
  var BridgeModelAttributeTable = exports.BridgeModelAttributeTable = (0, _Table.generateTable)({
87
84
  columns: columns,
88
- // filters,
89
85
  dataSource: dataSource,
90
86
  tableOptions: ['modelName']
91
87
  });
@@ -122,18 +122,15 @@ var fields = function fields(_ref6) {
122
122
  name: 'query',
123
123
  label: 'Query',
124
124
  type: 'code',
125
- language: 'js-template',
125
+ language: 'text',
126
126
  required: false,
127
127
  initialValue: bridgeModelQualificationMapping && bridgeModelQualificationMapping.get('query') || '',
128
- options: {
129
- 'Add Parameter': {
130
- value: 'parameters("NAME")',
131
- selection: {
132
- start: 12,
133
- end: 16
134
- }
135
- }
136
- }
128
+ options: [{
129
+ label: 'parameters',
130
+ type: 'function',
131
+ quoteType: 'double',
132
+ detail: 'Add Parameter'
133
+ }]
137
134
  }];
138
135
  };
139
136
  };
@@ -11,8 +11,6 @@ var _apis = require("../../../apis");
11
11
  var _helpers = require("../../../helpers");
12
12
  var clientSide = (0, _helpers.defineFilter)(true).startsWith('name', 'name').equals('resultType', 'resultType').end();
13
13
 
14
- // const resultTypes = ['Single', 'Multiple'];
15
-
16
14
  // Handles bridge model api response by checking for error and also returning
17
15
  // error if active mapping is not present. If valid returns object with the
18
16
  // attributes and their mappings.
@@ -73,31 +71,20 @@ var dataSource = function dataSource(_ref5) {
73
71
  transform: transform
74
72
  };
75
73
  };
76
-
77
- // const filters = () => () => [
78
- // { name: 'name', label: 'Name', type: 'text' },
79
- // {
80
- // name: 'resultType',
81
- // label: 'Result Type',
82
- // type: 'select',
83
- // options: resultTypes.map(el => ({ label: el, value: el })),
84
- // },
85
- // ];
86
-
87
74
  var columns = [{
88
75
  value: 'name',
89
76
  title: 'Name',
90
77
  sortable: true
91
78
  }, {
92
79
  value: 'resultType',
93
- title: 'Result Type'
80
+ title: 'Result Type',
81
+ sortable: true
94
82
  }, {
95
83
  value: 'query',
96
84
  title: 'Query'
97
85
  }];
98
86
  var BridgeModelQualificationTable = exports.BridgeModelQualificationTable = (0, _Table.generateTable)({
99
87
  columns: columns,
100
- // filters,
101
88
  dataSource: dataSource,
102
89
  tableOptions: ['modelName']
103
90
  });
@@ -22,6 +22,9 @@ var dataSources = function dataSources(_ref) {
22
22
  }],
23
23
  transform: function transform(result) {
24
24
  return result.category;
25
+ },
26
+ errorTransform: function errorTransform(result) {
27
+ return result.error;
25
28
  }
26
29
  },
27
30
  attributeDefinitions: {
@@ -77,7 +80,7 @@ var fields = function fields(_ref4) {
77
80
  name: 'slug',
78
81
  label: 'Slug',
79
82
  type: 'text',
80
- required: false,
83
+ required: true,
81
84
  initialValue: category ? category.get('slug') : '',
82
85
  onChange: function onChange(_bindings, _ref8) {
83
86
  var setValue = _ref8.setValue;
@@ -54,7 +54,7 @@ var columns = [{
54
54
  toggleable: true
55
55
  }, {
56
56
  value: 'createdAt',
57
- title: 'Created',
57
+ title: 'Created At',
58
58
  sortable: true,
59
59
  toggleable: true
60
60
  }, {
@@ -64,7 +64,7 @@ var columns = [{
64
64
  toggleable: true
65
65
  }, {
66
66
  value: 'updatedAt',
67
- title: 'Updated',
67
+ title: 'Updated At',
68
68
  sortable: true,
69
69
  toggleable: true
70
70
  }, {
@@ -13,6 +13,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inhe
13
13
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
14
14
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
16
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
16
17
  var _react = _interopRequireWildcard(require("react"));
17
18
  var _propTypes = _interopRequireDefault(require("prop-types"));
18
19
  var _lodash = _interopRequireDefault(require("lodash.isplainobject"));
@@ -28,8 +29,14 @@ var _ComponentConfigContext = require("../../common/ComponentConfigContext");
28
29
  var _defaults = require("./defaults");
29
30
  var _excluded = ["init", "poller"],
30
31
  _excluded2 = ["components"];
31
- var submissionIncludes = 'values,form,form.fields,form.attributesMap,form.kapp,form.kapp.attributesMap,form.kapp.space,form.kapp.space.attributesMap';
32
- var formIncludes = 'fields,attributesMap,kapp,kapp.attributesMap,kapp.space,kapp.space.attributesMap';
32
+ var submissionIncludes = function submissionIncludes() {
33
+ var addSubmissionIncludes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
34
+ return ['values', 'form', 'form.fields', 'form.attributesMap', 'form.kapp', 'form.kapp.attributesMap', 'form.kapp.space', 'form.kapp.space.attributesMap'].concat((0, _toConsumableArray2["default"])(addSubmissionIncludes)).join(',');
35
+ };
36
+ var formIncludes = function formIncludes() {
37
+ var addFormIncludes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
38
+ return ['fields', 'attributesMap', 'kapp', 'kapp.attributesMap', 'kapp.space', 'kapp.space.attributesMap'].concat((0, _toConsumableArray2["default"])(addFormIncludes)).join(',');
39
+ };
33
40
  var getNumericAttributeValue = function getNumericAttributeValue(form, name) {
34
41
  var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
35
42
  var kapp = form ? form.kapp : null;
@@ -82,7 +89,7 @@ var lockSubmission = exports.lockSubmission = function lockSubmission(_ref) {
82
89
  return (0, _apis.fetchSubmission)({
83
90
  id: id,
84
91
  datastore: !!datastore,
85
- include: submissionIncludes
92
+ include: submissionIncludes(options.addSubmissionIncludes)
86
93
  }).then(function (_ref2) {
87
94
  var _values;
88
95
  var submission = _ref2.submission,
@@ -109,7 +116,7 @@ var lockSubmission = exports.lockSubmission = function lockSubmission(_ref) {
109
116
  var lockTime = getNumericAttributeValue(submission.form, options.lockTimeAttribute || _defaults.LOCK_TIME_ATTRIBUTE, _defaults.LOCK_TIME_DEFAULT_VALUE);
110
117
  return (0, _apis.updateSubmission)({
111
118
  id: submission.id,
112
- include: submissionIncludes,
119
+ include: submissionIncludes(options.addSubmissionIncludes),
113
120
  values: (_values = {}, (0, _defineProperty2["default"])(_values, options.lockedByField || _defaults.LOCKED_BY_FIELD, _helpers.bundle.identity()), (0, _defineProperty2["default"])(_values, options.lockedUntilField || _defaults.LOCKED_UNTIL_FIELD, new Date(new Date().getTime() + lockTime * 1000).toISOString()), _values)
114
121
  }).then(function (response) {
115
122
  return (0, _objectSpread2["default"])({
@@ -127,7 +134,7 @@ var unlockSubmission = exports.unlockSubmission = function unlockSubmission(_ref
127
134
  return (0, _apis.fetchSubmission)({
128
135
  id: id,
129
136
  datastore: !!datastore,
130
- include: submissionIncludes
137
+ include: submissionIncludes(options.addSubmissionIncludes)
131
138
  }).then(function (_ref4) {
132
139
  var _values2;
133
140
  var submission = _ref4.submission,
@@ -160,7 +167,7 @@ var unlockSubmission = exports.unlockSubmission = function unlockSubmission(_ref
160
167
  }
161
168
  return (0, _apis.updateSubmission)({
162
169
  id: submission.id,
163
- include: submissionIncludes,
170
+ include: submissionIncludes(options.addSubmissionIncludes),
164
171
  values: (_values2 = {}, (0, _defineProperty2["default"])(_values2, options.lockedByField || _defaults.LOCKED_BY_FIELD, ''), (0, _defineProperty2["default"])(_values2, options.lockedUntilField || _defaults.LOCKED_UNTIL_FIELD, ''), _values2)
165
172
  }).then(function (response) {
166
173
  return (0, _objectSpread2["default"])({
@@ -369,7 +376,7 @@ var CoreFormComponent = exports.CoreFormComponent = /*#__PURE__*/function (_Comp
369
376
  return this.props.submission ? (0, _apis.fetchSubmission)({
370
377
  id: this.props.submission,
371
378
  datastore: !!this.props.datastore,
372
- include: submissionIncludes,
379
+ include: submissionIncludes(this.props.addSubmissionIncludes),
373
380
  "public": this.props["public"]
374
381
  }).then(function (_ref7) {
375
382
  var submission = _ref7.submission,
@@ -383,7 +390,7 @@ var CoreFormComponent = exports.CoreFormComponent = /*#__PURE__*/function (_Comp
383
390
  datastore: !!this.props.datastore,
384
391
  kappSlug: this.props.kapp,
385
392
  formSlug: this.props.form,
386
- include: formIncludes,
393
+ include: formIncludes(this.props.addFormIncludes),
387
394
  "public": this.props["public"]
388
395
  }).then(function (_ref8) {
389
396
  var form = _ref8.form,
@@ -401,7 +408,7 @@ var CoreFormComponent = exports.CoreFormComponent = /*#__PURE__*/function (_Comp
401
408
  return this.props.submission ? (0, _apis.fetchSubmission)({
402
409
  id: this.props.submission,
403
410
  datastore: !!this.props.datastore,
404
- include: submissionIncludes
411
+ include: submissionIncludes(this.props.addSubmissionIncludes)
405
412
  }).then(function (_ref9) {
406
413
  var submission = _ref9.submission,
407
414
  error = _ref9.error;
@@ -700,7 +707,8 @@ var CoreFormComponent = exports.CoreFormComponent = /*#__PURE__*/function (_Comp
700
707
  actions: actions,
701
708
  lockMessage: lockMessage,
702
709
  reviewPaginationControl: reviewPaginationControl,
703
- lock: init ? lockProps : undefined
710
+ lock: init ? lockProps : undefined,
711
+ renderProps: this.props.renderProps
704
712
  }) : content;
705
713
  }
706
714
  }]);
@@ -139,7 +139,8 @@ var fields = function fields(_ref4) {
139
139
  }).map(function (definition) {
140
140
  return (0, _immutable.Map)({
141
141
  value: definition.get('name'),
142
- label: definition.get('name')
142
+ label: definition.get('name'),
143
+ type: definition.get('type')
143
144
  });
144
145
  }) : [];
145
146
  },
@@ -40,29 +40,36 @@ var dataSource = function dataSource() {
40
40
  var columns = [{
41
41
  value: 'slug',
42
42
  title: 'Slug',
43
- sortable: true
43
+ sortable: true,
44
+ toggleable: false
44
45
  }, {
45
46
  value: 'agentSlug',
46
47
  title: 'Agent Slug',
47
- sortable: true
48
+ sortable: true,
49
+ toggleable: true
48
50
  }, {
49
51
  value: 'filestoreSlug',
50
- title: 'File Store Slug',
51
- sortable: true
52
+ title: 'Filestore Slug',
53
+ sortable: true,
54
+ toggleable: true
52
55
  }, {
53
56
  value: 'createdAt',
54
- title: 'Created',
55
- sortable: true
57
+ title: 'Created At',
58
+ sortable: true,
59
+ toggleable: true
56
60
  }, {
57
61
  value: 'createdBy',
58
- title: 'Created By'
62
+ title: 'Created By',
63
+ toggleable: true
59
64
  }, {
60
65
  value: 'updatedAt',
61
66
  title: 'Updated At',
67
+ toggleable: true,
62
68
  sortable: true
63
69
  }, {
64
70
  value: 'updatedBy',
65
71
  title: 'Updated By',
72
+ toggleable: true,
66
73
  sortable: true
67
74
  }];
68
75
  var FileResourceTable = exports.FileResourceTable = (0, _Table.generateTable)({