@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
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { css } from '@genesislcap/web-core';
|
|
2
|
-
import { formLabel, optionMessageBubble } from '../../../styles';
|
|
3
|
-
|
|
4
|
-
export const styles = css`
|
|
5
|
-
${optionMessageBubble()}
|
|
6
|
-
${formLabel}
|
|
7
|
-
|
|
8
|
-
div.container {
|
|
9
|
-
gap: calc(var(--design-unit) * 2px);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
div.split {
|
|
13
|
-
display: grid;
|
|
14
|
-
grid-template-columns: 1fr 1fr;
|
|
15
|
-
gap: calc(var(--design-unit) * 2px);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
rapid-combobox.datasource {
|
|
19
|
-
margin-bottom: calc(var(--design-unit) * 2px);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
rapid-combobox.datasource.error {
|
|
23
|
-
border-color: var(--error-color);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
div.configs {
|
|
27
|
-
display: grid;
|
|
28
|
-
grid-template-columns: 5fr 2fr;
|
|
29
|
-
gap: calc(var(--design-unit) * 3px);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
rapid-text-field::part(root) {
|
|
33
|
-
height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1.35px);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
rapid-select,
|
|
37
|
-
rapid-combobox,
|
|
38
|
-
rapid-text-field {
|
|
39
|
-
width: 100%;
|
|
40
|
-
min-width: unset;
|
|
41
|
-
height: 41px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
div.configs rapid-select,
|
|
45
|
-
div.configs rapid-combobox {
|
|
46
|
-
min-width: 20%;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
rapid-select::part(listbox),
|
|
50
|
-
rapid-combobox::part(listbox) {
|
|
51
|
-
max-height: 20vh;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
div.header {
|
|
55
|
-
display: grid;
|
|
56
|
-
grid-template-columns: 4fr 1fr;
|
|
57
|
-
margin-bottom: calc(var(--design-unit) * 1.2px);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
div.close-button {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: row-reverse;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
rapid-button.close {
|
|
66
|
-
margin: 5px;
|
|
67
|
-
background-color: var(--error-color);
|
|
68
|
-
min-width: calc(var(--base-height-multiplier) * (var(--design-unit) - 1) * 1px);
|
|
69
|
-
width: calc(var(--base-height-multiplier) * (var(--design-unit) - 1) * 1px);
|
|
70
|
-
height: calc(var(--base-height-multiplier) * (var(--design-unit) - 1) * 1px);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
rapid-button.close::part(control) {
|
|
74
|
-
padding: 0;
|
|
75
|
-
}
|
|
76
|
-
`;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { Combobox } from '@genesislcap/foundation-ui';
|
|
2
|
-
import { classNames, html, repeat, when, whenElse } from '@genesislcap/web-core';
|
|
3
|
-
import {
|
|
4
|
-
datasourceGroupingStrategies,
|
|
5
|
-
DatasourceGroupingStrategy,
|
|
6
|
-
datasourceOutputs,
|
|
7
|
-
DatasourceOutputTypes,
|
|
8
|
-
selectors,
|
|
9
|
-
} from '../../../store';
|
|
10
|
-
import { datasourceInputForDisplay, TOOLTIP, tooltip } from '../../../utils';
|
|
11
|
-
import type { DatasourceConfigItem } from './datasource-config-item';
|
|
12
|
-
import { DatasourceChoice } from './types';
|
|
13
|
-
|
|
14
|
-
const datasourceAlias = html<DatasourceConfigItem>`
|
|
15
|
-
<div>
|
|
16
|
-
<p class="label">Name${tooltip(TOOLTIP.DATASOURCES_NAME)}</p>
|
|
17
|
-
<rapid-text-field
|
|
18
|
-
value=${(x) => selectors.datasourceConfig.getDatasource(x.datasourceName!).KEY}
|
|
19
|
-
@change=${(x, ctx) =>
|
|
20
|
-
x.updateKeyHandler((<HTMLInputElement>ctx.event.target).value, ctx.event)}
|
|
21
|
-
></rapid-text-field>
|
|
22
|
-
</div>
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
const groupingType = html<DatasourceConfigItem>`
|
|
26
|
-
<div class="split">
|
|
27
|
-
<div>
|
|
28
|
-
<p class="label">Grouping Strategy${tooltip(TOOLTIP.DATASOURCES_GROUPING_STRATEGY)}</p>
|
|
29
|
-
<rapid-select
|
|
30
|
-
:value=${(x) =>
|
|
31
|
-
selectors.datasourceConfig.getDatasource(x.datasourceName!).GROUPING_STRATEGY}
|
|
32
|
-
@change=${(x, ctx) =>
|
|
33
|
-
x.updateGroupingStrategyHandler(
|
|
34
|
-
(<HTMLSelectElement>ctx.event.target).value as DatasourceGroupingStrategy,
|
|
35
|
-
)}
|
|
36
|
-
>
|
|
37
|
-
${repeat(
|
|
38
|
-
() => datasourceGroupingStrategies,
|
|
39
|
-
html<string>`
|
|
40
|
-
<rapid-option>${(x) => x}</rapid-option>
|
|
41
|
-
`,
|
|
42
|
-
)}
|
|
43
|
-
</rapid-select>
|
|
44
|
-
</div>
|
|
45
|
-
<div>
|
|
46
|
-
<p class="label">Grouping Key${tooltip(TOOLTIP.DATASOURCES_GROUPING_KEY)}</p>
|
|
47
|
-
<rapid-select
|
|
48
|
-
:value=${(x) => selectors.datasourceConfig.getDatasource(x.datasourceName!).GROUP_KEY}
|
|
49
|
-
@change=${(x, ctx) =>
|
|
50
|
-
x.updateGroupingByHandler((<HTMLSelectElement>ctx.event.target).value)}
|
|
51
|
-
?disabled=${(x) =>
|
|
52
|
-
selectors.datasourceConfig.getDatasource(x.datasourceName!).GROUPING_STRATEGY === 'NONE'}
|
|
53
|
-
>
|
|
54
|
-
${repeat(
|
|
55
|
-
(x) => x.groupingByFieldsNames ?? [],
|
|
56
|
-
html<string>`
|
|
57
|
-
<rapid-option>${(x) => x}</rapid-option>
|
|
58
|
-
`,
|
|
59
|
-
)}
|
|
60
|
-
</rapid-select>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
const processType = html<DatasourceConfigItem>`
|
|
66
|
-
<div>
|
|
67
|
-
<p class="label">Type${tooltip(TOOLTIP.DATASOURCES_TYPE)}</p>
|
|
68
|
-
<rapid-select
|
|
69
|
-
:value=${(x) => selectors.datasourceConfig.getDatasource(x.datasourceName!).OUTPUT_TYPE}
|
|
70
|
-
@change=${(x, ctx) =>
|
|
71
|
-
x.updateOutputTypeHandler(
|
|
72
|
-
(<HTMLSelectElement>ctx.event.target).value as DatasourceOutputTypes,
|
|
73
|
-
)}
|
|
74
|
-
>
|
|
75
|
-
${repeat(
|
|
76
|
-
() => datasourceOutputs,
|
|
77
|
-
html<string>`
|
|
78
|
-
<rapid-option>${(x) => x}</rapid-option>
|
|
79
|
-
`,
|
|
80
|
-
)}
|
|
81
|
-
</rapid-select>
|
|
82
|
-
</div>
|
|
83
|
-
`;
|
|
84
|
-
|
|
85
|
-
const closeButton = html<DatasourceConfigItem>`
|
|
86
|
-
<div class="close-button">
|
|
87
|
-
<rapid-button class="close" @click=${(x) => x.deleteDatasourceHandler()}>
|
|
88
|
-
<rapid-icon name="minus" size="md"></rapid-icon>
|
|
89
|
-
</rapid-button>
|
|
90
|
-
</div>
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
const component = html<DatasourceConfigItem>`
|
|
94
|
-
${when((x) => x.canRemove, closeButton)}
|
|
95
|
-
<div class="container">
|
|
96
|
-
<div class="${() => classNames(['split', Boolean(selectors.baseConfig.getConfig().DOCUMENT_TEMPLATE_ID)])}">
|
|
97
|
-
<div>
|
|
98
|
-
<p class="label">Datasource${tooltip(TOOLTIP.DATASOURCES_DATASOURCE)}</p>
|
|
99
|
-
<rapid-combobox
|
|
100
|
-
class="datasource ${(x) => classNames(['error', x.error !== 'none'])}"
|
|
101
|
-
autocomplete="both"
|
|
102
|
-
:value=${(x) => selectors.datasourceConfig.getDatasource(x.datasourceName!).NAME}
|
|
103
|
-
@change=${(x, ctx) => x.updateDatasourceSourceHandler(<Combobox>ctx.event.target)}
|
|
104
|
-
position="${(x) => x.position}"
|
|
105
|
-
>
|
|
106
|
-
${repeat(
|
|
107
|
-
(x) => x.datasourceChoices!,
|
|
108
|
-
html<DatasourceChoice>`
|
|
109
|
-
<rapid-option
|
|
110
|
-
class="message-bubble"
|
|
111
|
-
data-color="${(x) => (x.inputType === 'REQ_REP' ? 'red' : 'blue')}"
|
|
112
|
-
data-bubble-content="${(x) => datasourceInputForDisplay(x.inputType)}"
|
|
113
|
-
>
|
|
114
|
-
${(x) => x.name}
|
|
115
|
-
</rapid-option>
|
|
116
|
-
`,
|
|
117
|
-
)}
|
|
118
|
-
</rapid-combobox>
|
|
119
|
-
</div>
|
|
120
|
-
${when(
|
|
121
|
-
(_) =>
|
|
122
|
-
Boolean(selectors.baseConfig.getConfig().DOCUMENT_TEMPLATE_ID) ||
|
|
123
|
-
selectors.baseConfig.getConfig().OUTPUT_FORMAT !== 'CSV',
|
|
124
|
-
datasourceAlias,
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
${when((_) => Boolean(selectors.baseConfig.getConfig().DOCUMENT_TEMPLATE_ID), groupingType)}
|
|
129
|
-
<!-- ${when((_) => selectors.baseConfig.getConfig().OUTPUT_FORMAT === 'CSV', processType)} -->
|
|
130
|
-
</div>
|
|
131
|
-
`;
|
|
132
|
-
|
|
133
|
-
export const template = html<DatasourceConfigItem>`
|
|
134
|
-
${whenElse(
|
|
135
|
-
(x) => x.datasourceName && x.datasourceChoices,
|
|
136
|
-
component,
|
|
137
|
-
html`
|
|
138
|
-
Missing attributes
|
|
139
|
-
`,
|
|
140
|
-
)}
|
|
141
|
-
`;
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
-
import { Combobox } from '@genesislcap/foundation-ui';
|
|
3
|
-
import { attr, customElement, GenesisElement, observable } from '@genesislcap/web-core';
|
|
4
|
-
import {
|
|
5
|
-
actions,
|
|
6
|
-
DatasourceGroupingStrategy,
|
|
7
|
-
DatasourceInputTypes,
|
|
8
|
-
DatasourceName,
|
|
9
|
-
DatasourceOutputTypes,
|
|
10
|
-
selectors,
|
|
11
|
-
} from '../../../store';
|
|
12
|
-
import { Display } from '../../../types';
|
|
13
|
-
import {
|
|
14
|
-
buildDatasourceName,
|
|
15
|
-
datasourceInputFromDisplay,
|
|
16
|
-
generateUniqueAlias,
|
|
17
|
-
getDatasourceSchema,
|
|
18
|
-
showNotificationToast,
|
|
19
|
-
} from '../../../utils';
|
|
20
|
-
import { setDefaultFormatsForDatasource } from '../data-transforms-derived-fields/data-transforms.helpers';
|
|
21
|
-
import { styles } from './datasource-config-item.styles';
|
|
22
|
-
import { template } from './datasource-config-item.template';
|
|
23
|
-
import { DatasourceChoice } from './types';
|
|
24
|
-
|
|
25
|
-
@customElement({
|
|
26
|
-
name: 'datasource-config-item',
|
|
27
|
-
template,
|
|
28
|
-
styles,
|
|
29
|
-
})
|
|
30
|
-
export class DatasourceConfigItem extends GenesisElement {
|
|
31
|
-
@Connect connect!: Connect;
|
|
32
|
-
private getSchema = getDatasourceSchema(this.connect);
|
|
33
|
-
|
|
34
|
-
@observable datasourceName: DatasourceName | null = null;
|
|
35
|
-
@observable datasourceChoices: DatasourceChoice[] | null = null;
|
|
36
|
-
@observable groupingByFieldsNames: string[] | null = null;
|
|
37
|
-
@attr({ mode: 'boolean', attribute: 'can-remove' }) canRemove: boolean = false;
|
|
38
|
-
|
|
39
|
-
@attr position: 'below' | 'above' = 'below';
|
|
40
|
-
@attr error: 'none' | 'invalid-datasource' | 'unknown' = 'none';
|
|
41
|
-
|
|
42
|
-
async connectedCallback(): Promise<void> {
|
|
43
|
-
super.connectedCallback();
|
|
44
|
-
try {
|
|
45
|
-
const datasource = selectors.datasourceConfig.getDatasource(this.datasourceName);
|
|
46
|
-
const schema = await this.getSchema(datasource.NAME);
|
|
47
|
-
this.groupingByFieldsNames = Object.keys(schema.properties);
|
|
48
|
-
} catch (e) {
|
|
49
|
-
console.error(e);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
deleteDatasourceHandler() {
|
|
54
|
-
if (!this.canRemove) throw new Error('Trying to remove final datasource!');
|
|
55
|
-
if (!this.datasourceName) throw new Error('deleteDatasourceHandler - Datasource key unset!');
|
|
56
|
-
actions.datasourceConfig.deleteDatasource({
|
|
57
|
-
key: this.datasourceName,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
updateKeyHandler(newName: string, event?: Event) {
|
|
62
|
-
if (!this.datasourceName) {
|
|
63
|
-
throw new Error('updateKeyHandler - datasourceName unset');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const allDatasources = selectors.datasourceConfig.getAllConfigSet();
|
|
67
|
-
const nameExists = Object.entries(allDatasources)
|
|
68
|
-
.filter(([key]) => key !== this.datasourceName)
|
|
69
|
-
.some(([, ds]) => ds.KEY.toLowerCase() === newName.toLowerCase());
|
|
70
|
-
|
|
71
|
-
if (nameExists) {
|
|
72
|
-
showNotificationToast({
|
|
73
|
-
title: 'Reporting Config',
|
|
74
|
-
body: `Name '${newName}' is already in use by another datasource.`,
|
|
75
|
-
toast: { type: 'error' as any },
|
|
76
|
-
});
|
|
77
|
-
if (event) {
|
|
78
|
-
(event.target as HTMLInputElement).value = allDatasources[this.datasourceName].KEY;
|
|
79
|
-
}
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
actions.datasourceConfig.renameDatasource({
|
|
84
|
-
key: this.datasourceName,
|
|
85
|
-
newName,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
updateOutputTypeHandler(newType: DatasourceOutputTypes) {
|
|
90
|
-
if (!this.datasourceName) {
|
|
91
|
-
throw new Error('updateKeyHandler - datasourceName unset');
|
|
92
|
-
}
|
|
93
|
-
actions.datasourceConfig.updateDatasourceOutputType({
|
|
94
|
-
key: this.datasourceName,
|
|
95
|
-
newType,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async updateGroupingStrategyHandler(value: DatasourceGroupingStrategy) {
|
|
100
|
-
try {
|
|
101
|
-
if (value === 'NONE') {
|
|
102
|
-
actions.datasourceConfig.deleteGrouping({ key: this.datasourceName });
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const dsResource = selectors.datasourceConfig.getDatasource(this.datasourceName).NAME;
|
|
107
|
-
const schema = await this.getSchema(dsResource);
|
|
108
|
-
if (!schema.properties) throw new Error(`schema properties for ${dsResource} undefined`);
|
|
109
|
-
|
|
110
|
-
const fields = Object.keys(schema.properties);
|
|
111
|
-
actions.datasourceConfig.setGrouping({
|
|
112
|
-
key: this.datasourceName,
|
|
113
|
-
grouping: { GROUPING_STRATEGY: value, GROUP_KEY: fields[0] },
|
|
114
|
-
});
|
|
115
|
-
this.groupingByFieldsNames = Object.keys(schema.properties);
|
|
116
|
-
} catch (e) {
|
|
117
|
-
const errorMsg = e instanceof Error ? `\n\n${e.message}` : '';
|
|
118
|
-
showNotificationToast({
|
|
119
|
-
title: 'Reporting Config',
|
|
120
|
-
body: `Error fetching field data for datasource ${this.datasourceName}.${errorMsg}`,
|
|
121
|
-
toast: { type: 'critical' as any },
|
|
122
|
-
});
|
|
123
|
-
this.error = 'unknown';
|
|
124
|
-
console.error(e);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
updateGroupingByHandler(value: string) {
|
|
129
|
-
const datasource = selectors.datasourceConfig.getDatasource(this.datasourceName);
|
|
130
|
-
if (datasource.GROUPING_STRATEGY === 'NONE')
|
|
131
|
-
throw new Error('Cannot set group by field when GROUPING_STRATEGY is NONE');
|
|
132
|
-
actions.datasourceConfig.setGrouping({
|
|
133
|
-
key: this.datasourceName,
|
|
134
|
-
grouping: { GROUPING_STRATEGY: datasource.GROUPING_STRATEGY, GROUP_KEY: value },
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
async updateDatasourceSourceHandler(selectedOption: Combobox) {
|
|
139
|
-
try {
|
|
140
|
-
if ((selectedOption?.selectedOptions ?? []).filter((x) => x).length === 0) {
|
|
141
|
-
// This occurs when the user types arbitrary input into the combo box which doesn't
|
|
142
|
-
// match any of the options
|
|
143
|
-
this.error = 'invalid-datasource';
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const option = selectedOption.selectedOptions[0];
|
|
147
|
-
const RESOURCE_NAME = option.value;
|
|
148
|
-
const dataAttr = <Display.DatasourceInputTypes | null>(
|
|
149
|
-
option.getAttribute('data-bubble-content')
|
|
150
|
-
);
|
|
151
|
-
if (!dataAttr) throw new Error(`Unable to read datasource from attribute ${dataAttr}`);
|
|
152
|
-
const INPUT_TYPE = datasourceInputFromDisplay(dataAttr);
|
|
153
|
-
|
|
154
|
-
if (!this.datasourceName || !INPUT_TYPE) {
|
|
155
|
-
throw new Error('updateKeyHandler - datasourceName or INPUT_TYPE null');
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const schema = await this.getSchema(RESOURCE_NAME);
|
|
159
|
-
if (!schema.properties) throw new Error(`schema properties for ${RESOURCE_NAME} undefined`);
|
|
160
|
-
|
|
161
|
-
const fields = Object.keys(schema.properties);
|
|
162
|
-
|
|
163
|
-
// Check for duplicate aliases
|
|
164
|
-
const allDatasources = selectors.datasourceConfig.getAllConfigSet();
|
|
165
|
-
const existingAliases = new Set(
|
|
166
|
-
Object.entries(allDatasources)
|
|
167
|
-
.filter(([key]) => key !== this.datasourceName)
|
|
168
|
-
.map(([, ds]) => ds.KEY),
|
|
169
|
-
);
|
|
170
|
-
|
|
171
|
-
const uniqueAlias = generateUniqueAlias(RESOURCE_NAME, existingAliases);
|
|
172
|
-
|
|
173
|
-
// Preserve index
|
|
174
|
-
const originalIndex = Object.keys(allDatasources).indexOf(this.datasourceName);
|
|
175
|
-
|
|
176
|
-
actions.datasourceConfig.deleteDatasource({ key: this.datasourceName });
|
|
177
|
-
actions.datasourceConfig.initDatasourceConfiguration({
|
|
178
|
-
base: {
|
|
179
|
-
KEY: uniqueAlias,
|
|
180
|
-
NAME: RESOURCE_NAME,
|
|
181
|
-
INPUT_TYPE: INPUT_TYPE as DatasourceInputTypes,
|
|
182
|
-
},
|
|
183
|
-
fields,
|
|
184
|
-
});
|
|
185
|
-
const datasourceName = buildDatasourceName(
|
|
186
|
-
uniqueAlias,
|
|
187
|
-
RESOURCE_NAME,
|
|
188
|
-
INPUT_TYPE as DatasourceInputTypes,
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
if (originalIndex !== -1) {
|
|
192
|
-
actions.datasourceConfig.reorderDatasource({
|
|
193
|
-
key: datasourceName,
|
|
194
|
-
newIndex: originalIndex,
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
setDefaultFormatsForDatasource(datasourceName, schema);
|
|
199
|
-
this.error = 'none';
|
|
200
|
-
this.groupingByFieldsNames = Object.keys(schema.properties);
|
|
201
|
-
} catch (e: unknown) {
|
|
202
|
-
const errorMsg = e instanceof Error ? `\n\n${e.message}` : '';
|
|
203
|
-
showNotificationToast({
|
|
204
|
-
title: 'Reporting Config',
|
|
205
|
-
body: `Error fetching field data for datasource ${selectedOption.selectedOptions[0].value}.${errorMsg}`,
|
|
206
|
-
toast: { type: 'critical' as any },
|
|
207
|
-
});
|
|
208
|
-
this.error = 'unknown';
|
|
209
|
-
console.error(e);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|