@genesislcap/pbc-reporting-ui 15.19.0 → 15.19.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/dist/custom-elements.json +4247 -5382
- package/dist/dts/react.d.ts +44 -44
- package/dist/react.cjs +65 -65
- package/dist/react.mjs +57 -57
- package/package.json +22 -23
- package/.env +0 -3
- package/api-extractor.json +0 -4
- package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/row-filters/row-filters.helpers.test.d.ts +0 -2
- package/dist/dts/new/main/edit-config/row-filters/row-filters.helpers.test.d.ts.map +0 -1
- package/dist/dts/new/main/edit-config/shared/datasource-data-base-component.test.d.ts +0 -5
- package/dist/dts/new/main/edit-config/shared/datasource-data-base-component.test.d.ts.map +0 -1
- package/dist/dts/new/utils/alias-generator.test.d.ts +0 -2
- package/dist/dts/new/utils/alias-generator.test.d.ts.map +0 -1
- package/dist/dts/new/utils/endpoint.test.d.ts +0 -2
- package/dist/dts/new/utils/endpoint.test.d.ts.map +0 -1
- package/dist/dts/new/utils/transformers.test.d.ts +0 -2
- package/dist/dts/new/utils/transformers.test.d.ts.map +0 -1
- package/dist/dts/new/utils/validators.test.d.ts +0 -2
- package/dist/dts/new/utils/validators.test.d.ts.map +0 -1
- package/dist/dts/old/main/main.test.d.ts +0 -2
- package/dist/dts/old/main/main.test.d.ts.map +0 -1
- package/dist/dts/old/utils/filterObjectArray.test.d.ts +0 -2
- package/dist/dts/old/utils/filterObjectArray.test.d.ts.map +0 -1
- package/dist/esm/new/main/edit-config/col-filters/col-filters-grid.helpers.test.js +0 -200
- package/dist/esm/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.js +0 -152
- package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.js +0 -629
- package/dist/esm/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.js +0 -268
- package/dist/esm/new/main/edit-config/row-filters/row-filters.helpers.test.js +0 -1
- package/dist/esm/new/main/edit-config/shared/datasource-data-base-component.test.js +0 -426
- package/dist/esm/new/utils/alias-generator.test.js +0 -36
- package/dist/esm/new/utils/endpoint.test.js +0 -162
- package/dist/esm/new/utils/transformers.test.js +0 -469
- package/dist/esm/new/utils/validators.test.js +0 -139
- package/dist/esm/old/main/main.test.js +0 -5
- package/dist/esm/old/utils/filterObjectArray.test.js +0 -46
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/globals.d.ts +0 -7
- package/src/index.federated.ts +0 -1
- package/src/index.ts +0 -8
- package/src/new/components/clone-report-config-modal/clone-report-config-modal.styles.ts +0 -47
- package/src/new/components/clone-report-config-modal/clone-report-config-modal.template.ts +0 -55
- package/src/new/components/clone-report-config-modal/clone-report-config-modal.ts +0 -173
- package/src/new/components/components.ts +0 -118
- package/src/new/components/renderers/data-transform-renderer.ts +0 -111
- package/src/new/components/reporting-configurations/reporting-configurations.styles.ts +0 -42
- package/src/new/components/reporting-configurations/reporting-configurations.template.ts +0 -59
- package/src/new/components/reporting-configurations/reporting-configurations.ts +0 -366
- package/src/new/components/shared/file-template-picker.template.ts +0 -45
- package/src/new/lib/redux-store/README.md +0 -55
- package/src/new/lib/redux-store/index.ts +0 -2
- package/src/new/lib/redux-store/state-utils.ts +0 -1
- package/src/new/lib/redux-store/store.ts +0 -135
- package/src/new/main/edit-config/base-config/base-config.styles.ts +0 -26
- package/src/new/main/edit-config/base-config/base-config.template.ts +0 -71
- package/src/new/main/edit-config/base-config/base-config.ts +0 -116
- package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.test.ts +0 -232
- package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.ts +0 -35
- package/src/new/main/edit-config/col-filters/col-filters-grid.styles.ts +0 -22
- package/src/new/main/edit-config/col-filters/col-filters-grid.ts +0 -150
- package/src/new/main/edit-config/col-filters/col-filters-grid.types.ts +0 -7
- package/src/new/main/edit-config/col-filters/col-filters-tutorial.ts +0 -25
- package/src/new/main/edit-config/col-filters/col-fitlers-grid.template.ts +0 -15
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.ts +0 -187
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.ts +0 -89
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.styles.ts +0 -22
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.template.ts +0 -14
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.ts +0 -119
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.types.ts +0 -10
- package/src/new/main/edit-config/col-rename-alias/col-rename-alias-tutorial.ts +0 -33
- package/src/new/main/edit-config/config-journey-orchestrator.styles.ts +0 -120
- package/src/new/main/edit-config/config-journey-orchestrator.template.ts +0 -149
- package/src/new/main/edit-config/config-journey-orchestrator.ts +0 -92
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms-tutorial.ts +0 -127
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.ts +0 -799
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.ts +0 -371
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.styles.ts +0 -22
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.template.ts +0 -21
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.ts +0 -162
- package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.ts +0 -211
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.styles.ts +0 -79
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.template.ts +0 -217
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.ts +0 -280
- package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/index.ts +0 -1
- package/src/new/main/edit-config/data-transforms-derived-fields/format-warning.ts +0 -43
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.ts +0 -1
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.styles.ts +0 -68
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.template.ts +0 -93
- package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.ts +0 -152
- package/src/new/main/edit-config/datasource-config/datasource-config-container.styles.ts +0 -22
- package/src/new/main/edit-config/datasource-config/datasource-config-item.styles.ts +0 -76
- package/src/new/main/edit-config/datasource-config/datasource-config-item.template.ts +0 -141
- package/src/new/main/edit-config/datasource-config/datasource-config-item.ts +0 -212
- package/src/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.ts +0 -341
- package/src/new/main/edit-config/datasource-config/datasources-config-container.helpers.ts +0 -99
- package/src/new/main/edit-config/datasource-config/datasources-config-container.template.ts +0 -68
- package/src/new/main/edit-config/datasource-config/datasources-config-container.ts +0 -55
- package/src/new/main/edit-config/datasource-config/types.ts +0 -6
- package/src/new/main/edit-config/outputs-config/outputs-config.style.ts +0 -11
- package/src/new/main/edit-config/outputs-config/outputs-config.template.ts +0 -66
- package/src/new/main/edit-config/outputs-config/outputs-config.ts +0 -66
- package/src/new/main/edit-config/row-filters/row-filters-tutorial.styles.ts +0 -16
- package/src/new/main/edit-config/row-filters/row-filters-tutorial.template.ts +0 -229
- package/src/new/main/edit-config/row-filters/row-filters-tutorial.ts +0 -15
- package/src/new/main/edit-config/row-filters/row-filters.helpers.test.ts +0 -2
- package/src/new/main/edit-config/row-filters/row-filters.helpers.ts +0 -53
- package/src/new/main/edit-config/row-filters/row-filters.styles.ts +0 -23
- package/src/new/main/edit-config/row-filters/row-filters.template.ts +0 -15
- package/src/new/main/edit-config/row-filters/row-filters.ts +0 -58
- package/src/new/main/edit-config/row-filters/row-filters.types.ts +0 -14
- package/src/new/main/edit-config/scheduling/scheduling.styles.ts +0 -59
- package/src/new/main/edit-config/scheduling/scheduling.template.ts +0 -80
- package/src/new/main/edit-config/scheduling/scheduling.ts +0 -101
- package/src/new/main/edit-config/shared/datasource-data-base-component.helpers.ts.ts +0 -250
- package/src/new/main/edit-config/shared/datasource-data-base-component.test.ts +0 -568
- package/src/new/main/edit-config/shared/datasource-data-base-component.ts +0 -65
- package/src/new/main/edit-config/shared/datasource-data-base-component.types.ts +0 -55
- package/src/new/main/edit-config/shared/index.ts +0 -3
- package/src/new/main/edit-config/tabbed-datasource-container/index.ts +0 -2
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.styles.ts +0 -12
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.template.ts +0 -29
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.ts +0 -69
- package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.types.ts +0 -7
- package/src/new/main/generated-reports/generated-reports.styles.ts +0 -15
- package/src/new/main/generated-reports/generated-reports.template.ts +0 -29
- package/src/new/main/generated-reports/generated-reports.ts +0 -270
- package/src/new/main/index.ts +0 -3
- package/src/new/main/main.styles.ts +0 -31
- package/src/new/main/main.template.ts +0 -92
- package/src/new/main/main.ts +0 -117
- package/src/new/main/report-destinations/report-destinations.template.ts +0 -39
- package/src/new/main/report-destinations/report-destinations.ts +0 -63
- package/src/new/store/index.ts +0 -3
- package/src/new/store/slices/base-config.ts +0 -50
- package/src/new/store/slices/datasources-config.ts +0 -297
- package/src/new/store/slices/index.ts +0 -3
- package/src/new/store/slices/types.ts +0 -90
- package/src/new/store/store.ts +0 -36
- package/src/new/store/types.ts +0 -10
- package/src/new/styles/constraints.styles.ts +0 -32
- package/src/new/styles/forms.styles.ts +0 -38
- package/src/new/styles/index.ts +0 -3
- package/src/new/styles/misc.styles.ts +0 -25
- package/src/new/types/display.ts +0 -4
- package/src/new/types/index.ts +0 -4
- package/src/new/types/misc.ts +0 -73
- package/src/new/types/redux.ts +0 -73
- package/src/new/types/rights.ts +0 -28
- package/src/new/utils/alias-generator.test.ts +0 -44
- package/src/new/utils/alias-generator.ts +0 -18
- package/src/new/utils/date-filter-params.ts +0 -28
- package/src/new/utils/endpoint.test.ts +0 -193
- package/src/new/utils/endpoint.ts +0 -62
- package/src/new/utils/event-map.ts +0 -11
- package/src/new/utils/format-utils.ts +0 -22
- package/src/new/utils/formatters.ts +0 -36
- package/src/new/utils/index.ts +0 -10
- package/src/new/utils/notifications.ts +0 -9
- package/src/new/utils/renderer.ts +0 -38
- package/src/new/utils/rights.ts +0 -66
- package/src/new/utils/sorter.ts +0 -19
- package/src/new/utils/tooltip.ts +0 -94
- package/src/new/utils/transformers.test.ts +0 -549
- package/src/new/utils/transformers.ts +0 -174
- package/src/new/utils/validators.test.ts +0 -165
- package/src/new/utils/validators.ts +0 -81
- package/src/old/assets/images/index.ts +0 -69
- package/src/old/components/create-edit/create-edit.styles.ts +0 -16
- package/src/old/components/create-edit/create-edit.template.ts +0 -15
- package/src/old/components/create-edit/create-edit.ts +0 -70
- package/src/old/components/create-edit/index.ts +0 -3
- package/src/old/components/list/columns.ts +0 -175
- package/src/old/components/list/index.ts +0 -3
- package/src/old/components/list/list.styles.ts +0 -9
- package/src/old/components/list/list.template.ts +0 -40
- package/src/old/components/list/list.ts +0 -109
- package/src/old/components/preview/columns.ts +0 -58
- package/src/old/components/preview/index.ts +0 -3
- package/src/old/components/preview/preview.styles.ts +0 -22
- package/src/old/components/preview/preview.template.ts +0 -33
- package/src/old/components/preview/preview.ts +0 -143
- package/src/old/components/rapid-components.ts +0 -64
- package/src/old/components/renderers/custom-header-component.ts +0 -92
- package/src/old/components/renderers/filter-value-renderer.ts +0 -237
- package/src/old/components/renderers/row-select.renderer.ts +0 -148
- package/src/old/components/select-fields/columns.ts +0 -83
- package/src/old/components/select-fields/data.ts +0 -218
- package/src/old/components/select-fields/index.ts +0 -3
- package/src/old/components/select-fields/select-fields.styles.ts +0 -22
- package/src/old/components/select-fields/select-fields.template.ts +0 -58
- package/src/old/components/select-fields/select-fields.ts +0 -218
- package/src/old/components/select-filters/columns.ts +0 -78
- package/src/old/components/select-filters/index.ts +0 -3
- package/src/old/components/select-filters/select-filters.styles.ts +0 -21
- package/src/old/components/select-filters/select-filters.template.ts +0 -58
- package/src/old/components/select-filters/select-filters.ts +0 -255
- package/src/old/components/wizard/debug.ts +0 -35
- package/src/old/components/wizard/index.ts +0 -2
- package/src/old/components/wizard/steps/filters.ts +0 -13
- package/src/old/components/wizard/steps/index.ts +0 -4
- package/src/old/components/wizard/steps/name.ts +0 -72
- package/src/old/components/wizard/steps/run.ts +0 -14
- package/src/old/components/wizard/steps/select.ts +0 -14
- package/src/old/components/wizard/wizard.styles.ts +0 -198
- package/src/old/components/wizard/wizard.template.ts +0 -147
- package/src/old/components/wizard/wizard.ts +0 -398
- package/src/old/components/wizard/wizard.types.ts +0 -43
- package/src/old/components/zero-components.ts +0 -61
- package/src/old/config/config.ts +0 -59
- package/src/old/config/configure.ts +0 -66
- package/src/old/config/index.ts +0 -2
- package/src/old/config/templates.ts +0 -59
- package/src/old/constants/grid-config.ts +0 -19
- package/src/old/layouts/default.ts +0 -30
- package/src/old/layouts/index.ts +0 -2
- package/src/old/layouts/two-pane-horizontal.ts +0 -81
- package/src/old/main/index.ts +0 -3
- package/src/old/main/main.styles.ts +0 -69
- package/src/old/main/main.template.ts +0 -127
- package/src/old/main/main.test.ts +0 -7
- package/src/old/main/main.ts +0 -250
- package/src/old/main/types.ts +0 -29
- package/src/old/styles/colors.ts +0 -16
- package/src/old/styles/helpers.ts +0 -181
- package/src/old/styles/index.ts +0 -4
- package/src/old/styles/normalize.ts +0 -14
- package/src/old/styles/styles.ts +0 -24
- package/src/old/tags/index.ts +0 -1
- package/src/old/tags/tags.ts +0 -79
- package/src/old/tsconfig.json +0 -10
- package/src/old/utils/filterObjectArray.test.ts +0 -110
- package/src/old/utils/filterObjectArray.ts +0 -23
- package/src/old/utils/getFiltersByType.ts +0 -92
- package/src/old/utils/getSelectedFields.ts +0 -16
- package/src/old/utils/index.ts +0 -4
- package/src/old/utils/logger.ts +0 -3
- package/src/sandbox.ts +0 -51
- package/src/tsconfig.base.json +0 -24
- package/src/typings.d.ts +0 -1
- package/tsconfig.json +0 -9
package/dist/esm/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.js
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { logger } from '@genesislcap/foundation-comms';
|
|
3
|
-
import { assert, sinon, suite } from '@genesislcap/foundation-testing';
|
|
4
|
-
import { actions, selectors } from '../../../store';
|
|
5
|
-
import { createNewDatasourceConfig, findFirstValidDatasource, getDatasources, } from './datasources-config-container.helpers';
|
|
6
|
-
const GetDatasources = suite('getDatasources()');
|
|
7
|
-
GetDatasources.before.each(() => {
|
|
8
|
-
sinon.restore();
|
|
9
|
-
});
|
|
10
|
-
// GetDatasources('should combine REQ_REP and DATA_PIPELINE datasources', async () => {
|
|
11
|
-
// const mockConnect = {
|
|
12
|
-
// request: sinon.stub(),
|
|
13
|
-
// };
|
|
14
|
-
//
|
|
15
|
-
// // Stub the REQ_REP response
|
|
16
|
-
// mockConnect.request.withArgs('ALL_REPORT_DATASOURCES', { REQUEST: {} }).resolves({
|
|
17
|
-
// REPLY: [{ DATASOURCE_NAME: 'ReqRep1' }, { DATASOURCE_NAME: 'ReqRep2' }],
|
|
18
|
-
// });
|
|
19
|
-
//
|
|
20
|
-
// // Stub the DATA_PIPELINE response
|
|
21
|
-
// mockConnect.request.withArgs('REPORTING_DATA_PIPELINES', { REQUEST: {} }).resolves({
|
|
22
|
-
// REPLY: [{ NAME: 'Pipeline1' }, { NAME: 'Pipeline2' }],
|
|
23
|
-
// });
|
|
24
|
-
//
|
|
25
|
-
// const result = await getDatasources(mockConnect as Connect);
|
|
26
|
-
//
|
|
27
|
-
// assert.equal(result.length, 4);
|
|
28
|
-
// assert.equal(result[0], { name: 'ReqRep1', inputType: 'REQ_REP' });
|
|
29
|
-
// assert.equal(result[1], { name: 'ReqRep2', inputType: 'REQ_REP' });
|
|
30
|
-
// assert.equal(result[2], { name: 'Pipeline1', inputType: 'DATA_PIPELINE' });
|
|
31
|
-
// assert.equal(result[3], { name: 'Pipeline2', inputType: 'DATA_PIPELINE' });
|
|
32
|
-
// assert.ok(mockConnect.request.calledTwice);
|
|
33
|
-
// });
|
|
34
|
-
GetDatasources('should throw error when REQ_REP request fails', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
const mockConnect = {
|
|
36
|
-
request: sinon.stub(),
|
|
37
|
-
};
|
|
38
|
-
mockConnect.request.withArgs('ALL_REPORT_DATASOURCES', { REQUEST: {} }).resolves({
|
|
39
|
-
REPLY: null,
|
|
40
|
-
});
|
|
41
|
-
try {
|
|
42
|
-
yield getDatasources(mockConnect);
|
|
43
|
-
assert.unreachable('Should have thrown an error');
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
assert.instance(error, Error);
|
|
47
|
-
assert.is(error.message, 'REQ_REP request');
|
|
48
|
-
}
|
|
49
|
-
}));
|
|
50
|
-
// GetDatasources('should throw error when DATA_PIPELINE request fails', async () => {
|
|
51
|
-
// const mockConnect = {
|
|
52
|
-
// request: sinon.stub(),
|
|
53
|
-
// };
|
|
54
|
-
//
|
|
55
|
-
// mockConnect.request.withArgs('ALL_REPORT_DATASOURCES', { REQUEST: {} }).resolves({
|
|
56
|
-
// REPLY: [{ DATASOURCE_NAME: 'ReqRep1' }],
|
|
57
|
-
// });
|
|
58
|
-
//
|
|
59
|
-
// mockConnect.request.withArgs('REPORTING_DATA_PIPELINES', { REQUEST: {} }).resolves({
|
|
60
|
-
// REPLY: null,
|
|
61
|
-
// });
|
|
62
|
-
//
|
|
63
|
-
// try {
|
|
64
|
-
// await getDatasources(mockConnect as Connect);
|
|
65
|
-
// assert.unreachable('Should have thrown an error');
|
|
66
|
-
// } catch (error) {
|
|
67
|
-
// assert.instance(error, Error);
|
|
68
|
-
// assert.is(error.message, 'DATA_PIPELINE request');
|
|
69
|
-
// }
|
|
70
|
-
// });
|
|
71
|
-
GetDatasources('should handle empty responses', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
-
const mockConnect = {
|
|
73
|
-
request: sinon.stub(),
|
|
74
|
-
};
|
|
75
|
-
mockConnect.request.withArgs('ALL_REPORT_DATASOURCES', { REQUEST: {} }).resolves({
|
|
76
|
-
REPLY: [],
|
|
77
|
-
});
|
|
78
|
-
// mockConnect.request.withArgs('REPORTING_DATA_PIPELINES', { REQUEST: {} }).resolves({
|
|
79
|
-
// REPLY: [],
|
|
80
|
-
// });
|
|
81
|
-
//
|
|
82
|
-
const result = yield getDatasources(mockConnect);
|
|
83
|
-
assert.equal(result.length, 0);
|
|
84
|
-
// assert.ok(mockConnect.request.calledTwice);
|
|
85
|
-
assert.ok(mockConnect.request.calledOnce);
|
|
86
|
-
}));
|
|
87
|
-
GetDatasources.run();
|
|
88
|
-
const FindFirstValidDatasource = suite('findFirstValidDatasource()');
|
|
89
|
-
FindFirstValidDatasource.before.each(() => {
|
|
90
|
-
sinon.restore();
|
|
91
|
-
});
|
|
92
|
-
FindFirstValidDatasource('should return first valid datasource with schema', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
const mockSchema = { properties: { someProperty: 'value' } };
|
|
94
|
-
const getSchemaStub = sinon.stub().resolves(mockSchema);
|
|
95
|
-
const validDatasources = [
|
|
96
|
-
{ name: 'TEST_SOURCE', inputType: 'REQ_REP' },
|
|
97
|
-
];
|
|
98
|
-
const result = yield findFirstValidDatasource(getSchemaStub)(validDatasources);
|
|
99
|
-
assert.equal(result.KEY, 'TEST_SOURCE');
|
|
100
|
-
assert.equal(result.INPUT_TYPE, 'REQ_REP');
|
|
101
|
-
assert.equal(result.schema, mockSchema);
|
|
102
|
-
assert.ok(getSchemaStub.calledOnce);
|
|
103
|
-
assert.ok(getSchemaStub.calledWith('TEST_SOURCE'));
|
|
104
|
-
}));
|
|
105
|
-
FindFirstValidDatasource('should try next datasource if first fails', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
-
const mockSchema = { properties: { someProperty: 'value' } };
|
|
107
|
-
const getSchemaStub = sinon.stub();
|
|
108
|
-
getSchemaStub.onFirstCall().rejects(new Error('Failed'));
|
|
109
|
-
getSchemaStub.onSecondCall().resolves(mockSchema);
|
|
110
|
-
const validDatasources = [
|
|
111
|
-
{ name: 'FAILED_SOURCE', inputType: 'REQ_REP' },
|
|
112
|
-
{ name: 'VALID_SOURCE', inputType: 'DATA_PIPELINE' },
|
|
113
|
-
];
|
|
114
|
-
const result = yield findFirstValidDatasource(getSchemaStub)(validDatasources);
|
|
115
|
-
assert.equal(result.KEY, 'VALID_SOURCE');
|
|
116
|
-
assert.equal(result.INPUT_TYPE, 'DATA_PIPELINE');
|
|
117
|
-
assert.equal(result.schema, mockSchema);
|
|
118
|
-
assert.ok(getSchemaStub.calledTwice);
|
|
119
|
-
}));
|
|
120
|
-
FindFirstValidDatasource('should throw error if no valid datasources found', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
121
|
-
const getSchemaStub = sinon.stub().rejects(new Error('Failed'));
|
|
122
|
-
const validDatasources = [
|
|
123
|
-
{ name: 'FAILED_SOURCE', inputType: 'REQ_REP' },
|
|
124
|
-
];
|
|
125
|
-
try {
|
|
126
|
-
yield findFirstValidDatasource(getSchemaStub)(validDatasources);
|
|
127
|
-
assert.unreachable('Should have thrown an error');
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
assert.instance(error, Error);
|
|
131
|
-
assert.equal(error.message, 'No valid datasources found');
|
|
132
|
-
}
|
|
133
|
-
assert.ok(getSchemaStub.calledOnce);
|
|
134
|
-
}));
|
|
135
|
-
FindFirstValidDatasource('should skip schema without properties', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
-
const invalidSchema = { properties: null };
|
|
137
|
-
const validSchema = { properties: { someProperty: 'value' } };
|
|
138
|
-
const getSchemaStub = sinon.stub();
|
|
139
|
-
getSchemaStub.onFirstCall().resolves(invalidSchema);
|
|
140
|
-
getSchemaStub.onSecondCall().resolves(validSchema);
|
|
141
|
-
const validDatasources = [
|
|
142
|
-
{ name: 'INVALID_SCHEMA', inputType: 'REQ_REP' },
|
|
143
|
-
{ name: 'VALID_SCHEMA', inputType: 'DATA_PIPELINE' },
|
|
144
|
-
];
|
|
145
|
-
const result = yield findFirstValidDatasource(getSchemaStub)(validDatasources);
|
|
146
|
-
assert.equal(result.KEY, 'VALID_SCHEMA');
|
|
147
|
-
assert.equal(result.INPUT_TYPE, 'DATA_PIPELINE');
|
|
148
|
-
assert.equal(result.schema, validSchema);
|
|
149
|
-
assert.ok(getSchemaStub.calledTwice);
|
|
150
|
-
}));
|
|
151
|
-
FindFirstValidDatasource.run();
|
|
152
|
-
const CreateNewDatasourceConfig = suite('createNewDatasourceConfig()');
|
|
153
|
-
CreateNewDatasourceConfig.before.each(() => {
|
|
154
|
-
sinon.restore();
|
|
155
|
-
});
|
|
156
|
-
CreateNewDatasourceConfig('should exit when no valid datasources are available', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
|
-
const mockChoices = [{ name: 'testSource', inputType: 'REQ_REP' }];
|
|
158
|
-
const getAllConfigSetStub = sinon.stub(selectors.datasourceConfig, 'getAllConfigSet').returns({
|
|
159
|
-
REQ_REP_testSource_testSource: {
|
|
160
|
-
KEY: 'testSource',
|
|
161
|
-
NAME: 'testSource',
|
|
162
|
-
INPUT_TYPE: 'REQ_REP',
|
|
163
|
-
OUTPUT_TYPE: 'TABLE',
|
|
164
|
-
TRANSFORMER_CONFIGURATION: { INCLUDE_COLUMNS: [] },
|
|
165
|
-
GROUPING_STRATEGY: 'NONE',
|
|
166
|
-
GROUP_KEY: null,
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
const loggerStub = sinon.stub(logger, 'error');
|
|
170
|
-
const getSchemaStub = sinon.stub().resolves({});
|
|
171
|
-
yield createNewDatasourceConfig(getSchemaStub)(mockChoices);
|
|
172
|
-
assert.ok(getAllConfigSetStub.calledOnce);
|
|
173
|
-
assert.ok(loggerStub.calledWith('No datasources available to create new config from'));
|
|
174
|
-
assert.ok(!getSchemaStub.called);
|
|
175
|
-
}));
|
|
176
|
-
CreateNewDatasourceConfig('should exit when trying to add multiple datasources with CSV format', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
177
|
-
const mockChoices = [{ name: 'testSource', inputType: 'REQ_REP' }];
|
|
178
|
-
const getAllConfigSetStub = sinon.stub(selectors.datasourceConfig, 'getAllConfigSet').returns({
|
|
179
|
-
REQ_REP_existingSource_existingAlias: {
|
|
180
|
-
KEY: 'existingAlias',
|
|
181
|
-
NAME: 'existingSource',
|
|
182
|
-
INPUT_TYPE: 'REQ_REP',
|
|
183
|
-
OUTPUT_TYPE: 'TABLE',
|
|
184
|
-
TRANSFORMER_CONFIGURATION: { INCLUDE_COLUMNS: [] },
|
|
185
|
-
GROUPING_STRATEGY: 'NONE',
|
|
186
|
-
GROUP_KEY: null,
|
|
187
|
-
},
|
|
188
|
-
});
|
|
189
|
-
const getConfigStub = sinon.stub(selectors.baseConfig, 'getConfig').returns({
|
|
190
|
-
DESTINATION_IDS: [],
|
|
191
|
-
OUTPUT_DIRECTORY: '/reports',
|
|
192
|
-
OUTPUT_FORMAT: 'CSV',
|
|
193
|
-
});
|
|
194
|
-
const loggerStub = sinon.stub(logger, 'error');
|
|
195
|
-
const getSchemaStub = sinon.stub().resolves({});
|
|
196
|
-
yield createNewDatasourceConfig(getSchemaStub)(mockChoices);
|
|
197
|
-
assert.equal(getAllConfigSetStub.callCount, 1, 'getAllConfigSetStub should be called once');
|
|
198
|
-
assert.equal(getConfigStub.callCount, 1, 'getConfigStub should be called once');
|
|
199
|
-
// assert.ok(loggerStub.calledWith('Cannot add multiple datasources when using csv file without a template'));
|
|
200
|
-
if (loggerStub.args.length > 0) {
|
|
201
|
-
assert.equal(loggerStub.args[0][0], 'Cannot add multiple datasources when using csv file without a template');
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
assert.unreachable('Logger was not called');
|
|
205
|
-
}
|
|
206
|
-
assert.equal(getSchemaStub.callCount, 0, 'getSchemaStub should not be called');
|
|
207
|
-
}));
|
|
208
|
-
CreateNewDatasourceConfig('should allow adding multiple datasources with CSV format IF template is selected', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
209
|
-
const mockChoices = [{ name: 'testSource', inputType: 'REQ_REP' }];
|
|
210
|
-
const getAllConfigSetStub = sinon.stub(selectors.datasourceConfig, 'getAllConfigSet').returns({
|
|
211
|
-
REQ_REP_existingSource_existingAlias: {
|
|
212
|
-
KEY: 'existingAlias',
|
|
213
|
-
NAME: 'existingSource',
|
|
214
|
-
INPUT_TYPE: 'REQ_REP',
|
|
215
|
-
OUTPUT_TYPE: 'TABLE',
|
|
216
|
-
TRANSFORMER_CONFIGURATION: { INCLUDE_COLUMNS: [] },
|
|
217
|
-
GROUPING_STRATEGY: 'NONE',
|
|
218
|
-
GROUP_KEY: null,
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
sinon.stub(selectors.baseConfig, 'getConfig').returns({
|
|
222
|
-
DESTINATION_IDS: [],
|
|
223
|
-
OUTPUT_DIRECTORY: '/reports',
|
|
224
|
-
OUTPUT_FORMAT: 'CSV',
|
|
225
|
-
DOCUMENT_TEMPLATE_ID: 'some-template-id',
|
|
226
|
-
});
|
|
227
|
-
const mockSchema = {
|
|
228
|
-
properties: {
|
|
229
|
-
field1: {},
|
|
230
|
-
field2: {},
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
const getSchemaStub = sinon.stub().resolves(mockSchema);
|
|
234
|
-
const initConfigStub = sinon.stub(actions.datasourceConfig, 'initDatasourceConfiguration');
|
|
235
|
-
yield createNewDatasourceConfig(getSchemaStub)(mockChoices);
|
|
236
|
-
assert.ok(getAllConfigSetStub.calledOnce);
|
|
237
|
-
assert.ok(getSchemaStub.calledOnce);
|
|
238
|
-
assert.ok(initConfigStub.called);
|
|
239
|
-
}));
|
|
240
|
-
CreateNewDatasourceConfig('should successfully create new datasource configuration', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
241
|
-
const mockChoices = [{ name: 'testSource', inputType: 'REQ_REP' }];
|
|
242
|
-
const getAllConfigSetStub = sinon.stub(selectors.datasourceConfig, 'getAllConfigSet').returns({});
|
|
243
|
-
sinon.stub(selectors.baseConfig, 'getConfig').returns({
|
|
244
|
-
DESTINATION_IDS: [],
|
|
245
|
-
OUTPUT_DIRECTORY: '/reports',
|
|
246
|
-
OUTPUT_FORMAT: 'XLSX',
|
|
247
|
-
});
|
|
248
|
-
const mockSchema = {
|
|
249
|
-
properties: {
|
|
250
|
-
field1: {},
|
|
251
|
-
field2: {},
|
|
252
|
-
},
|
|
253
|
-
};
|
|
254
|
-
const getSchemaStub = sinon.stub().resolves(mockSchema);
|
|
255
|
-
const initConfigStub = sinon.stub(actions.datasourceConfig, 'initDatasourceConfiguration');
|
|
256
|
-
yield createNewDatasourceConfig(getSchemaStub)(mockChoices);
|
|
257
|
-
assert.ok(getAllConfigSetStub.calledOnce);
|
|
258
|
-
assert.ok(getSchemaStub.calledOnce);
|
|
259
|
-
assert.ok(initConfigStub.calledWith(sinon.match({
|
|
260
|
-
base: sinon.match({
|
|
261
|
-
KEY: 'testSource',
|
|
262
|
-
NAME: 'testSource',
|
|
263
|
-
INPUT_TYPE: 'REQ_REP',
|
|
264
|
-
}),
|
|
265
|
-
fields: sinon.match.array.deepEquals(['field1', 'field2']),
|
|
266
|
-
})));
|
|
267
|
-
}));
|
|
268
|
-
CreateNewDatasourceConfig.run();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|