@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,71 +0,0 @@
|
|
|
1
|
-
import { html, repeat } from '@genesislcap/web-core';
|
|
2
|
-
import { fileTemplatePicker } from '../../../components/shared/file-template-picker.template';
|
|
3
|
-
import { actions, reportOutputFormats, ReportOutputTypes, selectors } from '../../../store';
|
|
4
|
-
import { requiredTooltip, TOOLTIP, tooltip } from '../../../utils';
|
|
5
|
-
import type { BaseConfig } from './base-config';
|
|
6
|
-
|
|
7
|
-
export const template = html<BaseConfig>`
|
|
8
|
-
<h1>Reporting Setup</h1>
|
|
9
|
-
<p>
|
|
10
|
-
Configure the basics of the report, such as the file name, the type of file and also the
|
|
11
|
-
directory under which generated reports will be stored.
|
|
12
|
-
</p>
|
|
13
|
-
<label class="label">Report name${requiredTooltip}${tooltip(TOOLTIP.SETUP_NAME)}</label>
|
|
14
|
-
<rapid-text-field
|
|
15
|
-
data-test-id="config-report-name"
|
|
16
|
-
placeholder="(REQUIRED) Enter report name..."
|
|
17
|
-
value="${() => selectors.baseConfig.getConfig().NAME}"
|
|
18
|
-
@change="${(_, ctx) =>
|
|
19
|
-
actions.baseConfig.updateState({
|
|
20
|
-
key: 'NAME',
|
|
21
|
-
value: (ctx.event.target as HTMLInputElement).value,
|
|
22
|
-
})}"
|
|
23
|
-
></rapid-text-field>
|
|
24
|
-
<label class="label">File type${tooltip(TOOLTIP.SETUP_FILE_TYPE)}</label>
|
|
25
|
-
<rapid-select
|
|
26
|
-
data-test-id="config-report-file-type"
|
|
27
|
-
value=${() => selectors.baseConfig.getConfig().OUTPUT_FORMAT}
|
|
28
|
-
@change=${(x, ctx) => x.handleOutputFormatChange(ctx.event)}
|
|
29
|
-
>
|
|
30
|
-
${repeat(
|
|
31
|
-
() => reportOutputFormats,
|
|
32
|
-
html<ReportOutputTypes>`
|
|
33
|
-
<rapid-option value="${(x) => x}">${(x) => '.' + x.toLowerCase()}</rapid-option>
|
|
34
|
-
`,
|
|
35
|
-
)}
|
|
36
|
-
</rapid-select>
|
|
37
|
-
<label class="label">File name${requiredTooltip}${tooltip(TOOLTIP.SETUP_FILENAME)}</label>
|
|
38
|
-
<rapid-text-field
|
|
39
|
-
data-test-id="config-report-filename"
|
|
40
|
-
placeholder="(REQUIRED) Enter file name..."
|
|
41
|
-
value="${() => selectors.baseConfig.getConfig().FILE_NAME}"
|
|
42
|
-
@change="${(_, ctx) =>
|
|
43
|
-
actions.baseConfig.updateState({
|
|
44
|
-
key: 'FILE_NAME',
|
|
45
|
-
value: (ctx.event.target as HTMLInputElement).value,
|
|
46
|
-
})}"
|
|
47
|
-
></rapid-text-field>
|
|
48
|
-
${fileTemplatePicker}
|
|
49
|
-
<label class="label">Output directory${requiredTooltip}${tooltip(TOOLTIP.SETUP_DIRECTORY)}</label>
|
|
50
|
-
<rapid-text-field
|
|
51
|
-
data-test-id="config-report-output-directory"
|
|
52
|
-
placeholder="(REQUIRED) /reports"
|
|
53
|
-
value="${() => selectors.baseConfig.getConfig().OUTPUT_DIRECTORY}"
|
|
54
|
-
@change="${(_, ctx) =>
|
|
55
|
-
actions.baseConfig.updateState({
|
|
56
|
-
key: 'OUTPUT_DIRECTORY',
|
|
57
|
-
value: (ctx.event.target as HTMLInputElement).value,
|
|
58
|
-
})}"
|
|
59
|
-
></rapid-text-field>
|
|
60
|
-
<label class="label">Report description${tooltip(TOOLTIP.SETUP_DESCRIPTION)}</label>
|
|
61
|
-
<rapid-text-area
|
|
62
|
-
data-test-id="config-report-description"
|
|
63
|
-
value="${() => selectors.baseConfig.getConfig().DESCRIPTION}"
|
|
64
|
-
placeholder="Enter report description..."
|
|
65
|
-
@change="${(_, ctx) =>
|
|
66
|
-
actions.baseConfig.updateState({
|
|
67
|
-
key: 'DESCRIPTION',
|
|
68
|
-
value: (ctx.event.target as HTMLInputElement).value,
|
|
69
|
-
})}"
|
|
70
|
-
></rapid-text-area>
|
|
71
|
-
`;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { Connect, logger } from '@genesislcap/foundation-comms';
|
|
2
|
-
import { showNotificationToast } from '@genesislcap/foundation-notifications';
|
|
3
|
-
import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
|
|
4
|
-
import {
|
|
5
|
-
allowedTemplateFiletypes,
|
|
6
|
-
NULL_TEMPLATE,
|
|
7
|
-
} from '../../../components/shared/file-template-picker.template';
|
|
8
|
-
import { actions, DatasourceName, ReportOutputTypes, selectors } from '../../../store';
|
|
9
|
-
import { Genesis } from '../../../types';
|
|
10
|
-
import { getDatasourceSchema } from '../../../utils';
|
|
11
|
-
import { setDefaultFormatsForDatasource } from '../data-transforms-derived-fields/data-transforms.helpers';
|
|
12
|
-
import { styles } from './base-config.styles';
|
|
13
|
-
import { template } from './base-config.template';
|
|
14
|
-
|
|
15
|
-
@customElement({
|
|
16
|
-
name: 'base-config',
|
|
17
|
-
template,
|
|
18
|
-
styles,
|
|
19
|
-
})
|
|
20
|
-
export class BaseConfig extends GenesisElement {
|
|
21
|
-
@Connect connect!: Connect;
|
|
22
|
-
|
|
23
|
-
/** All templates available in the document server */
|
|
24
|
-
@observable fileTemplates: Array<Genesis.FileStorageDataRow>;
|
|
25
|
-
/** All available templates accounting for currently selected output type */
|
|
26
|
-
@observable allowedTemplates: Array<Genesis.FileStorageDataRow>;
|
|
27
|
-
@observable selectedTemplateId: string = '';
|
|
28
|
-
|
|
29
|
-
async connectedCallback() {
|
|
30
|
-
super.connectedCallback();
|
|
31
|
-
await this.getFileTemplates();
|
|
32
|
-
this.allowedTemplates = this.getAllowedTemplates();
|
|
33
|
-
this.selectedTemplateId = selectors.baseConfig.getConfig().DOCUMENT_TEMPLATE_ID ?? '';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
getAllowedTemplates(): Array<Genesis.FileStorageDataRow> {
|
|
37
|
-
const allowedFiletypes =
|
|
38
|
-
allowedTemplateFiletypes[selectors.baseConfig.getConfig().OUTPUT_FORMAT ?? 'CSV'];
|
|
39
|
-
return (this.fileTemplates ?? [])
|
|
40
|
-
.map((file) => {
|
|
41
|
-
const splitName = file[Genesis.FileStorageFields.FILE_NAME].split('.');
|
|
42
|
-
const fileExtension = splitName[splitName.length - 1];
|
|
43
|
-
return { file, fileExtension };
|
|
44
|
-
})
|
|
45
|
-
.filter(({ fileExtension }) => allowedFiletypes.includes(fileExtension))
|
|
46
|
-
.map(({ file }) => file);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async handleOutputFormatChange(event: Event) {
|
|
50
|
-
const format = (event.target as HTMLSelectElement).value as ReportOutputTypes;
|
|
51
|
-
actions.baseConfig.deleteTemplate();
|
|
52
|
-
actions.baseConfig.setOutputFormat({ format });
|
|
53
|
-
this.allowedTemplates = this.getAllowedTemplates();
|
|
54
|
-
|
|
55
|
-
const allDatasources = selectors.datasourceConfig.getAllConfigSet();
|
|
56
|
-
|
|
57
|
-
if (format === 'XLSX') {
|
|
58
|
-
Object.entries(allDatasources).forEach(([dsName, dsConfig]) => {
|
|
59
|
-
const columnFormats = dsConfig.TRANSFORMER_CONFIGURATION.COLUMN_FORMATS || {};
|
|
60
|
-
Object.entries(columnFormats).forEach(([colName]) => {
|
|
61
|
-
actions.datasourceConfig.deleteColumnFormat({
|
|
62
|
-
key: dsName as DatasourceName,
|
|
63
|
-
column: colName,
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
// Re-apply default formats when switching back to CSV or PDF
|
|
69
|
-
const getSchema = getDatasourceSchema(this.connect);
|
|
70
|
-
|
|
71
|
-
await Promise.all(
|
|
72
|
-
Object.entries(allDatasources).map(async ([dsName, dsConfig]) => {
|
|
73
|
-
try {
|
|
74
|
-
const schema = await getSchema(dsConfig.KEY);
|
|
75
|
-
setDefaultFormatsForDatasource(dsName as DatasourceName, schema);
|
|
76
|
-
} catch (e) {
|
|
77
|
-
logger.error(`Failed to fetch schema for ${dsName} to restore formats`, e);
|
|
78
|
-
}
|
|
79
|
-
}),
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async handleTemplateSelectChange(selectInput: HTMLSelectElement) {
|
|
85
|
-
const value = selectInput.value as ReportOutputTypes | typeof NULL_TEMPLATE;
|
|
86
|
-
if (value === NULL_TEMPLATE) {
|
|
87
|
-
this.selectedTemplateId = '';
|
|
88
|
-
actions.baseConfig.deleteTemplate();
|
|
89
|
-
} else {
|
|
90
|
-
this.selectedTemplateId = value;
|
|
91
|
-
actions.baseConfig.updateState({
|
|
92
|
-
key: 'DOCUMENT_TEMPLATE_ID',
|
|
93
|
-
value: value,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
async getFileTemplates(): Promise<void> {
|
|
99
|
-
try {
|
|
100
|
-
const response = await this.connect.request('FILE_STORAGE_TEMPLATES');
|
|
101
|
-
if (!response.REPLY || !Array.isArray(response.REPLY))
|
|
102
|
-
throw new Error('Invalid data returned for FILE_STORAGE_TEMPLATES');
|
|
103
|
-
this.fileTemplates = response.REPLY;
|
|
104
|
-
} catch (e: unknown) {
|
|
105
|
-
showNotificationToast(
|
|
106
|
-
{
|
|
107
|
-
title: 'Edit Report Config',
|
|
108
|
-
body: `Unable to fetch template data.`,
|
|
109
|
-
toast: { type: 'critical' as any },
|
|
110
|
-
},
|
|
111
|
-
'rapid',
|
|
112
|
-
);
|
|
113
|
-
logger.error(e);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { RowSelectedEvent } from '@ag-grid-community/core';
|
|
2
|
-
import { assert, sinon, suite } from '@genesislcap/foundation-testing';
|
|
3
|
-
import { actions, selectors, TransformerConfig } from '../../../store';
|
|
4
|
-
import { GridColumnNames } from '../shared';
|
|
5
|
-
import { rowSelectionChangedHandler } from './col-filters-grid.helpers';
|
|
6
|
-
import { ColFilterData } from './col-filters-grid.types';
|
|
7
|
-
|
|
8
|
-
// When running all tests, the shared helper tests will be executed separately
|
|
9
|
-
// Here we only test the col-filters-specific helpers
|
|
10
|
-
|
|
11
|
-
const RowSelectionChangedHandler = suite('rowSelectionChangedHandler');
|
|
12
|
-
|
|
13
|
-
RowSelectionChangedHandler.before.each(() => {
|
|
14
|
-
sinon.restore();
|
|
15
|
-
sinon.stub(selectors.baseConfig, 'getConfig').returns({ OUTPUT_FORMAT: 'CSV' } as any);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
RowSelectionChangedHandler('should return early if event.data is undefined', () => {
|
|
19
|
-
const event = { data: undefined } as RowSelectedEvent<ColFilterData>;
|
|
20
|
-
const stub = sinon.stub(actions.datasourceConfig, 'setColumnIncluded');
|
|
21
|
-
rowSelectionChangedHandler(event);
|
|
22
|
-
assert.equal(stub.called, false);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
RowSelectionChangedHandler('should return early if filtered state matches selection state', () => {
|
|
26
|
-
const mockData = {
|
|
27
|
-
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
28
|
-
[GridColumnNames.ColumnName]: 'testColumn',
|
|
29
|
-
[GridColumnNames.Type]: 'STRING',
|
|
30
|
-
} as ColFilterData;
|
|
31
|
-
|
|
32
|
-
const mockEvent = {
|
|
33
|
-
data: mockData,
|
|
34
|
-
node: {
|
|
35
|
-
isSelected: sinon.stub().returns(false),
|
|
36
|
-
},
|
|
37
|
-
api: {
|
|
38
|
-
redrawRows: sinon.stub(),
|
|
39
|
-
},
|
|
40
|
-
} as unknown as RowSelectedEvent<ColFilterData>;
|
|
41
|
-
|
|
42
|
-
const lookupStub = sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
43
|
-
KEY: 'test',
|
|
44
|
-
NAME: 'Test Datasource',
|
|
45
|
-
INPUT_TYPE: 'REQ_REP' as const,
|
|
46
|
-
OUTPUT_TYPE: 'TABLE' as const,
|
|
47
|
-
TRANSFORMER_CONFIGURATION: <TransformerConfig>{
|
|
48
|
-
COLUMN_FILTERS: ['testColumn'],
|
|
49
|
-
},
|
|
50
|
-
GROUPING_STRATEGY: 'NONE',
|
|
51
|
-
GROUP_KEY: null,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
rowSelectionChangedHandler(mockEvent);
|
|
55
|
-
|
|
56
|
-
assert.equal(lookupStub.called, true);
|
|
57
|
-
assert.equal(sinon.stub(actions.datasourceConfig, 'setColumnIncluded').called, false);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
RowSelectionChangedHandler('should return early if type is invalid', () => {
|
|
61
|
-
const mockData = {
|
|
62
|
-
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
63
|
-
[GridColumnNames.ColumnName]: 'testColumn',
|
|
64
|
-
[GridColumnNames.Type]: 'RAW',
|
|
65
|
-
} as ColFilterData;
|
|
66
|
-
|
|
67
|
-
const mockEvent = {
|
|
68
|
-
data: mockData,
|
|
69
|
-
node: {
|
|
70
|
-
isSelected: sinon.stub().returns(false),
|
|
71
|
-
},
|
|
72
|
-
api: {
|
|
73
|
-
redrawRows: sinon.stub(),
|
|
74
|
-
},
|
|
75
|
-
} as unknown as RowSelectedEvent<ColFilterData>;
|
|
76
|
-
|
|
77
|
-
const lookupStub = sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
78
|
-
KEY: 'test',
|
|
79
|
-
NAME: 'Test Datasource',
|
|
80
|
-
INPUT_TYPE: 'REQ_REP' as const,
|
|
81
|
-
OUTPUT_TYPE: 'TABLE' as const,
|
|
82
|
-
TRANSFORMER_CONFIGURATION: <TransformerConfig>{
|
|
83
|
-
COLUMN_FILTERS: [],
|
|
84
|
-
},
|
|
85
|
-
GROUPING_STRATEGY: 'NONE',
|
|
86
|
-
GROUP_KEY: null,
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
rowSelectionChangedHandler(mockEvent);
|
|
90
|
-
|
|
91
|
-
assert.equal(lookupStub.called, true);
|
|
92
|
-
assert.equal(sinon.stub(actions.datasourceConfig, 'setColumnIncluded').called, false);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
RowSelectionChangedHandler('should update include and redraw when selection changes', () => {
|
|
96
|
-
const mockData = {
|
|
97
|
-
[GridColumnNames.Datasource]: 'testAlias (Snapshot)',
|
|
98
|
-
[GridColumnNames.ColumnName]: 'testColumn',
|
|
99
|
-
[GridColumnNames.Type]: 'INT',
|
|
100
|
-
} as ColFilterData;
|
|
101
|
-
|
|
102
|
-
const mockEvent = {
|
|
103
|
-
data: mockData,
|
|
104
|
-
node: {
|
|
105
|
-
isSelected: sinon.stub().returns(false),
|
|
106
|
-
},
|
|
107
|
-
api: {
|
|
108
|
-
redrawRows: sinon.stub(),
|
|
109
|
-
},
|
|
110
|
-
} as unknown as RowSelectedEvent<ColFilterData>;
|
|
111
|
-
|
|
112
|
-
const setColumnIncludedStub = sinon.stub(actions.datasourceConfig, 'setColumnIncluded');
|
|
113
|
-
sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
114
|
-
KEY: 'testSource',
|
|
115
|
-
NAME: 'testAlias',
|
|
116
|
-
INPUT_TYPE: 'REQ_REP' as const,
|
|
117
|
-
OUTPUT_TYPE: 'TABLE' as const,
|
|
118
|
-
TRANSFORMER_CONFIGURATION: <TransformerConfig>{
|
|
119
|
-
INCLUDE_COLUMNS: ['testColumn'],
|
|
120
|
-
},
|
|
121
|
-
GROUPING_STRATEGY: 'NONE',
|
|
122
|
-
GROUP_KEY: null,
|
|
123
|
-
});
|
|
124
|
-
sinon.stub(selectors.datasourceConfig, 'getAllConfigSet').returns({
|
|
125
|
-
REQ_REP_testSource_testAlias: {
|
|
126
|
-
KEY: 'testAlias',
|
|
127
|
-
NAME: 'testSource',
|
|
128
|
-
INPUT_TYPE: 'REQ_REP',
|
|
129
|
-
OUTPUT_TYPE: 'TABLE',
|
|
130
|
-
TRANSFORMER_CONFIGURATION: {},
|
|
131
|
-
GROUPING_STRATEGY: 'NONE',
|
|
132
|
-
GROUP_KEY: null,
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
rowSelectionChangedHandler(mockEvent);
|
|
137
|
-
|
|
138
|
-
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
139
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].key, 'REQ_REP_testSource_testAlias');
|
|
140
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].column, 'testColumn');
|
|
141
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].included, false);
|
|
142
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, true);
|
|
143
|
-
assert.equal((<any>mockEvent.api.redrawRows).calledOnce, true);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
RowSelectionChangedHandler('should not set default format if output format is XLSX', () => {
|
|
147
|
-
(selectors.baseConfig.getConfig as any).returns({ OUTPUT_FORMAT: 'XLSX' });
|
|
148
|
-
const mockData = {
|
|
149
|
-
[GridColumnNames.Datasource]: 'TEST (Snapshot)',
|
|
150
|
-
[GridColumnNames.ColumnName]: 'testColumn',
|
|
151
|
-
[GridColumnNames.Type]: 'INT',
|
|
152
|
-
} as ColFilterData;
|
|
153
|
-
|
|
154
|
-
const mockEvent = {
|
|
155
|
-
data: mockData,
|
|
156
|
-
node: {
|
|
157
|
-
isSelected: sinon.stub().returns(false),
|
|
158
|
-
},
|
|
159
|
-
api: {
|
|
160
|
-
redrawRows: sinon.stub(),
|
|
161
|
-
},
|
|
162
|
-
} as unknown as RowSelectedEvent<ColFilterData>;
|
|
163
|
-
|
|
164
|
-
const setColumnIncludedStub = sinon.stub(actions.datasourceConfig, 'setColumnIncluded');
|
|
165
|
-
sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
166
|
-
KEY: 'test',
|
|
167
|
-
NAME: 'Test Datasource',
|
|
168
|
-
INPUT_TYPE: 'REQ_REP' as const,
|
|
169
|
-
OUTPUT_TYPE: 'TABLE' as const,
|
|
170
|
-
TRANSFORMER_CONFIGURATION: <TransformerConfig>{
|
|
171
|
-
INCLUDE_COLUMNS: ['testColumn'],
|
|
172
|
-
},
|
|
173
|
-
GROUPING_STRATEGY: 'NONE',
|
|
174
|
-
GROUP_KEY: null,
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
rowSelectionChangedHandler(mockEvent);
|
|
178
|
-
|
|
179
|
-
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
180
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, false);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
RowSelectionChangedHandler('should handle undefined selection state', () => {
|
|
184
|
-
const mockData = {
|
|
185
|
-
[GridColumnNames.Datasource]: 'testAlias (Snapshot)',
|
|
186
|
-
[GridColumnNames.ColumnName]: 'testColumn',
|
|
187
|
-
[GridColumnNames.Type]: 'INT',
|
|
188
|
-
} as ColFilterData;
|
|
189
|
-
|
|
190
|
-
const mockEvent = {
|
|
191
|
-
data: mockData,
|
|
192
|
-
node: {
|
|
193
|
-
isSelected: sinon.stub().returns(undefined),
|
|
194
|
-
},
|
|
195
|
-
api: {
|
|
196
|
-
redrawRows: sinon.stub(),
|
|
197
|
-
},
|
|
198
|
-
} as unknown as RowSelectedEvent<ColFilterData>;
|
|
199
|
-
|
|
200
|
-
const setColumnIncludedStub = sinon.stub(actions.datasourceConfig, 'setColumnIncluded');
|
|
201
|
-
sinon.stub(selectors.datasourceConfig, 'getDatasource').returns({
|
|
202
|
-
KEY: 'testSource',
|
|
203
|
-
NAME: 'testAlias',
|
|
204
|
-
INPUT_TYPE: 'REQ_REP' as const,
|
|
205
|
-
OUTPUT_TYPE: 'TABLE' as const,
|
|
206
|
-
TRANSFORMER_CONFIGURATION: <TransformerConfig>{
|
|
207
|
-
COLUMN_FILTERS: ['testColumn'],
|
|
208
|
-
},
|
|
209
|
-
GROUPING_STRATEGY: 'NONE',
|
|
210
|
-
GROUP_KEY: null,
|
|
211
|
-
});
|
|
212
|
-
sinon.stub(selectors.datasourceConfig, 'getAllConfigSet').returns({
|
|
213
|
-
REQ_REP_testSource_testAlias: {
|
|
214
|
-
KEY: 'testAlias',
|
|
215
|
-
NAME: 'testSource',
|
|
216
|
-
INPUT_TYPE: 'REQ_REP',
|
|
217
|
-
OUTPUT_TYPE: 'TABLE',
|
|
218
|
-
TRANSFORMER_CONFIGURATION: {},
|
|
219
|
-
GROUPING_STRATEGY: 'NONE',
|
|
220
|
-
GROUP_KEY: null,
|
|
221
|
-
},
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
rowSelectionChangedHandler(mockEvent);
|
|
225
|
-
|
|
226
|
-
assert.equal(setColumnIncludedStub.calledOnce, true);
|
|
227
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].included, true);
|
|
228
|
-
assert.equal(setColumnIncludedStub.getCall(0).args[0].setDefaultFormat, true);
|
|
229
|
-
assert.equal((<any>mockEvent.api.redrawRows).calledOnce, true);
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
RowSelectionChangedHandler.run();
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { RowSelectedEvent } from '@ag-grid-community/core';
|
|
2
|
-
import { actions, selectors } from '../../../store';
|
|
3
|
-
import {
|
|
4
|
-
GridColumnNames,
|
|
5
|
-
datasourceNameFromDisplay,
|
|
6
|
-
lookupColumnIsIncluded,
|
|
7
|
-
shouldDisableColumn,
|
|
8
|
-
} from '../shared';
|
|
9
|
-
import { ColFilterData } from './col-filters-grid.types';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Handler for row selection changes in the grid
|
|
13
|
-
*/
|
|
14
|
-
export function rowSelectionChangedHandler(event: RowSelectedEvent<ColFilterData>): void {
|
|
15
|
-
if (!event.data) return;
|
|
16
|
-
|
|
17
|
-
// gate event listener to only trigger if the data is actually changed by the user
|
|
18
|
-
// (return if setting the same value as in the store, e.g. when first loading
|
|
19
|
-
// the grid data)
|
|
20
|
-
if (lookupColumnIsIncluded(event.data) === (event.node.isSelected() ?? true)) return;
|
|
21
|
-
|
|
22
|
-
if (shouldDisableColumn(event.data)) return;
|
|
23
|
-
|
|
24
|
-
const setDefaultFormat = selectors.baseConfig.getConfig().OUTPUT_FORMAT !== 'XLSX';
|
|
25
|
-
|
|
26
|
-
actions.datasourceConfig.setColumnIncluded({
|
|
27
|
-
key: datasourceNameFromDisplay(event.data[GridColumnNames.Datasource]),
|
|
28
|
-
column: event.data[GridColumnNames.ColumnName],
|
|
29
|
-
included: event.node.isSelected() ?? true,
|
|
30
|
-
type: event.data[GridColumnNames.Type],
|
|
31
|
-
setDefaultFormat,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
event.api.redrawRows();
|
|
35
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { css } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
export const styles = css`
|
|
4
|
-
div.grid-container {
|
|
5
|
-
height: calc(var(--constrained-height) - 240px);
|
|
6
|
-
width: 100%;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
div.grid-container.error {
|
|
10
|
-
cursor: not-allowed;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
div.error rapid-grid-pro {
|
|
14
|
-
pointer-events: none;
|
|
15
|
-
opacity: 80%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
rapid-grid-pro::part(grid) {
|
|
19
|
-
--base-height-multiplier: 9;
|
|
20
|
-
--ag-selected-row-background-color: transparent !important;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ColDef,
|
|
3
|
-
GridApi,
|
|
4
|
-
IRowNode,
|
|
5
|
-
RowDataUpdatedEvent,
|
|
6
|
-
RowDragEndEvent,
|
|
7
|
-
ValueGetterParams,
|
|
8
|
-
} from '@ag-grid-community/core';
|
|
9
|
-
import { GridOptionsConfig } from '@genesislcap/grid-pro';
|
|
10
|
-
import { customElement } from '@genesislcap/web-core';
|
|
11
|
-
import { RowSelectRenderer } from '../../../../old/components/renderers/row-select.renderer';
|
|
12
|
-
import { actions, selectors } from '../../../store';
|
|
13
|
-
import {
|
|
14
|
-
DatasourceDataBaseComponent,
|
|
15
|
-
GridColumnNames,
|
|
16
|
-
GridRowData,
|
|
17
|
-
buildCellStyle,
|
|
18
|
-
configureDisabledColumns,
|
|
19
|
-
lookupColumnIsIncluded,
|
|
20
|
-
pathParameters,
|
|
21
|
-
orderRowsByIncludeColumns,
|
|
22
|
-
datasourceNameFromDisplay,
|
|
23
|
-
} from '../shared';
|
|
24
|
-
import { rowSelectionChangedHandler } from './col-filters-grid.helpers';
|
|
25
|
-
import { styles } from './col-filters-grid.styles';
|
|
26
|
-
import { ColFilterData } from './col-filters-grid.types';
|
|
27
|
-
import { template } from './col-fitlers-grid.template';
|
|
28
|
-
|
|
29
|
-
@customElement({
|
|
30
|
-
name: 'col-filters',
|
|
31
|
-
template,
|
|
32
|
-
styles,
|
|
33
|
-
})
|
|
34
|
-
export class ColFiltersGrid extends DatasourceDataBaseComponent {
|
|
35
|
-
grid!: HTMLElement;
|
|
36
|
-
private dragGhostStyleEl?: HTMLStyleElement;
|
|
37
|
-
|
|
38
|
-
connectedCallback() {
|
|
39
|
-
super.connectedCallback();
|
|
40
|
-
/**
|
|
41
|
-
* Workaround to hide the AG Grid drag ghost element.
|
|
42
|
-
* The ghost appears well below the dragged row (not directly after it), which creates a visual distraction.
|
|
43
|
-
*/
|
|
44
|
-
this.dragGhostStyleEl = document.createElement('style');
|
|
45
|
-
this.dragGhostStyleEl.textContent = `
|
|
46
|
-
.ag-dnd-ghost {
|
|
47
|
-
display: none !important;
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
this.grid.shadowRoot?.appendChild(this.dragGhostStyleEl);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Update grid data with column filter information
|
|
55
|
-
*/
|
|
56
|
-
protected async updateDataFields() {
|
|
57
|
-
try {
|
|
58
|
-
const rows = this.datasourceSpec.flatMap(pathParameters).map(configureDisabledColumns);
|
|
59
|
-
const currentDisplay = this.datasourceSpec[0]?.name;
|
|
60
|
-
const include = currentDisplay
|
|
61
|
-
? selectors.datasourceConfig.getDatasource(datasourceNameFromDisplay(currentDisplay))
|
|
62
|
-
?.TRANSFORMER_CONFIGURATION?.INCLUDE_COLUMNS
|
|
63
|
-
: undefined;
|
|
64
|
-
this.fieldData = orderRowsByIncludeColumns(rows, include);
|
|
65
|
-
this.dataError = false;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
this.handleError(e as Error, 'There were errors when loading the datasource fields');
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
saveFieldsOrder = (gridApi: GridApi) => {
|
|
72
|
-
const orderedRows: GridRowData[] = [];
|
|
73
|
-
gridApi.forEachNodeAfterFilterAndSort((rowNode: IRowNode<GridRowData>) => {
|
|
74
|
-
if (rowNode.data) {
|
|
75
|
-
orderedRows.push(rowNode.data);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
if (orderedRows.length > 0) {
|
|
80
|
-
this.fieldData = orderedRows;
|
|
81
|
-
const currentDatasourceDisplay = orderedRows[0][GridColumnNames.Datasource];
|
|
82
|
-
const key = datasourceNameFromDisplay(currentDatasourceDisplay);
|
|
83
|
-
const includedOrderedFields = orderedRows
|
|
84
|
-
.filter((row) => lookupColumnIsIncluded(row))
|
|
85
|
-
.map((row) => row[GridColumnNames.ColumnName]);
|
|
86
|
-
|
|
87
|
-
actions.datasourceConfig.setFieldsOrder({ key, fields: includedOrderedFields });
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
getGridOptions(): GridOptionsConfig {
|
|
92
|
-
const disableCellStyle = {
|
|
93
|
-
opacity: '0.5',
|
|
94
|
-
pointerEvents: 'none',
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const columnDefs: ColDef[] = [
|
|
98
|
-
{
|
|
99
|
-
field: '',
|
|
100
|
-
headerTooltip: 'Controls whether this column is added to the generated report.',
|
|
101
|
-
headerCheckboxSelection: true,
|
|
102
|
-
cellRenderer: 'row-select',
|
|
103
|
-
valueGetter: (params: ValueGetterParams<ColFilterData>) =>
|
|
104
|
-
lookupColumnIsIncluded(params.data!),
|
|
105
|
-
maxWidth: 60,
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
field: GridColumnNames.ColumnName,
|
|
109
|
-
headerTooltip: 'The name of the field as defined on the selected datasource.',
|
|
110
|
-
cellStyle: buildCellStyle<ColFilterData>(disableCellStyle),
|
|
111
|
-
rowDrag: true,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
field: GridColumnNames.Type,
|
|
115
|
-
headerTooltip: 'The type of the field on the underlying datasource.',
|
|
116
|
-
cellStyle: buildCellStyle<ColFilterData>(disableCellStyle),
|
|
117
|
-
},
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
return {
|
|
121
|
-
components: {
|
|
122
|
-
'row-select': RowSelectRenderer,
|
|
123
|
-
},
|
|
124
|
-
suppressRowTransform: true,
|
|
125
|
-
columnDefs,
|
|
126
|
-
rowData: [],
|
|
127
|
-
headerHeight: 30,
|
|
128
|
-
rowHeight: 38,
|
|
129
|
-
tooltipShowDelay: 0,
|
|
130
|
-
rowSelection: 'multiple',
|
|
131
|
-
onGridReady: () => {
|
|
132
|
-
this.handleUpdatedDatasources();
|
|
133
|
-
},
|
|
134
|
-
context: {
|
|
135
|
-
ariaLabelField: GridColumnNames.ColumnName,
|
|
136
|
-
},
|
|
137
|
-
suppressRowClickSelection: true,
|
|
138
|
-
onRowSelected: rowSelectionChangedHandler,
|
|
139
|
-
onRowDataUpdated(params: RowDataUpdatedEvent) {
|
|
140
|
-
params.api.forEachNode((node: IRowNode<ColFilterData>) => {
|
|
141
|
-
node.setSelected(lookupColumnIsIncluded(node.data!));
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
rowDragManaged: true,
|
|
145
|
-
onRowDragEnd: (event: RowDragEndEvent) => {
|
|
146
|
-
this.saveFieldsOrder(event.api);
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { customElement, GenesisElement, html } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
@customElement({
|
|
4
|
-
name: 'col-filters-tutorial',
|
|
5
|
-
template: html`
|
|
6
|
-
<template>
|
|
7
|
-
<h1>Column Visibility</h1>
|
|
8
|
-
<p>
|
|
9
|
-
This step is used to select which columns (fields) from each datasource are visible in the
|
|
10
|
-
report. You can toggle each individual column using the checkbox to the left of each row, or
|
|
11
|
-
quickly select or deselect all for the datasource using the checkbox in the header.
|
|
12
|
-
</p>
|
|
13
|
-
<p>
|
|
14
|
-
Where a column is set to not be visible (deselected), it won't be available to configure it
|
|
15
|
-
in any subsequent steps, however any "Row Filters" configured can still use this column.
|
|
16
|
-
</p>
|
|
17
|
-
<p>
|
|
18
|
-
You can reorder the visible columns by dragging rows using the handle in the "Column Name"
|
|
19
|
-
column. The new order is saved to your configuration and will be respected in the generated
|
|
20
|
-
report.
|
|
21
|
-
</p>
|
|
22
|
-
</template>
|
|
23
|
-
`,
|
|
24
|
-
})
|
|
25
|
-
export class ColFiltersTutorial extends GenesisElement {}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { classNames, html, ref } from '@genesislcap/web-core';
|
|
2
|
-
import type { ColFiltersGrid } from './col-filters-grid';
|
|
3
|
-
|
|
4
|
-
export const template = html<ColFiltersGrid>`
|
|
5
|
-
<div class="grid-container ${(x) => classNames(['error', x.dataError])}">
|
|
6
|
-
<rapid-grid-pro
|
|
7
|
-
${ref('grid')}
|
|
8
|
-
class="${(x) => classNames(['error', x.dataError])}"
|
|
9
|
-
data-test-id="datasource-config-col-filters-grid"
|
|
10
|
-
:gridOptions=${(x) => x.getGridOptions()}
|
|
11
|
-
:rowData=${(x) => x.fieldData}
|
|
12
|
-
grid-autosizing
|
|
13
|
-
></rapid-grid-pro>
|
|
14
|
-
</div>
|
|
15
|
-
`;
|