@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
@@ -577,4 +577,72 @@ export var deleteSubmission = function deleteSubmission(options) {
577
577
  }) // Clean up any errors we receive. Make sure this the last thing so that it
578
578
  // cleans up any errors.
579
579
  ["catch"](handleErrors);
580
+ };
581
+ export var exportSubmissions = function exportSubmissions(options) {
582
+ var kappSlug = options.kappSlug,
583
+ formSlug = options.formSlug,
584
+ onDownloadProgress = options.onDownloadProgress;
585
+
586
+ if (!kappSlug) {
587
+ throw new Error('exportSubmissions failed! The option "kappSlug" is required.');
588
+ }
589
+
590
+ if (!formSlug) {
591
+ throw new Error('exportSubmissions failed! The option "formSlug" is required.');
592
+ }
593
+
594
+ var path = "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms/").concat(formSlug, "/submissions-search?export");
595
+ return axios.post(path, {}, {
596
+ params: paramBuilder(options),
597
+ headers: headerBuilder(options),
598
+ onDownloadProgress: onDownloadProgress,
599
+ responseType: 'blob'
600
+ });
601
+ };
602
+ export var MODE_IMPORT = 'import';
603
+ export var MODE_BULK = 'bulk';
604
+
605
+ var modeToFn = function modeToFn(mode) {
606
+ return mode === MODE_BULK ? 'post' : 'patch';
607
+ };
608
+
609
+ export var importSubmissions = function importSubmissions(options) {
610
+ var kappSlug = options.kappSlug,
611
+ formSlug = options.formSlug,
612
+ onUploadProgress = options.onUploadProgress,
613
+ file = options.file,
614
+ _options$mode = options.mode,
615
+ mode = _options$mode === void 0 ? MODE_IMPORT : _options$mode,
616
+ cancelToken = options.cancelToken;
617
+
618
+ if (!kappSlug) {
619
+ throw new Error('importSubmissions failed! The option "kappSlug" is required.');
620
+ }
621
+
622
+ if (!formSlug) {
623
+ throw new Error('importSubmissions failed! The option "formSlug" is required.');
624
+ }
625
+
626
+ if (!file) {
627
+ throw new Error('importSubmissions failed! The option "file" is required.');
628
+ }
629
+
630
+ var path = "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms/").concat(formSlug, "/submissions?import");
631
+ return axios[modeToFn(mode)](path, file, {
632
+ cancelToken: cancelToken,
633
+ data: file,
634
+ params: paramBuilder(options),
635
+ headers: _objectSpread(_objectSpread({}, headerBuilder(options)), {}, {
636
+ 'Content-Type': 'application/csv'
637
+ }),
638
+ onUploadProgress: onUploadProgress
639
+ }).then(function (response) {
640
+ return response.data;
641
+ })["catch"](function (error) {
642
+ if (error.response && error.response.data && error.response.data.errors) {
643
+ return error.response.data;
644
+ } else {
645
+ return handleErrors(error);
646
+ }
647
+ });
580
648
  };
@@ -24,7 +24,7 @@ var buildEndpoint = function buildEndpoint(_ref) {
24
24
  var kappSlug = _ref.kappSlug,
25
25
  webhookName = _ref.webhookName;
26
26
  var basePath = kappSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/webhooks") : "".concat(bundle.apiLocation(), "/webhooks");
27
- return webhookName ? "".concat(basePath, "/").concat(webhookName) : basePath;
27
+ return webhookName ? "".concat(basePath, "/").concat(encodeURIComponent(webhookName)) : basePath;
28
28
  };
29
29
 
