@kineticdata/react 5.1.0 → 5.1.2
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/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 +20 -8
- package/lib/apis/core/bridgedresources.js +4 -2
- package/lib/apis/core/bridgedresources.test.js +1 -1
- package/lib/apis/core/formTypes.js +18 -21
- package/lib/apis/core/forms.js +2 -1
- package/lib/apis/core/oauthClients.js +11 -5
- package/lib/apis/core/platformItems.js +21 -0
- package/lib/apis/core/securityPolicyDefinitions.js +1 -1
- package/lib/apis/core/submissions.js +92 -3
- package/lib/apis/core/submissions.test.js +46 -19
- package/lib/apis/core/webhooks.js +1 -1
- package/lib/apis/core/webhooks.test.js +2 -2
- package/lib/apis/core/workflows.js +56 -0
- package/lib/apis/http.js +6 -0
- package/lib/apis/index.js +3 -1
- package/lib/apis/task/index.js +7 -3
- package/lib/components/index.js +2 -0
- package/lib/components/table/Table.js +14 -7
- package/lib/components/table/Table.redux.js +16 -8
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +1 -1
- package/lib/components/task/builder/builder.redux.js +65 -28
- package/lib/components/task/builder/models.js +19 -0
- package/lib/components/task/workflows/LinkedWorkflowForm.js +255 -0
- package/lib/components/task/workflows/LinkedWorkflowTable.js +133 -0
- package/lib/components/task/workflows/WorkflowForm.js +12 -2
- package/package.json +3 -3
- package/proxyhelper.js +1 -2
|
@@ -224,7 +224,7 @@ describe('#searchSubmissions', function () {
|
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
search = new SubmissionSearch().build();
|
|
227
|
-
axios.
|
|
227
|
+
axios.post = resolvePromiseWith(response);
|
|
228
228
|
});
|
|
229
229
|
test('does not return errors', function () {
|
|
230
230
|
expect.assertions(1);
|
|
@@ -265,6 +265,33 @@ describe('#searchSubmissions', function () {
|
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
267
|
});
|
|
268
|
+
describe('when successful - get', function () {
|
|
269
|
+
var response;
|
|
270
|
+
var search;
|
|
271
|
+
beforeEach(function () {
|
|
272
|
+
response = {
|
|
273
|
+
status: 200,
|
|
274
|
+
data: {
|
|
275
|
+
submissions: [],
|
|
276
|
+
messages: [],
|
|
277
|
+
nextPageToken: 'page-token'
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
search = new SubmissionSearch().build();
|
|
281
|
+
axios.get = resolvePromiseWith(response);
|
|
282
|
+
});
|
|
283
|
+
test('does return submissions', function () {
|
|
284
|
+
expect.assertions(2);
|
|
285
|
+
return searchSubmissions({
|
|
286
|
+
search: search,
|
|
287
|
+
get: true
|
|
288
|
+
}).then(function (_ref5) {
|
|
289
|
+
var submissions = _ref5.submissions;
|
|
290
|
+
expect(submissions).toBeDefined();
|
|
291
|
+
expect(submissions).toBeInstanceOf(Array);
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
});
|
|
268
295
|
});
|
|
269
296
|
describe('#fetchSubmission', function () {
|
|
270
297
|
describe('when successful', function () {
|
|
@@ -287,8 +314,8 @@ describe('#fetchSubmission', function () {
|
|
|
287
314
|
expect.assertions(1);
|
|
288
315
|
return fetchSubmission({
|
|
289
316
|
id: id
|
|
290
|
-
}).then(function (
|
|
291
|
-
var errors =
|
|
317
|
+
}).then(function (_ref6) {
|
|
318
|
+
var errors = _ref6.errors;
|
|
292
319
|
expect(errors).toBeUndefined();
|
|
293
320
|
});
|
|
294
321
|
});
|
|
@@ -296,8 +323,8 @@ describe('#fetchSubmission', function () {
|
|
|
296
323
|
expect.assertions(1);
|
|
297
324
|
return fetchSubmission({
|
|
298
325
|
id: id
|
|
299
|
-
}).then(function (
|
|
300
|
-
var submission =
|
|
326
|
+
}).then(function (_ref7) {
|
|
327
|
+
var submission = _ref7.submission;
|
|
301
328
|
expect(submission).toMatchObject({
|
|
302
329
|
id: id,
|
|
303
330
|
values: values
|
|
@@ -323,8 +350,8 @@ describe('#fetchSubmission', function () {
|
|
|
323
350
|
expect.assertions(1);
|
|
324
351
|
return fetchSubmission({
|
|
325
352
|
id: 'fake'
|
|
326
|
-
}).then(function (
|
|
327
|
-
var error =
|
|
353
|
+
}).then(function (_ref8) {
|
|
354
|
+
var error = _ref8.error;
|
|
328
355
|
expect(error).toEqual({
|
|
329
356
|
statusCode: 500,
|
|
330
357
|
key: null,
|
|
@@ -359,8 +386,8 @@ describe('#createSubmission', function () {
|
|
|
359
386
|
kappSlug: kappSlug,
|
|
360
387
|
formSlug: formSlug,
|
|
361
388
|
values: values
|
|
362
|
-
}).then(function (
|
|
363
|
-
var errors =
|
|
389
|
+
}).then(function (_ref9) {
|
|
390
|
+
var errors = _ref9.errors;
|
|
364
391
|
expect(errors).toBeUndefined();
|
|
365
392
|
});
|
|
366
393
|
});
|
|
@@ -370,8 +397,8 @@ describe('#createSubmission', function () {
|
|
|
370
397
|
kappSlug: kappSlug,
|
|
371
398
|
formSlug: formSlug,
|
|
372
399
|
values: values
|
|
373
|
-
}).then(function (
|
|
374
|
-
var submission =
|
|
400
|
+
}).then(function (_ref10) {
|
|
401
|
+
var submission = _ref10.submission;
|
|
375
402
|
expect(submission).toMatchObject({
|
|
376
403
|
id: id,
|
|
377
404
|
values: values
|
|
@@ -443,8 +470,8 @@ describe('#createSubmission', function () {
|
|
|
443
470
|
return createSubmission({
|
|
444
471
|
formSlug: formSlug,
|
|
445
472
|
values: values
|
|
446
|
-
}).then(function (
|
|
447
|
-
var error =
|
|
473
|
+
}).then(function (_ref11) {
|
|
474
|
+
var error = _ref11.error;
|
|
448
475
|
expect(error).toEqual({
|
|
449
476
|
statusCode: 500,
|
|
450
477
|
key: null,
|
|
@@ -475,8 +502,8 @@ describe('#deleteSubmission', function () {
|
|
|
475
502
|
expect.assertions(1);
|
|
476
503
|
return deleteSubmission({
|
|
477
504
|
id: id
|
|
478
|
-
}).then(function (
|
|
479
|
-
var errors =
|
|
505
|
+
}).then(function (_ref12) {
|
|
506
|
+
var errors = _ref12.errors;
|
|
480
507
|
expect(errors).toBeUndefined();
|
|
481
508
|
});
|
|
482
509
|
});
|
|
@@ -484,8 +511,8 @@ describe('#deleteSubmission', function () {
|
|
|
484
511
|
expect.assertions(1);
|
|
485
512
|
return deleteSubmission({
|
|
486
513
|
id: id
|
|
487
|
-
}).then(function (
|
|
488
|
-
var submission =
|
|
514
|
+
}).then(function (_ref13) {
|
|
515
|
+
var submission = _ref13.submission;
|
|
489
516
|
expect(submission).toMatchObject({
|
|
490
517
|
id: id,
|
|
491
518
|
values: values
|
|
@@ -511,8 +538,8 @@ describe('#deleteSubmission', function () {
|
|
|
511
538
|
expect.assertions(1);
|
|
512
539
|
return deleteSubmission({
|
|
513
540
|
id: 'fake'
|
|
514
|
-
}).then(function (
|
|
515
|
-
var error =
|
|
541
|
+
}).then(function (_ref14) {
|
|
542
|
+
var error = _ref14.error;
|
|
516
543
|
expect(error).toEqual({
|
|
517
544
|
statusCode: 500,
|
|
518
545
|
key: null,
|
|
@@ -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
|
|
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
|
|
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: '',
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { apiGroup, handleErrors, headerBuilder, paramBuilder } from '../http';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { bundle } from '../../helpers';
|
|
4
|
+
|
|
5
|
+
var _apiGroup = apiGroup({
|
|
6
|
+
name: 'Workflow',
|
|
7
|
+
dataOption: 'workflow',
|
|
8
|
+
plural: {
|
|
9
|
+
requiredOptions: [],
|
|
10
|
+
url: function url(_ref) {
|
|
11
|
+
var kappSlug = _ref.kappSlug,
|
|
12
|
+
formSlug = _ref.formSlug;
|
|
13
|
+
return formSlug ? "/kapps/".concat(kappSlug, "/forms/").concat(formSlug, "/workflows") : kappSlug ? "/kapps/".concat(kappSlug, "/workflows") : "/workflows";
|
|
14
|
+
},
|
|
15
|
+
transform: function transform(response) {
|
|
16
|
+
return response.data;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
singular: {
|
|
20
|
+
requiredOptions: ['workflowId'],
|
|
21
|
+
url: function url(_ref2) {
|
|
22
|
+
var workflowId = _ref2.workflowId,
|
|
23
|
+
kappSlug = _ref2.kappSlug,
|
|
24
|
+
formSlug = _ref2.formSlug;
|
|
25
|
+
return formSlug ? "/kapps/".concat(kappSlug, "/forms/").concat(formSlug, "/workflows/").concat(workflowId) : kappSlug ? "/kapps/".concat(kappSlug, "/workflows/").concat(workflowId) : "/workflows/".concat(workflowId);
|
|
26
|
+
},
|
|
27
|
+
transform: function transform(response) {
|
|
28
|
+
return {
|
|
29
|
+
workflow: response.data
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
fetchWorkflows = _apiGroup.fetchWorkflows,
|
|
35
|
+
fetchWorkflow = _apiGroup.fetchWorkflow,
|
|
36
|
+
createWorkflow = _apiGroup.createWorkflow,
|
|
37
|
+
updateWorkflow = _apiGroup.updateWorkflow,
|
|
38
|
+
deleteWorkflow = _apiGroup.deleteWorkflow;
|
|
39
|
+
|
|
40
|
+
export { fetchWorkflows, fetchWorkflow, createWorkflow, updateWorkflow, deleteWorkflow };
|
|
41
|
+
|
|
42
|
+
var repairPath = function repairPath(_ref3) {
|
|
43
|
+
var kappSlug = _ref3.kappSlug,
|
|
44
|
+
formSlug = _ref3.formSlug;
|
|
45
|
+
return kappSlug && formSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms/").concat(formSlug, "/workflows/repair") : kappSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/workflows/repair") : "".concat(bundle.apiLocation(), "/workflows/repair");
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export var repairWorkflows = function repairWorkflows() {
|
|
49
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
50
|
+
return axios.post(repairPath(options), {
|
|
51
|
+
params: paramBuilder(options),
|
|
52
|
+
headers: headerBuilder(options)
|
|
53
|
+
}).then(function (response) {
|
|
54
|
+
return response.data;
|
|
55
|
+
})["catch"](handleErrors);
|
|
56
|
+
};
|
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
|
|
package/lib/apis/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * from './core/meta';
|
|
|
22
22
|
export * from './core/notices';
|
|
23
23
|
export * from './core/oauthClients';
|
|
24
24
|
export * from './core/platformComponents';
|
|
25
|
+
export * from './core/platformItems';
|
|
25
26
|
export * from './core/profile';
|
|
26
27
|
export * from './core/securityPolicyDefinitions';
|
|
27
28
|
export * from './core/space';
|
|
@@ -32,7 +33,8 @@ export * from './core/users';
|
|
|
32
33
|
export * from './core/version';
|
|
33
34
|
export * from './core/webApis';
|
|
34
35
|
export * from './core/webhooks';
|
|
35
|
-
export * from './core/webhooksJobs';
|
|
36
|
+
export * from './core/webhooksJobs';
|
|
37
|
+
export * from './core/workflows'; // Discussions
|
|
36
38
|
|
|
37
39
|
export * from './discussions'; // Http
|
|
38
40
|
|
package/lib/apis/task/index.js
CHANGED
|
@@ -42,9 +42,12 @@ export var fetchTrees = function fetchTrees() {
|
|
|
42
42
|
};
|
|
43
43
|
export var fetchTree = function fetchTree() {
|
|
44
44
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
|
|
46
|
+
if (!options.guid) {
|
|
47
|
+
validateOptions('fetchTree', ['name'], options);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return axios.get(options.guid ? "".concat(bundle.spaceLocation(), "/app/components/task/app/api/v2/trees/guid/").concat(options.guid) : "".concat(bundle.spaceLocation(), "/app/components/task/app/api/v2/trees/").concat(buildTreeId(options)), {
|
|
48
51
|
params: {
|
|
49
52
|
include: options.include
|
|
50
53
|
}
|
|
@@ -635,6 +638,7 @@ export var fetchTaskRuns = function fetchTaskRuns() {
|
|
|
635
638
|
return {
|
|
636
639
|
runs: response.data.runs,
|
|
637
640
|
count: response.data.count,
|
|
641
|
+
more: response.data.more,
|
|
638
642
|
nextPageToken: generateNextPageToken(response.data)
|
|
639
643
|
};
|
|
640
644
|
})["catch"](handleErrors);
|
package/lib/components/index.js
CHANGED
|
@@ -119,6 +119,8 @@ export { TriggerTable } from './task/triggers/TriggerTable';
|
|
|
119
119
|
export { RunErrorTable } from './task/errors/RunErrorTable';
|
|
120
120
|
export { SystemErrorsTable } from './task/errors/SystemErrorsTable';
|
|
121
121
|
export { WorkflowTable } from './task/workflows/WorkflowTable';
|
|
122
|
+
export { LinkedWorkflowTable } from './task/workflows/LinkedWorkflowTable';
|
|
123
|
+
export { LinkedWorkflowForm } from './task/workflows/LinkedWorkflowForm';
|
|
122
124
|
export { MissingRoutineTable } from './task/workflows/MissingRoutineTable';
|
|
123
125
|
export { WorkflowForm } from './task/workflows/WorkflowForm';
|
|
124
126
|
export { SourceTable } from './task/sources/SourceTable';
|
|
@@ -38,7 +38,8 @@ var TableComponent = function TableComponent(props) {
|
|
|
38
38
|
components = props.components,
|
|
39
39
|
tableKey = props.tableKey,
|
|
40
40
|
_filterFormKey = props.filterFormKey,
|
|
41
|
-
count = props.count
|
|
41
|
+
count = props.count,
|
|
42
|
+
extraData = props.extraData;
|
|
42
43
|
var table = buildTable(props);
|
|
43
44
|
var filter = components.FilterForm ? buildFilterForm(props) : buildFilterLayout(props);
|
|
44
45
|
var pagination = buildPaginationControl(props);
|
|
@@ -53,7 +54,8 @@ var TableComponent = function TableComponent(props) {
|
|
|
53
54
|
loading: loading,
|
|
54
55
|
rows: rows,
|
|
55
56
|
count: count,
|
|
56
|
-
error: error
|
|
57
|
+
error: error,
|
|
58
|
+
extraData: extraData
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
|
|
@@ -266,7 +268,8 @@ var buildPaginationControl = function buildPaginationControl(props) {
|
|
|
266
268
|
count = props.count,
|
|
267
269
|
components = props.components,
|
|
268
270
|
loading = props.loading,
|
|
269
|
-
renderOptions = props.renderOptions
|
|
271
|
+
renderOptions = props.renderOptions,
|
|
272
|
+
extraData = props.extraData;
|
|
270
273
|
var PaginationControl = components.PaginationControl;
|
|
271
274
|
var prevPage = hasPrevPage(data, dataSource, tableOptions, pageTokens, pageOffset) ? onPrevPage(tableKey) : null;
|
|
272
275
|
var nextPage = hasNextPage(data, dataSource, tableOptions, pageOffset, pageSize, currentPageToken, rows) ? onNextPage(tableKey) : null;
|
|
@@ -286,7 +289,8 @@ var buildPaginationControl = function buildPaginationControl(props) {
|
|
|
286
289
|
endIndex: endIndex,
|
|
287
290
|
count: count,
|
|
288
291
|
renderOptions: renderOptions,
|
|
289
|
-
tableOptions: tableOptions
|
|
292
|
+
tableOptions: tableOptions,
|
|
293
|
+
extraData: extraData
|
|
290
294
|
});
|
|
291
295
|
};
|
|
292
296
|
|
|
@@ -306,7 +310,8 @@ export var buildTable = function buildTable(props) {
|
|
|
306
310
|
error: props.error,
|
|
307
311
|
empty: props.rows.isEmpty(),
|
|
308
312
|
renderOptions: props.renderOptions,
|
|
309
|
-
tableOptions: props.tableOptions
|
|
313
|
+
tableOptions: props.tableOptions,
|
|
314
|
+
extraData: props.extraData
|
|
310
315
|
});
|
|
311
316
|
};
|
|
312
317
|
export var buildTableHeader = function buildTableHeader(props) {
|
|
@@ -412,7 +417,8 @@ export var buildTableBodyCells = function buildTableBodyCells(props, row, rowInd
|
|
|
412
417
|
columnComponents = props.columnComponents,
|
|
413
418
|
appliedFilters = props.appliedFilters,
|
|
414
419
|
renderOptions = props.renderOptions,
|
|
415
|
-
tableOptions = props.tableOptions
|
|
420
|
+
tableOptions = props.tableOptions,
|
|
421
|
+
extraData = props.extraData;
|
|
416
422
|
return fromColumnSet(columns, columnSet).map(function (column, index) {
|
|
417
423
|
var BodyCell = columnComponents.getIn([column.get('value'), 'BodyCell'], components.BodyCell);
|
|
418
424
|
var value = row.get(column.get('value'));
|
|
@@ -428,7 +434,8 @@ export var buildTableBodyCells = function buildTableBodyCells(props, row, rowInd
|
|
|
428
434
|
column: column,
|
|
429
435
|
filters: appliedFilters,
|
|
430
436
|
renderOptions: renderOptions,
|
|
431
|
-
tableOptions: tableOptions
|
|
437
|
+
tableOptions: tableOptions,
|
|
438
|
+
extraData: extraData
|
|
432
439
|
}));
|
|
433
440
|
});
|
|
434
441
|
};
|
|
@@ -138,6 +138,7 @@ regHandlers({
|
|
|
138
138
|
onFetch = _ref3$payload.onFetch;
|
|
139
139
|
return !state.getIn(['tables', tableKey, 'mounted']) ? state : state.hasIn(['tables', tableKey, 'configured']) ? state.setIn(['tables', tableKey, 'initialize'], false) : state.mergeIn(['tables', tableKey], Map({
|
|
140
140
|
data: hasData(data) ? fromJS(data) : data,
|
|
141
|
+
extraData: null,
|
|
141
142
|
dataSource: dataSource,
|
|
142
143
|
tableOptions: tableOptions,
|
|
143
144
|
columns: columns,
|
|
@@ -170,12 +171,14 @@ regHandlers({
|
|
|
170
171
|
tableKey = _ref4$payload.tableKey,
|
|
171
172
|
rows = _ref4$payload.rows,
|
|
172
173
|
data = _ref4$payload.data,
|
|
174
|
+
_ref4$payload$extraDa = _ref4$payload.extraData,
|
|
175
|
+
extraData = _ref4$payload$extraDa === void 0 ? null : _ref4$payload$extraDa,
|
|
173
176
|
nextPageToken = _ref4$payload.nextPageToken,
|
|
174
177
|
count = _ref4$payload.count,
|
|
175
178
|
_ref4$payload$error = _ref4$payload.error,
|
|
176
179
|
error = _ref4$payload$error === void 0 ? null : _ref4$payload$error;
|
|
177
180
|
return state.updateIn(['tables', tableKey], function (table) {
|
|
178
|
-
return table && table.set('rows', rows).set('data', data).set('currentPageToken', nextPageToken).set('nextPageToken', null).set('count', count).set('error', error).set('initializing', false).set('loading', false);
|
|
181
|
+
return table && table.set('rows', rows).set('data', data).set('extraData', extraData).set('currentPageToken', nextPageToken).set('nextPageToken', null).set('count', count).set('error', error).set('initializing', false).set('loading', false);
|
|
179
182
|
});
|
|
180
183
|
},
|
|
181
184
|
NEXT_PAGE: function NEXT_PAGE(state, _ref5) {
|
|
@@ -250,7 +253,7 @@ regHandlers({
|
|
|
250
253
|
});
|
|
251
254
|
|
|
252
255
|
function calculateRowsTask(_ref15) {
|
|
253
|
-
var payload, tableKey, tableData, response, rows, data, nextPageToken, count, error, onFetch;
|
|
256
|
+
var payload, tableKey, tableData, response, rows, data, nextPageToken, count, error, extraData, onFetch;
|
|
254
257
|
return _regeneratorRuntime.wrap(function calculateRowsTask$(_context) {
|
|
255
258
|
while (1) {
|
|
256
259
|
switch (_context.prev = _context.next) {
|
|
@@ -279,7 +282,7 @@ function calculateRowsTask(_ref15) {
|
|
|
279
282
|
|
|
280
283
|
case 10:
|
|
281
284
|
response = _context.sent;
|
|
282
|
-
rows = response.rows, data = response.data, nextPageToken = response.nextPageToken, count = response.count, error = response.error;
|
|
285
|
+
rows = response.rows, data = response.data, nextPageToken = response.nextPageToken, count = response.count, error = response.error, extraData = response.extraData;
|
|
283
286
|
onFetch = tableData.get('onFetch');
|
|
284
287
|
|
|
285
288
|
if (!error) {
|
|
@@ -296,7 +299,8 @@ function calculateRowsTask(_ref15) {
|
|
|
296
299
|
rows: List(),
|
|
297
300
|
data: List(),
|
|
298
301
|
nextPageToken: null,
|
|
299
|
-
count: null
|
|
302
|
+
count: null,
|
|
303
|
+
extraData: extraData
|
|
300
304
|
}
|
|
301
305
|
});
|
|
302
306
|
|
|
@@ -313,7 +317,8 @@ function calculateRowsTask(_ref15) {
|
|
|
313
317
|
rows: rows,
|
|
314
318
|
data: data,
|
|
315
319
|
nextPageToken: nextPageToken,
|
|
316
|
-
count: count
|
|
320
|
+
count: count,
|
|
321
|
+
extraData: extraData
|
|
317
322
|
}
|
|
318
323
|
});
|
|
319
324
|
|
|
@@ -328,7 +333,8 @@ function calculateRowsTask(_ref15) {
|
|
|
328
333
|
tableKey: tableKey,
|
|
329
334
|
rows: rows,
|
|
330
335
|
count: count,
|
|
331
|
-
error: error
|
|
336
|
+
error: error,
|
|
337
|
+
extraData: extraData
|
|
332
338
|
});
|
|
333
339
|
|
|
334
340
|
case 23:
|
|
@@ -647,7 +653,8 @@ var calculateRows = function calculateRows(tableData) {
|
|
|
647
653
|
var _transform = transform(response, paramData),
|
|
648
654
|
nextPageToken = _transform.nextPageToken,
|
|
649
655
|
responseData = _transform.data,
|
|
650
|
-
count = _transform.count
|
|
656
|
+
count = _transform.count,
|
|
657
|
+
extraData = _transform.extraData;
|
|
651
658
|
|
|
652
659
|
var data = fromJS(responseData);
|
|
653
660
|
var transformedRows = transformData(data, tableData);
|
|
@@ -656,7 +663,8 @@ var calculateRows = function calculateRows(tableData) {
|
|
|
656
663
|
nextPageToken: nextPageToken,
|
|
657
664
|
count: dataSource.clientSideSearch || dataSource.clientSide ? rows.size : count,
|
|
658
665
|
data: data,
|
|
659
|
-
rows: rows
|
|
666
|
+
rows: rows,
|
|
667
|
+
extraData: extraData
|
|
660
668
|
};
|
|
661
669
|
});
|
|
662
670
|
} else {
|
|
@@ -11,7 +11,7 @@ export var checkOmittedParameters = function checkOmittedParameters(node, parame
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
export var generateTaskDefinition = function generateTaskDefinition(taskDefinition) {
|
|
14
|
-
if (taskDefinition.definitionName === 'system_submission_create') {
|
|
14
|
+
if (taskDefinition && taskDefinition.definitionName === 'system_submission_create') {
|
|
15
15
|
return function (_ref) {
|
|
16
16
|
var form = _ref.form;
|
|
17
17
|
return _objectSpread(_objectSpread({}, taskDefinition), {}, {
|
|
@@ -7,7 +7,7 @@ import { List, OrderedMap } from 'immutable';
|
|
|
7
7
|
import { isFunction } from 'lodash-es';
|
|
8
8
|
import { action, dispatch, regHandlers, regSaga } from '../../../store';
|
|
9
9
|
import { deserializeTree, serializeTree, Connector, TreeBuilderState, deserializeWebApi } from './models';
|
|
10
|
-
import {
|
|
10
|
+
import { createWorkflow, createTree, fetchPlatformItem, fetchTaskCategories, fetchTree, fetchWebApi, updateTree, updateWebApi } from '../../../apis';
|
|
11
11
|
import { renameDependencies, treeReturnTask } from './helpers';
|
|
12
12
|
export var mountTreeBuilder = function mountTreeBuilder(treeKey) {
|
|
13
13
|
return dispatch('TREE_MOUNT', {
|
|
@@ -34,7 +34,7 @@ var remember = function remember(state, treeKey) {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
regSaga(takeEvery('TREE_CONFIGURE', /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
37
|
-
var payload, name, sourceGroup, sourceName, treeKey, webApiProps, _yield$all, _yield$all2, tree, categories, webApi;
|
|
37
|
+
var payload, name, sourceGroup, sourceName, treeKey, webApiProps, _yield$all, _yield$all2, tree, categories, webApi, platformItem, result;
|
|
38
38
|
|
|
39
39
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
40
|
while (1) {
|
|
@@ -62,33 +62,62 @@ regSaga(takeEvery('TREE_CONFIGURE', /*#__PURE__*/_regeneratorRuntime.mark(functi
|
|
|
62
62
|
tree = _yield$all2[0].tree;
|
|
63
63
|
categories = _yield$all2[1].categories;
|
|
64
64
|
webApi = _yield$all2[2].webApi;
|
|
65
|
-
|
|
65
|
+
platformItem = null;
|
|
66
|
+
|
|
67
|
+
if (!tree.event) {
|
|
68
|
+
_context.next = 17;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
_context.next = 15;
|
|
73
|
+
return call(fetchPlatformItem, {
|
|
74
|
+
type: tree.platformItemType,
|
|
75
|
+
id: tree.platformItemId
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
case 15:
|
|
79
|
+
result = _context.sent;
|
|
80
|
+
platformItem = result.platformItem;
|
|
81
|
+
|
|
82
|
+
case 17:
|
|
83
|
+
_context.next = 19;
|
|
66
84
|
return put(action('TREE_LOADED', {
|
|
67
85
|
categories: categories,
|
|
68
86
|
kappSlug: webApiProps && webApiProps.kappSlug,
|
|
87
|
+
platformItem: platformItem,
|
|
69
88
|
treeKey: treeKey,
|
|
70
89
|
tree: deserializeTree(tree),
|
|
71
90
|
webApi: webApiProps && deserializeWebApi(webApi, webApiProps.kappSlug)
|
|
72
91
|
}));
|
|
73
92
|
|
|
74
|
-
case
|
|
75
|
-
_context.next =
|
|
93
|
+
case 19:
|
|
94
|
+
_context.next = 24;
|
|
76
95
|
break;
|
|
77
96
|
|
|
78
|
-
case
|
|
79
|
-
_context.prev =
|
|
97
|
+
case 21:
|
|
98
|
+
_context.prev = 21;
|
|
80
99
|
_context.t0 = _context["catch"](1);
|
|
81
100
|
console.error('Caught error loading tree', _context.t0);
|
|
82
101
|
|
|
83
|
-
case
|
|
102
|
+
case 24:
|
|
84
103
|
case "end":
|
|
85
104
|
return _context.stop();
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
|
-
}, _callee, null, [[1,
|
|
107
|
+
}, _callee, null, [[1, 21]]);
|
|
89
108
|
})));
|
|
109
|
+
|
|
110
|
+
var getPlatformItemSlugs = function getPlatformItemSlugs(platformItem) {
|
|
111
|
+
return platformItem.kapp ? {
|
|
112
|
+
formSlug: platformItem.slug,
|
|
113
|
+
kappSlug: platformItem.kapp.slug
|
|
114
|
+
} : platformItem.space ? {
|
|
115
|
+
kappSlug: platformItem.slug
|
|
116
|
+
} : {};
|
|
117
|
+
};
|
|
118
|
+
|
|
90
119
|
regSaga(takeEvery('TREE_SAVE', /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
91
|
-
var payload, newName, onError, onSave, overwrite, treeKey, _yield$select, kappSlug, lastSave, lastWebApi, tree, webApi, name, sourceGroup, sourceName, _yield, error1, newTree, _yield2, error2, error;
|
|
120
|
+
var payload, newName, onError, onSave, overwrite, treeKey, _yield$select, kappSlug, lastSave, lastWebApi, platformItem, tree, webApi, name, sourceGroup, sourceName, _yield, error1, newTree, newWorkflow, _yield2, error2, error;
|
|
92
121
|
|
|
93
122
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
94
123
|
while (1) {
|
|
@@ -109,19 +138,23 @@ regSaga(takeEvery('TREE_SAVE', /*#__PURE__*/_regeneratorRuntime.mark(function _c
|
|
|
109
138
|
kappSlug = _yield$select.kappSlug;
|
|
110
139
|
lastSave = _yield$select.lastSave;
|
|
111
140
|
lastWebApi = _yield$select.lastWebApi;
|
|
141
|
+
platformItem = _yield$select.platformItem;
|
|
112
142
|
tree = _yield$select.tree;
|
|
113
143
|
webApi = _yield$select.webApi;
|
|
114
144
|
name = lastSave.name, sourceGroup = lastSave.sourceGroup, sourceName = lastSave.sourceName; // if a newName was passed we will be creating a new tree with the builder
|
|
115
145
|
// contents, otherwise just an update
|
|
146
|
+
// additionally, if the tree is a linked workflow then we call a core
|
|
147
|
+
// endpoint to create the workflow
|
|
116
148
|
|
|
117
|
-
_context2.next =
|
|
118
|
-
return newName ? call(
|
|
119
|
-
|
|
120
|
-
sourceGroup: sourceGroup,
|
|
121
|
-
sourceName: sourceName,
|
|
122
|
-
tree: _objectSpread({
|
|
149
|
+
_context2.next = 15;
|
|
150
|
+
return newName ? tree.event ? call(createWorkflow, _objectSpread({
|
|
151
|
+
workflow: _objectSpread(_objectSpread({}, serializeTree(tree)), {}, {
|
|
123
152
|
name: newName
|
|
124
|
-
}
|
|
153
|
+
})
|
|
154
|
+
}, getPlatformItemSlugs(platformItem))) : call(createTree, {
|
|
155
|
+
tree: _objectSpread(_objectSpread({}, serializeTree(tree, true)), {}, {
|
|
156
|
+
name: newName
|
|
157
|
+
})
|
|
125
158
|
}) : call(updateTree, {
|
|
126
159
|
name: name,
|
|
127
160
|
sourceGroup: sourceGroup,
|
|
@@ -129,23 +162,24 @@ regSaga(takeEvery('TREE_SAVE', /*#__PURE__*/_regeneratorRuntime.mark(function _c
|
|
|
129
162
|
tree: serializeTree(tree, overwrite)
|
|
130
163
|
});
|
|
131
164
|
|
|
132
|
-
case
|
|
165
|
+
case 15:
|
|
133
166
|
_yield = _context2.sent;
|
|
134
167
|
error1 = _yield.error;
|
|
135
168
|
newTree = _yield.tree;
|
|
136
|
-
|
|
169
|
+
newWorkflow = _yield.workflow;
|
|
170
|
+
_context2.next = 21;
|
|
137
171
|
return webApi && !error1 ? call(updateWebApi, {
|
|
138
172
|
slug: lastWebApi.get('slug'),
|
|
139
173
|
kappSlug: kappSlug,
|
|
140
174
|
webApi: webApi
|
|
141
175
|
}) : {};
|
|
142
176
|
|
|
143
|
-
case
|
|
177
|
+
case 21:
|
|
144
178
|
_yield2 = _context2.sent;
|
|
145
179
|
error2 = _yield2.error;
|
|
146
180
|
error = error1 || error2; // dispatch the appropriate action based on the result of the call above
|
|
147
181
|
|
|
148
|
-
_context2.next =
|
|
182
|
+
_context2.next = 26;
|
|
149
183
|
return put(error ? action('TREE_SAVE_ERROR', {
|
|
150
184
|
treeKey: treeKey,
|
|
151
185
|
error: error.message || error,
|
|
@@ -153,26 +187,26 @@ regSaga(takeEvery('TREE_SAVE', /*#__PURE__*/_regeneratorRuntime.mark(function _c
|
|
|
153
187
|
}) : action('TREE_SAVE_SUCCESS', {
|
|
154
188
|
previousTree: lastSave,
|
|
155
189
|
treeKey: treeKey,
|
|
156
|
-
tree: newTree,
|
|
190
|
+
tree: newTree || newWorkflow,
|
|
157
191
|
webApi: webApi,
|
|
158
192
|
onSave: onSave
|
|
159
193
|
}));
|
|
160
194
|
|
|
161
|
-
case
|
|
162
|
-
_context2.next =
|
|
195
|
+
case 26:
|
|
196
|
+
_context2.next = 31;
|
|
163
197
|
break;
|
|
164
198
|
|
|
165
|
-
case
|
|
166
|
-
_context2.prev =
|
|
199
|
+
case 28:
|
|
200
|
+
_context2.prev = 28;
|
|
167
201
|
_context2.t0 = _context2["catch"](1);
|
|
168
202
|
console.error(_context2.t0);
|
|
169
203
|
|
|
170
|
-
case
|
|
204
|
+
case 31:
|
|
171
205
|
case "end":
|
|
172
206
|
return _context2.stop();
|
|
173
207
|
}
|
|
174
208
|
}
|
|
175
|
-
}, _callee2, null, [[1,
|
|
209
|
+
}, _callee2, null, [[1, 28]]);
|
|
176
210
|
})));
|
|
177
211
|
regSaga(takeEvery('TREE_SAVE_ERROR', /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
178
212
|
var _ref3$payload, error, onError;
|
|
@@ -269,6 +303,7 @@ regHandlers({
|
|
|
269
303
|
var _ref8$payload = _ref8.payload,
|
|
270
304
|
categories = _ref8$payload.categories,
|
|
271
305
|
kappSlug = _ref8$payload.kappSlug,
|
|
306
|
+
platformItem = _ref8$payload.platformItem,
|
|
272
307
|
treeKey = _ref8$payload.treeKey,
|
|
273
308
|
tree = _ref8$payload.tree,
|
|
274
309
|
webApi = _ref8$payload.webApi;
|
|
@@ -277,6 +312,7 @@ regHandlers({
|
|
|
277
312
|
lastSave: tree,
|
|
278
313
|
lastWebApi: webApi,
|
|
279
314
|
loading: false,
|
|
315
|
+
platformItem: platformItem,
|
|
280
316
|
tasks: List(categories).map(function (category) {
|
|
281
317
|
return category.name === 'System Controls' ? _objectSpread(_objectSpread({}, category), {}, {
|
|
282
318
|
handlers: [].concat(_toConsumableArray(category.handlers), [treeReturnTask(tree)])
|
|
@@ -314,6 +350,7 @@ regHandlers({
|
|
|
314
350
|
webApi = _ref11$payload.webApi;
|
|
315
351
|
var newTree = state.getIn(['trees', treeKey, 'tree']).merge({
|
|
316
352
|
name: tree.name,
|
|
353
|
+
sourceGroup: tree.sourceGroup,
|
|
317
354
|
versionId: tree.versionId
|
|
318
355
|
});
|
|
319
356
|
return state.mergeIn(['trees', treeKey], {
|