@kineticdata/react 5.0.17 → 5.0.18

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 (26) hide show
  1. package/lib/apis/core/authentication.js +11 -3
  2. package/lib/apis/core/fileResources.js +36 -0
  3. package/lib/apis/core/filestores.js +40 -0
  4. package/lib/components/agent/filestore/FilestoreForm.js +132 -0
  5. package/lib/components/agent/filestore/FilestoreTable.js +53 -0
  6. package/lib/components/common/Scroller.js +6 -6
  7. package/lib/components/core/core_form/CoreForm.js +10 -10
  8. package/lib/components/core/field_definition/FieldDefinitionForm.js +130 -0
  9. package/lib/components/core/field_definition/FieldDefinitionTable.js +86 -0
  10. package/lib/components/core/file_resource/FileResourceForm.js +180 -0
  11. package/lib/components/core/file_resource/FileResourceTable.js +71 -0
  12. package/lib/components/core/i18n/I18n.js +14 -14
  13. package/lib/components/core/submission/FormSubmissionFilters.js +378 -0
  14. package/lib/components/core/submission/FormSubmissionTable.js +116 -0
  15. package/lib/components/core/submission/KappSubmissionTable.js +250 -0
  16. package/lib/components/core/submission/SubmissionForm.js +124 -0
  17. package/lib/components/core/submission/helpers.js +95 -0
  18. package/lib/components/core/submission/helpers.test.js +96 -0
  19. package/lib/components/form/Form.js +2 -2
  20. package/lib/components/index.js +4 -4
  21. package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
  22. package/lib/components/system/SystemSecurityForm.js +69 -0
  23. package/lib/components/task/builder/Connector.js +2 -2
  24. package/lib/components/task/builder/TaskDefinitionConfigForm.js +113 -0
  25. package/lib/components/task/builder/TreeBuilder.js +2 -2
  26. package/package.json +2 -2
@@ -12,14 +12,14 @@ export { Scroller } from './common/Scroller';
12
12
  export { StaticSelect } from './common/StaticSelect';
13
13
  export { getToken, logout, timedOut } from './common/authentication/AuthenticationContainer'; // Form
14
14
 
15
- export { mountForm, resetForm, reloadDataSource, serializeForm, submitForm, unmountForm // Don't keep.
16
- , generateForm } from './form/Form';
15
+ export { mountForm, resetForm, reloadDataSource, serializeForm, submitForm, unmountForm, // Don't keep.
16
+ generateForm } from './form/Form';
17
17
  export { FormState } from './form/FormState';
18
18
  export { KitchenSinkForm } from './form/KitchenSinkForm'; // Table
19
19
 
20
20
  export { mountTable, unmountTable, refetchTable, clearFilters, isValueEmpty } from './table/Table.redux';
21
- export { Table // Don't keep.
22
- , generateTable } from './table/Table'; // Tree Builder
21
+ export { Table, // Don't keep.
22
+ generateTable } from './table/Table'; // Tree Builder
23
23
 
24
24
  export { mountTreeBuilder, unmountTreeBuilder } from './task/builder/builder.redux';
25
25
  export { searchNodeResultDependencies } from './task/builder/helpers'; // Discussions
