@kineticdata/react 6.0.1 → 6.0.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/agent/adapters.js +2 -3
- package/lib/apis/agent/bridges.js +7 -13
- package/lib/apis/agent/handlers.js +7 -13
- package/lib/apis/core/activity.js +2 -3
- package/lib/apis/core/attributeDefinitions.js +6 -11
- package/lib/apis/core/attributeDefinitions.test.js +201 -213
- package/lib/apis/core/authentication.js +74 -84
- package/lib/apis/core/backgroundJobs.js +5 -9
- package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
- package/lib/apis/core/bridgeModelAttributes.js +6 -11
- package/lib/apis/core/bridgeModelMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualifications.js +5 -10
- package/lib/apis/core/bridgeModels.js +7 -13
- package/lib/apis/core/bridgeModels.test.js +313 -333
- package/lib/apis/core/bridgedresources.js +7 -13
- package/lib/apis/core/categories.js +6 -11
- package/lib/apis/core/fileResources.js +5 -10
- package/lib/apis/core/filestores.js +5 -10
- package/lib/apis/core/formTypes.js +6 -11
- package/lib/apis/core/forms.js +6 -11
- package/lib/apis/core/forms.test.js +201 -213
- package/lib/apis/core/kapps.js +6 -11
- package/lib/apis/core/kapps.test.js +122 -130
- package/lib/apis/core/logs.js +3 -5
- package/lib/apis/core/memberships.js +3 -5
- package/lib/apis/core/meta.js +6 -11
- package/lib/apis/core/notices.js +2 -3
- package/lib/apis/core/oauthClients.js +6 -11
- package/lib/apis/core/platformComponents.js +10 -19
- package/lib/apis/core/platformItems.js +2 -3
- package/lib/apis/core/profile.js +3 -5
- package/lib/apis/core/securityPolicyDefinitions.js +6 -11
- package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
- package/lib/apis/core/space.js +3 -5
- package/lib/apis/core/space.test.js +106 -114
- package/lib/apis/core/submissions.js +17 -33
- package/lib/apis/core/teams.js +6 -11
- package/lib/apis/core/translations.js +18 -35
- package/lib/apis/core/translations.test.js +1343 -1437
- package/lib/apis/core/users.js +6 -11
- package/lib/apis/core/version.js +2 -3
- package/lib/apis/core/webApis.js +5 -10
- package/lib/apis/core/webhooks.js +6 -11
- package/lib/apis/core/webhooks.test.js +243 -257
- package/lib/apis/core/webhooksJobs.js +3 -5
- package/lib/apis/core/workflows.js +7 -13
- package/lib/apis/http.js +16 -31
- package/lib/apis/system/index.js +46 -91
- package/lib/apis/task/index.js +60 -119
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +1 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +1 -2
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
- package/lib/components/common/AttributeSelect.js +2 -3
- package/lib/components/common/BridgeSelect.js +16 -17
- package/lib/components/common/ComponentConfigContext.js +1 -2
- package/lib/components/common/ContentEditable.js +23 -3
- package/lib/components/common/FormSelect.js +16 -17
- package/lib/components/common/NodeSelect.js +2 -3
- package/lib/components/common/Scroller.js +2 -3
- package/lib/components/common/StaticSelect.js +14 -15
- package/lib/components/common/TableInput.js +276 -63
- package/lib/components/common/TeamSelect.js +16 -17
- package/lib/components/common/ToastContainer.js +7 -12
- package/lib/components/common/Typeahead.js +15 -2
- package/lib/components/common/UserSelect.js +16 -17
- package/lib/components/common/authentication/AuthInterceptor.js +2 -3
- package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
- package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
- package/lib/components/common/authentication/RequestInterceptor.js +2 -10
- package/lib/components/common/code_input/CodeInput.js +4 -9
- package/lib/components/common/code_input/draftHelpers.js +20 -37
- package/lib/components/common/code_input/languageHelpers.js +6 -12
- package/lib/components/common/code_input/languageHelpers.test.js +10 -8
- package/lib/components/common/defaults/Toast.js +1 -2
- package/lib/components/common/defaults/index.js +2 -3
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
- package/lib/components/core/category/CategoryForm.js +1 -2
- package/lib/components/core/category/CategoryTable.js +1 -2
- package/lib/components/core/core_form/CoreForm.js +11 -22
- package/lib/components/core/core_form/defaults/index.js +11 -19
- package/lib/components/core/core_form/globals.js +3 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
- package/lib/components/core/field_definition/FieldDefinitionTable.js +2 -4
- package/lib/components/core/file_resource/FileResourceForm.js +1 -2
- package/lib/components/core/file_resource/FileResourceTable.js +1 -2
- package/lib/components/core/form/FormForm.js +1 -2
- package/lib/components/core/form/FormTable.js +1 -2
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +1 -2
- package/lib/components/core/i18n/I18n.js +2 -4
- package/lib/components/core/i18n/I18nContext.js +1 -2
- package/lib/components/core/i18n/I18nProvider.js +2 -3
- package/lib/components/core/i18n/Moment.js +10 -9
- package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
- package/lib/components/core/index_definition/IndexDefinitionTable.js +1 -2
- package/lib/components/core/index_job/IndexJobTable.js +1 -2
- package/lib/components/core/kapp/KappForm.js +1 -2
- package/lib/components/core/kapp/KappTable.js +1 -2
- package/lib/components/core/log/LogTable.js +2 -4
- package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
- package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
- package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
- package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
- package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
- package/lib/components/core/profile/ProfileForm.js +1 -2
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +1 -2
- package/lib/components/core/space/SpaceForm.js +1 -2
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
- package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
- package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
- package/lib/components/core/submission/FormSubmissionTable.js +2 -4
- package/lib/components/core/submission/KappSubmissionTable.js +2 -4
- package/lib/components/core/submission/SubmissionForm.js +1 -2
- package/lib/components/core/submission/SubmissionTable.js +2 -3
- package/lib/components/core/submission/helpers.js +4 -7
- package/lib/components/core/team/TeamForm.js +1 -2
- package/lib/components/core/team/TeamTable.js +1 -2
- package/lib/components/core/translation/ContextForm.js +1 -2
- package/lib/components/core/translation/ContextTable.js +1 -2
- package/lib/components/core/translation/EntryForm.js +1 -2
- package/lib/components/core/translation/EntryTable.js +1 -2
- package/lib/components/core/translation/LocaleForm.js +1 -2
- package/lib/components/core/translation/LocaleTable.js +1 -2
- package/lib/components/core/user/UserForm.js +1 -2
- package/lib/components/core/user/UserTable.js +1 -2
- package/lib/components/core/webapi/WebApiForm.js +97 -101
- package/lib/components/core/webapi/WebApiTable.js +1 -2
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +1 -2
- package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
- package/lib/components/form/Form.helpers.js +10 -19
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +6 -11
- package/lib/components/form/FormState.js +1 -2
- package/lib/components/form/KitchenSinkForm.js +23 -3
- package/lib/components/form/SimpleForm.helpers.js +262 -0
- package/lib/components/form/SimpleForm.js +462 -0
- package/lib/components/form/SimpleForm.models.js +62 -0
- package/lib/components/form/defaults/AttributesField.js +3 -4
- package/lib/components/form/defaults/CheckboxField.js +2 -3
- package/lib/components/form/defaults/CodeField.js +2 -3
- package/lib/components/form/defaults/FormButtons.js +2 -3
- package/lib/components/form/defaults/FormError.js +2 -3
- package/lib/components/form/defaults/FormField.js +2 -3
- package/lib/components/form/defaults/FormLayout.js +2 -3
- package/lib/components/form/defaults/FormMultiField.js +2 -3
- package/lib/components/form/defaults/PasswordField.js +2 -3
- package/lib/components/form/defaults/RadioField.js +2 -3
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
- package/lib/components/form/defaults/SelectField.js +2 -3
- package/lib/components/form/defaults/SelectMultiField.js +2 -3
- package/lib/components/form/defaults/TableField.js +2 -3
- package/lib/components/form/defaults/TeamField.js +2 -3
- package/lib/components/form/defaults/TeamMultiField.js +2 -3
- package/lib/components/form/defaults/TextField.js +2 -3
- package/lib/components/form/defaults/TextMultiField.js +2 -3
- package/lib/components/form/defaults/UserField.js +2 -3
- package/lib/components/form/defaults/UserMultiField.js +2 -3
- package/lib/components/form/defaults/index.js +2 -3
- package/lib/components/form/tests/Form.test.js +3865 -4257
- package/lib/components/form/tests/components.js +2 -3
- package/lib/components/index.js +7 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +1 -2
- package/lib/components/system/SystemElasticSearchForm.js +1 -2
- package/lib/components/system/SystemFilestoreForm.js +2 -3
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +1 -2
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +11 -21
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +48 -51
- package/lib/components/table/Table.redux.js +161 -188
- package/lib/components/table/Table.test.js +115 -123
- package/lib/components/table/defaults/BodyCell.js +1 -2
- package/lib/components/table/defaults/BodyRow.js +1 -2
- package/lib/components/table/defaults/BooleanFilter.js +1 -2
- package/lib/components/table/defaults/ColumnControl.js +1 -2
- package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
- package/lib/components/table/defaults/FilterLayout.js +1 -2
- package/lib/components/table/defaults/Footer.js +1 -2
- package/lib/components/table/defaults/FooterCell.js +1 -2
- package/lib/components/table/defaults/FooterRow.js +1 -2
- package/lib/components/table/defaults/Header.js +1 -2
- package/lib/components/table/defaults/HeaderCell.js +1 -2
- package/lib/components/table/defaults/HeaderRow.js +1 -2
- package/lib/components/table/defaults/PaginationControl.js +2 -4
- package/lib/components/table/defaults/TableBody.js +1 -2
- package/lib/components/table/defaults/TableLayout.js +1 -2
- package/lib/components/table/defaults/TextFilter.js +1 -2
- package/lib/components/table/defaults/index.js +2 -3
- package/lib/components/task/builder/Connector.js +26 -11
- package/lib/components/task/builder/ConnectorForm.js +1 -2
- package/lib/components/task/builder/Node.js +18 -9
- package/lib/components/task/builder/NodeForm.js +1 -2
- package/lib/components/task/builder/NodeParametersForm.js +1 -2
- package/lib/components/task/builder/SvgCanvas.js +2 -3
- package/lib/components/task/builder/SvgText.js +2 -3
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
- package/lib/components/task/builder/TreeBuilder.js +10 -4
- package/lib/components/task/builder/builder.redux.js +171 -182
- package/lib/components/task/builder/constants.js +38 -76
- package/lib/components/task/builder/helpers.js +23 -40
- package/lib/components/task/builder/models.js +19 -35
- package/lib/components/task/category/TaskCategoryForm.js +2 -3
- package/lib/components/task/category/TaskCategoryTable.js +1 -2
- package/lib/components/task/common/UsageTable.js +1 -2
- package/lib/components/task/engine/EngineSettingsForm.js +2 -3
- package/lib/components/task/errors/RunErrorTable.js +2 -3
- package/lib/components/task/errors/SystemErrorsTable.js +1 -2
- package/lib/components/task/handlers/HandlerForm.js +2 -3
- package/lib/components/task/handlers/HandlerTable.js +1 -2
- package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
- package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
- package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
- package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
- package/lib/components/task/runs/RunTable.js +2 -3
- package/lib/components/task/runs/RunTaskTable.js +1 -2
- package/lib/components/task/sources/SourceForm.js +1 -2
- package/lib/components/task/sources/SourceTable.js +1 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -3
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
- package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
- package/lib/components/task/workflows/WorkflowForm.js +2 -3
- package/lib/components/task/workflows/WorkflowTable.js +1 -2
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +3 -6
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +12 -15
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
|
@@ -141,23 +141,53 @@ describe('<Table />', function () {
|
|
|
141
141
|
test('kitchen sink', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
142
142
|
var ActionCell, addColumns;
|
|
143
143
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
144
|
-
while (1) {
|
|
145
|
-
|
|
144
|
+
while (1) switch (_context.prev = _context.next) {
|
|
145
|
+
case 0:
|
|
146
|
+
ActionCell = function ActionCell(props) {
|
|
147
|
+
return /*#__PURE__*/_react["default"].createElement("td", null, props.value);
|
|
148
|
+
};
|
|
149
|
+
addColumns = [{
|
|
150
|
+
value: '_action',
|
|
151
|
+
label: 'Actions',
|
|
152
|
+
components: {
|
|
153
|
+
BodyCell: ActionCell
|
|
154
|
+
}
|
|
155
|
+
}];
|
|
156
|
+
_context.next = 4;
|
|
157
|
+
return mountTable({
|
|
158
|
+
columns: columns,
|
|
159
|
+
addColumns: addColumns,
|
|
160
|
+
dataSource: function dataSource(_tableOptions) {
|
|
161
|
+
return {
|
|
162
|
+
fn: dataSourceFn,
|
|
163
|
+
params: function params(_paramData) {
|
|
164
|
+
return [];
|
|
165
|
+
},
|
|
166
|
+
transform: function transform(result) {
|
|
167
|
+
return {
|
|
168
|
+
data: result.mockData
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
case 4:
|
|
175
|
+
wrapper = _context.sent;
|
|
176
|
+
expect(wrapper).toMatchSnapshot();
|
|
177
|
+
case 6:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context.stop();
|
|
180
|
+
}
|
|
181
|
+
}, _callee);
|
|
182
|
+
})));
|
|
183
|
+
describe('filters', function () {
|
|
184
|
+
test('legacy filters', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
185
|
+
var filterLayout;
|
|
186
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
187
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
146
188
|
case 0:
|
|
147
|
-
|
|
148
|
-
return /*#__PURE__*/_react["default"].createElement("td", null, props.value);
|
|
149
|
-
};
|
|
150
|
-
addColumns = [{
|
|
151
|
-
value: '_action',
|
|
152
|
-
label: 'Actions',
|
|
153
|
-
components: {
|
|
154
|
-
BodyCell: ActionCell
|
|
155
|
-
}
|
|
156
|
-
}];
|
|
157
|
-
_context.next = 4;
|
|
189
|
+
_context2.next = 2;
|
|
158
190
|
return mountTable({
|
|
159
|
-
columns: columns,
|
|
160
|
-
addColumns: addColumns,
|
|
161
191
|
dataSource: function dataSource(_tableOptions) {
|
|
162
192
|
return {
|
|
163
193
|
fn: dataSourceFn,
|
|
@@ -172,95 +202,59 @@ describe('<Table />', function () {
|
|
|
172
202
|
};
|
|
173
203
|
}
|
|
174
204
|
});
|
|
175
|
-
case
|
|
176
|
-
wrapper =
|
|
177
|
-
|
|
205
|
+
case 2:
|
|
206
|
+
wrapper = _context2.sent;
|
|
207
|
+
filterLayout = wrapper.find('FilterLayout');
|
|
208
|
+
expect(filterLayout).toBeDefined();
|
|
209
|
+
expect(filterLayout).toMatchSnapshot();
|
|
178
210
|
case 6:
|
|
179
211
|
case "end":
|
|
180
|
-
return
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}, _callee);
|
|
184
|
-
})));
|
|
185
|
-
describe('filters', function () {
|
|
186
|
-
test('legacy filters', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
187
|
-
var filterLayout;
|
|
188
|
-
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
189
|
-
while (1) {
|
|
190
|
-
switch (_context2.prev = _context2.next) {
|
|
191
|
-
case 0:
|
|
192
|
-
_context2.next = 2;
|
|
193
|
-
return mountTable({
|
|
194
|
-
dataSource: function dataSource(_tableOptions) {
|
|
195
|
-
return {
|
|
196
|
-
fn: dataSourceFn,
|
|
197
|
-
params: function params(_paramData) {
|
|
198
|
-
return [];
|
|
199
|
-
},
|
|
200
|
-
transform: function transform(result) {
|
|
201
|
-
return {
|
|
202
|
-
data: result.mockData
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
case 2:
|
|
209
|
-
wrapper = _context2.sent;
|
|
210
|
-
filterLayout = wrapper.find('FilterLayout');
|
|
211
|
-
expect(filterLayout).toBeDefined();
|
|
212
|
-
expect(filterLayout).toMatchSnapshot();
|
|
213
|
-
case 6:
|
|
214
|
-
case "end":
|
|
215
|
-
return _context2.stop();
|
|
216
|
-
}
|
|
212
|
+
return _context2.stop();
|
|
217
213
|
}
|
|
218
214
|
}, _callee2);
|
|
219
215
|
})));
|
|
220
216
|
test('filter form', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
221
217
|
var filterForm;
|
|
222
218
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
223
|
-
while (1) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return _context3.stop();
|
|
263
|
-
}
|
|
219
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
220
|
+
case 0:
|
|
221
|
+
_context3.next = 2;
|
|
222
|
+
return mountTable({
|
|
223
|
+
filters: function filters() {
|
|
224
|
+
return function () {
|
|
225
|
+
return [{
|
|
226
|
+
name: 'name',
|
|
227
|
+
label: 'Name',
|
|
228
|
+
type: 'text'
|
|
229
|
+
}, {
|
|
230
|
+
name: 'status',
|
|
231
|
+
label: 'Status',
|
|
232
|
+
type: 'text'
|
|
233
|
+
}];
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
dataSource: function dataSource(_tableOptions) {
|
|
237
|
+
return {
|
|
238
|
+
fn: dataSourceFn,
|
|
239
|
+
params: function params(_paramData) {
|
|
240
|
+
return [];
|
|
241
|
+
},
|
|
242
|
+
transform: function transform(result) {
|
|
243
|
+
return {
|
|
244
|
+
data: result.mockData
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
case 2:
|
|
251
|
+
wrapper = _context3.sent;
|
|
252
|
+
filterForm = wrapper.find('FilterForm');
|
|
253
|
+
expect(filterForm).toBeDefined();
|
|
254
|
+
expect(filterForm).toMatchSnapshot();
|
|
255
|
+
case 6:
|
|
256
|
+
case "end":
|
|
257
|
+
return _context3.stop();
|
|
264
258
|
}
|
|
265
259
|
}, _callee3);
|
|
266
260
|
})));
|
|
@@ -268,33 +262,31 @@ describe('<Table />', function () {
|
|
|
268
262
|
describe('dataSource', function () {
|
|
269
263
|
test('dataSource resolves', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
270
264
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
|
|
271
|
-
while (1) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return _context4.stop();
|
|
297
|
-
}
|
|
265
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
266
|
+
case 0:
|
|
267
|
+
_context4.next = 2;
|
|
268
|
+
return mountTable({
|
|
269
|
+
dataSource: function dataSource(_tableOptions) {
|
|
270
|
+
return {
|
|
271
|
+
fn: dataSourceFn,
|
|
272
|
+
params: function params(_paramData) {
|
|
273
|
+
return [];
|
|
274
|
+
},
|
|
275
|
+
transform: function transform(result) {
|
|
276
|
+
return {
|
|
277
|
+
data: result.mockData
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
case 2:
|
|
284
|
+
wrapper = _context4.sent;
|
|
285
|
+
expect(wrapper).toMatchSnapshot();
|
|
286
|
+
expect(dataSourceFn.mock.calls).toMatchSnapshot();
|
|
287
|
+
case 5:
|
|
288
|
+
case "end":
|
|
289
|
+
return _context4.stop();
|
|
298
290
|
}
|
|
299
291
|
}, _callee4);
|
|
300
292
|
})));
|
|
@@ -14,5 +14,4 @@ var EmptyBodyRow = function EmptyBodyRow(_ref) {
|
|
|
14
14
|
colSpan: colSpan
|
|
15
15
|
}, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "No data found."))));
|
|
16
16
|
};
|
|
17
|
-
var _default = EmptyBodyRow;
|
|
18
|
-
exports["default"] = _default;
|
|
17
|
+
var _default = exports["default"] = EmptyBodyRow;
|
|
@@ -9,5 +9,4 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var FooterCell = function FooterCell() {
|
|
10
10
|
return /*#__PURE__*/_react["default"].createElement("td", null);
|
|
11
11
|
};
|
|
12
|
-
var _default = FooterCell;
|
|
13
|
-
exports["default"] = _default;
|
|
12
|
+
var _default = exports["default"] = FooterCell;
|
|
@@ -19,5 +19,4 @@ var HeaderCell = function HeaderCell(_ref) {
|
|
|
19
19
|
onClick: onSortColumn
|
|
20
20
|
}, sorting === 'desc' ? /*#__PURE__*/_react["default"].createElement("span", null, "\u2193") : sorting === 'asc' ? /*#__PURE__*/_react["default"].createElement("span", null, "\u2191") : /*#__PURE__*/_react["default"].createElement("span", null, "\u2013"))));
|
|
21
21
|
};
|
|
22
|
-
var _default = HeaderCell;
|
|
23
|
-
exports["default"] = _default;
|
|
22
|
+
var _default = exports["default"] = HeaderCell;
|
|
@@ -10,5 +10,4 @@ var HeaderRow = function HeaderRow(_ref) {
|
|
|
10
10
|
var columnHeaders = _ref.columnHeaders;
|
|
11
11
|
return /*#__PURE__*/_react["default"].createElement("tr", null, columnHeaders);
|
|
12
12
|
};
|
|
13
|
-
var _default = HeaderRow;
|
|
14
|
-
exports["default"] = _default;
|
|
13
|
+
var _default = exports["default"] = HeaderRow;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = exports.PaginationControl = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _I18n = require("../../core/i18n/I18n");
|
|
10
|
-
var PaginationControl = function PaginationControl(_ref) {
|
|
10
|
+
var PaginationControl = exports.PaginationControl = function PaginationControl(_ref) {
|
|
11
11
|
var nextPage = _ref.nextPage,
|
|
12
12
|
prevPage = _ref.prevPage,
|
|
13
13
|
loading = _ref.loading;
|
|
@@ -19,6 +19,4 @@ var PaginationControl = function PaginationControl(_ref) {
|
|
|
19
19
|
disabled: loading || !nextPage
|
|
20
20
|
}, /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "Next")));
|
|
21
21
|
};
|
|
22
|
-
exports
|
|
23
|
-
var _default = PaginationControl;
|
|
24
|
-
exports["default"] = _default;
|
|
22
|
+
var _default = exports["default"] = PaginationControl;
|
|
@@ -10,5 +10,4 @@ var TableBody = function TableBody(_ref) {
|
|
|
10
10
|
var tableRows = _ref.tableRows;
|
|
11
11
|
return /*#__PURE__*/_react["default"].createElement("tbody", null, tableRows);
|
|
12
12
|
};
|
|
13
|
-
var _default = TableBody;
|
|
14
|
-
exports["default"] = _default;
|
|
13
|
+
var _default = exports["default"] = TableBody;
|
|
@@ -12,5 +12,4 @@ var TableLayout = function TableLayout(_ref) {
|
|
|
12
12
|
footer = _ref.footer;
|
|
13
13
|
return /*#__PURE__*/_react["default"].createElement("table", null, header, body, footer);
|
|
14
14
|
};
|
|
15
|
-
var _default = TableLayout;
|
|
16
|
-
exports["default"] = _default;
|
|
15
|
+
var _default = exports["default"] = TableLayout;
|
|
@@ -22,7 +22,7 @@ var _BooleanFilter = _interopRequireDefault(require("./BooleanFilter"));
|
|
|
22
22
|
var _TextFilter = _interopRequireDefault(require("./TextFilter"));
|
|
23
23
|
var _PaginationControl = _interopRequireDefault(require("./PaginationControl"));
|
|
24
24
|
var _ColumnControl = _interopRequireDefault(require("./ColumnControl"));
|
|
25
|
-
var DefaultTableConfig = (0, _immutable.Map)({
|
|
25
|
+
var DefaultTableConfig = exports.DefaultTableConfig = (0, _immutable.Map)({
|
|
26
26
|
TableLayout: _TableLayout["default"],
|
|
27
27
|
Header: _Header["default"],
|
|
28
28
|
HeaderRow: _HeaderRow["default"],
|
|
@@ -39,5 +39,4 @@ var DefaultTableConfig = (0, _immutable.Map)({
|
|
|
39
39
|
BooleanFilter: _BooleanFilter["default"],
|
|
40
40
|
PaginationControl: _PaginationControl["default"],
|
|
41
41
|
ColumnControl: _ColumnControl["default"]
|
|
42
|
-
});
|
|
43
|
-
exports.DefaultTableConfig = DefaultTableConfig;
|
|
42
|
+
});
|
|
@@ -21,7 +21,7 @@ var _helpers = require("./helpers");
|
|
|
21
21
|
var _SvgText = require("./SvgText");
|
|
22
22
|
var _filter = _interopRequireDefault(require("../../../../assets/task/icons/filter.svg"));
|
|
23
23
|
var _lodashEs = require("lodash-es");
|
|
24
|
-
var Connector = /*#__PURE__*/function (_Component) {
|
|
24
|
+
var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
|
|
25
25
|
(0, _inherits2["default"])(Connector, _Component);
|
|
26
26
|
var _super = (0, _createSuper2["default"])(Connector);
|
|
27
27
|
function Connector(props) {
|
|
@@ -31,11 +31,24 @@ var Connector = /*#__PURE__*/function (_Component) {
|
|
|
31
31
|
_this.setTreeBuilder = function (treeBuilder) {
|
|
32
32
|
_this.treeBuilder = treeBuilder;
|
|
33
33
|
};
|
|
34
|
+
/*****************************************************************************
|
|
35
|
+
* Click handlers *
|
|
36
|
+
****************************************************************************/
|
|
34
37
|
_this.onSelect = function (event) {
|
|
35
38
|
if (typeof _this.props.onSelect === 'function') {
|
|
36
39
|
_this.props.onSelect(_this.props.connector, event.shiftKey);
|
|
37
40
|
}
|
|
38
41
|
};
|
|
42
|
+
/*****************************************************************************
|
|
43
|
+
* Drag-and-drop support *
|
|
44
|
+
* Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
|
|
45
|
+
* On move we update this instance's `head` or `tail` properties and set *
|
|
46
|
+
* `dragging` to either "head" or "tail" so that the `draw` method knows if *
|
|
47
|
+
* we are drawing to a dragging point or to the center of a node. *
|
|
48
|
+
* On drop we check to see if the point we are dropping at is within a node *
|
|
49
|
+
* (we check that its a valid node as well) and dispatch a redux action to *
|
|
50
|
+
* persist the change or we reset the `head` or `tail` properties and `draw` *
|
|
51
|
+
****************************************************************************/
|
|
39
52
|
_this.dragHead = function (event) {
|
|
40
53
|
_this.treeBuilder.watchDrag({
|
|
41
54
|
relative: false,
|
|
@@ -90,18 +103,29 @@ var Connector = /*#__PURE__*/function (_Component) {
|
|
|
90
103
|
_this.setTail(_this.props.tailNode.position, false);
|
|
91
104
|
}
|
|
92
105
|
};
|
|
106
|
+
// Dragging will be true when dragging by the head and false when called via
|
|
107
|
+
// dragging node.
|
|
93
108
|
_this.setHead = function (point) {
|
|
94
109
|
var dragging = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
95
110
|
_this.dragging = dragging ? 'head' : null;
|
|
96
111
|
_this.head = point;
|
|
97
112
|
_this.draw();
|
|
98
113
|
};
|
|
114
|
+
// Dragging will be true when dragging by the tail and false when called via
|
|
115
|
+
// dragging node.
|
|
99
116
|
_this.setTail = function (point) {
|
|
100
117
|
var dragging = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
101
118
|
_this.dragging = dragging ? 'tail' : null;
|
|
102
119
|
_this.tail = point;
|
|
103
120
|
_this.draw();
|
|
104
121
|
};
|
|
122
|
+
/*****************************************************************************
|
|
123
|
+
* Rendering *
|
|
124
|
+
* To make the drag-and-drop perform as fast as possible we manually *
|
|
125
|
+
* manipulate some DOM elements in the `draw` method below. Anything that *
|
|
126
|
+
* changes the instance's `head` or `tail` properties should also call *
|
|
127
|
+
* `draw` *
|
|
128
|
+
****************************************************************************/
|
|
105
129
|
_this.draw = function () {
|
|
106
130
|
_this.connector.current.parentElement.style.display = '';
|
|
107
131
|
var _getRectIntersections = (0, _helpers.getRectIntersections)((0, _assertThisInitialized2["default"])(_this)),
|
|
@@ -183,14 +207,6 @@ var Connector = /*#__PURE__*/function (_Component) {
|
|
|
183
207
|
this.draw();
|
|
184
208
|
}
|
|
185
209
|
}
|
|
186
|
-
|
|
187
|
-
/*****************************************************************************
|
|
188
|
-
* Rendering *
|
|
189
|
-
* To make the drag-and-drop perform as fast as possible we manually *
|
|
190
|
-
* manipulate some DOM elements in the `draw` method below. Anything that *
|
|
191
|
-
* changes the instance's `head` or `tail` properties should also call *
|
|
192
|
-
* `draw` *
|
|
193
|
-
****************************************************************************/
|
|
194
210
|
}, {
|
|
195
211
|
key: "render",
|
|
196
212
|
value: function render() {
|
|
@@ -288,5 +304,4 @@ var Connector = /*#__PURE__*/function (_Component) {
|
|
|
288
304
|
}
|
|
289
305
|
}]);
|
|
290
306
|
return Connector;
|
|
291
|
-
}(_react.Component);
|
|
292
|
-
exports.Connector = Connector;
|
|
307
|
+
}(_react.Component);
|
|
@@ -81,11 +81,10 @@ var handleSubmit = function handleSubmit(_ref4) {
|
|
|
81
81
|
return connector.merge(values);
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
-
var ConnectorForm = (0, _Form.generateForm)({
|
|
84
|
+
var ConnectorForm = exports.ConnectorForm = (0, _Form.generateForm)({
|
|
85
85
|
formOptions: ['connector', 'tasks', 'tree'],
|
|
86
86
|
dataSources: dataSources,
|
|
87
87
|
fields: fields,
|
|
88
88
|
handleSubmit: handleSubmit
|
|
89
89
|
});
|
|
90
|
-
exports.ConnectorForm = ConnectorForm;
|
|
91
90
|
ConnectorForm.displayName = 'ConnectorForm';
|
|
@@ -14,19 +14,23 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _lodashEs = require("lodash-es");
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
var _store = require("../../../store");
|
|
17
|
-
var
|
|
17
|
+
var _constants = _interopRequireWildcard(require("./constants"));
|
|
18
|
+
var constants = _constants;
|
|
18
19
|
var _helpers = require("./helpers");
|
|
19
20
|
var _models = require("./models");
|
|
20
21
|
var _SvgText = require("./SvgText");
|
|
21
22
|
var _plus_small = _interopRequireDefault(require("../../../../assets/task/icons/plus_small.svg"));
|
|
22
23
|
var _dragHandle = _interopRequireDefault(require("../../../../assets/task/icons/drag-handle.svg"));
|
|
23
|
-
var Node = /*#__PURE__*/function (_Component) {
|
|
24
|
+
var Node = exports.Node = /*#__PURE__*/function (_Component) {
|
|
24
25
|
(0, _inherits2["default"])(Node, _Component);
|
|
25
26
|
var _super = (0, _createSuper2["default"])(Node);
|
|
26
27
|
function Node(props) {
|
|
27
28
|
var _this;
|
|
28
29
|
(0, _classCallCheck2["default"])(this, Node);
|
|
29
30
|
_this = _super.call(this, props);
|
|
31
|
+
/*****************************************************************************
|
|
32
|
+
* Click handlers *
|
|
33
|
+
****************************************************************************/
|
|
30
34
|
_this.onSelect = function (shiftKey) {
|
|
31
35
|
return function () {
|
|
32
36
|
if ((0, _lodashEs.isFunction)(_this.props.onSelect)) {
|
|
@@ -34,6 +38,16 @@ var Node = /*#__PURE__*/function (_Component) {
|
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
};
|
|
41
|
+
/*****************************************************************************
|
|
42
|
+
* Drag-and-drop support *
|
|
43
|
+
* Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
|
|
44
|
+
* On move we need to update any related connectors manually (for maximum *
|
|
45
|
+
* performance). *
|
|
46
|
+
* On drop we dispatch an action to update the node in redux to persist the *
|
|
47
|
+
* change. *
|
|
48
|
+
* We also watch for drag on the plus button, which should leverage the *
|
|
49
|
+
* `TreeBuilder` instance to start creating a new connector *
|
|
50
|
+
****************************************************************************/
|
|
37
51
|
_this.drag = function (event) {
|
|
38
52
|
_this.treeBuilder.watchDrag({
|
|
39
53
|
event: event,
|
|
@@ -48,7 +62,7 @@ var Node = /*#__PURE__*/function (_Component) {
|
|
|
48
62
|
relative: false,
|
|
49
63
|
onMove: _this.treeBuilder.dragNewConnector(_this.props.node),
|
|
50
64
|
onDrop: _this.treeBuilder.dropNewConnector,
|
|
51
|
-
onClick: _this.treeBuilder.addNewNode(_this.props.node, event.nativeEvent, (0, _helpers.getNodeType)(_this.props.node) === 'start' ?
|
|
65
|
+
onClick: _this.treeBuilder.addNewNode(_this.props.node, event.nativeEvent, (0, _helpers.getNodeType)(_this.props.node) === 'start' ? _constants.NODE_START_RADIUS * 2 - 18 : _constants.NODE_WIDTH - 18, (0, _helpers.getNodeType)(_this.props.node) === 'start' ? (_constants.NODE_START_RADIUS * 2 - _constants.NODE_HEIGHT) / 2 : 0)
|
|
52
66
|
});
|
|
53
67
|
};
|
|
54
68
|
_this.drop = function () {
|
|
@@ -84,10 +98,6 @@ var Node = /*#__PURE__*/function (_Component) {
|
|
|
84
98
|
value: function setTreeBuilder(treeBuilder) {
|
|
85
99
|
this.treeBuilder = treeBuilder;
|
|
86
100
|
}
|
|
87
|
-
|
|
88
|
-
/*****************************************************************************
|
|
89
|
-
* Click handlers *
|
|
90
|
-
****************************************************************************/
|
|
91
101
|
}, {
|
|
92
102
|
key: "shouldComponentUpdate",
|
|
93
103
|
value:
|
|
@@ -238,5 +248,4 @@ var Node = /*#__PURE__*/function (_Component) {
|
|
|
238
248
|
}
|
|
239
249
|
}]);
|
|
240
250
|
return Node;
|
|
241
|
-
}(_react.Component);
|
|
242
|
-
exports.Node = Node;
|
|
251
|
+
}(_react.Component);
|
|
@@ -212,11 +212,10 @@ var handleSubmit = function handleSubmit(_ref11) {
|
|
|
212
212
|
return node.merge(values);
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
-
var NodeForm = (0, _Form.generateForm)({
|
|
215
|
+
var NodeForm = exports.NodeForm = (0, _Form.generateForm)({
|
|
216
216
|
formOptions: ['node', 'tasks', 'tree'],
|
|
217
217
|
dataSources: dataSources,
|
|
218
218
|
fields: fields,
|
|
219
219
|
handleSubmit: handleSubmit
|
|
220
220
|
});
|
|
221
|
-
exports.NodeForm = NodeForm;
|
|
222
221
|
NodeForm.displayName = 'NodeForm';
|
|
@@ -134,11 +134,10 @@ var handleSubmit = function handleSubmit(_ref5) {
|
|
|
134
134
|
return values;
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
|
-
var NodeParametersForm = (0, _Form.generateForm)({
|
|
137
|
+
var NodeParametersForm = exports.NodeParametersForm = (0, _Form.generateForm)({
|
|
138
138
|
formOptions: ['node', 'task', 'tasks', 'tree'],
|
|
139
139
|
dataSources: dataSources,
|
|
140
140
|
fields: fields,
|
|
141
141
|
handleSubmit: handleSubmit
|
|
142
142
|
});
|
|
143
|
-
exports.NodeParametersForm = NodeParametersForm;
|
|
144
143
|
NodeParametersForm.displayName = 'NodeParametersForm';
|
|
@@ -15,7 +15,7 @@ var _lodashEs = require("lodash-es");
|
|
|
15
15
|
var _helpers = require("./helpers");
|
|
16
16
|
var constants = _interopRequireWildcard(require("./constants"));
|
|
17
17
|
var _models = require("./models");
|
|
18
|
-
var SvgCanvas = /*#__PURE__*/function (_Component) {
|
|
18
|
+
var SvgCanvas = exports.SvgCanvas = /*#__PURE__*/function (_Component) {
|
|
19
19
|
(0, _inherits2["default"])(SvgCanvas, _Component);
|
|
20
20
|
var _super = (0, _createSuper2["default"])(SvgCanvas);
|
|
21
21
|
function SvgCanvas(props) {
|
|
@@ -267,5 +267,4 @@ var SvgCanvas = /*#__PURE__*/function (_Component) {
|
|
|
267
267
|
}
|
|
268
268
|
}]);
|
|
269
269
|
return SvgCanvas;
|
|
270
|
-
}(_react.Component);
|
|
271
|
-
exports.SvgCanvas = SvgCanvas;
|
|
270
|
+
}(_react.Component);
|