30
30
  export var fetchWebhooks = function fetchWebhooks() {
@@ -185,7 +185,7 @@ describe('webhooks api', function () {
185
185
 
186
186
  case 3:
187
187
  result = _context4.sent;
188
- expect(axios.get.mock.calls).toEqual([['space/app/api/v1/webhooks/Test Webhook Name', {
188
+ expect(axios.get.mock.calls).toEqual([['space/app/api/v1/webhooks/Test%20Webhook%20Name', {
189
189
  params: {},
190
190
  headers: {
191
191
  'X-Kinetic-AuthAssumed': 'true'
@@ -391,7 +391,7 @@ describe('webhooks api', function () {
391
391
 
392
392
  case 3:
393
393
  result = _context7.sent;
394
- expect(axios.put.mock.calls).toEqual([['space/app/api/v1/webhooks/Test Webhook Name', {
394
+ expect(axios.put.mock.calls).toEqual([['space/app/api/v1/webhooks/Test%20Webhook%20Name', {
395
395
  authStrategy: null,
396
396
  event: 'Login Failure',
397
397
  filter: '',
package/lib/apis/http.js CHANGED
@@ -17,6 +17,12 @@ export var handleErrors = function handleErrors(error) {
17
17
  // make a mistake in a `then` block in one of our api functions.
18
18
  if (error instanceof Error && !error.response) {
19
19
  throw error;
20
+ }
21
+
22
+ if (axios.isCancel(error)) {
23
+ return {
24
+ error: 'Canceled by user request.'
25
+ };
20
26
  } // Destructure out the information needed.
21
27
 
22
28
 
@@ -24,7 +30,8 @@ export var handleErrors = function handleErrors(error) {
24
30
  _error$response$data = _error$response.data,
25
31
  data = _error$response$data === void 0 ? {} : _error$response$data,
26
32
  statusCode = _error$response.status,
27
- statusText = _error$response.statusText;
33
+ statusText = _error$response.statusText,
34
+ headers = _error$response.headers;
28
35
  var type = types[statusCode];
29
36
 
30
37
  var errorMessage = data.error,
@@ -33,7 +40,13 @@ export var handleErrors = function handleErrors(error) {
33
40
  message = data.message,
34
41
  rest = _objectWithoutProperties(data, ["error", "errorKey", "message"]);
35
42
 
36
- var result = typeof data === 'string' ? {
43
+ var result = headers && !headers['content-type'].startsWith('application/json') ? {
44
+ message: 'An unexpected error occurred.',
45
+ statusCode: statusCode
46
+ } : statusCode === 503 ? {
47
+ statusCode: statusCode,
48
+ message: 'The platform component you are using is not available. Please contact your administrator.'
49
+ } : typeof data === 'string' ? {
37
50
  message: data,
38
51
  statusCode: statusCode,
39
52
  key: key
@@ -93,9 +106,10 @@ export var apiFunction = function apiFunction(_ref) {
93
106
  return function () {
94
107
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
95
108
  validateOptions(name, dataOption ? [].concat(_toConsumableArray(requiredOptions), [dataOption]) : requiredOptions, options);
109
+ var urlPostfix = url(options);
96
110
  return axios({
97
111
  method: method,
98
- url: bundle.apiLocation() + url(options),
112
+ url: urlPostfix.startsWith('/app') ? urlPostfix : bundle.apiLocation() + urlPostfix,
99
113
  data: dataOption && options[dataOption],
100
114
  params: paramBuilder(options),
101
115
  headers: headerBuilder(options)
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 {
@@ -766,16 +773,17 @@ export var fetchTaskRunError = function fetchTaskRunError() {
766
773
  };
767
774
  export var updateRunTaskResults = function updateRunTaskResults() {
768
775
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
769
- validateOptions('updateRunTaskResults', ['runId', 'taskId', 'results'], options);
770
- var resultKey = options.type || 'results';
771
- 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
+ }, {
772
782
  params: {
773
783
  include: options.include
774
784
  }
775
785
  }).then(function (response) {
776
- return {
777
- message: response.data
778
- };
786
+ return response.data;
779
787
  })["catch"](handleErrors);
780
788
  };
781
789
  export var resolveTaskErrors = function resolveTaskErrors() {
@@ -795,7 +803,6 @@ export var resolveTaskErrors = function resolveTaskErrors() {
795
803
  })["catch"](handleErrors);
796
804
  };
797
805
  export var fetchTaskVersion = function fetchTaskVersion() {
798
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
799
806
  return axios.get("".concat(bundle.spaceLocation(), "/app/components/task/app/api/v2/version")).then(function (response) {
800
807
  return {
801
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
  }