@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,39 +0,0 @@
|
|
|
1
|
-
import { ColDef } from '@ag-grid-community/core';
|
|
2
|
-
import { html } from '@genesislcap/web-core';
|
|
3
|
-
import { Permissions } from '../../types';
|
|
4
|
-
import { permissionGuard, permissionTemplateGuard } from '../../utils';
|
|
5
|
-
import type { ReportDestinations } from './report-destinations';
|
|
6
|
-
|
|
7
|
-
const colDef: ColDef[] = [
|
|
8
|
-
{ field: 'ID', headerName: 'ID', minWidth: 150, flex: 1, cellStyle: { display: 'flex' } },
|
|
9
|
-
{ field: 'NAME', headerName: 'Name', minWidth: 150, flex: 1, cellStyle: { display: 'flex' } },
|
|
10
|
-
{ field: 'TOPIC', headerName: 'Topic', minWidth: 150, flex: 1, cellStyle: { display: 'flex' } },
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const viewTemplate = html<ReportDestinations>`
|
|
14
|
-
<entity-management
|
|
15
|
-
enable-search-bar
|
|
16
|
-
design-system-prefix="rapid"
|
|
17
|
-
resourceName="NOTIFY_DESTINATIONS"
|
|
18
|
-
title="Report destinations"
|
|
19
|
-
updateEvent="${(x) =>
|
|
20
|
-
permissionGuard(x, Permissions.ReportDestinationUpdate)
|
|
21
|
-
? 'EVENT_NOTIFY_DESTINATION_UPDATE'
|
|
22
|
-
: ''}"
|
|
23
|
-
createEvent="${(x) =>
|
|
24
|
-
permissionGuard(x, Permissions.ReportDestinationUpdate)
|
|
25
|
-
? 'EVENT_NOTIFY_DESTINATION_INSERT'
|
|
26
|
-
: ''}"
|
|
27
|
-
deleteEvent="${(x) =>
|
|
28
|
-
permissionGuard(x, Permissions.ReportDestinationDelete)
|
|
29
|
-
? 'EVENT_NOTIFY_DESTINATION_DELETE'
|
|
30
|
-
: ''}"
|
|
31
|
-
:createFormUiSchema=${(x) => x.getUISchema}
|
|
32
|
-
:updateFormUiSchema=${(x) => x.getUISchema}
|
|
33
|
-
:columns=${() => colDef}
|
|
34
|
-
></entity-management>
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
export const template = html<ReportDestinations>`
|
|
38
|
-
${(x) => permissionTemplateGuard(x, Permissions.ReportDestinationView, viewTemplate)}
|
|
39
|
-
`;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
-
import { ConnectedRenderersOptions, UiSchema } from '@genesislcap/foundation-forms';
|
|
3
|
-
import { User } from '@genesislcap/foundation-user';
|
|
4
|
-
import { logger } from '@genesislcap/foundation-utils';
|
|
5
|
-
import { customElement, GenesisElement, observable, volatile } from '@genesislcap/web-core';
|
|
6
|
-
import { showNotificationToast } from '../../utils';
|
|
7
|
-
import { template } from './report-destinations.template';
|
|
8
|
-
|
|
9
|
-
@customElement({
|
|
10
|
-
name: 'report-destinations',
|
|
11
|
-
template,
|
|
12
|
-
})
|
|
13
|
-
export class ReportDestinations extends GenesisElement {
|
|
14
|
-
@Connect private connect: Connect;
|
|
15
|
-
@observable topics: string[] = [];
|
|
16
|
-
|
|
17
|
-
@User user!: User;
|
|
18
|
-
|
|
19
|
-
async connectedCallback() {
|
|
20
|
-
super.connectedCallback();
|
|
21
|
-
await this.setNotifyRouteTopics();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@volatile
|
|
25
|
-
get getUISchema(): UiSchema {
|
|
26
|
-
return {
|
|
27
|
-
type: 'VerticalLayout',
|
|
28
|
-
elements: [
|
|
29
|
-
{ type: 'Control', scope: '#/properties/NAME' },
|
|
30
|
-
{
|
|
31
|
-
type: 'Control',
|
|
32
|
-
scope: '#/properties/TOPIC',
|
|
33
|
-
options: <ConnectedRenderersOptions>{
|
|
34
|
-
data: this.topics.map((item) => ({ value: item, label: item })),
|
|
35
|
-
valueField: 'value',
|
|
36
|
-
labelField: 'label',
|
|
37
|
-
allowCustomOptions: true,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public async setNotifyRouteTopics() {
|
|
45
|
-
try {
|
|
46
|
-
const response = await this.connect.request('REQ_NOTIFY_ROUTE_TOPICS', {
|
|
47
|
-
REQUEST: { NOTIFY_ROUTE_ID: '' },
|
|
48
|
-
});
|
|
49
|
-
if (response.MESSAGE_TYPE === 'REP_NOTIFY_ROUTE_TOPICS') {
|
|
50
|
-
this.topics = response.REPLY ? response.REPLY[0].TOPICS : [];
|
|
51
|
-
} else {
|
|
52
|
-
const error = response?.ERROR?.length ? response.ERROR[0].TEXT : '';
|
|
53
|
-
showNotificationToast({
|
|
54
|
-
title: 'Report Destination',
|
|
55
|
-
body: ` Topics were not fetched due to following error "${error}"`,
|
|
56
|
-
toast: { type: 'critical' as any },
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
} catch (err) {
|
|
60
|
-
logger.error(err);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
package/src/new/store/index.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { PayloadStateUpdater } from '../../types';
|
|
3
|
-
import { BaseConfig, ReportOutputTypes } from './types';
|
|
4
|
-
|
|
5
|
-
const initialState: BaseConfig = {
|
|
6
|
-
DESTINATION_IDS: [],
|
|
7
|
-
OUTPUT_DIRECTORY: '/reports',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const baseSlice = createSlice({
|
|
11
|
-
name: 'baseConfig',
|
|
12
|
-
initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
updateState(
|
|
15
|
-
state: BaseConfig,
|
|
16
|
-
action: PayloadStateUpdater<Omit<BaseConfig, 'DESTINATION_IDS' | 'OUTPUT_FORMAT'>>,
|
|
17
|
-
) {
|
|
18
|
-
const { key, value } = action.payload;
|
|
19
|
-
(<any>state[key]) = value;
|
|
20
|
-
},
|
|
21
|
-
setOutputs(state: BaseConfig, action: PayloadAction<{ ids: string[] }>) {
|
|
22
|
-
state.DESTINATION_IDS = action.payload.ids;
|
|
23
|
-
},
|
|
24
|
-
loadState(_: BaseConfig, action: PayloadAction<BaseConfig>) {
|
|
25
|
-
return action.payload;
|
|
26
|
-
},
|
|
27
|
-
setOutputFormat(state: BaseConfig, action: PayloadAction<{ format: ReportOutputTypes }>) {
|
|
28
|
-
state.OUTPUT_FORMAT = action.payload.format;
|
|
29
|
-
baseSlice.caseReducers.deleteTemplate(state);
|
|
30
|
-
},
|
|
31
|
-
deleteTemplate(state: BaseConfig) {
|
|
32
|
-
delete state.DOCUMENT_TEMPLATE_ID;
|
|
33
|
-
},
|
|
34
|
-
deleteSchedule(state: BaseConfig) {
|
|
35
|
-
delete state.SCHEDULE;
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
selectors: {
|
|
39
|
-
// could add additional params if needed
|
|
40
|
-
getConfig(state: BaseConfig) {
|
|
41
|
-
return state;
|
|
42
|
-
},
|
|
43
|
-
// test showing extra params
|
|
44
|
-
getConfigTest(state: BaseConfig, test: boolean, test2: boolean) {
|
|
45
|
-
console.log(test);
|
|
46
|
-
console.log({ state, test, test2 });
|
|
47
|
-
return state;
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { RuleExpression } from '@genesislcap/foundation-ui';
|
|
2
|
-
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
3
|
-
import { capitalCase } from 'change-case';
|
|
4
|
-
import { Genesis } from '../../types';
|
|
5
|
-
import { buildDatasourceName } from '../../utils';
|
|
6
|
-
import { getDefaultFormat } from '../../utils/format-utils';
|
|
7
|
-
import {
|
|
8
|
-
DatasourceConfig,
|
|
9
|
-
DatasourceGrouping,
|
|
10
|
-
DatasourceName,
|
|
11
|
-
DatasourceOutputTypes,
|
|
12
|
-
deselectedColumns,
|
|
13
|
-
TransformerConfig,
|
|
14
|
-
} from './types';
|
|
15
|
-
|
|
16
|
-
export const initialState: DatasourceConfig = {};
|
|
17
|
-
|
|
18
|
-
export const datasourceSlice = createSlice({
|
|
19
|
-
name: 'datasourceConfig',
|
|
20
|
-
initialState,
|
|
21
|
-
reducers: {
|
|
22
|
-
initDatasourceConfiguration(
|
|
23
|
-
state: DatasourceConfig,
|
|
24
|
-
action: PayloadAction<{
|
|
25
|
-
base: Pick<DatasourceConfig[DatasourceName], 'KEY' | 'NAME' | 'INPUT_TYPE'>;
|
|
26
|
-
fields: string[];
|
|
27
|
-
}>,
|
|
28
|
-
) {
|
|
29
|
-
const { KEY, NAME, INPUT_TYPE } = action.payload.base;
|
|
30
|
-
const key: DatasourceName = buildDatasourceName(KEY, NAME, INPUT_TYPE);
|
|
31
|
-
state[key] = {
|
|
32
|
-
KEY: KEY,
|
|
33
|
-
INPUT_TYPE: INPUT_TYPE,
|
|
34
|
-
NAME: NAME,
|
|
35
|
-
OUTPUT_TYPE: 'TABLE',
|
|
36
|
-
TRANSFORMER_CONFIGURATION: {},
|
|
37
|
-
GROUPING_STRATEGY: 'NONE',
|
|
38
|
-
GROUP_KEY: null,
|
|
39
|
-
};
|
|
40
|
-
action.payload.fields.forEach((field) => {
|
|
41
|
-
datasourceSlice.caseReducers.setColumnRename(state, {
|
|
42
|
-
...action,
|
|
43
|
-
payload: {
|
|
44
|
-
key,
|
|
45
|
-
columnFrom: field,
|
|
46
|
-
columnTo: capitalCase(field),
|
|
47
|
-
included: true,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
datasourceSlice.caseReducers.setColumnIncluded(state, {
|
|
51
|
-
...action,
|
|
52
|
-
payload: {
|
|
53
|
-
column: field,
|
|
54
|
-
key,
|
|
55
|
-
included: !deselectedColumns.includes(field),
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
reorderDatasource(
|
|
61
|
-
state: DatasourceConfig,
|
|
62
|
-
action: PayloadAction<{ key: DatasourceName; newIndex: number }>,
|
|
63
|
-
) {
|
|
64
|
-
const { key, newIndex } = action.payload;
|
|
65
|
-
const entries = Object.entries(state);
|
|
66
|
-
const currentIndex = entries.findIndex(([k]) => k === key);
|
|
67
|
-
|
|
68
|
-
if (currentIndex === -1) return state;
|
|
69
|
-
|
|
70
|
-
const [item] = entries.splice(currentIndex, 1);
|
|
71
|
-
entries.splice(newIndex, 0, item);
|
|
72
|
-
|
|
73
|
-
return Object.fromEntries(entries) as DatasourceConfig;
|
|
74
|
-
},
|
|
75
|
-
renameDatasource(
|
|
76
|
-
state: DatasourceConfig,
|
|
77
|
-
action: PayloadAction<{ key: DatasourceName; newName: string }>,
|
|
78
|
-
) {
|
|
79
|
-
const { key: oldKey, newName } = action.payload;
|
|
80
|
-
const datasource = state[oldKey];
|
|
81
|
-
if (!datasource) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const newKey = buildDatasourceName(newName, datasource.NAME, datasource.INPUT_TYPE);
|
|
85
|
-
if (state[newKey] && newKey !== oldKey) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return Object.fromEntries(
|
|
90
|
-
Object.entries(state).map(([k, v]) => {
|
|
91
|
-
if (k === oldKey) {
|
|
92
|
-
return [newKey, { ...v, KEY: newName }];
|
|
93
|
-
}
|
|
94
|
-
return [k, v];
|
|
95
|
-
}),
|
|
96
|
-
) as DatasourceConfig;
|
|
97
|
-
},
|
|
98
|
-
updateDatasourceOutputType(
|
|
99
|
-
state: DatasourceConfig,
|
|
100
|
-
action: PayloadAction<{ key: DatasourceName; newType: DatasourceOutputTypes }>,
|
|
101
|
-
) {
|
|
102
|
-
state[action.payload.key].OUTPUT_TYPE = action.payload.newType;
|
|
103
|
-
},
|
|
104
|
-
deleteDatasource(state: DatasourceConfig, action: PayloadAction<{ key: DatasourceName }>) {
|
|
105
|
-
delete state[action.payload.key];
|
|
106
|
-
},
|
|
107
|
-
setColumnRename(
|
|
108
|
-
state: DatasourceConfig,
|
|
109
|
-
action: PayloadAction<{
|
|
110
|
-
key: DatasourceName;
|
|
111
|
-
columnFrom: string;
|
|
112
|
-
columnTo: string;
|
|
113
|
-
included: boolean;
|
|
114
|
-
}>,
|
|
115
|
-
) {
|
|
116
|
-
const { key, columnFrom, columnTo, included } = action.payload;
|
|
117
|
-
if (included) {
|
|
118
|
-
state[key].TRANSFORMER_CONFIGURATION.COLUMN_RENAMES = {
|
|
119
|
-
...state[key].TRANSFORMER_CONFIGURATION.COLUMN_RENAMES,
|
|
120
|
-
[columnFrom]: columnTo,
|
|
121
|
-
};
|
|
122
|
-
} else {
|
|
123
|
-
if (state[key].TRANSFORMER_CONFIGURATION?.COLUMN_RENAMES) {
|
|
124
|
-
delete state[key].TRANSFORMER_CONFIGURATION.COLUMN_RENAMES![columnFrom];
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
/**
|
|
129
|
-
* Will also clean up data associated with this field, such as rename transformers
|
|
130
|
-
*/
|
|
131
|
-
setColumnIncluded(
|
|
132
|
-
state: DatasourceConfig,
|
|
133
|
-
action: PayloadAction<{
|
|
134
|
-
key: DatasourceName;
|
|
135
|
-
column: string;
|
|
136
|
-
included: boolean;
|
|
137
|
-
type?: Genesis.GenesisFieldTypes;
|
|
138
|
-
setDefaultFormat?: boolean;
|
|
139
|
-
}>,
|
|
140
|
-
) {
|
|
141
|
-
const { key, column, included, type, setDefaultFormat = true } = action.payload;
|
|
142
|
-
if (included) {
|
|
143
|
-
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = [
|
|
144
|
-
...(state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS ?? []),
|
|
145
|
-
column,
|
|
146
|
-
];
|
|
147
|
-
const defaultFormat = getDefaultFormat(type);
|
|
148
|
-
if (defaultFormat && setDefaultFormat) {
|
|
149
|
-
datasourceSlice.caseReducers.setColumnFormat(state, {
|
|
150
|
-
...action,
|
|
151
|
-
payload: {
|
|
152
|
-
key,
|
|
153
|
-
column,
|
|
154
|
-
format: defaultFormat,
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
} else {
|
|
159
|
-
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = (
|
|
160
|
-
state[key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS ?? []
|
|
161
|
-
).filter((col) => col !== column);
|
|
162
|
-
|
|
163
|
-
datasourceSlice.caseReducers.deleteColumnTransform(state, {
|
|
164
|
-
...action,
|
|
165
|
-
payload: {
|
|
166
|
-
key,
|
|
167
|
-
column,
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
datasourceSlice.caseReducers.deleteColumnFormat(state, {
|
|
171
|
-
...action,
|
|
172
|
-
payload: {
|
|
173
|
-
key,
|
|
174
|
-
column,
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
datasourceSlice.caseReducers.setColumnRename(state, {
|
|
180
|
-
...action,
|
|
181
|
-
payload: {
|
|
182
|
-
key,
|
|
183
|
-
columnFrom: column,
|
|
184
|
-
columnTo: !included ? column : capitalCase(column),
|
|
185
|
-
included,
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
},
|
|
189
|
-
setFieldsOrder(
|
|
190
|
-
state: DatasourceConfig,
|
|
191
|
-
action: PayloadAction<{
|
|
192
|
-
key: DatasourceName;
|
|
193
|
-
fields: string[];
|
|
194
|
-
}>,
|
|
195
|
-
) {
|
|
196
|
-
state[action.payload.key].TRANSFORMER_CONFIGURATION.INCLUDE_COLUMNS = action.payload.fields;
|
|
197
|
-
},
|
|
198
|
-
setRowFilter(
|
|
199
|
-
state: DatasourceConfig,
|
|
200
|
-
action: PayloadAction<{
|
|
201
|
-
key: DatasourceName;
|
|
202
|
-
expression: RuleExpression.Expression['PredicateExpression'];
|
|
203
|
-
}>,
|
|
204
|
-
) {
|
|
205
|
-
const { key, expression } = action.payload;
|
|
206
|
-
state[key].TRANSFORMER_CONFIGURATION.ROW_FILTERS = expression;
|
|
207
|
-
},
|
|
208
|
-
setColumnTransform(
|
|
209
|
-
state: DatasourceConfig,
|
|
210
|
-
action: PayloadAction<{
|
|
211
|
-
key: DatasourceName;
|
|
212
|
-
column: string;
|
|
213
|
-
expression: Required<TransformerConfig>['COLUMN_TRANSFORMS'][string];
|
|
214
|
-
}>,
|
|
215
|
-
) {
|
|
216
|
-
const { key, column, expression } = action.payload;
|
|
217
|
-
state[key].TRANSFORMER_CONFIGURATION.COLUMN_TRANSFORMS = {
|
|
218
|
-
...state[key].TRANSFORMER_CONFIGURATION.COLUMN_TRANSFORMS,
|
|
219
|
-
[column]: expression,
|
|
220
|
-
};
|
|
221
|
-
},
|
|
222
|
-
deleteColumnTransform(
|
|
223
|
-
state: DatasourceConfig,
|
|
224
|
-
action: PayloadAction<{
|
|
225
|
-
key: DatasourceName;
|
|
226
|
-
column: string;
|
|
227
|
-
}>,
|
|
228
|
-
) {
|
|
229
|
-
const { key, column } = action.payload;
|
|
230
|
-
const { [column]: _, ...rest } =
|
|
231
|
-
state[key].TRANSFORMER_CONFIGURATION?.COLUMN_TRANSFORMS ?? {};
|
|
232
|
-
state[key].TRANSFORMER_CONFIGURATION.COLUMN_TRANSFORMS = rest;
|
|
233
|
-
},
|
|
234
|
-
loadState(_: DatasourceConfig, action: PayloadAction<DatasourceConfig>) {
|
|
235
|
-
return action.payload;
|
|
236
|
-
},
|
|
237
|
-
setColumnFormat(
|
|
238
|
-
state: DatasourceConfig,
|
|
239
|
-
action: PayloadAction<{
|
|
240
|
-
key: DatasourceName;
|
|
241
|
-
column: string;
|
|
242
|
-
format: string;
|
|
243
|
-
}>,
|
|
244
|
-
) {
|
|
245
|
-
const { key, column, format } = action.payload;
|
|
246
|
-
state[key].TRANSFORMER_CONFIGURATION.COLUMN_FORMATS = {
|
|
247
|
-
...state[key].TRANSFORMER_CONFIGURATION.COLUMN_FORMATS,
|
|
248
|
-
[column]: format,
|
|
249
|
-
};
|
|
250
|
-
},
|
|
251
|
-
deleteColumnFormat(
|
|
252
|
-
state: DatasourceConfig,
|
|
253
|
-
action: PayloadAction<{
|
|
254
|
-
key: DatasourceName;
|
|
255
|
-
column: string;
|
|
256
|
-
}>,
|
|
257
|
-
) {
|
|
258
|
-
const { key, column } = action.payload;
|
|
259
|
-
const { [column]: _, ...rest } = state[key].TRANSFORMER_CONFIGURATION?.COLUMN_FORMATS ?? {};
|
|
260
|
-
state[key].TRANSFORMER_CONFIGURATION.COLUMN_FORMATS = rest;
|
|
261
|
-
},
|
|
262
|
-
setGrouping(
|
|
263
|
-
state: DatasourceConfig,
|
|
264
|
-
action: PayloadAction<{
|
|
265
|
-
key: DatasourceName;
|
|
266
|
-
grouping: Exclude<DatasourceGrouping, { GROUPING_STRATEGY: 'NONE' }>;
|
|
267
|
-
}>,
|
|
268
|
-
) {
|
|
269
|
-
const { key, grouping } = action.payload;
|
|
270
|
-
state[key].GROUPING_STRATEGY = grouping.GROUPING_STRATEGY;
|
|
271
|
-
state[key].GROUP_KEY = grouping.GROUP_KEY;
|
|
272
|
-
},
|
|
273
|
-
deleteGrouping(state: DatasourceConfig, action: PayloadAction<{ key: DatasourceName }>) {
|
|
274
|
-
const { key } = action.payload;
|
|
275
|
-
state[key].GROUPING_STRATEGY = 'NONE';
|
|
276
|
-
state[key].GROUP_KEY = null;
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
selectors: {
|
|
280
|
-
getAllConfigSet(state: DatasourceConfig) {
|
|
281
|
-
return state;
|
|
282
|
-
},
|
|
283
|
-
getDatasource(state: DatasourceConfig, key: keyof DatasourceConfig) {
|
|
284
|
-
return state[key];
|
|
285
|
-
},
|
|
286
|
-
getRowFilterExpression(state: DatasourceConfig, key: DatasourceName) {
|
|
287
|
-
return state[key].TRANSFORMER_CONFIGURATION.ROW_FILTERS;
|
|
288
|
-
},
|
|
289
|
-
getRowTransform(state: DatasourceConfig, key: DatasourceName, column: string) {
|
|
290
|
-
const transforms = state?.[key]?.TRANSFORMER_CONFIGURATION?.COLUMN_TRANSFORMS;
|
|
291
|
-
if (!transforms || !(column in transforms)) {
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
return transforms[column];
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// DATA SOURCE CONFIG
|
|
2
|
-
|
|
3
|
-
import { RuleExpression } from '@genesislcap/foundation-ui';
|
|
4
|
-
|
|
5
|
-
// All columns are automatically included in the output report when a datasource is first
|
|
6
|
-
// configured, except field names defined in this array
|
|
7
|
-
export const deselectedColumns = ['RECORD_ID', 'TIMESTAMP'];
|
|
8
|
-
|
|
9
|
-
export const datasourceInputs = ['REQ_REP', 'DATA_PIPELINE'] as const;
|
|
10
|
-
export type DatasourceInputTypes = (typeof datasourceInputs)[number];
|
|
11
|
-
|
|
12
|
-
// TODO: temporarily disabled RECORD_STREAM
|
|
13
|
-
export const datasourceOutputs = [
|
|
14
|
-
// 'RECORD_STREAM',
|
|
15
|
-
'TABLE',
|
|
16
|
-
] as const;
|
|
17
|
-
export type DatasourceOutputTypes = (typeof datasourceOutputs)[number];
|
|
18
|
-
|
|
19
|
-
export const datasourceGroupingStrategies = ['NONE', 'MULTI_SHEET', 'LOOKUP_TABLE'] as const;
|
|
20
|
-
export type DatasourceGroupingStrategy = (typeof datasourceGroupingStrategies)[number];
|
|
21
|
-
export type DatasourceGrouping =
|
|
22
|
-
| {
|
|
23
|
-
GROUPING_STRATEGY: Extract<DatasourceGroupingStrategy, 'NONE'>;
|
|
24
|
-
GROUP_KEY: null;
|
|
25
|
-
}
|
|
26
|
-
| {
|
|
27
|
-
GROUPING_STRATEGY: Extract<DatasourceGroupingStrategy, 'MULTI_SHEET' | 'LOOKUP_TABLE'>;
|
|
28
|
-
GROUP_KEY: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Server KEY => This is an alias (this needs to be unique). This is presented as "Name" input on the UI, rapid-text-field
|
|
33
|
-
* Server NAME => The name of the datasource (matches req_rep). This is presented as rapid-select
|
|
34
|
-
* DatasoureName to uniquely identify each data source, must be keyed on the input type as
|
|
35
|
-
* the names are not unique between the different data sources
|
|
36
|
-
*/
|
|
37
|
-
export type AliasKey = string;
|
|
38
|
-
export type ServerDatasourceName = string;
|
|
39
|
-
export type DatasourceName = `${DatasourceInputTypes}_${ServerDatasourceName}_${AliasKey}`;
|
|
40
|
-
|
|
41
|
-
export type TransformerConfig = {
|
|
42
|
-
COLUMN_RENAMES?: { [k: string]: string };
|
|
43
|
-
/**
|
|
44
|
-
* Columns to include in the report. The order is respected in the generated report.
|
|
45
|
-
*/
|
|
46
|
-
INCLUDE_COLUMNS?: string[];
|
|
47
|
-
ROW_FILTERS?: RuleExpression.Expression['PredicateExpression'];
|
|
48
|
-
COLUMN_TRANSFORMS?: {
|
|
49
|
-
[k: string]:
|
|
50
|
-
| RuleExpression.Expression['BinaryExpression']
|
|
51
|
-
| RuleExpression.Expression['MethodExpression'];
|
|
52
|
-
};
|
|
53
|
-
COLUMN_FORMATS?: {
|
|
54
|
-
[k: string]: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export type DatasourceConfig = {
|
|
59
|
-
[k: DatasourceName]: {
|
|
60
|
-
KEY: string;
|
|
61
|
-
NAME: string;
|
|
62
|
-
INPUT_TYPE: DatasourceInputTypes;
|
|
63
|
-
OUTPUT_TYPE: DatasourceOutputTypes;
|
|
64
|
-
TRANSFORMER_CONFIGURATION: TransformerConfig;
|
|
65
|
-
} & DatasourceGrouping;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// BASE-CONFIG
|
|
69
|
-
|
|
70
|
-
export const reportOutputFormats = ['CSV', 'PDF', 'XLSX'] as const;
|
|
71
|
-
|
|
72
|
-
export type ReportOutputTypes = (typeof reportOutputFormats)[number];
|
|
73
|
-
|
|
74
|
-
export type Schedule = {
|
|
75
|
-
CRON_EXPRESSION: string;
|
|
76
|
-
TIME_ZONE: string;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export type BaseConfig = {
|
|
80
|
-
ID?: string;
|
|
81
|
-
NAME?: string;
|
|
82
|
-
DESCRIPTION?: string;
|
|
83
|
-
OUTPUT_FORMAT?: ReportOutputTypes;
|
|
84
|
-
FILE_NAME?: string;
|
|
85
|
-
AUTO_DISPATCH?: boolean;
|
|
86
|
-
DESTINATION_IDS: string[];
|
|
87
|
-
DOCUMENT_TEMPLATE_ID?: string;
|
|
88
|
-
SCHEDULE?: Schedule;
|
|
89
|
-
OUTPUT_DIRECTORY: string;
|
|
90
|
-
};
|
package/src/new/store/store.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createStore } from '../lib/redux-store';
|
|
2
|
-
import { baseSlice, datasourceSlice } from './slices';
|
|
3
|
-
import { ReportingConfig } from './types';
|
|
4
|
-
|
|
5
|
-
export const reduxBlankState: ReportingConfig = {
|
|
6
|
-
baseConfig: {
|
|
7
|
-
DESTINATION_IDS: [],
|
|
8
|
-
OUTPUT_FORMAT: 'CSV',
|
|
9
|
-
OUTPUT_DIRECTORY: '/reports',
|
|
10
|
-
},
|
|
11
|
-
datasourceConfig: {},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const {
|
|
15
|
-
store,
|
|
16
|
-
actions,
|
|
17
|
-
rootReducer,
|
|
18
|
-
selectors,
|
|
19
|
-
subscribe,
|
|
20
|
-
dispatch,
|
|
21
|
-
getState,
|
|
22
|
-
subscribeKey,
|
|
23
|
-
} = createStore([baseSlice, datasourceSlice], reduxBlankState);
|
|
24
|
-
|
|
25
|
-
export type State = ReturnType<typeof getState>;
|
|
26
|
-
export type AppDispatch = typeof dispatch;
|
|
27
|
-
|
|
28
|
-
export const writeReduxState = (state: ReportingConfig) => {
|
|
29
|
-
actions.baseConfig.loadState(state.baseConfig);
|
|
30
|
-
actions.datasourceConfig.loadState(state.datasourceConfig);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const readReduxState = (): ReportingConfig => ({
|
|
34
|
-
datasourceConfig: selectors.datasourceConfig.getAllConfigSet(),
|
|
35
|
-
baseConfig: selectors.baseConfig.getConfig(),
|
|
36
|
-
});
|
package/src/new/store/types.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cssPartial as css } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Set the `--constrained-height` and `-constrained-width` css variables in a cssPartial
|
|
5
|
-
* which can be used to size `display: block` contents within bounds.
|
|
6
|
-
*
|
|
7
|
-
* Variable allows you to specify the height of the content from the top of the PBC to the content,
|
|
8
|
-
* allowing the content to be sized correctly
|
|
9
|
-
*
|
|
10
|
-
* Looks at `--app-top-height` which let's the PBC user specify extra pixel height (e.g. they have their
|
|
11
|
-
* own nav)
|
|
12
|
-
*/
|
|
13
|
-
export const constrainedDimensions = ({ navToContentPx }: { navToContentPx: number }) => css`
|
|
14
|
-
/* the height of the stepper footer (back/next buttons) */
|
|
15
|
-
--footer-height: 62px;
|
|
16
|
-
|
|
17
|
-
--app-top-height: 60px; /* can be used to account for main app header, in this case the extra height taken up by the tabs to select between the beta */
|
|
18
|
-
|
|
19
|
-
/* the height from the top of the reporting PBC (tabs with configure/destinations/etc.) to the top of the slotted section */
|
|
20
|
-
--reporting-header-to-content-height: ${navToContentPx.toString()}px;
|
|
21
|
-
|
|
22
|
-
/* total height from the page we want to subtract from the total height to give to the slot contents */
|
|
23
|
-
--taken-height: calc(
|
|
24
|
-
var(--footer-height) + var(--reporting-header-to-content-height) + var(--app-top-height, 0px)
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
/* the height/max height we want to set on the component - the calculated space for the content */
|
|
28
|
-
--constrained-height: calc(100vh - var(--taken-height));
|
|
29
|
-
|
|
30
|
-
/* the width/max width we want to set on the component - 98% of the view width, bounded at most 1200px */
|
|
31
|
-
--constrained-width: min(1200px, 98vw);
|
|
32
|
-
`;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { accentColor, css } from '@genesislcap/web-core';
|
|
2
|
-
|
|
3
|
-
export const optionMessageBubble = (dataAttr: string = 'data-bubble-content') => css`
|
|
4
|
-
rapid-multiselect::part(option-label)::after,
|
|
5
|
-
rapid-option.message-bubble::after {
|
|
6
|
-
background-color: var(--accent-fill-rest);
|
|
7
|
-
border-radius: calc((var(--control-corner-radius) + 1) * 1px);
|
|
8
|
-
color: var(--neutral-foreground-rest);
|
|
9
|
-
content: attr(${dataAttr});
|
|
10
|
-
font-size: var(--type-ramp-minus-2-font-size);
|
|
11
|
-
padding: calc((var(--design-unit) - 2) * 1px) calc(var(--design-unit) * 2px);
|
|
12
|
-
position: absolute;
|
|
13
|
-
right: 0;
|
|
14
|
-
transform: translateX(-6px);
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
rapid-option.message-bubble:hover::after {
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
rapid-multiselect::part(option-label)::after,
|
|
23
|
-
rapid-option.message-bubble[data-color='red']::after {
|
|
24
|
-
background-color: ${accentColor};
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
export const formLabel = css`
|
|
29
|
-
.label {
|
|
30
|
-
display: block;
|
|
31
|
-
padding-bottom: calc(var(--design-unit) * 2px);
|
|
32
|
-
color: var(--neutral-foreground-hint);
|
|
33
|
-
margin: 0;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
font-size: var(--type-ramp-base-font-size);
|
|
36
|
-
line-height: var(--type-ramp-base-line-height);
|
|
37
|
-
}
|
|
38
|
-
`;
|
package/src/new/styles/index.ts
DELETED