@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.
Files changed (88) hide show
  1. package/lib/apis/core/attributeDefinitions.js +3 -2
  2. package/lib/apis/core/authentication.js +13 -5
  3. package/lib/apis/core/backgroundJobs.js +22 -39
  4. package/lib/apis/core/fileResources.js +36 -0
  5. package/lib/apis/core/filestores.js +40 -0
  6. package/lib/apis/core/forms.js +21 -36
  7. package/lib/apis/core/forms.test.js +51 -278
  8. package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
  9. package/lib/apis/core/submissions.js +46 -30
  10. package/lib/apis/core/webhooks.js +1 -2
  11. package/lib/apis/discussions/index.js +2 -1
  12. package/lib/apis/http.js +28 -13
  13. package/lib/apis/http.test.js +13 -15
  14. package/lib/apis/index.js +2 -0
  15. package/lib/apis/system/index.js +86 -1
  16. package/lib/apis/task/index.js +22 -14
  17. package/lib/components/agent/filestore/FilestoreForm.js +132 -0
  18. package/lib/components/agent/filestore/FilestoreTable.js +53 -0
  19. package/lib/components/common/BridgeSelect.js +2 -1
  20. package/lib/components/common/FormSelect.js +2 -1
  21. package/lib/components/common/Scroller.js +6 -6
  22. package/lib/components/common/TableInput.js +74 -29
  23. package/lib/components/common/TeamSelect.js +2 -1
  24. package/lib/components/common/Typeahead.js +7 -4
  25. package/lib/components/common/UserSelect.js +2 -1
  26. package/lib/components/common/authentication/AuthenticationContainer.js +50 -27
  27. package/lib/components/common/code_input/languageHelpers.test.js +1 -1
  28. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -1
  29. package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -1
  30. package/lib/components/core/core_form/CoreForm.js +10 -10
  31. package/lib/components/core/field_definition/FieldDefinitionForm.js +130 -0
  32. package/lib/components/core/field_definition/FieldDefinitionTable.js +86 -0
  33. package/lib/components/core/file_resource/FileResourceForm.js +180 -0
  34. package/lib/components/core/file_resource/FileResourceTable.js +71 -0
  35. package/lib/components/core/form/FormForm.js +12 -17
  36. package/lib/components/core/form/FormTable.js +3 -8
  37. package/lib/components/core/i18n/I18n.js +15 -15
  38. package/lib/components/core/index_definition/IndexDefinitionForm.js +32 -19
  39. package/lib/components/core/index_definition/IndexDefinitionTable.js +15 -24
  40. package/lib/components/core/index_job/IndexJobTable.js +12 -9
  41. package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
  42. package/lib/components/core/space/SpaceForm.js +59 -10
  43. package/lib/components/core/submission/DatastoreSubmissionTable.js +31 -1
  44. package/lib/components/core/submission/FormSubmissionFilters.js +378 -0
  45. package/lib/components/core/submission/FormSubmissionTable.js +116 -0
  46. package/lib/components/core/submission/KappSubmissionTable.js +250 -0
  47. package/lib/components/core/submission/SubmissionForm.js +124 -0
  48. package/lib/components/core/submission/SubmissionTable.js +35 -249
  49. package/lib/components/core/submission/helpers.js +95 -0
  50. package/lib/components/core/submission/helpers.test.js +96 -0
  51. package/lib/components/core/translation/ContextTable.js +1 -1
  52. package/lib/components/core/user/UserForm.js +2 -2
  53. package/lib/components/core/webapi/WebApiForm.js +111 -126
  54. package/lib/components/core/webhook/WebhookForm.js +1 -1
  55. package/lib/components/form/Form.helpers.js +1 -1
  56. package/lib/components/form/Form.js +200 -144
  57. package/lib/components/index.js +16 -6
  58. package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
  59. package/lib/components/system/SystemSecurityForm.js +69 -0
  60. package/lib/components/system/helpers.js +20 -6
  61. package/lib/components/system/spaces/SystemSpaceForm.js +44 -16
  62. package/lib/components/system/spaces/SystemTenantForm.js +15 -9
  63. package/lib/components/system/spaces/SystemTenantTable.js +21 -16
  64. package/lib/components/table/Table.js +37 -10
  65. package/lib/components/table/Table.redux.js +228 -57
  66. package/lib/components/table/Table.redux.test.js +73 -2
  67. package/lib/components/task/builder/Connector.js +21 -10
  68. package/lib/components/task/builder/ConnectorForm.js +1 -1
  69. package/lib/components/task/builder/Node.js +10 -3
  70. package/lib/components/task/builder/NodeForm.js +54 -22
  71. package/lib/components/task/builder/NodeParametersForm.js +5 -2
  72. package/lib/components/task/builder/SvgCanvas.js +13 -4
  73. package/lib/components/task/builder/TaskDefinitionConfigForm.js +113 -0
  74. package/lib/components/task/builder/TreeBuilder.js +27 -9
  75. package/lib/components/task/builder/builder.redux.js +159 -52
  76. package/lib/components/task/builder/helpers.js +5 -3
  77. package/lib/components/task/builder/models.js +84 -12
  78. package/lib/components/task/errors/RunErrorTable.js +1 -1
  79. package/lib/components/task/runs/CreateManualTriggerForm.js +15 -24
  80. package/lib/components/task/runs/RunTable.js +5 -3
  81. package/lib/components/task/triggers/TriggerTable.js +3 -2
  82. package/lib/components/task/workflows/WorkflowForm.js +67 -85
  83. package/lib/helpers/index.js +19 -2
  84. package/lib/index.js +1 -0
  85. package/lib/models/discussions.js +18 -2
  86. package/lib/models/index.js +1 -1
  87. package/package.json +3 -3
  88. package/proxyhelper.js +19 -6
