@kineticdata/react 6.0.5 → 6.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/README.md +110 -110
- package/assets/task/icons/defer.svg +12 -12
- package/assets/task/icons/drag-handle.svg +3 -3
- package/assets/task/icons/filter.svg +11 -11
- package/assets/task/icons/loop.svg +10 -10
- package/assets/task/icons/plus_small.svg +5 -5
- package/assets/task/icons/routine.svg +9 -9
- package/assets/task/icons/scale-minus.svg +11 -11
- package/assets/task/icons/scale-plus.svg +13 -13
- package/assets/task/icons/start.svg +11 -11
- package/assets/task/icons/stop.svg +8 -8
- package/lib/apis/core/activity.js +4 -4
- package/lib/apis/core/attributeDefinitions.js +64 -6
- package/lib/apis/core/attributeDefinitions.test.js +7 -4
- package/lib/apis/core/authentication.js +12 -1
- package/lib/apis/core/bridgeModels.test.js +46 -23
- package/lib/apis/core/bridgedresources.js +41 -41
- package/lib/apis/core/fileResources.js +2 -6
- package/lib/apis/core/forms.js +51 -2
- package/lib/apis/core/forms.test.js +32 -19
- package/lib/apis/core/integrations.js +61 -0
- package/lib/apis/core/kapps.js +49 -0
- package/lib/apis/core/kapps.test.js +16 -10
- package/lib/apis/core/notices.js +7 -0
- package/lib/apis/core/securityPolicyDefinitions.test.js +7 -4
- package/lib/apis/core/space.js +18 -0
- package/lib/apis/core/space.test.js +16 -10
- package/lib/apis/core/submissionActivities.js +38 -0
- package/lib/apis/core/submissions.js +114 -15
- package/lib/apis/core/translations.test.js +126 -55
- package/lib/apis/core/userPreferences.js +59 -0
- package/lib/apis/core/webApis.js +32 -2
- package/lib/apis/core/webhooks.test.js +7 -4
- package/lib/apis/http.js +30 -5
- package/lib/apis/index.js +48 -0
- package/lib/apis/integrator/index.js +337 -0
- package/lib/apis/system/index.js +64 -12
- package/lib/apis/task/index.js +9 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -1
- package/lib/components/common/AttributeSelect.js +11 -2
- package/lib/components/common/BridgeSelect.js +3 -1
- package/lib/components/common/ConnectionSelect.js +73 -0
- package/lib/components/common/FormSelect.js +3 -1
- package/lib/components/common/NodeSelect.js +1 -0
- package/lib/components/common/StaticSelect.js +16 -6
- package/lib/components/common/TableInput.js +4 -1
- package/lib/components/common/TeamSelect.js +3 -1
- package/lib/components/common/ToastContainer.js +34 -10
- package/lib/components/common/Typeahead.js +62 -23
- package/lib/components/common/UserSelect.js +3 -1
- package/lib/components/common/authentication/AuthenticationContainer.js +121 -55
- package/lib/components/common/authentication/RequestInterceptor.js +1 -1
- package/lib/components/common/preferences/PreferencesProvider.js +461 -0
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +10 -7
- package/lib/components/core/bridge_model/BridgeModelTable.js +19 -0
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +6 -9
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +0 -4
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +7 -10
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +2 -15
- package/lib/components/core/category/CategoryForm.js +4 -1
- package/lib/components/core/category/CategoryTable.js +2 -2
- package/lib/components/core/core_form/CoreForm.js +18 -10
- package/lib/components/core/field_definition/FieldDefinitionForm.js +3 -3
- package/lib/components/core/file_resource/FileResourceForm.js +2 -1
- package/lib/components/core/file_resource/FileResourceTable.js +14 -7
- package/lib/components/core/form/FormForm.js +42 -19
- package/lib/components/core/form/FormTable.js +13 -14
- package/lib/components/core/form_type/FormTypeForm.js +3 -0
- package/lib/components/core/i18n/Moment.js +1 -0
- package/lib/components/core/integration/IntegrationForm.js +232 -0
- package/lib/components/core/integration/IntegrationTable.js +142 -0
- package/lib/components/core/kapp/KappForm.js +18 -5
- package/lib/components/core/kapp/KappTable.js +3 -3
- package/lib/components/core/log/LogTable.js +1 -1
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +48 -10
- package/lib/components/core/space/SpaceForm.js +17 -36
- package/lib/components/core/submission/DatastoreSubmissionTable.js +4 -4
- package/lib/components/core/submission/FormSubmissionTable.js +12 -7
- package/lib/components/core/submission/KappSubmissionTable.js +4 -4
- package/lib/components/core/submission/SubmissionActivityForm.js +79 -0
- package/lib/components/core/submission/SubmissionForm.js +15 -3
- package/lib/components/core/team/TeamTable.js +17 -7
- package/lib/components/core/translation/EntryTable.js +8 -7
- package/lib/components/core/user/UserForm.js +2 -0
- package/lib/components/core/user/UserTable.js +22 -22
- package/lib/components/core/webapi/WebApiForm.js +5 -2
- package/lib/components/core/webapi/WebApiTable.js +2 -2
- package/lib/components/core/webhook/WebhookForm.js +43 -33
- package/lib/components/core/webhook/WebhookTable.js +16 -16
- package/lib/components/core/webhook_job/WebhookJobTable.js +17 -6
- package/lib/components/form/Form.helpers.js +10 -4
- package/lib/components/form/Form.js +264 -171
- package/lib/components/form/Form.models.js +6 -1
- package/lib/components/form/FormState.js +9 -5
- package/lib/components/form/SimpleForm.js +2 -2
- package/lib/components/form/defaults/CodeField.js +44 -1
- package/lib/components/index.js +152 -3
- package/lib/components/integrator/connection/ConnectionForm.js +156 -0
- package/lib/components/integrator/connection/ConnectionTable.js +82 -0
- package/lib/components/integrator/connection/config_fields/http.js +570 -0
- package/lib/components/integrator/connection/config_fields/sql.js +123 -0
- package/lib/components/integrator/integrationTypes.js +120 -0
- package/lib/components/integrator/operation/OperationForm.js +148 -0
- package/lib/components/integrator/operation/OperationTable.js +62 -0
- package/lib/components/integrator/operation/config_fields/http.js +185 -0
- package/lib/components/integrator/operation/config_fields/sql.js +81 -0
- package/lib/components/system/SystemSecurityForm.js +1 -1
- package/lib/components/system/SystemTaskAdapterForm.js +9 -9
- package/lib/components/system/SystemUserForm.js +2 -0
- package/lib/components/system/helpers.js +123 -100
- package/lib/components/system/spaces/SystemSpaceForm.js +9 -37
- package/lib/components/system/spaces/SystemTenantForm.js +276 -104
- package/lib/components/system/spaces/SystemTenantMigrateForm.js +449 -0
- package/lib/components/system/spaces/SystemTenantTable.js +20 -16
- package/lib/components/table/Table.js +75 -15
- package/lib/components/table/Table.redux.js +297 -73
- package/lib/components/table/defaults/FilterControl.js +24 -0
- package/lib/components/table/defaults/index.js +2 -0
- package/lib/components/table/tests/Table.test.js +22 -22
- package/lib/components/table/tests/components.js +9 -2
- package/lib/components/task/builder/Connector.js +51 -41
- package/lib/components/task/builder/ConnectorForm.js +11 -7
- package/lib/components/task/builder/Node.js +31 -35
- package/lib/components/task/builder/NodeForm.js +93 -22
- package/lib/components/task/builder/NodeParametersForm.js +29 -17
- package/lib/components/task/builder/SvgCanvas.js +3 -17
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +18 -50
- package/lib/components/task/builder/TreeBuilder.js +23 -3
- package/lib/components/task/builder/builder.redux.js +342 -197
- package/lib/components/task/builder/constants.js +10 -2
- package/lib/components/task/builder/helpers.js +231 -81
- package/lib/components/task/builder/models.js +7 -6
- package/lib/components/task/category/TaskCategoryTable.js +3 -3
- package/lib/components/task/common/UsageTable.js +9 -2
- package/lib/components/task/handlers/HandlerTable.js +44 -37
- package/lib/components/task/policy_rule/PolicyRuleTable.js +3 -3
- package/lib/components/task/runs/CreateManualTriggerForm.js +2 -0
- package/lib/components/task/runs/RunTable.js +10 -14
- package/lib/components/task/runs/RunTaskTable.js +1 -1
- package/lib/components/task/sources/SourceTable.js +2 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -2
- package/lib/components/task/workflows/LinkedWorkflowTable.js +16 -11
- package/lib/components/task/workflows/WorkflowForm.js +27 -8
- package/lib/components/task/workflows/WorkflowTable.js +27 -26
- package/lib/helpers/index.js +307 -74
- package/lib/index.js +2 -1
- package/lib/saga.js +4 -4
- package/lib/store.js +2 -1
- package/package.json +7 -6
- package/proxyhelper.js +201 -176
- package/CHANGELOG.md +0 -94
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.IntegrationTable = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
|
+
var _Table = require("../../table/Table");
|
|
12
|
+
var _apis = require("../../../apis");
|
|
13
|
+
var _http = require("../../../apis/http");
|
|
14
|
+
var _helpers = require("../../../helpers");
|
|
15
|
+
var _excluded = ["integrations"];
|
|
16
|
+
var clientSide = (0, _helpers.defineFilter)(true).startsWith('name', 'name').end();
|
|
17
|
+
var fetchIntegrationsWithSupportingData = function fetchIntegrationsWithSupportingData(options) {
|
|
18
|
+
return (0, _apis.fetchIntegrations)(options).then(function (_ref) {
|
|
19
|
+
var integrations = _ref.integrations,
|
|
20
|
+
response = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
21
|
+
// Get ids of all operations in the table
|
|
22
|
+
var ids = integrations === null || integrations === void 0 ? void 0 : integrations.map(function (integration) {
|
|
23
|
+
return integration.operationId;
|
|
24
|
+
});
|
|
25
|
+
// Fetch supporting integrator data for the table
|
|
26
|
+
return Promise.all([
|
|
27
|
+
// Get all connections
|
|
28
|
+
(0, _apis.fetchConnections)(),
|
|
29
|
+
// Get the operations that are used in the integrations
|
|
30
|
+
(ids === null || ids === void 0 ? void 0 : ids.length) > 0 ? (0, _apis.fetchBulkOperations)({
|
|
31
|
+
ids: ids
|
|
32
|
+
}) : Promise.resolve({
|
|
33
|
+
operations: []
|
|
34
|
+
})]).then(function (_ref2) {
|
|
35
|
+
var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
|
|
36
|
+
_ref3$ = _ref3[0],
|
|
37
|
+
connections = _ref3$.connections,
|
|
38
|
+
integratorError = _ref3$.error,
|
|
39
|
+
operations = _ref3[1].operations;
|
|
40
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, response), {}, {
|
|
41
|
+
integrations: integrations.map(function (integration) {
|
|
42
|
+
var _connections$find, _operations$find;
|
|
43
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, integration), {}, {
|
|
44
|
+
// Add the connection and operation names to the records
|
|
45
|
+
connectionName: connections === null || connections === void 0 ? void 0 : (_connections$find = connections.find(function (conn) {
|
|
46
|
+
return conn.id === integration.connectionId;
|
|
47
|
+
})) === null || _connections$find === void 0 ? void 0 : _connections$find.name,
|
|
48
|
+
operationName: operations === null || operations === void 0 ? void 0 : (_operations$find = operations.find(function (op) {
|
|
49
|
+
return op.id === integration.operationId;
|
|
50
|
+
})) === null || _operations$find === void 0 ? void 0 : _operations$find.name
|
|
51
|
+
});
|
|
52
|
+
}),
|
|
53
|
+
integratorError: integratorError
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var dataSource = function dataSource(_ref4) {
|
|
59
|
+
var kappSlug = _ref4.kappSlug;
|
|
60
|
+
return {
|
|
61
|
+
fn: fetchIntegrationsWithSupportingData,
|
|
62
|
+
clientSide: clientSide,
|
|
63
|
+
params: function params(paramData) {
|
|
64
|
+
return [(0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
65
|
+
include: 'details',
|
|
66
|
+
kappSlug: kappSlug
|
|
67
|
+
}, (0, _http.generateSortParams)(paramData)), (0, _http.generatePaginationParams)(paramData))];
|
|
68
|
+
},
|
|
69
|
+
transform: function transform(result) {
|
|
70
|
+
return {
|
|
71
|
+
data: result.integrations,
|
|
72
|
+
nextPageToken: result.nextPageToken,
|
|
73
|
+
extraData: {
|
|
74
|
+
integratorError: result.integratorError
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
var filters = function filters() {
|
|
81
|
+
return function () {
|
|
82
|
+
return [{
|
|
83
|
+
name: 'name',
|
|
84
|
+
label: 'Name',
|
|
85
|
+
type: 'text'
|
|
86
|
+
}];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
var columns = [{
|
|
90
|
+
value: 'name',
|
|
91
|
+
title: 'Name',
|
|
92
|
+
sortable: true,
|
|
93
|
+
toggleable: false,
|
|
94
|
+
columnOrder: 'first'
|
|
95
|
+
}, {
|
|
96
|
+
value: 'connectionId',
|
|
97
|
+
title: 'Connection ID',
|
|
98
|
+
sortable: false,
|
|
99
|
+
toggleable: true
|
|
100
|
+
}, {
|
|
101
|
+
value: 'connectionName',
|
|
102
|
+
title: 'Connection',
|
|
103
|
+
sortable: false,
|
|
104
|
+
toggleable: true
|
|
105
|
+
}, {
|
|
106
|
+
value: 'operationId',
|
|
107
|
+
title: 'Operation ID',
|
|
108
|
+
sortable: false,
|
|
109
|
+
toggleable: true
|
|
110
|
+
}, {
|
|
111
|
+
value: 'operationName',
|
|
112
|
+
title: 'Operation',
|
|
113
|
+
sortable: false,
|
|
114
|
+
toggleable: true
|
|
115
|
+
}, {
|
|
116
|
+
value: 'createdAt',
|
|
117
|
+
title: 'Created At',
|
|
118
|
+
sortable: true,
|
|
119
|
+
toggleable: true
|
|
120
|
+
}, {
|
|
121
|
+
value: 'createdBy',
|
|
122
|
+
title: 'Created By',
|
|
123
|
+
sortable: true,
|
|
124
|
+
toggleable: true
|
|
125
|
+
}, {
|
|
126
|
+
value: 'updatedAt',
|
|
127
|
+
title: 'Updated At',
|
|
128
|
+
sortable: true,
|
|
129
|
+
toggleable: true
|
|
130
|
+
}, {
|
|
131
|
+
value: 'updatedBy',
|
|
132
|
+
title: 'Updated By',
|
|
133
|
+
sortable: true,
|
|
134
|
+
toggleable: true
|
|
135
|
+
}];
|
|
136
|
+
var IntegrationTable = exports.IntegrationTable = (0, _Table.generateTable)({
|
|
137
|
+
tableOptions: ['kappSlug'],
|
|
138
|
+
columns: columns,
|
|
139
|
+
filters: filters,
|
|
140
|
+
dataSource: dataSource
|
|
141
|
+
});
|
|
142
|
+
IntegrationTable.displayName = 'IntegrationTable';
|
|
@@ -156,10 +156,22 @@ var fields = function fields(_ref4) {
|
|
|
156
156
|
var space = _ref6.space,
|
|
157
157
|
kapp = _ref6.kapp,
|
|
158
158
|
attributeDefinitions = _ref6.attributeDefinitions;
|
|
159
|
-
return (0, _helpers.
|
|
160
|
-
space:
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
return (0, _helpers.buildCodeEditorBindings)({
|
|
160
|
+
space: {
|
|
161
|
+
attributeDefinitions: space === null || space === void 0 ? void 0 : space.get('spaceAttributeDefinitions')
|
|
162
|
+
},
|
|
163
|
+
kapp: {
|
|
164
|
+
attributeDefinitions: attributeDefinitions
|
|
165
|
+
},
|
|
166
|
+
form: {
|
|
167
|
+
attributeDefinitions: kapp === null || kapp === void 0 ? void 0 : kapp.get('formAttributeDefinitions')
|
|
168
|
+
},
|
|
169
|
+
submission: {
|
|
170
|
+
detailed: true
|
|
171
|
+
},
|
|
172
|
+
values: (kapp === null || kapp === void 0 ? void 0 : kapp.get('fields').size) > 0 && {
|
|
173
|
+
data: kapp.get('fields')
|
|
174
|
+
}
|
|
163
175
|
});
|
|
164
176
|
}
|
|
165
177
|
}, {
|
|
@@ -248,7 +260,8 @@ var fields = function fields(_ref4) {
|
|
|
248
260
|
}).map(function (definition) {
|
|
249
261
|
return (0, _immutable.Map)({
|
|
250
262
|
value: definition.get('name'),
|
|
251
|
-
label: definition.get('name')
|
|
263
|
+
label: definition.get('name'),
|
|
264
|
+
type: definition.get('type')
|
|
252
265
|
});
|
|
253
266
|
}) : [];
|
|
254
267
|
},
|
|
@@ -54,8 +54,8 @@ var columns = [{
|
|
|
54
54
|
sortable: true,
|
|
55
55
|
toggleable: true
|
|
56
56
|
}, {
|
|
57
|
-
value: '
|
|
58
|
-
title: 'Created',
|
|
57
|
+
value: 'createdAt',
|
|
58
|
+
title: 'Created At',
|
|
59
59
|
sortable: true,
|
|
60
60
|
toggleable: true
|
|
61
61
|
}, {
|
|
@@ -64,7 +64,7 @@ var columns = [{
|
|
|
64
64
|
toggleable: true
|
|
65
65
|
}, {
|
|
66
66
|
value: 'updatedAt',
|
|
67
|
-
title: 'Updated',
|
|
67
|
+
title: 'Updated At',
|
|
68
68
|
sortable: true,
|
|
69
69
|
toggleable: true
|
|
70
70
|
}, {
|
|
@@ -63,7 +63,7 @@ var dataSource = function dataSource() {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
var APP_COMPONENT_OPTIONS = ['agent', 'core', 'loghub', 'task'].map(function (component) {
|
|
66
|
+
var APP_COMPONENT_OPTIONS = ['agent', 'core', 'integrator', 'loghub', 'task'].map(function (component) {
|
|
67
67
|
return {
|
|
68
68
|
label: component,
|
|
69
69
|
value: component
|
|
@@ -8,9 +8,20 @@ var _Form = require("../../form/Form");
|
|
|
8
8
|
var _apis = require("../../../apis");
|
|
9
9
|
var _helpers = require("../../../helpers");
|
|
10
10
|
var SPACE_SECURITY_DEFINITION_TYPES = exports.SPACE_SECURITY_DEFINITION_TYPES = ['Space', 'File Resource', 'Team', 'User'];
|
|
11
|
+
var SPACE_SECURITY_DEFINITION_TYPES_MAP = {
|
|
12
|
+
Space: ['Space'],
|
|
13
|
+
'File Resource': ['Space', 'File Resource'],
|
|
14
|
+
Team: ['Space', 'Team'],
|
|
15
|
+
User: ['Space', 'User']
|
|
16
|
+
};
|
|
11
17
|
var KAPP_SECURITY_DEFINITION_TYPES = exports.KAPP_SECURITY_DEFINITION_TYPES = ['Kapp', 'Form', 'Submission'];
|
|
12
|
-
var
|
|
13
|
-
|
|
18
|
+
var KAPP_SECURITY_DEFINITION_TYPES_MAP = {
|
|
19
|
+
Kapp: ['Kapp'],
|
|
20
|
+
Form: ['Kapp', 'Form'],
|
|
21
|
+
Submission: ['Kapp', 'Form', 'Submission']
|
|
22
|
+
};
|
|
23
|
+
var SPACE_INCLUDES = 'spaceAttributeDefinitions,teamAttributeDefinitions,userAttributeDefinitions,userProfileAttributeDefinitions';
|
|
24
|
+
var KAPP_INCLUDES = 'formAttributeDefinitions,kappAttributeDefinitions,fields.details';
|
|
14
25
|
var PROFILE_INCLUDES = 'attributesMap,profileAttributesMap';
|
|
15
26
|
var dataSources = function dataSources(_ref) {
|
|
16
27
|
var securityPolicyName = _ref.securityPolicyName,
|
|
@@ -43,6 +54,9 @@ var dataSources = function dataSources(_ref) {
|
|
|
43
54
|
}],
|
|
44
55
|
transform: function transform(result) {
|
|
45
56
|
return result.securityPolicyDefinition;
|
|
57
|
+
},
|
|
58
|
+
errorTransform: function errorTransform(result) {
|
|
59
|
+
return result.error;
|
|
46
60
|
}
|
|
47
61
|
},
|
|
48
62
|
profile: {
|
|
@@ -76,6 +90,7 @@ var handleSubmit = function handleSubmit(_ref2) {
|
|
|
76
90
|
};
|
|
77
91
|
var fields = function fields(_ref4) {
|
|
78
92
|
var securityPolicyName = _ref4.securityPolicyName,
|
|
93
|
+
securityPolicyType = _ref4.securityPolicyType,
|
|
79
94
|
kappSlug = _ref4.kappSlug;
|
|
80
95
|
return function (_ref5) {
|
|
81
96
|
var securityPolicy = _ref5.securityPolicy;
|
|
@@ -91,7 +106,7 @@ var fields = function fields(_ref4) {
|
|
|
91
106
|
label: 'Type',
|
|
92
107
|
type: 'select',
|
|
93
108
|
required: true,
|
|
94
|
-
options: (kappSlug ? KAPP_SECURITY_DEFINITION_TYPES : SPACE_SECURITY_DEFINITION_TYPES).map(function (ele) {
|
|
109
|
+
options: (kappSlug ? securityPolicyType && KAPP_SECURITY_DEFINITION_TYPES.includes(securityPolicyType) ? KAPP_SECURITY_DEFINITION_TYPES_MAP[securityPolicyType] : KAPP_SECURITY_DEFINITION_TYPES : securityPolicyType && SPACE_SECURITY_DEFINITION_TYPES.includes(securityPolicyType) ? SPACE_SECURITY_DEFINITION_TYPES_MAP[securityPolicyType] : SPACE_SECURITY_DEFINITION_TYPES).map(function (ele) {
|
|
95
110
|
return {
|
|
96
111
|
value: ele,
|
|
97
112
|
label: ele
|
|
@@ -110,18 +125,41 @@ var fields = function fields(_ref4) {
|
|
|
110
125
|
name: 'rule',
|
|
111
126
|
label: 'Rule',
|
|
112
127
|
type: 'code',
|
|
113
|
-
language: 'js',
|
|
128
|
+
language: 'js-expression',
|
|
114
129
|
required: true,
|
|
115
130
|
options: function options(_ref6) {
|
|
116
131
|
var space = _ref6.space,
|
|
117
132
|
kapp = _ref6.kapp,
|
|
118
133
|
values = _ref6.values,
|
|
119
134
|
profile = _ref6.profile;
|
|
120
|
-
return (0, _helpers.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
135
|
+
return (0, _helpers.buildCodeEditorBindings)({
|
|
136
|
+
identity: profile && {
|
|
137
|
+
attributeDefinitions: space === null || space === void 0 ? void 0 : space.get('userAttributeDefinitions'),
|
|
138
|
+
profileAttributeDefinitions: space === null || space === void 0 ? void 0 : space.get('userProfileAttributeDefinitions')
|
|
139
|
+
},
|
|
140
|
+
space: {
|
|
141
|
+
attributeDefinitions: space === null || space === void 0 ? void 0 : space.get('spaceAttributeDefinitions')
|
|
142
|
+
},
|
|
143
|
+
file: values.get('type') === 'File Resource' && {},
|
|
144
|
+
user: values.get('type') === 'User' && {
|
|
145
|
+
attributeDefinitions: space === null || space === void 0 ? void 0 : space.get('userAttributeDefinitions'),
|
|
146
|
+
profileAttributeDefinitions: space === null || space === void 0 ? void 0 : space.get('userProfileAttributeDefinitions')
|
|
147
|
+
},
|
|
148
|
+
team: values.get('type') === 'Team' && {
|
|
149
|
+
attributeDefinitions: space === null || space === void 0 ? void 0 : space.get('teamAttributeDefinitions')
|
|
150
|
+
},
|
|
151
|
+
kapp: ['Kapp', 'Form', 'Submission'].includes(values.get('type')) && {
|
|
152
|
+
attributeDefinitions: kapp === null || kapp === void 0 ? void 0 : kapp.get('kappAttributeDefinitions')
|
|
153
|
+
},
|
|
154
|
+
form: ['Form', 'Submission'].includes(values.get('type')) && {
|
|
155
|
+
attributeDefinitions: kapp === null || kapp === void 0 ? void 0 : kapp.get('formAttributeDefinitions')
|
|
156
|
+
},
|
|
157
|
+
submission: values.get('type') === 'Submission' && {
|
|
158
|
+
detailed: true
|
|
159
|
+
},
|
|
160
|
+
values: values.get('type') === 'Submission' && (kapp === null || kapp === void 0 ? void 0 : kapp.get('fields').size) > 0 && {
|
|
161
|
+
data: kapp.get('fields')
|
|
162
|
+
}
|
|
125
163
|
});
|
|
126
164
|
},
|
|
127
165
|
initialValue: securityPolicy ? securityPolicy.get('rule') : '',
|
|
@@ -130,7 +168,7 @@ var fields = function fields(_ref4) {
|
|
|
130
168
|
};
|
|
131
169
|
};
|
|
132
170
|
var SecurityDefinitionForm = exports.SecurityDefinitionForm = (0, _Form.generateForm)({
|
|
133
|
-
formOptions: ['kappSlug', 'securityPolicyName'],
|
|
171
|
+
formOptions: ['kappSlug', 'securityPolicyName', 'securityPolicyType'],
|
|
134
172
|
dataSources: dataSources,
|
|
135
173
|
fields: fields,
|
|
136
174
|
handleSubmit: handleSubmit
|
|
@@ -116,26 +116,6 @@ var securityEndpoints = {
|
|
|
116
116
|
endpoint: 'User Modification',
|
|
117
117
|
label: 'User Modification',
|
|
118
118
|
types: ['Space', 'User']
|
|
119
|
-
},
|
|
120
|
-
defaultFormDisplay: {
|
|
121
|
-
endpoint: 'Default Form Display',
|
|
122
|
-
label: 'Default Form Display',
|
|
123
|
-
types: ['Form']
|
|
124
|
-
},
|
|
125
|
-
defaultFormModification: {
|
|
126
|
-
endpoint: 'Default Form Modification',
|
|
127
|
-
label: 'Default Form Modification',
|
|
128
|
-
types: ['Form']
|
|
129
|
-
},
|
|
130
|
-
defaultSubmissionAccess: {
|
|
131
|
-
endpoint: 'Default Submission Access',
|
|
132
|
-
label: 'Default Submission Access',
|
|
133
|
-
types: ['Form', 'Submission']
|
|
134
|
-
},
|
|
135
|
-
defaultSubmissionModification: {
|
|
136
|
-
endpoint: 'Default Submission Modification',
|
|
137
|
-
label: 'Default Submission Modification',
|
|
138
|
-
types: ['Form', 'Submission']
|
|
139
119
|
}
|
|
140
120
|
};
|
|
141
121
|
var fields = function fields() {
|
|
@@ -413,7 +393,8 @@ var fields = function fields() {
|
|
|
413
393
|
}).map(function (definition) {
|
|
414
394
|
return (0, _immutable.Map)({
|
|
415
395
|
value: definition.get('name'),
|
|
416
|
-
label: definition.get('name')
|
|
396
|
+
label: definition.get('name'),
|
|
397
|
+
type: definition.get('type')
|
|
417
398
|
});
|
|
418
399
|
});
|
|
419
400
|
},
|
|
@@ -468,7 +449,7 @@ var fields = function fields() {
|
|
|
468
449
|
}
|
|
469
450
|
}, {
|
|
470
451
|
name: 'allowedIpsEnabled',
|
|
471
|
-
label: '
|
|
452
|
+
label: 'Allowed IP Restrictions',
|
|
472
453
|
type: 'checkbox',
|
|
473
454
|
initialValue: (0, _immutable.get)(space, 'allowedIpsEnabled', false) || false
|
|
474
455
|
}, {
|
|
@@ -492,24 +473,24 @@ var SpaceForm = exports.SpaceForm = (0, _Form.generateForm)({
|
|
|
492
473
|
});
|
|
493
474
|
SpaceForm.displayName = 'SpaceForm';
|
|
494
475
|
SpaceForm.propTypes = {
|
|
495
|
-
/**
|
|
496
|
-
* A unique identifier for this form.
|
|
497
|
-
* If none is provided, one will be automatically generated and
|
|
498
|
-
* the form will be automatically mounted.
|
|
499
|
-
*
|
|
500
|
-
* If a formKey is provided, the form won't render until the
|
|
501
|
-
* `mountForm` action is dispatched.
|
|
476
|
+
/**
|
|
477
|
+
* A unique identifier for this form.
|
|
478
|
+
* If none is provided, one will be automatically generated and
|
|
479
|
+
* the form will be automatically mounted.
|
|
480
|
+
*
|
|
481
|
+
* If a formKey is provided, the form won't render until the
|
|
482
|
+
* `mountForm` action is dispatched.
|
|
502
483
|
*/
|
|
503
484
|
formKey: _propTypes["default"].string,
|
|
504
|
-
/**
|
|
505
|
-
* A set of fields that should be added to the form
|
|
485
|
+
/**
|
|
486
|
+
* A set of fields that should be added to the form
|
|
506
487
|
*/
|
|
507
488
|
addFields: _propTypes["default"].oneOfType([_propTypes["default"].array, _propTypes["default"].func]),
|
|
508
|
-
/**
|
|
509
|
-
* The layout of the form.
|
|
510
|
-
* - @param {Node} form The react `Node` of the rendered form
|
|
511
|
-
* - @param {Object} bindings all bindings fetched when the form was loaded
|
|
512
|
-
* - @param {Boolean} initialized If the form has been initialized
|
|
489
|
+
/**
|
|
490
|
+
* The layout of the form.
|
|
491
|
+
* - @param {Node} form The react `Node` of the rendered form
|
|
492
|
+
* - @param {Object} bindings all bindings fetched when the form was loaded
|
|
493
|
+
* - @param {Boolean} initialized If the form has been initialized
|
|
513
494
|
*/
|
|
514
495
|
children: _propTypes["default"].func
|
|
515
496
|
};
|
|
@@ -51,7 +51,7 @@ var columns = [{
|
|
|
51
51
|
sortable: true
|
|
52
52
|
}, {
|
|
53
53
|
value: 'closedBy',
|
|
54
|
-
title: '
|
|
54
|
+
title: 'Closed By',
|
|
55
55
|
sortable: false
|
|
56
56
|
}, {
|
|
57
57
|
value: 'coreState',
|
|
@@ -59,7 +59,7 @@ var columns = [{
|
|
|
59
59
|
sortable: false
|
|
60
60
|
}, {
|
|
61
61
|
value: 'createdAt',
|
|
62
|
-
title: 'Created',
|
|
62
|
+
title: 'Created At',
|
|
63
63
|
sortable: true
|
|
64
64
|
}, {
|
|
65
65
|
value: 'createdBy',
|
|
@@ -75,7 +75,7 @@ var columns = [{
|
|
|
75
75
|
sortable: false
|
|
76
76
|
}, {
|
|
77
77
|
value: 'id',
|
|
78
|
-
title: '
|
|
78
|
+
title: 'ID',
|
|
79
79
|
sortable: false
|
|
80
80
|
}, {
|
|
81
81
|
value: 'label',
|
|
@@ -107,7 +107,7 @@ var columns = [{
|
|
|
107
107
|
sortable: false
|
|
108
108
|
}, {
|
|
109
109
|
value: 'updatedAt',
|
|
110
|
-
title: 'Updated',
|
|
110
|
+
title: 'Updated At',
|
|
111
111
|
sortable: false
|
|
112
112
|
}, {
|
|
113
113
|
value: 'updatedBy',
|
|
@@ -43,8 +43,8 @@ var dataSource = function dataSource(_ref) {
|
|
|
43
43
|
};
|
|
44
44
|
var columns = [{
|
|
45
45
|
value: 'closedAt',
|
|
46
|
-
title: 'Closed',
|
|
47
|
-
sortable:
|
|
46
|
+
title: 'Closed At',
|
|
47
|
+
sortable: false,
|
|
48
48
|
toggleable: true
|
|
49
49
|
}, {
|
|
50
50
|
value: 'closedBy',
|
|
@@ -58,8 +58,8 @@ var columns = [{
|
|
|
58
58
|
toggleable: true
|
|
59
59
|
}, {
|
|
60
60
|
value: 'createdAt',
|
|
61
|
-
title: 'Created',
|
|
62
|
-
sortable:
|
|
61
|
+
title: 'Created At',
|
|
62
|
+
sortable: false,
|
|
63
63
|
toggleable: true
|
|
64
64
|
}, {
|
|
65
65
|
value: 'createdBy',
|
|
@@ -79,7 +79,7 @@ var columns = [{
|
|
|
79
79
|
columnOrder: 'first'
|
|
80
80
|
}, {
|
|
81
81
|
value: 'id',
|
|
82
|
-
title: '
|
|
82
|
+
title: 'ID',
|
|
83
83
|
sortable: false,
|
|
84
84
|
toggleable: true
|
|
85
85
|
}, {
|
|
@@ -105,7 +105,7 @@ var columns = [{
|
|
|
105
105
|
}, {
|
|
106
106
|
value: 'submittedAt',
|
|
107
107
|
title: 'Submitted At',
|
|
108
|
-
sortable:
|
|
108
|
+
sortable: false,
|
|
109
109
|
toggleable: true
|
|
110
110
|
}, {
|
|
111
111
|
value: 'submittedBy',
|
|
@@ -119,7 +119,7 @@ var columns = [{
|
|
|
119
119
|
toggleable: true
|
|
120
120
|
}, {
|
|
121
121
|
value: 'updatedAt',
|
|
122
|
-
title: 'Updated',
|
|
122
|
+
title: 'Updated At',
|
|
123
123
|
sortable: false,
|
|
124
124
|
toggleable: true
|
|
125
125
|
}, {
|
|
@@ -127,6 +127,11 @@ var columns = [{
|
|
|
127
127
|
title: 'Updated By',
|
|
128
128
|
sortable: false,
|
|
129
129
|
toggleable: true
|
|
130
|
+
}, {
|
|
131
|
+
value: 'sortDate',
|
|
132
|
+
title: 'Sort Date',
|
|
133
|
+
sortable: false,
|
|
134
|
+
toggleable: true
|
|
130
135
|
}];
|
|
131
136
|
var FormSubmissionTable = exports.FormSubmissionTable = (0, _Table.generateTable)({
|
|
132
137
|
tableOptions: ['kappSlug', 'formSlug', 'include', 'count'],
|
|
@@ -170,7 +170,7 @@ var filters = function filters(_ref6) {
|
|
|
170
170
|
};
|
|
171
171
|
var columns = [{
|
|
172
172
|
value: 'closedAt',
|
|
173
|
-
title: 'Closed',
|
|
173
|
+
title: 'Closed At',
|
|
174
174
|
sortable: true,
|
|
175
175
|
toggleable: true
|
|
176
176
|
}, {
|
|
@@ -185,7 +185,7 @@ var columns = [{
|
|
|
185
185
|
toggleable: true
|
|
186
186
|
}, {
|
|
187
187
|
value: 'createdAt',
|
|
188
|
-
title: 'Created',
|
|
188
|
+
title: 'Created At',
|
|
189
189
|
sortable: true,
|
|
190
190
|
toggleable: true
|
|
191
191
|
}, {
|
|
@@ -206,7 +206,7 @@ var columns = [{
|
|
|
206
206
|
columnOrder: 'first'
|
|
207
207
|
}, {
|
|
208
208
|
value: 'id',
|
|
209
|
-
title: '
|
|
209
|
+
title: 'ID',
|
|
210
210
|
sortable: false,
|
|
211
211
|
toggleable: true
|
|
212
212
|
}, {
|
|
@@ -246,7 +246,7 @@ var columns = [{
|
|
|
246
246
|
toggleable: true
|
|
247
247
|
}, {
|
|
248
248
|
value: 'updatedAt',
|
|
249
|
-
title: 'Updated',
|
|
249
|
+
title: 'Updated At',
|
|
250
250
|
sortable: true,
|
|
251
251
|
toggleable: true
|
|
252
252
|
}, {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SubmissionActivityForm = void 0;
|
|
7
|
+
var _apis = require("../../../apis");
|
|
8
|
+
var _Form = require("../../form/Form");
|
|
9
|
+
var _immutable = require("immutable");
|
|
10
|
+
var dataSources = function dataSources(_ref) {
|
|
11
|
+
var submissionId = _ref.submissionId,
|
|
12
|
+
activityId = _ref.activityId;
|
|
13
|
+
return {
|
|
14
|
+
activity: {
|
|
15
|
+
fn: _apis.fetchSubmissionActivity,
|
|
16
|
+
params: submissionId && activityId && [{
|
|
17
|
+
submissionId: submissionId,
|
|
18
|
+
activityId: activityId,
|
|
19
|
+
include: 'details'
|
|
20
|
+
}],
|
|
21
|
+
transform: function transform(result) {
|
|
22
|
+
return result.activity;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
var handleSubmit = function handleSubmit(_ref2) {
|
|
28
|
+
var submissionId = _ref2.submissionId,
|
|
29
|
+
activityId = _ref2.activityId;
|
|
30
|
+
return function (values) {
|
|
31
|
+
return (activityId ? _apis.updateSubmissionActivity : _apis.createSubmissionActivity)({
|
|
32
|
+
submissionId: submissionId,
|
|
33
|
+
activityId: activityId,
|
|
34
|
+
activity: values.toJS()
|
|
35
|
+
}).then(function (_ref3) {
|
|
36
|
+
var kapp = _ref3.kapp,
|
|
37
|
+
error = _ref3.error;
|
|
38
|
+
if (error) {
|
|
39
|
+
throw error.statusCode === 400 && error.message || 'There was an error saving the activity';
|
|
40
|
+
}
|
|
41
|
+
return kapp;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var fields = function fields(_ref4) {
|
|
46
|
+
var submissionId = _ref4.submissionId,
|
|
47
|
+
activityId = _ref4.activityId;
|
|
48
|
+
return function (_ref5) {
|
|
49
|
+
var activity = _ref5.activity;
|
|
50
|
+
return submissionId && (!activityId || activity) && [{
|
|
51
|
+
name: 'type',
|
|
52
|
+
label: 'Type',
|
|
53
|
+
type: 'text',
|
|
54
|
+
initialValue: (0, _immutable.get)(activity, 'type')
|
|
55
|
+
}, {
|
|
56
|
+
name: 'label',
|
|
57
|
+
label: 'Label',
|
|
58
|
+
type: 'text',
|
|
59
|
+
initialValue: (0, _immutable.get)(activity, 'label')
|
|
60
|
+
}, {
|
|
61
|
+
name: 'description',
|
|
62
|
+
label: 'Description',
|
|
63
|
+
type: 'text',
|
|
64
|
+
initialValue: (0, _immutable.get)(activity, 'description')
|
|
65
|
+
}, {
|
|
66
|
+
name: 'data',
|
|
67
|
+
label: 'Data',
|
|
68
|
+
type: 'text',
|
|
69
|
+
initialValue: (0, _immutable.get)(activity, 'data')
|
|
70
|
+
}];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
var SubmissionActivityForm = exports.SubmissionActivityForm = (0, _Form.generateForm)({
|
|
74
|
+
formOptions: ['submissionId', 'activityId'],
|
|
75
|
+
dataSources: dataSources,
|
|
76
|
+
fields: fields,
|
|
77
|
+
handleSubmit: handleSubmit
|
|
78
|
+
});
|
|
79
|
+
SubmissionActivityForm.displayName = 'SubmissionActivityForm';
|
|
@@ -20,12 +20,22 @@ var dataSources = function dataSources(_ref) {
|
|
|
20
20
|
fn: _apis.fetchSubmission,
|
|
21
21
|
params: submissionId && [{
|
|
22
22
|
id: submissionId,
|
|
23
|
-
include: 'details,values.raw,form,form.fields,form.fields.details,form.pages'
|
|
23
|
+
include: 'details,values.raw,form,form.fields,form.fields.details,form.pages,origin,origin.form,origin.form.kapp,parent,parent.form,parent.form.kapp'
|
|
24
24
|
}],
|
|
25
25
|
transform: function transform(result) {
|
|
26
26
|
return result.submission;
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
activities: {
|
|
30
|
+
fn: _apis.fetchSubmissionActivities,
|
|
31
|
+
params: submissionId && [{
|
|
32
|
+
submissionId: submissionId,
|
|
33
|
+
include: 'details'
|
|
34
|
+
}],
|
|
35
|
+
transform: function transform(result) {
|
|
36
|
+
return result.activities;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
29
39
|
form: {
|
|
30
40
|
fn: _apis.fetchForm,
|
|
31
41
|
params: kappSlug && formSlug && [{
|
|
@@ -123,7 +133,9 @@ var convertRenderType = function convertRenderType(element) {
|
|
|
123
133
|
};
|
|
124
134
|
var getInitialValue = function getInitialValue(submission, element, type) {
|
|
125
135
|
var fieldKey = element.get('key');
|
|
126
|
-
|
|
136
|
+
|
|
137
|
+
// If value doesn't exist, set a default value based on the renderType
|
|
138
|
+
var value = ['checkbox', 'attachment'].includes(element.get('renderType')) ? (0, _immutable.getIn)(submission, ['valuesRaw', fieldKey, 'value']) || (0, _immutable.List)() : (0, _immutable.getIn)(submission, ['valuesRaw', fieldKey, 'value']) || '';
|
|
127
139
|
|
|
128
140
|
// To update a submission with existing submissions we need to grab the
|
|
129
141
|
// documentId and insert that into the attachment value normally returned with
|
|
@@ -134,7 +146,7 @@ var getInitialValue = function getInitialValue(submission, element, type) {
|
|
|
134
146
|
return attachment.set('documentId', (0, _immutable.getIn)(rawValue, [i, 'documentId'], null));
|
|
135
147
|
});
|
|
136
148
|
}
|
|
137
|
-
return type === 'datetime' && value ? (0, _moment["default"])(value).format('
|
|
149
|
+
return type === 'datetime' && value ? (0, _moment["default"])(value).format('YYYY-MM-DDTHH:mm') : type === 'date' && value ? (0, _moment["default"])(value).format('YYYY-MM-DD') : value;
|
|
138
150
|
};
|
|
139
151
|
var serializer = function serializer(element) {
|
|
140
152
|
return function (_ref7) {
|