@kineticdata/react 6.0.1 → 6.0.3
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/CHANGELOG.md +86 -0
- 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 +19 -35
- 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 +4 -4
- 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 +3 -3
- 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 +4354 -4508
- package/lib/components/form/tests/components.js +73 -64
- 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/table/tests/Table.redux.test.js +162 -0
- package/lib/components/table/tests/Table.test.js +767 -0
- package/lib/components/table/tests/components.js +182 -0
- 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 +14 -5
- package/lib/components/task/builder/builder.redux.js +187 -186
- 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 +24 -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 +91 -41
- 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
|
+
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Table = require("../Table.redux");
|
|
4
|
+
var _immutable = require("immutable");
|
|
5
|
+
describe('<Table /> redux', function () {
|
|
6
|
+
describe('setup', function () {
|
|
7
|
+
test('true dat', function () {
|
|
8
|
+
expect(true).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
describe('client-side operations', function () {
|
|
12
|
+
test('startsWith', function () {
|
|
13
|
+
var op = _Table.operations.get('startsWith');
|
|
14
|
+
expect(op('currentValue', 'cur')).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
test('equals', function () {
|
|
17
|
+
var op = _Table.operations.get('equals');
|
|
18
|
+
expect(op('currentValue', 'cur')).toBeFalsy();
|
|
19
|
+
expect(op('currentValue', 'currentValue')).toBeTruthy();
|
|
20
|
+
expect(op('CURRENTVALUE', 'currentValue')).toBeTruthy();
|
|
21
|
+
expect(op(1, 2)).toBeFalsy();
|
|
22
|
+
expect(op(1, 1)).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
test('lt', function () {
|
|
25
|
+
var op = _Table.operations.get('lt');
|
|
26
|
+
expect(op(10, 9)).toBeFalsy();
|
|
27
|
+
expect(op(10, 11)).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
test('lteq', function () {
|
|
30
|
+
var op = _Table.operations.get('lteq');
|
|
31
|
+
expect(op(10, 9)).toBeFalsy();
|
|
32
|
+
expect(op(10, 10)).toBeTruthy();
|
|
33
|
+
expect(op(10, 11)).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
test('gt', function () {
|
|
36
|
+
var op = _Table.operations.get('gt');
|
|
37
|
+
expect(op(10, 9)).toBeTruthy();
|
|
38
|
+
expect(op(10, 11)).toBeFalsy();
|
|
39
|
+
});
|
|
40
|
+
test('gteq', function () {
|
|
41
|
+
var op = _Table.operations.get('gteq');
|
|
42
|
+
expect(op(10, 9)).toBeTruthy();
|
|
43
|
+
expect(op(10, 10)).toBeTruthy();
|
|
44
|
+
expect(op(10, 11)).toBeFalsy();
|
|
45
|
+
});
|
|
46
|
+
test('between', function () {
|
|
47
|
+
var op = _Table.operations.get('between');
|
|
48
|
+
expect(op(10, (0, _immutable.List)([1, 20]))).toBeTruthy();
|
|
49
|
+
expect(op(1, (0, _immutable.List)([1, 20]))).toBeTruthy();
|
|
50
|
+
expect(op(20, (0, _immutable.List)([1, 20]))).toBeFalsy();
|
|
51
|
+
expect(op(21, (0, _immutable.List)([1, 20]))).toBeFalsy();
|
|
52
|
+
expect(op(0, (0, _immutable.List)([1, 20]))).toBeFalsy();
|
|
53
|
+
});
|
|
54
|
+
test('in', function () {
|
|
55
|
+
var op = _Table.operations.get('in');
|
|
56
|
+
expect(op('a', (0, _immutable.List)(['a', 'b', 'c']))).toBeTruthy();
|
|
57
|
+
expect(op('A', (0, _immutable.List)(['a', 'b', 'c']))).toBeTruthy();
|
|
58
|
+
expect(op('b', (0, _immutable.List)(['a', 'b', 'c']))).toBeTruthy();
|
|
59
|
+
expect(op('c', (0, _immutable.List)(['a', 'b', 'c']))).toBeTruthy();
|
|
60
|
+
expect(op('d', (0, _immutable.List)(['a', 'b', 'c']))).toBeFalsy();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe('#isValueEmpty', function () {
|
|
64
|
+
test('is empty when undefined', function () {
|
|
65
|
+
var a;
|
|
66
|
+
expect((0, _Table.isValueEmpty)(a)).toBeTruthy();
|
|
67
|
+
});
|
|
68
|
+
test('is empty when empty string', function () {
|
|
69
|
+
var a = '';
|
|
70
|
+
expect((0, _Table.isValueEmpty)(a)).toBeTruthy();
|
|
71
|
+
});
|
|
72
|
+
test('is not empty when it is string', function () {
|
|
73
|
+
var a = 'a';
|
|
74
|
+
expect((0, _Table.isValueEmpty)(a)).toBeFalsy();
|
|
75
|
+
});
|
|
76
|
+
test('is empty when empty List', function () {
|
|
77
|
+
var a = (0, _immutable.List)();
|
|
78
|
+
expect((0, _Table.isValueEmpty)(a)).toBeTruthy();
|
|
79
|
+
});
|
|
80
|
+
test('is empty when List of empty strings', function () {
|
|
81
|
+
var a = (0, _immutable.List)(['', '']);
|
|
82
|
+
expect((0, _Table.isValueEmpty)(a)).toBeTruthy();
|
|
83
|
+
});
|
|
84
|
+
test('is not empty when List of items', function () {
|
|
85
|
+
var a = (0, _immutable.List)(['a', 'b']);
|
|
86
|
+
expect((0, _Table.isValueEmpty)(a)).toBeFalsy();
|
|
87
|
+
a = (0, _immutable.List)([1, 2]);
|
|
88
|
+
expect((0, _Table.isValueEmpty)(a)).toBeFalsy();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe('#clientSideGotoPage', function () {
|
|
92
|
+
var tableData;
|
|
93
|
+
beforeEach(function () {
|
|
94
|
+
tableData = (0, _immutable.Map)({
|
|
95
|
+
pageSize: 5,
|
|
96
|
+
pageOffset: 0,
|
|
97
|
+
data: (0, _immutable.Range)(1, 25).toList()
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('when pageNumber is invalid', function () {
|
|
101
|
+
test('invalid type does not affect tableData', function () {
|
|
102
|
+
expect((0, _Table.clientSideGotoPage)(tableData, 'foo')).toEqualImmutable(tableData);
|
|
103
|
+
});
|
|
104
|
+
test('invalid number does not affect tableData', function () {
|
|
105
|
+
expect((0, _Table.clientSideGotoPage)(tableData, -1)).toEqualImmutable(tableData);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
test('pageNumber 1 offset is 0', function () {
|
|
109
|
+
var newTableData = (0, _Table.clientSideGotoPage)(tableData.set('pageOffset', 10), 1);
|
|
110
|
+
expect(newTableData.get('pageOffset')).toBe(0);
|
|
111
|
+
});
|
|
112
|
+
test('pageNumber 2 offset is 5', function () {
|
|
113
|
+
var newTableData = (0, _Table.clientSideGotoPage)(tableData, 2);
|
|
114
|
+
expect(newTableData.get('pageOffset')).toBe(5);
|
|
115
|
+
});
|
|
116
|
+
test('pageNumber 6 offset is unchanged (past the end of the data)', function () {
|
|
117
|
+
var newTableData = (0, _Table.clientSideGotoPage)(tableData, 6);
|
|
118
|
+
expect(newTableData.get('pageOffset')).toBe(0);
|
|
119
|
+
});
|
|
120
|
+
test('pageNumber 5 offset is 20 (last page)', function () {
|
|
121
|
+
var newTableData = (0, _Table.clientSideGotoPage)(tableData, 5);
|
|
122
|
+
expect(newTableData.get('pageOffset')).toBe(20);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
describe('#serverSideGotoPage', function () {
|
|
126
|
+
var tableData;
|
|
127
|
+
beforeEach(function () {
|
|
128
|
+
tableData = (0, _immutable.Map)({
|
|
129
|
+
loading: false,
|
|
130
|
+
nextPageToken: 'abc',
|
|
131
|
+
pageTokens: (0, _immutable.List)([2, 3, 4])
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
describe('when pageNumber is invalid', function () {
|
|
135
|
+
test('invalid type does not affect tableData', function () {
|
|
136
|
+
expect((0, _Table.serverSideGotoPage)(tableData, 'foo')).toEqualImmutable(tableData);
|
|
137
|
+
});
|
|
138
|
+
test('invalid number does not affect tableData', function () {
|
|
139
|
+
expect((0, _Table.serverSideGotoPage)(tableData, -1)).toEqualImmutable(tableData);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
test('when there are not enough pageTokens it does not affect tableData', function () {
|
|
143
|
+
expect((0, _Table.serverSideGotoPage)(tableData, 5)).toEqualImmutable(tableData);
|
|
144
|
+
});
|
|
145
|
+
test('when going to the first page reset the page tokens', function () {
|
|
146
|
+
var newTableData = (0, _Table.serverSideGotoPage)(tableData, 1);
|
|
147
|
+
expect(newTableData.get('loading')).toBe(true);
|
|
148
|
+
expect(newTableData.get('nextPageToken')).toBeNull();
|
|
149
|
+
expect(newTableData.get('pageTokens').size).toBe(0);
|
|
150
|
+
});
|
|
151
|
+
test('when going to a valid page use its pageToken and adjust the page tokens', function () {
|
|
152
|
+
var secondTableData = (0, _Table.serverSideGotoPage)(tableData, 2);
|
|
153
|
+
var thirdTableData = (0, _Table.serverSideGotoPage)(tableData, 3);
|
|
154
|
+
expect(secondTableData.get('loading')).toBe(true);
|
|
155
|
+
expect(secondTableData.get('nextPageToken')).toBe(2);
|
|
156
|
+
expect(secondTableData.get('pageTokens').size).toBe(0);
|
|
157
|
+
expect(thirdTableData.get('loading')).toBe(true);
|
|
158
|
+
expect(thirdTableData.get('nextPageToken')).toBe(3);
|
|
159
|
+
expect(thirdTableData.get('pageTokens').size).toBe(1);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
});
|