@@ -0,0 +1,83 @@
1
+ import { generateTable } from '../table/Table';
2
+ import { fetchSystemBackgroundTasks } from '../../apis';
3
+ import { defineFilter } from '../../helpers';
4
+ import { List } from 'immutable';
5
+ var clientSide = defineFilter(true).startsWith('id', 'id').startsWith('status', 'status').end();
6
+
7
+ var dataSource = function dataSource(_ref) {
8
+ var spaceSlug = _ref.spaceSlug;
9
+ return {
10
+ fn: fetchSystemBackgroundTasks,
11
+ clientSide: clientSide,
12
+ params: function params() {
13
+ return [{
14
+ spaceSlug: spaceSlug
15
+ }];
16
+ },
17
+ transform: function transform(result) {
18
+ return {
19
+ data: result.backgroundTasks
20
+ };
21
+ }
22
+ };
23
+ };
24
+
25
+ var filters = function filters() {
26
+ return function () {
27
+ return [{
28
+ name: 'id',
29
+ label: 'ID',
30
+ type: 'text'
31
+ }, {
32
+ name: 'status',
33
+ label: 'Status',
34
+ type: 'text'
35
+ }];
36
+ };
37
+ };
38
+
39
+ var columns = [{
40
+ value: 'id',
41
+ title: 'ID',
42
+ sortable: false
43
+ }, {
44
+ value: 'createdAt',
45
+ title: 'Created At',
46
+ valueTransform: function valueTransform(_value, row) {
47
+ var createdTransition = row.get('transitions', List()).find(function (t) {
48
+ return t.has('Created');
49
+ });
50
+ return createdTransition ? createdTransition.get('Created') : 'N/A';
51
+ },
52
+ sortable: true
53
+ }, {
54
+ value: 'description',
55
+ title: 'Description',
56
+ sortable: false
57
+ }, {
58
+ value: 'exception',
59
+ title: 'Exception',
60
+ sortable: false
61
+ }, {
62
+ value: 'messages',
63
+ title: 'Messages',
64
+ sortable: false
65
+ }, {
66
+ value: 'Result',
67
+ title: 'Result',
68
+ sortable: false
69
+ }, {
70
+ value: 'status',
71
+ title: 'Status'
72
+ }, {
73
+ value: 'transitions',
74
+ title: 'Transitions',
75
+ sortable: false
76
+ }];
77
+ export var SystemBackgroundTasksTable = generateTable({
78
+ tableOptions: ['spaceSlug'],
79
+ columns: columns,
80
+ filters: filters,
81
+ dataSource: dataSource
82
+ });
83
+ SystemBackgroundTasksTable.displayName = 'SystemBackgroundTasksTable';
@@ -0,0 +1,69 @@
1
+ import { List, fromJS, get } from 'immutable';
2
+ import { generateForm } from '../form/Form';
3
+ import { fetchSystemSecurity, updateSystemSecurity } from '../../apis';
4
+ import { handleFormErrors } from '../form/Form.helpers';
5
+
6
+ var handleSubmit = function handleSubmit() {
7
+ return function (values) {
8
+ return updateSystemSecurity({
9
+ systemSecurity: values.toJS()
10
+ }).then(handleFormErrors());
11
+ };
12
+ };
13
+
14
+ var dataSources = function dataSources() {
15
+ return {
16
+ systemSecurity: {
17
+ fn: fetchSystemSecurity,
18
+ params: [],
19
+ transform: function transform(result) {
20
+ return result.systemSecurity;
21
+ }
22
+ }
23
+ };
24
+ };
25
+
26
+ var fields = function fields() {
27
+ return function (_ref) {
28
+ var systemSecurity = _ref.systemSecurity;
29
+ return systemSecurity && [{
30
+ name: 'allowedSystemIps',
31
+ label: 'Allowed IPs',
32
+ type: 'select',
33
+ options: function options() {
34
+ return fromJS([{
35
+ name: 'description',
36
+ label: 'Description',
37
+ type: 'text'
38
+ }, {
39
+ name: 'value',
40
+ label: 'IP Range',
41
+ type: 'text'
42
+ }]);
43
+ },
44
+ visible: function visible(_ref2) {
45
+ var values = _ref2.values;
46
+ return values.get('allowedSystemIpsEnabled', false);
47
+ },
48
+ initialValue: get(systemSecurity, 'allowedSystemIps', List()),
49
+ serialize: function serialize(_ref3) {
50
+ var values = _ref3.values;
51
+ return values.get('allowedSystemIpsEnabled', false) ? values.get('allowedSystemIps') : [];
52
+ }
53
+ }, {
54
+ name: 'allowedSystemIpsEnabled',
55
+ label: 'Enabled Allowed IP Restrictions?',
56
+ type: 'checkbox',
57
+ initialValue: get(systemSecurity, 'allowedSystemIps', List()).size > 0,
58
+ "transient": true
59
+ }];
60
+ };
61
+ };
62
+
63
+ export var SystemSecurityForm = generateForm({
64
+ formOptions: [],
65
+ dataSources: dataSources,
66
+ fields: fields,
67
+ handleSubmit: handleSubmit
68
+ });
69
+ SystemSecurityForm.displayName = 'SystemSecurityForm';
@@ -73,8 +73,8 @@ export var Connector = /*#__PURE__*/function (_Component) {
73
73
  });
74
74
  } // when dropping a new connector the `headNode` prop will be undefined
75
75
  else if (_this.props.headNode) {
76
- _this.setHead(_this.props.headNode.position, false);
77
- }
76
+ _this.setHead(_this.props.headNode.position, false);
77
+ }
78
78
  };
79
79
 
