@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.
- package/lib/apis/core/attributeDefinitions.js +11 -9
- package/lib/apis/core/attributeDefinitions.test.js +1 -1
- package/lib/apis/core/authentication.js +13 -5
- package/lib/apis/core/backgroundJobs.js +2 -1
- package/lib/apis/core/bridgeModelAttributeMappings.js +1 -1
- package/lib/apis/core/bridgeModelAttributes.js +15 -12
- package/lib/apis/core/bridgeModelMappings.js +1 -1
- package/lib/apis/core/bridgeModelQualificationMappings.js +2 -2
- package/lib/apis/core/bridgeModelQualifications.js +2 -2
- package/lib/apis/core/bridgeModels.js +14 -8
- package/lib/apis/core/bridgedresources.js +3 -2
- package/lib/apis/core/fileResources.js +36 -0
- package/lib/apis/core/filestores.js +40 -0
- package/lib/apis/core/formTypes.js +18 -21
- package/lib/apis/core/oauthClients.js +11 -5
- package/lib/apis/core/securityPolicyDefinitions.js +1 -1
- package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
- package/lib/apis/core/submissions.js +68 -0
- package/lib/apis/core/webhooks.js +1 -1
- package/lib/apis/core/webhooks.test.js +2 -2
- package/lib/apis/http.js +17 -3
- package/lib/apis/index.js +2 -0
- package/lib/apis/system/index.js +86 -1
- package/lib/apis/task/index.js +20 -13
- package/lib/components/agent/filestore/FilestoreForm.js +132 -0
- package/lib/components/agent/filestore/FilestoreTable.js +53 -0
- package/lib/components/common/BridgeSelect.js +2 -1
- package/lib/components/common/FormSelect.js +2 -1
- package/lib/components/common/Scroller.js +6 -6
- package/lib/components/common/TableInput.js +74 -29
- package/lib/components/common/TeamSelect.js +2 -1
- package/lib/components/common/Typeahead.js +7 -4
- package/lib/components/common/UserSelect.js +2 -1
- package/lib/components/common/authentication/AuthenticationContainer.js +50 -27
- package/lib/components/core/core_form/CoreForm.js +10 -10
- package/lib/components/core/file_resource/FileResourceForm.js +180 -0
- package/lib/components/core/file_resource/FileResourceTable.js +71 -0
- package/lib/components/core/i18n/I18n.js +14 -14
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
- package/lib/components/core/space/SpaceForm.js +37 -8
- package/lib/components/core/submission/FormSubmissionFilters.js +3 -11
- package/lib/components/core/submission/FormSubmissionTable.js +4 -2
- package/lib/components/core/submission/SubmissionForm.js +124 -0
- package/lib/components/core/submission/helpers.js +2 -2
- package/lib/components/core/user/UserForm.js +2 -2
- package/lib/components/core/webapi/WebApiForm.js +111 -126
- package/lib/components/form/Form.helpers.js +1 -1
- package/lib/components/form/Form.js +200 -144
- package/lib/components/index.js +14 -6
- package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
- package/lib/components/system/SystemSecurityForm.js +69 -0
- package/lib/components/system/helpers.js +2 -2
- package/lib/components/system/spaces/SystemSpaceForm.js +44 -16
- package/lib/components/system/spaces/SystemTenantForm.js +15 -9
- package/lib/components/system/spaces/SystemTenantTable.js +15 -10
- package/lib/components/table/Table.js +9 -6
- package/lib/components/task/builder/Connector.js +21 -10
- package/lib/components/task/builder/ConnectorForm.js +1 -1
- package/lib/components/task/builder/Node.js +10 -3
- package/lib/components/task/builder/NodeForm.js +51 -22
- package/lib/components/task/builder/NodeParametersForm.js +5 -2
- package/lib/components/task/builder/SvgCanvas.js +13 -4
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +113 -0
- package/lib/components/task/builder/TreeBuilder.js +27 -9
- package/lib/components/task/builder/builder.redux.js +159 -52
- package/lib/components/task/builder/helpers.js +5 -3
- package/lib/components/task/builder/models.js +84 -12
- package/lib/components/task/errors/RunErrorTable.js +1 -1
- package/lib/components/task/runs/CreateManualTriggerForm.js +15 -24
- package/lib/components/task/runs/RunTable.js +5 -3
- package/lib/components/task/workflows/WorkflowForm.js +67 -85
- package/lib/helpers/index.js +4 -1
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/proxyhelper.js +19 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import { List, OrderedMap, Record } from 'immutable';
|
|
3
|
+
import { List, Map, OrderedMap, Record } from 'immutable';
|
|
4
4
|
/*******************************************************************************
|
|
5
5
|
* Immutable records *
|
|
6
6
|
******************************************************************************/
|
|
@@ -9,17 +9,34 @@ export var Point = Record({
|
|
|
9
9
|
x: 0,
|
|
10
10
|
y: 0
|
|
11
11
|
}, 'Point');
|
|
12
|
+
export var WebApi = Record({
|
|
13
|
+
createdAt: null,
|
|
14
|
+
createdBy: null,
|
|
15
|
+
method: null,
|
|
16
|
+
securityPolicies: null,
|
|
17
|
+
slug: null,
|
|
18
|
+
kappSlug: null,
|
|
19
|
+
updatedAt: null,
|
|
20
|
+
updatedBy: null
|
|
21
|
+
});
|
|
12
22
|
export var Tree = Record({
|
|
13
23
|
bindings: OrderedMap(),
|
|
24
|
+
categories: List(),
|
|
14
25
|
connectors: OrderedMap(),
|
|
26
|
+
definitionId: null,
|
|
27
|
+
inputs: null,
|
|
15
28
|
name: '',
|
|
16
29
|
nextNodeId: 0,
|
|
17
30
|
nextConnectorId: 0,
|
|
18
31
|
nodes: OrderedMap(),
|
|
32
|
+
notes: '',
|
|
33
|
+
outputs: null,
|
|
34
|
+
ownerEmail: '',
|
|
19
35
|
schemaVersion: '',
|
|
20
36
|
sourceGroup: '',
|
|
21
37
|
sourceName: '',
|
|
22
|
-
|
|
38
|
+
status: '',
|
|
39
|
+
type: '',
|
|
23
40
|
versionId: '0'
|
|
24
41
|
});
|
|
25
42
|
export var Node = Record({
|
|
@@ -60,13 +77,16 @@ export var Connector = Record({
|
|
|
60
77
|
export var TreeBuilderState = Record({
|
|
61
78
|
categories: OrderedMap(),
|
|
62
79
|
error: null,
|
|
80
|
+
kappSlug: null,
|
|
63
81
|
lastSave: null,
|
|
82
|
+
lastWebApi: null,
|
|
64
83
|
loading: true,
|
|
65
84
|
redoStack: List(),
|
|
66
85
|
saving: false,
|
|
67
86
|
tasks: OrderedMap(),
|
|
68
|
-
tree:
|
|
69
|
-
undoStack: List()
|
|
87
|
+
tree: null,
|
|
88
|
+
undoStack: List(),
|
|
89
|
+
webApi: null
|
|
70
90
|
});
|
|
71
91
|
export var NodeResultDependency = Record({
|
|
72
92
|
// where the dependency was found, one of:
|
|
@@ -89,10 +109,9 @@ var deserializeNodeId = function deserializeNodeId(id) {
|
|
|
89
109
|
return match ? parseInt(match[1]) : 0;
|
|
90
110
|
};
|
|
91
111
|
|
|
92
|
-
var serializeNodeId = function serializeNodeId(node) {
|
|
112
|
+
export var serializeNodeId = function serializeNodeId(node) {
|
|
93
113
|
return node.id === 0 ? 'start' : "".concat(node.definitionId, "_").concat(node.id);
|
|
94
114
|
};
|
|
95
|
-
|
|
96
115
|
export var deserializeNode = function deserializeNode(_ref) {
|
|
97
116
|
var id = _ref.id,
|
|
98
117
|
messages = _ref.messages,
|
|
@@ -145,17 +164,33 @@ export var serializeConnector = function serializeConnector(nodes) {
|
|
|
145
164
|
};
|
|
146
165
|
export var deserializeTree = function deserializeTree(_ref4) {
|
|
147
166
|
var bindings = _ref4.bindings,
|
|
167
|
+
categories = _ref4.categories,
|
|
168
|
+
definitionId = _ref4.definitionId,
|
|
169
|
+
inputs = _ref4.inputs,
|
|
148
170
|
name = _ref4.name,
|
|
171
|
+
notes = _ref4.notes,
|
|
172
|
+
outputs = _ref4.outputs,
|
|
173
|
+
ownerEmail = _ref4.ownerEmail,
|
|
149
174
|
sourceGroup = _ref4.sourceGroup,
|
|
150
175
|
sourceName = _ref4.sourceName,
|
|
176
|
+
status = _ref4.status,
|
|
151
177
|
treeJson = _ref4.treeJson,
|
|
178
|
+
type = _ref4.type,
|
|
152
179
|
versionId = _ref4.versionId;
|
|
153
180
|
return Tree({
|
|
154
181
|
bindings: bindings,
|
|
182
|
+
categories: List(categories).map(function (c) {
|
|
183
|
+
return c.name;
|
|
184
|
+
}),
|
|
155
185
|
connectors: OrderedMap(treeJson.connectors.map(deserializeConnector).map(function (c) {
|
|
156
186
|
return [c.id, c];
|
|
157
187
|
})),
|
|
188
|
+
definitionId: definitionId,
|
|
189
|
+
inputs: List(inputs).map(Map),
|
|
158
190
|
name: name,
|
|
191
|
+
notes: notes,
|
|
192
|
+
outputs: List(outputs).map(Map),
|
|
193
|
+
ownerEmail: ownerEmail,
|
|
159
194
|
nextNodeId: treeJson.lastId + 1,
|
|
160
195
|
nextConnectorId: treeJson.connectors.length,
|
|
161
196
|
nodes: OrderedMap(treeJson.nodes.map(deserializeNode).map(function (n) {
|
|
@@ -164,27 +199,64 @@ export var deserializeTree = function deserializeTree(_ref4) {
|
|
|
164
199
|
schemaVersion: treeJson.schemaVersion,
|
|
165
200
|
sourceGroup: sourceGroup,
|
|
166
201
|
sourceName: sourceName,
|
|
167
|
-
|
|
202
|
+
status: status,
|
|
203
|
+
type: type,
|
|
168
204
|
versionId: versionId
|
|
169
205
|
});
|
|
170
206
|
};
|
|
171
207
|
export var serializeTree = function serializeTree(_ref5) {
|
|
172
208
|
var connectors = _ref5.connectors,
|
|
209
|
+
categories = _ref5.categories,
|
|
210
|
+
definitionId = _ref5.definitionId,
|
|
211
|
+
inputs = _ref5.inputs,
|
|
212
|
+
name = _ref5.name,
|
|
173
213
|
nextNodeId = _ref5.nextNodeId,
|
|
174
214
|
nodes = _ref5.nodes,
|
|
215
|
+
notes = _ref5.notes,
|
|
216
|
+
outputs = _ref5.outputs,
|
|
217
|
+
ownerEmail = _ref5.ownerEmail,
|
|
175
218
|
schemaVersion = _ref5.schemaVersion,
|
|
176
|
-
|
|
219
|
+
sourceGroup = _ref5.sourceGroup,
|
|
220
|
+
sourceName = _ref5.sourceName,
|
|
221
|
+
status = _ref5.status,
|
|
177
222
|
versionId = _ref5.versionId;
|
|
178
223
|
var overwrite = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
179
224
|
return {
|
|
180
|
-
|
|
225
|
+
categories: categories,
|
|
226
|
+
definitionId: definitionId,
|
|
227
|
+
inputs: inputs,
|
|
228
|
+
name: name,
|
|
229
|
+
notes: notes,
|
|
230
|
+
outputs: outputs,
|
|
231
|
+
ownerEmail: ownerEmail,
|
|
232
|
+
sourceGroup: sourceGroup,
|
|
233
|
+
sourceName: sourceName,
|
|
234
|
+
status: status,
|
|
235
|
+
treeJson: {
|
|
181
236
|
connectors: connectors.toList().map(serializeConnector(nodes)).toJS(),
|
|
182
237
|
lastId: nextNodeId - 1,
|
|
183
238
|
nodes: nodes.toList().map(serializeNode).toJS(),
|
|
184
239
|
schemaVersion: schemaVersion
|
|
185
|
-
},
|
|
186
|
-
taskDefinition: taskDefinition
|
|
187
|
-
} : {}),
|
|
240
|
+
},
|
|
188
241
|
versionId: overwrite ? null : versionId
|
|
189
242
|
};
|
|
243
|
+
};
|
|
244
|
+
export var deserializeWebApi = function deserializeWebApi(_ref6, kappSlug) {
|
|
245
|
+
var createdAt = _ref6.createdAt,
|
|
246
|
+
createdBy = _ref6.createdBy,
|
|
247
|
+
method = _ref6.method,
|
|
248
|
+
securityPolicies = _ref6.securityPolicies,
|
|
249
|
+
slug = _ref6.slug,
|
|
250
|
+
updatedAt = _ref6.updatedAt,
|
|
251
|
+
updatedBy = _ref6.updatedBy;
|
|
252
|
+
return WebApi({
|
|
253
|
+
createdAt: createdAt,
|
|
254
|
+
createdBy: createdBy,
|
|
255
|
+
method: method,
|
|
256
|
+
securityPolicies: List(securityPolicies).map(Map),
|
|
257
|
+
slug: slug,
|
|
258
|
+
kappSlug: kappSlug,
|
|
259
|
+
updatedAt: updatedAt,
|
|
260
|
+
updatedBy: updatedBy
|
|
261
|
+
});
|
|
190
262
|
};
|
|
@@ -24,7 +24,7 @@ var dataSource = function dataSource(_ref) {
|
|
|
24
24
|
relatedItem1Type: paramData.filters.get('relatedItem1Type'),
|
|
25
25
|
relatedItem2Id: paramData.filters.get('relatedItem2Id'),
|
|
26
26
|
relatedItem2Type: paramData.filters.get('relatedItem2Type'),
|
|
27
|
-
include: 'details,run,messages,messages.details',
|
|
27
|
+
include: 'details,run,run.details,messages,messages.details',
|
|
28
28
|
limit: paramData.pageSize,
|
|
29
29
|
offset: paramData.nextPageToken,
|
|
30
30
|
timeline: paramData.sortColumn,
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { createTaskTrigger
|
|
2
|
+
import { createTaskTrigger } from '../../../apis';
|
|
3
3
|
import { generateForm } from '../../form/Form';
|
|
4
|
+
import { serializeNodeId } from '../builder/models';
|
|
4
5
|
|
|
5
6
|
var dataSources = function dataSources(_ref) {
|
|
6
|
-
var
|
|
7
|
-
sourceGroup = _ref.sourceGroup,
|
|
8
|
-
name = _ref.name,
|
|
9
|
-
workflowType = _ref.workflowType;
|
|
7
|
+
var tree = _ref.tree;
|
|
10
8
|
return {
|
|
11
9
|
nodes: {
|
|
12
|
-
fn:
|
|
13
|
-
|
|
14
|
-
type: workflowType || 'Tree',
|
|
15
|
-
sourceName: sourceName,
|
|
16
|
-
sourceGroup: sourceGroup,
|
|
17
|
-
name: name,
|
|
18
|
-
include: 'treeJson'
|
|
19
|
-
}],
|
|
20
|
-
transform: function transform(result) {
|
|
21
|
-
return result.tree && result.tree.treeJson ? result.tree.treeJson.nodes.map(function (node) {
|
|
10
|
+
fn: function fn() {
|
|
11
|
+
return tree.nodes.map(function (node) {
|
|
22
12
|
return {
|
|
23
|
-
label: "".concat(node.name, " (").concat(node
|
|
24
|
-
value: node
|
|
13
|
+
label: "".concat(node.name, " (").concat(serializeNodeId(node), ")"),
|
|
14
|
+
value: serializeNodeId(node)
|
|
25
15
|
};
|
|
26
|
-
})
|
|
27
|
-
}
|
|
16
|
+
}).valueSeq().toArray();
|
|
17
|
+
},
|
|
18
|
+
params: []
|
|
28
19
|
}
|
|
29
20
|
};
|
|
30
21
|
};
|
|
@@ -47,10 +38,10 @@ var handleSubmit = function handleSubmit(formOptions) {
|
|
|
47
38
|
};
|
|
48
39
|
};
|
|
49
40
|
|
|
50
|
-
var fields = function fields(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return
|
|
41
|
+
var fields = function fields() {
|
|
42
|
+
return function (_ref3) {
|
|
43
|
+
var nodes = _ref3.nodes;
|
|
44
|
+
return nodes && [{
|
|
54
45
|
name: 'nodeId',
|
|
55
46
|
label: 'Node Id',
|
|
56
47
|
type: 'select',
|
|
@@ -85,7 +76,7 @@ var fields = function fields(_ref3) {
|
|
|
85
76
|
};
|
|
86
77
|
|
|
87
78
|
export var CreateManualTriggerForm = generateForm({
|
|
88
|
-
formOptions: ['
|
|
79
|
+
formOptions: ['runId', 'tree'],
|
|
89
80
|
dataSources: dataSources,
|
|
90
81
|
fields: fields,
|
|
91
82
|
handleSubmit: handleSubmit
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchSources, fetchTaskRuns } from '../../../apis
|
|
1
|
+
import { fetchSources, fetchTaskRuns } from '../../../apis';
|
|
2
2
|
import { generateTable } from '../../table/Table';
|
|
3
3
|
import { get, getIn, Map } from 'immutable';
|
|
4
4
|
var ORDER_BY = Map({
|
|
@@ -20,7 +20,8 @@ var dataSource = function dataSource(_ref) {
|
|
|
20
20
|
treeName = _ref.treeName,
|
|
21
21
|
treeType = _ref.treeType,
|
|
22
22
|
sourceId = _ref.sourceId,
|
|
23
|
-
id = _ref.id
|
|
23
|
+
id = _ref.id,
|
|
24
|
+
count = _ref.count;
|
|
24
25
|
return {
|
|
25
26
|
fn: fetchTaskRuns,
|
|
26
27
|
params: function params(paramData) {
|
|
@@ -41,6 +42,7 @@ var dataSource = function dataSource(_ref) {
|
|
|
41
42
|
include: 'details',
|
|
42
43
|
limit: paramData.pageSize,
|
|
43
44
|
offset: paramData.nextPageToken,
|
|
45
|
+
count: count ? undefined : false,
|
|
44
46
|
orderBy: ORDER_BY.get(paramData.sortColumn, paramData.sortColumn),
|
|
45
47
|
direction: paramData.sortColumn ? paramData.sortDirection : undefined
|
|
46
48
|
}];
|
|
@@ -181,7 +183,7 @@ var columns = [{
|
|
|
181
183
|
sortable: false
|
|
182
184
|
}];
|
|
183
185
|
export var RunTable = generateTable({
|
|
184
|
-
tableOptions: ['sourceName', 'sourceGroup', 'treeName', 'sourceId'],
|
|
186
|
+
tableOptions: ['sourceName', 'sourceGroup', 'treeName', 'sourceId', 'count'],
|
|
185
187
|
columns: columns,
|
|
186
188
|
filters: filters,
|
|
187
189
|
dataSource: dataSource,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { fetchSources, fetchSource, updateTree, createTree, fetchTaskCategories } from '../../../apis';
|
|
3
3
|
import { Form } from '../../form/Form';
|
|
4
4
|
import { get, List, Map } from 'immutable'; // bulids a definition id based on a name (similar to slugify)
|
|
5
5
|
|
|
@@ -10,29 +10,12 @@ var buildDefinitionId = function buildDefinitionId(text) {
|
|
|
10
10
|
.replace(/[^A-Za-z0-9_]+/g, '');
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
var dataSources = function dataSources(
|
|
14
|
-
var workflowType = _ref.workflowType,
|
|
15
|
-
sourceName = _ref.sourceName,
|
|
16
|
-
sourceGroup = _ref.sourceGroup,
|
|
17
|
-
name = _ref.name;
|
|
13
|
+
var dataSources = function dataSources() {
|
|
18
14
|
return {
|
|
19
|
-
workflow: {
|
|
20
|
-
fn: fetchTree,
|
|
21
|
-
params: name && [{
|
|
22
|
-
type: workflowType || 'Tree',
|
|
23
|
-
sourceName: sourceName,
|
|
24
|
-
sourceGroup: sourceGroup,
|
|
25
|
-
name: name,
|
|
26
|
-
include: 'details,inputs,outputs,categories'
|
|
27
|
-
}],
|
|
28
|
-
transform: function transform(result) {
|
|
29
|
-
return result.tree;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
15
|
selectedSource: {
|
|
33
16
|
fn: fetchSource,
|
|
34
|
-
params: function params(
|
|
35
|
-
var values =
|
|
17
|
+
params: function params(_ref) {
|
|
18
|
+
var values = _ref.values;
|
|
36
19
|
return values && values.get('sourceName') && [{
|
|
37
20
|
sourceName: values.get('sourceName'),
|
|
38
21
|
include: 'predefinedSourceGroups,predefinedTreeNames'
|
|
@@ -64,44 +47,41 @@ var dataSources = function dataSources(_ref) {
|
|
|
64
47
|
};
|
|
65
48
|
};
|
|
66
49
|
|
|
67
|
-
var handleSubmit = function handleSubmit(
|
|
68
|
-
var
|
|
69
|
-
sourceGroup = _ref3.sourceGroup,
|
|
70
|
-
name = _ref3.name;
|
|
50
|
+
var handleSubmit = function handleSubmit(_ref2) {
|
|
51
|
+
var workflow = _ref2.workflow;
|
|
71
52
|
return function (values) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
tree: values.toJS()
|
|
79
|
-
})).then(function (_ref4) {
|
|
80
|
-
var tree = _ref4.tree,
|
|
81
|
-
error = _ref4.error;
|
|
53
|
+
if (!workflow) {
|
|
54
|
+
return createTree({
|
|
55
|
+
tree: values.toJS()
|
|
56
|
+
}).then(function (_ref3) {
|
|
57
|
+
var tree = _ref3.tree,
|
|
58
|
+
error = _ref3.error;
|
|
82
59
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
if (error) {
|
|
61
|
+
throw error.statusCode === 400 && error.message || 'There was an error saving the workflow';
|
|
62
|
+
} else {
|
|
63
|
+
return tree;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
return values.toObject();
|
|
68
|
+
}
|
|
89
69
|
};
|
|
90
70
|
};
|
|
91
71
|
|
|
92
|
-
var fields = function fields(
|
|
93
|
-
var name =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
var fields = function fields(_ref4) {
|
|
73
|
+
var name = _ref4.name,
|
|
74
|
+
workflow = _ref4.workflow,
|
|
75
|
+
workflowType = _ref4.workflowType;
|
|
76
|
+
return function (_ref5) {
|
|
77
|
+
var categories = _ref5.categories;
|
|
98
78
|
return (!name || workflow) && categories && [{
|
|
99
79
|
name: 'sourceName',
|
|
100
80
|
label: 'Source',
|
|
101
81
|
type: 'select',
|
|
102
82
|
required: true,
|
|
103
|
-
options: function options(
|
|
104
|
-
var sources =
|
|
83
|
+
options: function options(_ref6) {
|
|
84
|
+
var sources = _ref6.sources;
|
|
105
85
|
return sources;
|
|
106
86
|
},
|
|
107
87
|
initialValue: workflow ? workflow.get('sourceName') : workflowType === 'routines' ? '-' : '',
|
|
@@ -111,8 +91,8 @@ var fields = function fields(_ref5) {
|
|
|
111
91
|
label: 'Source Group',
|
|
112
92
|
type: 'text',
|
|
113
93
|
required: true,
|
|
114
|
-
options: function options(
|
|
115
|
-
var selectedSource =
|
|
94
|
+
options: function options(_ref7) {
|
|
95
|
+
var selectedSource = _ref7.selectedSource;
|
|
116
96
|
return selectedSource ? selectedSource.get('predefinedSourceGroups').map(function (g) {
|
|
117
97
|
return Map({
|
|
118
98
|
label: g,
|
|
@@ -127,8 +107,8 @@ var fields = function fields(_ref5) {
|
|
|
127
107
|
label: 'Name',
|
|
128
108
|
type: 'text',
|
|
129
109
|
required: true,
|
|
130
|
-
options: function options(
|
|
131
|
-
var selectedSource =
|
|
110
|
+
options: function options(_ref8) {
|
|
111
|
+
var selectedSource = _ref8.selectedSource;
|
|
132
112
|
return selectedSource ? selectedSource.get('predefinedTreeNames').map(function (n) {
|
|
133
113
|
return Map({
|
|
134
114
|
label: n,
|
|
@@ -136,9 +116,9 @@ var fields = function fields(_ref5) {
|
|
|
136
116
|
});
|
|
137
117
|
}) : List();
|
|
138
118
|
},
|
|
139
|
-
onChange: function onChange(
|
|
140
|
-
var values =
|
|
141
|
-
var setValue =
|
|
119
|
+
onChange: function onChange(_ref9, _ref10) {
|
|
120
|
+
var values = _ref9.values;
|
|
121
|
+
var setValue = _ref10.setValue;
|
|
142
122
|
|
|
143
123
|
if (values.has('definitionId') && values.get('linked')) {
|
|
144
124
|
setValue('definitionId', buildDefinitionId(values.get('name')), false);
|
|
@@ -151,23 +131,23 @@ var fields = function fields(_ref5) {
|
|
|
151
131
|
label: 'Linked',
|
|
152
132
|
type: 'checkbox',
|
|
153
133
|
"transient": true,
|
|
154
|
-
initialValue: !name,
|
|
134
|
+
initialValue: !name && !workflow,
|
|
155
135
|
visible: false
|
|
156
136
|
}, workflowType !== 'trees' && {
|
|
157
137
|
name: 'definitionId',
|
|
158
138
|
label: 'Definition ID',
|
|
159
139
|
type: 'text',
|
|
160
|
-
enabled: name
|
|
140
|
+
enabled: !name && !workflow,
|
|
161
141
|
required: true,
|
|
162
|
-
onChange: function onChange(_bindings,
|
|
163
|
-
var setValue =
|
|
142
|
+
onChange: function onChange(_bindings, _ref11) {
|
|
143
|
+
var setValue = _ref11.setValue;
|
|
164
144
|
setValue('linked', false);
|
|
165
145
|
},
|
|
166
146
|
initialValue: get(workflow, 'definitionId', '') || '',
|
|
167
147
|
helpText: 'Definition ID is generated by the system and used for API requests',
|
|
168
|
-
serialize: function serialize(
|
|
169
|
-
var values =
|
|
170
|
-
return name ? values.get('definitionId') : "routine_".concat(values.get('definitionId'));
|
|
148
|
+
serialize: function serialize(_ref12) {
|
|
149
|
+
var values = _ref12.values;
|
|
150
|
+
return name || workflow ? values.get('definitionId') : "routine_".concat(values.get('definitionId'));
|
|
171
151
|
}
|
|
172
152
|
}, {
|
|
173
153
|
name: 'notes',
|
|
@@ -202,9 +182,7 @@ var fields = function fields(_ref5) {
|
|
|
202
182
|
name: 'categories',
|
|
203
183
|
label: 'Categories',
|
|
204
184
|
type: 'select-multi',
|
|
205
|
-
initialValue: get(workflow, 'categories', List())
|
|
206
|
-
return c.get('name');
|
|
207
|
-
}),
|
|
185
|
+
initialValue: get(workflow, 'categories', List()),
|
|
208
186
|
options: categories.sortBy(function (c) {
|
|
209
187
|
return c.get('name');
|
|
210
188
|
}).map(function (c) {
|
|
@@ -218,6 +196,10 @@ var fields = function fields(_ref5) {
|
|
|
218
196
|
label: 'Inputs',
|
|
219
197
|
type: 'table',
|
|
220
198
|
options: [{
|
|
199
|
+
name: 'drag',
|
|
200
|
+
label: null,
|
|
201
|
+
type: 'drag'
|
|
202
|
+
}, {
|
|
221
203
|
name: 'name',
|
|
222
204
|
label: 'Name',
|
|
223
205
|
type: 'text'
|
|
@@ -234,12 +216,16 @@ var fields = function fields(_ref5) {
|
|
|
234
216
|
label: 'Required',
|
|
235
217
|
type: 'checkbox'
|
|
236
218
|
}],
|
|
237
|
-
initialValue: get(workflow, 'inputs',
|
|
219
|
+
initialValue: get(workflow, 'inputs', List())
|
|
238
220
|
}, workflowType !== 'trees' && {
|
|
239
221
|
name: 'outputs',
|
|
240
222
|
label: 'Outputs',
|
|
241
223
|
type: 'table',
|
|
242
224
|
options: [{
|
|
225
|
+
name: 'drag',
|
|
226
|
+
label: null,
|
|
227
|
+
type: 'drag'
|
|
228
|
+
}, {
|
|
243
229
|
name: 'name',
|
|
244
230
|
label: 'Name',
|
|
245
231
|
type: 'text'
|
|
@@ -248,24 +234,22 @@ var fields = function fields(_ref5) {
|
|
|
248
234
|
label: 'Description',
|
|
249
235
|
type: 'text'
|
|
250
236
|
}],
|
|
251
|
-
initialValue: get(workflow, 'outputs',
|
|
237
|
+
initialValue: get(workflow, 'outputs', List())
|
|
252
238
|
}];
|
|
253
239
|
};
|
|
254
240
|
};
|
|
255
241
|
|
|
256
|
-
export var WorkflowForm = function WorkflowForm(
|
|
257
|
-
var addFields =
|
|
258
|
-
alterFields =
|
|
259
|
-
fieldSet =
|
|
260
|
-
formKey =
|
|
261
|
-
components =
|
|
262
|
-
onSave =
|
|
263
|
-
onError =
|
|
264
|
-
children =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
sourceGroup = _ref14.sourceGroup,
|
|
268
|
-
name = _ref14.name;
|
|
242
|
+
export var WorkflowForm = function WorkflowForm(_ref13) {
|
|
243
|
+
var addFields = _ref13.addFields,
|
|
244
|
+
alterFields = _ref13.alterFields,
|
|
245
|
+
fieldSet = _ref13.fieldSet,
|
|
246
|
+
formKey = _ref13.formKey,
|
|
247
|
+
components = _ref13.components,
|
|
248
|
+
onSave = _ref13.onSave,
|
|
249
|
+
onError = _ref13.onError,
|
|
250
|
+
children = _ref13.children,
|
|
251
|
+
workflow = _ref13.workflow,
|
|
252
|
+
workflowType = _ref13.workflowType;
|
|
269
253
|
return /*#__PURE__*/React.createElement(Form, {
|
|
270
254
|
addFields: addFields,
|
|
271
255
|
alterFields: alterFields,
|
|
@@ -278,10 +262,8 @@ export var WorkflowForm = function WorkflowForm(_ref14) {
|
|
|
278
262
|
dataSources: dataSources,
|
|
279
263
|
fields: fields,
|
|
280
264
|
formOptions: {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
sourceGroup: sourceGroup,
|
|
284
|
-
name: name
|
|
265
|
+
workflow: workflow,
|
|
266
|
+
workflowType: workflowType
|
|
285
267
|
}
|
|
286
268
|
}, children);
|
|
287
269
|
};
|
package/lib/helpers/index.js
CHANGED
|
@@ -69,6 +69,7 @@ export var buildDefinitionId = function buildDefinitionId(text) {
|
|
|
69
69
|
.replace(/\s+/g, '_') // Remove unwanted chars
|
|
70
70
|
.replace(/[^A-Za-z0-9_]+/g, '');
|
|
71
71
|
};
|
|
72
|
+
var FILE_STATIC_BINDINGS = [['Folder', 'folder'], ['Name', 'name'], ['Path', 'path']];
|
|
72
73
|
var SUBMISSION_STATIC_BINDINGS = [['Anonymous', 'anonymous'], ['Closed At', 'closedAt'], ['Closed By', 'closedBy'], ['Core State', 'coreState'], ['Created At', 'createdAt'], ['Created By', 'createdBy'], ['Current Page', 'currentPage'], ['Id', 'id'], ['Session Token', 'sessionToken'], ['Submitted At', 'submittedAt'], ['Submitted By', 'submittedBy'], ['Type', 'type'], ['Updated At', 'updatedAt'], ['Updated By', 'updatedBy']];
|
|
73
74
|
var TEAM_STATIC_BINDINGS = [['Name', 'name'], ['Slug', 'slug']];
|
|
74
75
|
var USER_STATIC_BINDINGS = [['Display Name', 'displayName'], ['Email', 'email'], ['Invited By', 'invitedBy'], ['Space Admin', 'spaceAdmin'], ['Username', 'username']];
|
|
@@ -93,7 +94,7 @@ var bindifyProfile = function bindifyProfile(fnName, staticMap, attributes, prof
|
|
|
93
94
|
});
|
|
94
95
|
});
|
|
95
96
|
var combinedMap = OrderedMap(staticMap).merge(attributesMap).merge(profileAttributesMap);
|
|
96
|
-
return combinedMap.map(function (value
|
|
97
|
+
return combinedMap.map(function (value) {
|
|
97
98
|
return Map({
|
|
98
99
|
value: Map.isMap(value) ? value.get('value') : "".concat(fnName, "('").concat(value, "')"),
|
|
99
100
|
tags: []
|
|
@@ -125,6 +126,8 @@ export var buildBindings = function buildBindings(_ref) {
|
|
|
125
126
|
profile = _ref.profile;
|
|
126
127
|
return OrderedMap([['Identity', Map({
|
|
127
128
|
children: profile && bindifyProfile('identity', IDENTITY_STATIC_BINDINGS, get(profile, 'attributesMap'), get(profile, 'profileAttributesMap'))
|
|
129
|
+
})], ['File Resource', Map({
|
|
130
|
+
children: ['File Resource'].includes(scope) && bindify('file', FILE_STATIC_BINDINGS)
|
|
128
131
|
})], ['Form', Map({
|
|
129
132
|
children: ['Datastore Form', 'Datastore Submission', 'Form', 'Submission'].includes(scope) && bindify('form', FORM_STATIC_BINDINGS, scope.startsWith('Datastore') ? get(space, 'datastoreFormAttributeDefinitions') : get(kapp, 'formAttributeDefinitions'))
|
|
130
133
|
})], ['Kapp', Map({
|
package/lib/index.js
CHANGED
|
@@ -43,6 +43,7 @@ export var KineticLib = function KineticLib(props) {
|
|
|
43
43
|
value: DefaultFieldConfig.merge(DefaultTableConfig).merge(remove(props.components || {}, 'fields')).merge(props.components && props.components.fields)
|
|
44
44
|
}, typeof props.children === 'function' ? /*#__PURE__*/React.createElement(AuthenticationContainer, {
|
|
45
45
|
noSocket: props.noSocket,
|
|
46
|
+
skipInit: props.skipInit,
|
|
46
47
|
system: props.system
|
|
47
48
|
}, props.children) : props.children))));
|
|
48
49
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kineticdata/react",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
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": "
|
|
95
|
+
"gitHead": "d53f237edee36bdd6ed9ce00734dbdf045ea3f5b"
|
|
96
96
|
}
|
package/proxyhelper.js
CHANGED
|
@@ -69,18 +69,31 @@ module.exports = (
|
|
|
69
69
|
ws: true,
|
|
70
70
|
xfwd: true,
|
|
71
71
|
onProxyReq: (proxyRequest, originalRequest) => {
|
|
72
|
-
if (process.env.PROXY_DEBUGGING)
|
|
73
|
-
(proxyLogger || defaultProxyLogger)({
|
|
74
|
-
proxyRequest,
|
|
75
|
-
originalRequest,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
72
|
// Browsers may send Origin headers even with same-origin
|
|
79
73
|
// requests. To prevent CORS issues, we have to change
|
|
80
74
|
// the Origin to match the target URL.
|
|
81
75
|
if (proxyRequest.getHeader('origin')) {
|
|
82
76
|
proxyRequest.setHeader('origin', target);
|
|
83
77
|
}
|
|
78
|
+
|
|
79
|
+
if (
|
|
80
|
+
process.env.REACT_APP_PROXY_SUBDOMAIN &&
|
|
81
|
+
(!proxyRequest.path.endsWith('pack') ||
|
|
82
|
+
!proxyRequest.path.endsWith('favicon.ico'))
|
|
83
|
+
) {
|
|
84
|
+
proxyRequest.setHeader(
|
|
85
|
+
'X-Kinetic-Subdomain',
|
|
86
|
+
process.env.REACT_APP_PROXY_SUBDOMAIN,
|
|
87
|
+
);
|
|
88
|
+
proxyRequest.path =
|
|
89
|
+
'/' + process.env.REACT_APP_PROXY_SUBDOMAIN + proxyRequest.path;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (process.env.PROXY_DEBUGGING)
|
|
93
|
+
(proxyLogger || defaultProxyLogger)({
|
|
94
|
+
proxyRequest,
|
|
95
|
+
originalRequest,
|
|
96
|
+
});
|
|
84
97
|
},
|
|
85
98
|
onProxyRes: (proxyResponse, originalRequest) => {
|
|
86
99
|
if (process.env.PROXY_DEBUGGING)
|