@@ -3,11 +3,10 @@ import { bundle } from '../../helpers';
3
3
  import { handleErrors, headerBuilder, paramBuilder } from '../http';
4
4
 
5
5
  var validateOptions = function validateOptions(functionName, requiredOptions, options) {
6
- var typesRequiringKapp = ['Kapp', 'Form', 'Submission'];
7
6
  var kappSlug = options.kappSlug,
8
7
  _options$webhook = options.webhook,
9
8
  webhook = _options$webhook === void 0 ? {} : _options$webhook;
10
- var kappSlugMissing = typesRequiringKapp.includes(webhook.type) && !kappSlug;
9
+ var kappSlugMissing = webhook.type === 'Kapp' && !kappSlug;
11
10
  var missing = requiredOptions.filter(function (requiredOption) {
12
11
  return !options[requiredOption];
13
12
  });
@@ -170,6 +170,7 @@ export var fetchDiscussions = function fetchDiscussions(_ref4) {
170
170
  _ref4$relatedItem = _ref4.relatedItem,
171
171
  relatedItem = _ref4$relatedItem === void 0 ? {} : _ref4$relatedItem,
172
172
  isArchived = _ref4.isArchived,
173
+ limit = _ref4.limit,
173
174
  start = _ref4.start,
174
175
  end = _ref4.end;
175
176
  var type = relatedItem.type,
@@ -177,7 +178,7 @@ export var fetchDiscussions = function fetchDiscussions(_ref4) {
177
178
  return axios.get("".concat(baseUrl(), "/api/v1/discussions"), {
178
179
  params: {
179
180
  title: title && title.length > 0 ? title : null,
180
- limit: DEFAULT_DISCUSSION_LIMIT,
181
+ limit: limit || DEFAULT_DISCUSSION_LIMIT,
181
182
  type: type,
182
183
  key: key,
183
184
  pageToken: pageToken,
package/lib/apis/http.js CHANGED
@@ -24,7 +24,8 @@ export var handleErrors = function handleErrors(error) {
24
24
  _error$response$data = _error$response.data,
25
25
  data = _error$response$data === void 0 ? {} : _error$response$data,
26
26
  statusCode = _error$response.status,
27
- statusText = _error$response.statusText;
27
+ statusText = _error$response.statusText,
28
+ headers = _error$response.headers;
28
29
  var type = types[statusCode];
29
30
 
30
31
  var errorMessage = data.error,
@@ -33,7 +34,13 @@ export var handleErrors = function handleErrors(error) {
33
34
  message = data.message,
34
35
  rest = _objectWithoutProperties(data, ["error", "errorKey", "message"]);
35
36
 
36
- var result = typeof data === 'string' ? {
37
+ var result = headers && !headers['content-type'].startsWith('application/json') ? {
38
+ message: 'An unexpected error occurred.',
39
+ statusCode: statusCode
40
+ } : statusCode === 503 ? {
41
+ statusCode: statusCode,
42
+ message: 'The platform component you are using is not available. Please contact your administrator.'
43
+ } : typeof data === 'string' ? {
37
44
  message: data,
38
45
  statusCode: statusCode,
39
46
  key: key
@@ -54,7 +61,7 @@ export var handleErrors = function handleErrors(error) {
54
61
  export var paramBuilder = function paramBuilder(options) {
55
62
  var params = {};
56
63
  if (options.include) params.include = options.include;
57
- if (options.limit) params.limit = options.limit;
64
+ if (options.limit >= 0) params.limit = options.limit;
58
65
  if (options.pageToken) params.pageToken = options.pageToken;
59
66
  if (options.q) params.q = options.q;
60
67
  if (options.direction) params.direction = options.direction;
@@ -93,9 +100,10 @@ export var apiFunction = function apiFunction(_ref) {
93
100
  return function () {
94
101
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
95
102
  validateOptions(name, dataOption ? [].concat(_toConsumableArray(requiredOptions), [dataOption]) : requiredOptions, options);
103
+ var urlPostfix = url(options);
96
104
  return axios({
97
105
  method: method,
98
- url: bundle.apiLocation() + url(options),
106
+ url: urlPostfix.startsWith('/app') ? urlPostfix : bundle.apiLocation() + urlPostfix,
99
107
  data: dataOption && options[dataOption],
100
108
  params: paramBuilder(options),
101
109
  headers: headerBuilder(options)
@@ -132,9 +140,8 @@ export var apiGroup = function apiGroup(_ref2) {
132
140
  };
133
141
  export var formPath = function formPath(_ref4) {
134
142
  var form = _ref4.form,
135
- kapp = _ref4.kapp,
136
- datastore = _ref4.datastore;
137
- return datastore ? form ? "".concat(bundle.spaceLocation(), "/app/datastore/forms/").concat(form) : "".concat(bundle.spaceLocation(), "/app/datastore/forms") : form ? "".concat(bundle.spaceLocation(), "/").concat(kapp || bundle.kappSlug(), "/").concat(form) : "".concat(bundle.spaceLocation(), "/").concat(kapp || bundle.kappSlug());
143
+ kapp = _ref4.kapp;
144
+ return !kapp ? form ? "".concat(bundle.spaceLocation(), "/app/forms/").concat(form) : "".concat(bundle.spaceLocation(), "/app/forms") : form ? "".concat(bundle.spaceLocation(), "/").concat(kapp || bundle.kappSlug(), "/").concat(form) : "".concat(bundle.spaceLocation(), "/").concat(kapp || bundle.kappSlug());
138
145
  };
139
146
  export var submissionPath = function submissionPath(_ref5) {
140
147
  var submission = _ref5.submission,
@@ -145,15 +152,13 @@ export var corePath = function corePath(_ref6) {
145
152
  var submission = _ref6.submission,
146
153
  kapp = _ref6.kapp,
147
154
  form = _ref6.form,
148
- _ref6$datastore = _ref6.datastore,
149
- datastore = _ref6$datastore === void 0 ? false : _ref6$datastore;
155
+ datastore = _ref6.datastore;
150
156
  return submission ? submissionPath({
151
- submission: submission,
152
- datastore: datastore
157
+ datastore: datastore,
158
+ submission: submission
153
159
  }) : formPath({
154
160
  form: form,
155
- kapp: kapp,
156
- datastore: datastore
161
+ kapp: kapp
157
162
  });
158
163
  };
159
164
  export var operations = Map({
@@ -234,4 +239,14 @@ export var generateCESearchParams = function generateCESearchParams(_ref9) {
234
239
  limit: pageSize,
235
240
  pageToken: nextPageToken
236
241
  }, searchFilters(filters)), sortParams(sortColumn, sortDirection));
242
+ };
243
+ export var transformCoreResult = function transformCoreResult(envelope) {
244
+ return function (result, paramData) {
245
+ var count = paramData.nextPageToken ? result.count + paramData.pageTokens.size * paramData.pageSize : result.count;
246
+ return {
247
+ data: result[envelope],
248
+ nextPageToken: result.nextPageToken,
249
+ count: count
250
+ };
251
+ };
237
252
  };
@@ -1,4 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
3
  import { headerBuilder, corePath, handleErrors, paramBuilder, operations } from './http';
3
4
  import { List } from 'immutable';
4
5
  jest.mock('../helpers', function () {
@@ -62,11 +63,6 @@ describe('http module', function () {
62
63
  });
63
64
  describe('corePath', function () {
64
65
  describe('kapp forms and submissions', function () {
65
- test('builds url with default kapp', function () {
66
- expect(corePath({
67
- form: 'ipad-request'
68
- })).toBe('/kinetic/acme/catalog/ipad-request');
69
- });
70
66
  test('builds url with specified kapp', function () {
71
67
  expect(corePath({
72
68
  form: 'ipad-request',
@@ -79,18 +75,16 @@ describe('http module', function () {
79
75
  })).toBe('/kinetic/acme/submissions/abc123');
80
76
  });
81
77
  });
82
- describe('datastore forms and submissions', function () {
78
+ describe('space forms and submissions', function () {
83
79
  test('builds url to form', function () {
84
80
  expect(corePath({
85
- form: 'cars',
86
- datastore: true
87
- })).toBe('/kinetic/acme/app/datastore/forms/cars');
81
+ form: 'cars'
82
+ })).toBe('/kinetic/acme/app/forms/cars');
88
83
  });
89
84
  test('builds url with the submission id', function () {
90
85
  expect(corePath({
91
- submission: 'abc123',
92
- datastore: true
93
- })).toBe('/kinetic/acme/app/datastore/submissions/abc123');
86
+ submission: 'abc123'
87
+ })).toBe('/kinetic/acme/submissions/abc123');
94
88
  });
95
89
  });
96
90
  });
@@ -109,9 +103,13 @@ describe('http module', function () {
109
103
 
110
104
  describe('#paramBuilder', function () {
111
105
  test('returns parameter values', function () {
112
- var params = ['include', 'limit', 'pageToken', 'q', 'direction', 'orderBy', 'manage', 'export'];
113
- params.forEach(function (param) {
114
- return expect(paramBuilder(_defineProperty({}, param, param))).toMatchObject(_defineProperty({}, param, param));
106
+ var params = [['include', 'include'], ['limit', 1], ['pageToken', 'pageToken'], ['q', 'q'], ['direction', 'direction'], ['orderBy', 'orderBy'], ['manage', 'manage'], ['export', 'export']];
107
+ params.forEach(function (_ref) {
108
+ var _ref2 = _slicedToArray(_ref, 2),
109
+ param = _ref2[0],
110
+ value = _ref2[1];
111
+
112
+ return expect(paramBuilder(_defineProperty({}, param, value))).toMatchObject(_defineProperty({}, param, value));
115
113
  });
116
114
  });
117
115
  test('does not return non-parameter values', function () {
package/lib/apis/index.js CHANGED
@@ -11,6 +11,8 @@ export * from './core/bridgeModelMappings';
11
11
  export * from './core/bridgeModelQualifications';
12
12
  export * from './core/bridgeModelQualificationMappings';
13
13
  export * from './core/categories';
14
+ export * from './core/fileResources';
15
+ export * from './core/filestores';
14
16
  export * from './core/forms';
15
17
  export * from './core/formTypes';
16
18
  export * from './core/kapps';
@@ -269,7 +269,7 @@ export var updateSystemFilestore = function updateSystemFilestore() {
269
269
  };
270
270
  })["catch"](handleErrors);
271
271
  };
272
- var VALID_RESTARTABLE_COMPONENTS = ['agent', 'core', 'discussions', 'loghub', 'topics'];
272
+ var VALID_RESTARTABLE_COMPONENTS = ['agent', 'core', 'discussions', 'loghub', 'topics', 'indexer'];
273
273
  export var postPlatformComponentRestart = function postPlatformComponentRestart() {
274
274
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
275
275
 
@@ -336,6 +336,34 @@ export var fetchElasticSearchConfig = function fetchElasticSearchConfig() {
336
336
  };
337
337
  })["catch"](handleErrors);
338
338
  };
339
+ export var fetchSystemSecurity = function fetchSystemSecurity() {
340
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
341
+ return axios.get('/app/system-coordinator/api/v1/platform/system-security', {}, {
342
+ params: paramBuilder(options),
343
+ headers: headerBuilder(options)
344
+ }).then(function (response) {
345
+ return {
346
+ systemSecurity: response.data
347
+ };
348
+ })["catch"](handleErrors);
349
+ };
350
+ export var updateSystemSecurity = function updateSystemSecurity() {
351
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
352
+ var systemSecurity = options.systemSecurity;
353
+
354
+ if (!systemSecurity) {
355
+ throw new Error('updateSystemSecurity failed! The option "systemSecurity" is required.');
356
+ }
357
+
358
+ return axios.put("/app/system-coordinator/api/v1/platform/system-security", systemSecurity, {
359
+ params: paramBuilder(options),
360
+ headers: headerBuilder(options)
361
+ }).then(function (response) {
362
+ return {
363
+ systemSecurity: response.data
364
+ };
365
+ })["catch"](handleErrors);
366
+ };
339
367
  export var fetchSystemLicense = function fetchSystemLicense() {
340
368
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
341
369
  return axios.get('/app/system-coordinator/components/core/app/api/v1/license', {
@@ -406,4 +434,61 @@ export var fetchSystemLicenseCheck = function fetchSystemLicenseCheck() {
406
434
  system: response.data
407
435
  };
408
436
  })["catch"](handleErrors);
437
+ };
438
+ export var fetchSystemBackgroundTasks = function fetchSystemBackgroundTasks() {
439
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
440
+ return axios.get('/app/system-coordinator/api/v1/backgroundTasks', {
441
+ params: paramBuilder(options),
442
+ headers: headerBuilder(options)
443
+ }).then(function (response) {
444
+ return {
445
+ backgroundTasks: response.data.backgroundTasks
446
+ };
447
+ })["catch"](handleErrors);
448
+ };
449
+ export var fetchSystemBackgroundTask = function fetchSystemBackgroundTask() {
450
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
451
+ var id = options.id;
452
+
453
+ if (!id) {
454
+ throw new Error('fetchSystemBackgroundTask failed! The option "id" is required.');
455
+ }
456
+
457
+ return axios.get("/app/system-coordinator/api/v1/backgroundTasks/".concat(id), {
458
+ params: paramBuilder(options),
459
+ headers: headerBuilder(options)
460
+ }).then(function (response) {
461
+ return {
462
+ backgroundTask: response.data.backgroundTask
463
+ };
464
+ })["catch"](handleErrors);
465
+ };
466
+ export var deleteSystemBackgroundTask = function deleteSystemBackgroundTask() {
467
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
468
+ var id = options.id;
469
+
470
+ if (!id) {
471
+ throw new Error('deleteSystemBackgroundTask failed! The option "id" is required.');
472
+ }
473
+
474
+ return axios["delete"]("/app/system-coordinator/api/v1/backgroundTasks/".concat(id), {
475
+ params: paramBuilder(options),
476
+ headers: headerBuilder(options)
477
+ }).then(function (response) {
478
+ return {
479
+ backgroundTask: response.data.backgroundTask
480
+ };
481
+ })["catch"](handleErrors);
482
+ };
483
+ export var rotateEncryptionKey = function rotateEncryptionKey() {
484
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
485
+ var spaceSlug = options.spaceSlug;
486
+ return axios.post(spaceSlug ? "/app/system-coordinator/api/v1/tenants/".concat(spaceSlug, "/rotateEncryptionKey") : '/app/system-coordinator/api/v1/platform/rotateEncryptionKey', {}, {
487
+ params: paramBuilder(options),
488
+ headers: headerBuilder(options)
489
+ }).then(function (response) {
490
+ return {
491
+ system: response.data
492
+ };
493
+ })["catch"](handleErrors);
409
494
  };
@@ -1,5 +1,5 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
1
  import axios from 'axios';
2
+ import { get } from 'immutable';
3
3
  import { handleErrors, validateOptions } from '../http';
4
4
  import { bundle } from '../../helpers';
5
5
  export var buildTreeId = function buildTreeId(options) {
@@ -7,7 +7,12 @@ export var buildTreeId = function buildTreeId(options) {
7
7
  };
8
8
 
9
9
  var generateNextPageToken = function generateNextPageToken(data) {
10
- return data.offset >= 0 && data.limit && data.count ? data.offset + data.limit > data.count ? null : data.limit + data.offset : null;
10
+ var offset = data.offset,
11
+ limit = data.limit,
12
+ count = data.count,
13
+ more = data.more;
14
+ var nextPageToken = data.limit + data.offset;
15
+ return typeof more !== 'undefined' && more ? nextPageToken : offset >= 0 && limit && count ? offset + limit > count ? null : limit + offset : null;
11
16
  };
12
17
 
13
18
  export var fetchTrees = function fetchTrees() {
@@ -114,7 +119,7 @@ export var importTree = function importTree() {
114
119
  var content = options.content,
115
120
  contentUrl = options.contentUrl,
116
121
  force = options.force;
117
- var data = {};
122
+ var data;
118
123
  var headers = {};
119
124
 
120
125
  if (contentUrl) {
@@ -452,7 +457,7 @@ export var createHandler = function createHandler() {
452
457
  var packageUrl = options.packageUrl,
453
458
  packageFile = options.packageFile,
454
459
  force = options.force;
455
- var data = {};
460
+ var data;
456
461
  var headers = {};
457
462
 
458
463
  if (packageUrl) {
@@ -620,9 +625,11 @@ export var fetchTaskRuns = function fetchTaskRuns() {
620
625
  status: options.status || undefined,
621
626
  orderBy: options.orderBy,
622
627
  direction: options.direction,
623
- count: options.count || undefined,
628
+ count: get(options, 'count'),
624
629
  start: options.start || undefined,
625
- end: options.end || undefined
630
+ end: options.end || undefined,
631
+ afterId: options.afterId || undefined,
632
+ beforeId: options.beforeId || undefined
626
633
  }
627
634
  }).then(function (response) {
628
635
  return {
@@ -700,7 +707,8 @@ export var fetchTaskTriggers = function fetchTaskTriggers() {
700
707
  }).then(function (response) {
701
708
  return {
702
709
  triggers: response.data.triggers,
703
- nextPageToken: generateNextPageToken(response.data)
710
+ nextPageToken: generateNextPageToken(response.data),
711
+ count: response.data.count
704
712
  };
705
713
  })["catch"](handleErrors);
706
714
  };
@@ -765,16 +773,17 @@ export var fetchTaskRunError = function fetchTaskRunError() {
765
773
  };
766
774
  export var updateRunTaskResults = function updateRunTaskResults() {
767
775
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
768
- validateOptions('updateRunTaskResults', ['runId', 'taskId', 'results'], options);
769
- var resultKey = options.type || 'results';
770
- return axios.put("".concat(bundle.spaceLocation(), "/app/components/task/app/api/v2/runs/").concat(options.runId, "/tasks/").concat(options.taskId), _defineProperty({}, resultKey, options.results), {
776
+ validateOptions('updateRunTaskResults', ['runId', 'taskId'], options);
777
+ return axios.put("".concat(bundle.spaceLocation(), "/app/components/task/app/api/v2/runs/").concat(options.runId, "/tasks/").concat(options.taskId), {
778
+ deferredResults: options.deferredResults,
779
+ results: options.results,
780
+ message: options.message
781
+ }, {
771
782
  params: {
772
783
  include: options.include
773
784
  }
774
785
  }).then(function (response) {
775
- return {
776
- message: response.data
777
- };
786
+ return response.data;
778
787
  })["catch"](handleErrors);
779
788
  };
780
789
  export var resolveTaskErrors = function resolveTaskErrors() {
@@ -794,7 +803,6 @@ export var resolveTaskErrors = function resolveTaskErrors() {
794
803
  })["catch"](handleErrors);
795
804
  };
796
805
  export var fetchTaskVersion = function fetchTaskVersion() {
797
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
798
806
  return axios.get("".concat(bundle.spaceLocation(), "/app/components/task/app/api/v2/version")).then(function (response) {
799
807
  return {
800
808
  version: response.data
@@ -0,0 +1,132 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import { createFilestore, fetchFilestore, updateFilestore } from '../../../apis';
3
+ import { fetchAdapters } from '../../../apis';
4
+ import { get, getIn, List, Map } from 'immutable';
5
+ import { buildPropertyFields, handleFormErrors } from '../../form/Form.helpers';
6
+ import { generateForm } from '../../form/Form';
7
+
8
+ var dataSources = function dataSources(_ref) {
9
+ var agentSlug = _ref.agentSlug,
10
+ filestoreSlug = _ref.filestoreSlug,
11
+ adapterClass = _ref.adapterClass;
12
+ return {
13
+ filestore: {
14
+ fn: fetchFilestore,
15
+ params: agentSlug && filestoreSlug && [{
16
+ agentSlug: agentSlug,
17
+ filestoreSlug: filestoreSlug,
18
+ include: 'details'
19
+ }],
20
+ transform: function transform(result) {
21
+ return result.filestore;
22
+ }
23
+ },
24
+ adapters: {
25
+ fn: fetchAdapters,
26
+ params: [{
27
+ include: 'details',
28
+ type: 'filestore',
29
+ agentSlug: agentSlug
30
+ }],
31
+ transform: function transform(result) {
32
+ return result.adapters;
33
+ }
34
+ },
35
+ adapterProperties: {
36
+ fn: function fn(adapters, filestore) {
37
+ var appliedAdapterClass = filestore ? filestore.get('adapterClass') : adapterClass;
38
+ var adapter = adapters.find(function (adapter) {
39
+ return adapter.get('class') === appliedAdapterClass;
40
+ });
41
+ return adapter ? List(adapter.get('properties')) : List();
42
+ },
43
+ params: function params(_ref2) {
44
+ var adapters = _ref2.adapters,
45
+ filestore = _ref2.filestore;
46
+ return (!filestoreSlug || filestore) && adapters && [adapters, filestore];
47
+ }
48
+ }
49
+ };
50
+ };
51
+
52
+ var handleSubmit = function handleSubmit(_ref3) {
53
+ var agentSlug = _ref3.agentSlug,
54
+ filestoreSlug = _ref3.filestoreSlug;
55
+ return function (values) {
56
+ return (filestoreSlug ? updateFilestore : createFilestore)({
57
+ agentSlug: agentSlug,
58
+ filestoreSlug: filestoreSlug,
59
+ filestore: values.toJS()
60
+ }).then(handleFormErrors('filestore', 'There was a problem saving the filestore.'));
61
+ };
62
+ };
63
+
64
+ var fields = function fields(_ref4) {
65
+ var adapterClass = _ref4.adapterClass;
66
+ return function (_ref5) {
67
+ var filestore = _ref5.filestore,
68
+ adapters = _ref5.adapters,
69
+ adapterProperties = _ref5.adapterProperties;
70
+
71
+ if (adapterProperties) {
72
+ var _buildPropertyFields = buildPropertyFields({
73
+ isNew: !filestore,
74
+ properties: adapterProperties,
75
+ getName: function getName(property) {
76
+ return property.get('name');
77
+ },
78
+ getRequired: function getRequired(property) {
79
+ return property.get('required');
80
+ },
81
+ getSensitive: function getSensitive(property) {
82
+ return property.get('sensitive');
83
+ },
84
+ getOptions: function getOptions(property) {
85
+ return property.get('options');
86
+ },
87
+ getValue: function getValue(property) {
88
+ return getIn(filestore, ['properties', property.get('name')], '');
89
+ }
90
+ }),
91
+ propertiesFields = _buildPropertyFields.propertiesFields,
92
+ propertiesSerialize = _buildPropertyFields.propertiesSerialize;
93
+
94
+ return [{
95
+ name: 'slug',
96
+ label: 'Filestore Slug',
97
+ type: 'text',
98
+ required: true,
99
+ initialValue: get(filestore, 'slug', ''),
100
+ pattern: /^[a-z\d-]+$/,
101
+ patternMessage: 'File Store Slug may only contain letters, numbers, and dashes',
102
+ helpText: 'Unique name used in the bridge path.'
103
+ }, {
104
+ name: 'adapterClass',
105
+ label: 'Adapter Class',
106
+ type: 'text',
107
+ enabled: false,
108
+ required: false,
109
+ initialValue: filestore ? filestore.get('adapterClass') : adapterClass,
110
+ options: adapters.map(function (adapter) {
111
+ return Map({
112
+ value: adapter.get('class'),
113
+ label: adapter.get('name')
114
+ });
115
+ })
116
+ }].concat(_toConsumableArray(propertiesFields), [{
117
+ name: 'properties',
118
+ visible: false,
119
+ initialValue: get(filestore, 'properties', {}),
120
+ serialize: propertiesSerialize
121
+ }]);
122
+ }
123
+ };
124
+ };
125
+
126
+ export var FilestoreForm = generateForm({
127
+ formOptions: ['filestoreSlug', 'adapterClass', 'agentSlug'],
128
+ dataSources: dataSources,
129
+ fields: fields,
130
+ handleSubmit: handleSubmit
131
+ });
132
+ FilestoreForm.displayName = 'FilestoreForm';
@@ -0,0 +1,53 @@
1
+ import { defineFilter } from '../../../helpers';
2
+ import { fetchFilestores } from '../../../apis';
3
+ import { generateTable } from '../../table/Table';
4
+ var clientSide = defineFilter(true).startsWith('slug', 'slug').end();
5
+
6
+ var dataSource = function dataSource(_ref) {
7
+ var agentSlug = _ref.agentSlug;
8
+ return {
9
+ fn: fetchFilestores,
10
+ clientSide: clientSide,
11
+ params: function params() {
12
+ return [{
13
+ agentSlug: agentSlug,
14
+ include: 'details'
15
+ }];
16
+ },
17
+ transform: function transform(result) {
18
+ return {
19
+ data: result.filestores
20
+ };
21
+ }
22
+ };
23
+ };
24
+
25
+ var filters = function filters() {
26
+ return function () {
27
+ return [{
28
+ name: 'slug',
29
+ label: 'Slug',
30
+ type: 'text'
31
+ }];
32
+ };
33
+ };
34
+
35
+ var columns = [{
36
+ value: 'slug',
37
+ title: 'Slug',
38
+ sortable: true
39
+ }, {
40
+ value: 'adapterClass',
41
+ title: 'Adapter',
42
+ sortable: true,
43
+ valueTransform: function valueTransform(_value) {
44
+ return _value.split('.').pop().match(/[A-Z][a-z]+/g).join(' ');
45
+ }
46
+ }];
47
+ export var FilestoreTable = generateTable({
48
+ tableOptions: ['agentSlug'],
49
+ columns: columns,
50
+ filters: filters,
51
+ dataSource: dataSource
52
+ });
53
+ FilestoreTable.displayName = 'FilestoreTable';
@@ -20,7 +20,8 @@ var searchOptions = function searchOptions(_ref) {
20
20
  var name = _ref2.name,
21
21
  staticValue = _ref2.value;
22
22
  return _objectSpread(_objectSpread({}, values), {}, _defineProperty({}, name, staticValue || value));
23
- }, {})
23
+ }, {}),
24
+ "public": !!search.get('public')
24
25
  }).then(function (_ref3) {
25
26
  var records = _ref3.records,
26
27
  error = _ref3.error;
@@ -75,7 +75,8 @@ var searchForms = function searchForms(_ref3) {
75
75
  kappSlug: search.get('kappSlug'),
76
76
  q: buildQuery(searchFields, value),
77
77
  include: search.get('include') || (search.get('datastore') ? '' : 'categorizations.category'),
78
- limit: search.get('limit') || 25
78
+ limit: search.get('limit') || 25,
79
+ "public": !!search.get('public')
79
80
  }).then(function (_ref4) {
80
81
  var forms = _ref4.forms,
81
82
  error = _ref4.error,
@@ -50,13 +50,13 @@ export var Scroller = /*#__PURE__*/function (_Component) {
50
50
  }
51
51
  } // when scrolling up...
52
52
  else if (childTop < this.lastTop) {
53
- // check to see if the top of the child element is above the top of the
54
- // scrollable parent
55
- if (childTop < parent.scrollTop) {
56
- // scroll the child into view (passing true which aligns by top)
57
- child.scrollIntoView(true);
58
- }
53
+ // check to see if the top of the child element is above the top of the
54
+ // scrollable parent
55
+ if (childTop < parent.scrollTop) {
56
+ // scroll the child into view (passing true which aligns by top)
57
+ child.scrollIntoView(true);
59
58
  }
59
+ }
60
60
 
61
61
  this.lastTop = child.offsetTop;
62
62
  }