80
80
  _this.dropTail = function () {
@@ -0,0 +1,113 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import { List, Map } from 'immutable';
4
+ import { generateForm } from '../../form/Form';
5
+ import { fetchForm, fetchKapps } from '../../../apis';
6
+ export var checkOmittedParameters = function checkOmittedParameters(node, parameter) {
7
+ if (node.definitionId === 'system_submission_create_v1') {
8
+ return !['kappSlug', 'formSlug'].includes(parameter.id);
9
+ } else {
10
+ return true;
11
+ }
12
+ };
13
+ export var generateTaskDefinition = function generateTaskDefinition(taskDefinition) {
14
+ if (taskDefinition.definitionName === 'system_submission_create') {
15
+ return function (_ref) {
16
+ var form = _ref.form;
17
+ return _objectSpread(_objectSpread({}, taskDefinition), {}, {
18
+ parameters: [].concat(_toConsumableArray(taskDefinition.parameters.map(function (parameter) {
19
+ return parameter.id === 'kappSlug' ? _objectSpread(_objectSpread({}, parameter), {}, {
20
+ defaultValue: form.kapp.slug
21
+ }) : parameter.id === 'formSlug' ? _objectSpread(_objectSpread({}, parameter), {}, {
22
+ defaultValue: form.slug
23
+ }) : parameter;
24
+ })), _toConsumableArray(form.fields.map(function (field) {
25
+ return {
26
+ name: field.name,
27
+ defaultValue: '',
28
+ dependsOnId: null,
29
+ dependsOnValue: null,
30
+ description: '',
31
+ id: "values.".concat(field.name),
32
+ required: false
33
+ };
34
+ })))
35
+ });
36
+ };
37
+ } else {
38
+ return null;
39
+ }
40
+ };
41
+
42
+ var dataSources = function dataSources() {
43
+ return {
44
+ kapps: {
45
+ fn: fetchKapps,
46
+ params: [],
47
+ transform: function transform(data) {
48
+ return data.kapps;
49
+ }
50
+ }
51
+ };
52
+ };
53
+
54
+ var fields = function fields() {
55
+ return function () {
56
+ return [{
57
+ name: 'kappSlug',
58
+ label: 'Kapp',
59
+ type: 'select',
60
+ required: true,
61
+ options: function options(_ref2) {
62
+ var kapps = _ref2.kapps;
63
+ return kapps ? kapps.map(function (kapp) {
64
+ return Map({
65
+ value: kapp.get('slug'),
66
+ label: kapp.get('name')
67
+ });
68
+ }) : List();
69
+ },
70
+ onChange: function onChange(_ref3, actions) {
71
+ var values = _ref3.values;
72
+
73
+ if (!!values.get('form')) {
74
+ actions.setValue('form', null);
75
+ }
76
+ }
77
+ }, {
78
+ name: 'form',
79
+ label: 'Form',
80
+ type: 'form',
81
+ required: true,
82
+ enabled: function enabled(_ref4) {
83
+ var values = _ref4.values;
84
+ return values.get('kappSlug') !== '';
85
+ },
86
+ search: function search(_ref5) {
87
+ var values = _ref5.values;
88
+ return values.get('kappSlug') !== '' ? {
89
+ kappSlug: values.get('kappSlug')
90
+ } : {};
91
+ }
92
+ }];
93
+ };
94
+ };
95
+
96
+ var handleSubmit = function handleSubmit(_ref6) {
97
+ var taskDefinition = _ref6.taskDefinition;
98
+ return function (values) {
99
+ return fetchForm({
100
+ kappSlug: values.get('kappSlug'),
101
+ formSlug: values.getIn(['form', 'slug'], ''),
102
+ include: 'fields,kapp'
103
+ }).then(generateTaskDefinition(taskDefinition));
104
+ };
105
+ };
106
+
107
+ export var TaskDefinitionConfigForm = generateForm({
108
+ formOptions: ['taskDefinition'],
109
+ dataSources: dataSources,
110
+ fields: fields,
111
+ handleSubmit: handleSubmit
112
+ });
113
+ TaskDefinitionConfigForm.displayName = 'TaskDefinitionConfigForm';
@@ -218,8 +218,8 @@ export var TreeBuilderComponent = /*#__PURE__*/function (_Component) {
218
218
  } // otherwise check for changes to the highlight prop and focus if it changes
219
219
  // and its a truthy value
220
220
  else if (this.props.highlight && !this.props.highlight.equals(prevProps.highlight)) {
221
- this.panTo(this.props.highlight);
222
- }
221
+ this.panTo(this.props.highlight);
222
+ }
223
223
  }
224
224
  }
225
225
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kineticdata/react",
3
- "version": "5.0.17",
3
+ "version": "5.0.18",
4
4
  "description": "A React library for the Kinetic Platform",
5
5
  "main": "lib/index.js",
6
6
  "main:src": "src/index.js",
@@ -92,5 +92,5 @@
92
92
  "eslintConfig": {
93
93
  "extends": "react-app"
94
94
  },
95
- "gitHead": "d5b734adcd0eafac98f7eab447f7c4b4488fdffd"
95
+ "gitHead": "4af3c0d37633d85f65119ab5a2d2410f72128bda"
96
96
  }