@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,25 +0,0 @@
|
|
|
1
|
-
import { errorColor } from '@genesislcap/rapid-design-system';
|
|
2
|
-
import { css, neutralForegroundRest, neutralLayer4 } from '@genesislcap/web-core';
|
|
3
|
-
|
|
4
|
-
export const errorMessageStyles = css`
|
|
5
|
-
.error-message {
|
|
6
|
-
color: ${neutralForegroundRest};
|
|
7
|
-
background-color: ${neutralLayer4};
|
|
8
|
-
border-color: ${errorColor};
|
|
9
|
-
border-radius: 7px;
|
|
10
|
-
border-style: solid;
|
|
11
|
-
border-width: 4px;
|
|
12
|
-
padding: 5px;
|
|
13
|
-
margin: 15px;
|
|
14
|
-
text-align: center;
|
|
15
|
-
width: fit-content;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const mixinScreen = (display: string = 'block') => `
|
|
20
|
-
contain: content;
|
|
21
|
-
display: ${display};
|
|
22
|
-
height: 100%;
|
|
23
|
-
width: 100%;
|
|
24
|
-
overflow-y: auto;
|
|
25
|
-
`;
|
package/src/new/types/display.ts
DELETED
package/src/new/types/index.ts
DELETED
package/src/new/types/misc.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { JSONSchema7 as JSONShemaBase } from 'json-schema';
|
|
2
|
-
import type {
|
|
3
|
-
BaseConfig,
|
|
4
|
-
DatasourceConfig,
|
|
5
|
-
DatasourceName,
|
|
6
|
-
Schedule,
|
|
7
|
-
DatasourceGrouping,
|
|
8
|
-
} from '../store';
|
|
9
|
-
|
|
10
|
-
export namespace Genesis {
|
|
11
|
-
export const genesisFieldTypes = [
|
|
12
|
-
'STRING',
|
|
13
|
-
'ENUM',
|
|
14
|
-
'INT',
|
|
15
|
-
'SHORT',
|
|
16
|
-
'DOUBLE',
|
|
17
|
-
'LONG',
|
|
18
|
-
'BOOLEAN',
|
|
19
|
-
'BIGDECIMAL',
|
|
20
|
-
'DATE',
|
|
21
|
-
'DATETIME',
|
|
22
|
-
'RAW',
|
|
23
|
-
'NANO_TIMESTAMP',
|
|
24
|
-
] as const;
|
|
25
|
-
|
|
26
|
-
export type GenesisFieldTypes = (typeof genesisFieldTypes)[number];
|
|
27
|
-
|
|
28
|
-
export type JSONSchema7 = JSONShemaBase & {
|
|
29
|
-
properties?:
|
|
30
|
-
| {
|
|
31
|
-
[key: string]: JSONShemaBase & { genesisType: GenesisFieldTypes };
|
|
32
|
-
}
|
|
33
|
-
| undefined;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type ServerReportConfig = Omit<BaseConfig, 'SCHEDULE'> & {
|
|
37
|
-
DATA_SOURCES: (Omit<DatasourceConfig[DatasourceName], 'GROUPING_STRATEGY' | 'GROUP_KEY'> &
|
|
38
|
-
(Exclude<DatasourceGrouping, { GROUPING_STRATEGY: 'NONE' }> | {}))[];
|
|
39
|
-
SCHEDULES: Schedule[];
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const FileStorageFields = {
|
|
43
|
-
FILE_STORAGE_ID: 'FILE_STORAGE_ID',
|
|
44
|
-
STORAGE_MANAGER: 'STORAGE_MANAGER',
|
|
45
|
-
FILE_NAME: 'FILE_NAME',
|
|
46
|
-
FILE_SIZE: 'FILE_SIZE',
|
|
47
|
-
MODIFIED_AT: 'MODIFIED_AT',
|
|
48
|
-
MODIFIED_BY: 'MODIFIED_BY',
|
|
49
|
-
CREATED_BY: 'CREATED_BY',
|
|
50
|
-
CREATED_AT: 'CREATED_AT',
|
|
51
|
-
FILE_TYPE: 'FILE_TYPE',
|
|
52
|
-
} as const;
|
|
53
|
-
|
|
54
|
-
export enum FileMetaType {
|
|
55
|
-
'USER_DOCUMENT' = 'USER_DOCUMENT',
|
|
56
|
-
'DOCUMENT_TEMPLATE' = 'DOCUMENT_TEMPLATE',
|
|
57
|
-
'TEMPLATE_ASSET' = 'TEMPLATE_ASSET',
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type FileStorageDataRow = {
|
|
61
|
-
[FileStorageFields.FILE_STORAGE_ID]: string;
|
|
62
|
-
[FileStorageFields.STORAGE_MANAGER]: string;
|
|
63
|
-
[FileStorageFields.FILE_NAME]: string;
|
|
64
|
-
[FileStorageFields.FILE_SIZE]: number;
|
|
65
|
-
[FileStorageFields.MODIFIED_AT]: number;
|
|
66
|
-
[FileStorageFields.MODIFIED_BY]: string;
|
|
67
|
-
[FileStorageFields.CREATED_BY]: string;
|
|
68
|
-
[FileStorageFields.CREATED_AT]: number;
|
|
69
|
-
[FileStorageFields.FILE_TYPE]: FileMetaType;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export type Result<L, R> = { k: 'ok'; info?: L } | { k: 'err'; info?: R };
|
package/src/new/types/redux.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { PayloadAction, Action, Reducer, ReducersMapObject } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
3
|
-
export type PayloadStateUpdater<T> = PayloadAction<
|
|
4
|
-
Exclude<
|
|
5
|
-
{
|
|
6
|
-
[K in keyof T]: {
|
|
7
|
-
key: K;
|
|
8
|
-
value: NonNullable<T[K]>;
|
|
9
|
-
};
|
|
10
|
-
}[keyof T],
|
|
11
|
-
undefined
|
|
12
|
-
>
|
|
13
|
-
>;
|
|
14
|
-
|
|
15
|
-
type RemoveFirstParam<T> = T extends (first: any, ...args: infer P) => infer R
|
|
16
|
-
? (...args: P) => R
|
|
17
|
-
: never;
|
|
18
|
-
|
|
19
|
-
export type SelectorWithoutState<T> = {
|
|
20
|
-
[K in keyof T]: T[K] extends (...args: any[]) => any ? RemoveFirstParam<T[K]> : T[K];
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export interface Slice<State = any> {
|
|
24
|
-
name: string;
|
|
25
|
-
reducer: Reducer<State, Action>;
|
|
26
|
-
actions: Record<string, (payload: any) => Action>;
|
|
27
|
-
selectors: Record<string, (...args: any[]) => any>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type SliceArray = Slice[];
|
|
31
|
-
|
|
32
|
-
export type RootStateFromSlices<S extends SliceArray> = {
|
|
33
|
-
[K in S[number]['name']]: Extract<S[number], { name: K }> extends Slice<infer State>
|
|
34
|
-
? State
|
|
35
|
-
: never;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
type FirstParameter<T> = T extends (...args: infer P) => any ? P[0] : never;
|
|
39
|
-
|
|
40
|
-
export type ActionsFromSlices<S extends SliceArray> = {
|
|
41
|
-
[K in S[number]['name']]: {
|
|
42
|
-
[ActionKey in keyof Extract<S[number], { name: K }>['actions']]: (
|
|
43
|
-
payload: FirstParameter<Extract<S[number], { name: K }>['actions'][ActionKey]>,
|
|
44
|
-
) => void;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
type RemoveFirstParameter<T> = T extends (arg1: any, ...rest: infer Rest) => any ? Rest : never;
|
|
49
|
-
|
|
50
|
-
export type SelectorsFromSlices<S extends SliceArray> = {
|
|
51
|
-
[K in S[number]['name']]: {
|
|
52
|
-
[SelectorKey in keyof Extract<S[number], { name: K }>['selectors']]: (
|
|
53
|
-
...payload: RemoveFirstParameter<Extract<S[number], { name: K }>['selectors'][SelectorKey]>
|
|
54
|
-
) => ReturnType<Extract<S[number], { name: K }>['selectors'][SelectorKey]> extends void
|
|
55
|
-
? any
|
|
56
|
-
: ReturnType<Extract<S[number], { name: K }>['selectors'][SelectorKey]>;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type StoreReturn<S extends SliceArray> = {
|
|
61
|
-
store: RootStateFromSlices<S>;
|
|
62
|
-
actions: ActionsFromSlices<S>;
|
|
63
|
-
selectors: SelectorsFromSlices<S>;
|
|
64
|
-
rootReducer: ReducersMapObject<RootStateFromSlices<S>>;
|
|
65
|
-
subscribeKey: (
|
|
66
|
-
checkerFn: (s: RootStateFromSlices<S>) => string,
|
|
67
|
-
callbackFn: (s: RootStateFromSlices<S>) => void,
|
|
68
|
-
) => void;
|
|
69
|
-
dispatch: (action: Action) => void;
|
|
70
|
-
notify: (sliceName: keyof RootStateFromSlices<S>) => void;
|
|
71
|
-
subscribe: (cb: (state: RootStateFromSlices<S>) => void) => () => void;
|
|
72
|
-
getState: () => RootStateFromSlices<S>;
|
|
73
|
-
};
|
package/src/new/types/rights.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export enum Permissions {
|
|
2
|
-
// Allows you to view reports, but not delete, edit, or create them. You are allowed to look at the configs themselves
|
|
3
|
-
ReportConfigurationView = 'ReportConfigurationView',
|
|
4
|
-
|
|
5
|
-
// Allows you to create and edit report configs.
|
|
6
|
-
ReportConfigurationUpdate = 'ReportConfigurationUpdate',
|
|
7
|
-
|
|
8
|
-
// Allows you to delete report configs.
|
|
9
|
-
ReportConfigurationDelete = 'ReportConfigurationDelete',
|
|
10
|
-
|
|
11
|
-
// View report destinations, but not delete, edit, or create them. If the user has EditReportConfigs but not ViewReportDestinations then they can't select them when configuring a report
|
|
12
|
-
ReportDestinationView = 'ReportDestinationView',
|
|
13
|
-
|
|
14
|
-
// Allows you to create and edit report destinations
|
|
15
|
-
ReportDestinationUpdate = 'ReportDestinationUpdate',
|
|
16
|
-
|
|
17
|
-
// Allows you to delete report destinations
|
|
18
|
-
ReportDestinationDelete = 'ReportDestinationDelete',
|
|
19
|
-
|
|
20
|
-
// Allows you to execute an existing report config, and view generated reports (even if ViewReport isn't set)
|
|
21
|
-
ReportRun = 'ReportRun',
|
|
22
|
-
|
|
23
|
-
// Allows you to view generated reports
|
|
24
|
-
ReportView = 'ReportView',
|
|
25
|
-
|
|
26
|
-
// Allows you to delete generated reports
|
|
27
|
-
ReportDelete = 'ReportDelete',
|
|
28
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { assert, suite } from '@genesislcap/foundation-testing';
|
|
2
|
-
import { generateUniqueAlias } from './alias-generator';
|
|
3
|
-
|
|
4
|
-
const GenerateUniqueAlias = suite('generateUniqueAlias');
|
|
5
|
-
|
|
6
|
-
GenerateUniqueAlias('returns the base alias if it does not exist', () => {
|
|
7
|
-
const existingAliases = new Set(['other']);
|
|
8
|
-
const alias = generateUniqueAlias('test', existingAliases);
|
|
9
|
-
assert.equal(alias, 'test');
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
GenerateUniqueAlias('increments the alias if it already exists', () => {
|
|
13
|
-
const existingAliases = new Set(['test']);
|
|
14
|
-
const alias = generateUniqueAlias('test', existingAliases);
|
|
15
|
-
assert.equal(alias, 'test_1');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
GenerateUniqueAlias('increments the alias until it is unique', () => {
|
|
19
|
-
const existingAliases = new Set(['test', 'test_1']);
|
|
20
|
-
const alias = generateUniqueAlias('test', existingAliases);
|
|
21
|
-
assert.equal(alias, 'test_2');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
GenerateUniqueAlias('handles case-insensitivity when checking for existing aliases', () => {
|
|
25
|
-
const existingAliases = new Set(['Test']);
|
|
26
|
-
const alias = generateUniqueAlias('test', existingAliases);
|
|
27
|
-
assert.equal(alias, 'test_1');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
GenerateUniqueAlias('handles case-insensitivity for new alias generation', () => {
|
|
31
|
-
const existingAliases = new Set(['test']);
|
|
32
|
-
const alias = generateUniqueAlias('Test', existingAliases);
|
|
33
|
-
// Since input baseAlias is 'Test', it tries 'Test'. 'Test' matches 'test' case-insensitively.
|
|
34
|
-
// Next attempt 'Test_1'.
|
|
35
|
-
assert.equal(alias, 'Test_1');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
GenerateUniqueAlias('handles mixed case existing aliases', () => {
|
|
39
|
-
const existingAliases = new Set(['TeSt', 'tEsT_1']);
|
|
40
|
-
const alias = generateUniqueAlias('test', existingAliases);
|
|
41
|
-
assert.equal(alias, 'test_2');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
GenerateUniqueAlias.run();
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a unique alias by appending a counter if the base alias already exists in the set.
|
|
3
|
-
* @param baseAlias The desired alias name (usually the resource name).
|
|
4
|
-
* @param existingAliases A Set of currently used aliases to check against.
|
|
5
|
-
* @returns A unique alias string.
|
|
6
|
-
*/
|
|
7
|
-
export function generateUniqueAlias(baseAlias: string, existingAliases: Set<string>): string {
|
|
8
|
-
const existingAliasesLower = new Set(
|
|
9
|
-
Array.from(existingAliases).map((alias) => alias.toLowerCase()),
|
|
10
|
-
);
|
|
11
|
-
let uniqueAlias = baseAlias;
|
|
12
|
-
let counter = 1;
|
|
13
|
-
while (existingAliasesLower.has(uniqueAlias.toLowerCase())) {
|
|
14
|
-
uniqueAlias = `${baseAlias}_${counter}`;
|
|
15
|
-
counter += 1;
|
|
16
|
-
}
|
|
17
|
-
return uniqueAlias;
|
|
18
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const getFilterParams = () => {
|
|
2
|
-
return {
|
|
3
|
-
comparator: (filterDate: Date, cellValue: number) => {
|
|
4
|
-
if (!cellValue) return -1;
|
|
5
|
-
|
|
6
|
-
const cellValueTime = new Date(cellValue).setHours(0, 0, 0, 0);
|
|
7
|
-
const filterValueTime = filterDate.getTime();
|
|
8
|
-
|
|
9
|
-
if (cellValueTime === filterValueTime) {
|
|
10
|
-
return 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (cellValueTime < filterValueTime) {
|
|
14
|
-
return -1;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (cellValueTime > filterValueTime) {
|
|
18
|
-
return 1;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
buttons: ['reset', 'apply'],
|
|
22
|
-
closeOnApply: true,
|
|
23
|
-
closeOnClear: true,
|
|
24
|
-
suppressAndOrCondition: true,
|
|
25
|
-
browserDatePicker: true,
|
|
26
|
-
filterOptions: ['equals', 'lessThan', 'greaterThan'],
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
-
import { assert, sinon, suite } from '@genesislcap/foundation-testing';
|
|
3
|
-
import { getDatasourceSchema, getEndpointUrl } from './endpoint';
|
|
4
|
-
|
|
5
|
-
const GetDatasourceSchema = suite('getDatasourceSchema');
|
|
6
|
-
|
|
7
|
-
GetDatasourceSchema.before.each(() => {
|
|
8
|
-
sinon.restore();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
GetDatasourceSchema('returns schema items when response is valid', async () => {
|
|
12
|
-
const mockConnect = {
|
|
13
|
-
getJSONSchema: sinon.stub(),
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const mockResponse = {
|
|
17
|
-
OUTBOUND: {
|
|
18
|
-
properties: {
|
|
19
|
-
REPLY: {
|
|
20
|
-
items: {
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
mockConnect.getJSONSchema.resolves(mockResponse);
|
|
30
|
-
const getSchema = getDatasourceSchema(mockConnect as unknown as Connect);
|
|
31
|
-
const result = await getSchema('TEST_RESOURCE');
|
|
32
|
-
|
|
33
|
-
assert.equal(result, mockResponse.OUTBOUND.properties.REPLY.items);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
GetDatasourceSchema('surfaces server error response instead of a shape error', async () => {
|
|
37
|
-
const mockConnect = {
|
|
38
|
-
getJSONSchema: sinon.stub(),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const mockResponse = {
|
|
42
|
-
MESSAGE_TYPE: 'JSON_SCHEMA_NACK',
|
|
43
|
-
ERROR: [
|
|
44
|
-
{
|
|
45
|
-
'@type': 'StandardError',
|
|
46
|
-
CODE: 'FEATURE_NOT_FOUND',
|
|
47
|
-
STATUS_CODE: '404 Not Found',
|
|
48
|
-
TEXT: 'Feature not found',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
mockConnect.getJSONSchema.resolves(mockResponse);
|
|
54
|
-
const getSchema = getDatasourceSchema(mockConnect as unknown as Connect);
|
|
55
|
-
|
|
56
|
-
try {
|
|
57
|
-
await getSchema('Allocations');
|
|
58
|
-
assert.unreachable('Expected function to throw');
|
|
59
|
-
} catch (error) {
|
|
60
|
-
assert.equal(
|
|
61
|
-
error.message,
|
|
62
|
-
'Failed to fetch JSON schema for Allocations: 404 Not Found - FEATURE_NOT_FOUND - Feature not found',
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
GetDatasourceSchema('throws error when items is missing', async () => {
|
|
68
|
-
const mockConnect = {
|
|
69
|
-
getJSONSchema: sinon.stub(),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const mockResponse = {
|
|
73
|
-
OUTBOUND: {
|
|
74
|
-
properties: {
|
|
75
|
-
REPLY: {
|
|
76
|
-
type: 'object',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
mockConnect.getJSONSchema.resolves(mockResponse);
|
|
83
|
-
const getSchema = getDatasourceSchema(mockConnect as unknown as Connect);
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
await getSchema('TEST_RESOURCE');
|
|
87
|
-
assert.unreachable('Expected function to throw');
|
|
88
|
-
} catch (error) {
|
|
89
|
-
assert.equal(error.message, 'Invalid response shape for TEST_RESOURCE');
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
GetDatasourceSchema('throws error when REPLY is not an object', async () => {
|
|
94
|
-
const mockConnect = {
|
|
95
|
-
getJSONSchema: sinon.stub(),
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const mockResponse = {
|
|
99
|
-
OUTBOUND: {
|
|
100
|
-
properties: {
|
|
101
|
-
REPLY: 'not an object',
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
mockConnect.getJSONSchema.resolves(mockResponse);
|
|
107
|
-
const getSchema = getDatasourceSchema(mockConnect as unknown as Connect);
|
|
108
|
-
|
|
109
|
-
try {
|
|
110
|
-
await getSchema('TEST_RESOURCE');
|
|
111
|
-
assert.unreachable('Expected function to throw');
|
|
112
|
-
} catch (error) {
|
|
113
|
-
assert.equal(error.message, 'Invalid response shape for TEST_RESOURCE');
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
GetDatasourceSchema('throws error when items is an array', async () => {
|
|
118
|
-
const mockConnect = {
|
|
119
|
-
getJSONSchema: sinon.stub(),
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const mockResponse = {
|
|
123
|
-
OUTBOUND: {
|
|
124
|
-
properties: {
|
|
125
|
-
REPLY: {
|
|
126
|
-
items: [],
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
mockConnect.getJSONSchema.resolves(mockResponse);
|
|
133
|
-
const getSchema = getDatasourceSchema(mockConnect as unknown as Connect);
|
|
134
|
-
|
|
135
|
-
try {
|
|
136
|
-
await getSchema('TEST_RESOURCE');
|
|
137
|
-
assert.unreachable('Expected function to throw');
|
|
138
|
-
} catch (error) {
|
|
139
|
-
assert.equal(error.message, 'Items is an array');
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
GetDatasourceSchema.run();
|
|
144
|
-
|
|
145
|
-
const GetEndpointUrl = suite('getEndpointUrl');
|
|
146
|
-
|
|
147
|
-
GetEndpointUrl.before.each(() => {
|
|
148
|
-
sinon.restore();
|
|
149
|
-
// Clear sessionStorage before each test
|
|
150
|
-
sessionStorage.clear();
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
GetEndpointUrl('returns correct http URL for localhost', () => {
|
|
154
|
-
const endpoint = 'api/data';
|
|
155
|
-
const urlRoot = 'http://localhost:3000';
|
|
156
|
-
const result = getEndpointUrl(endpoint, urlRoot);
|
|
157
|
-
assert.equal(result, 'http://localhost:3000/api/data');
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
GetEndpointUrl('returns correct https URL for non-localhost', () => {
|
|
161
|
-
const endpoint = 'api/data';
|
|
162
|
-
const urlRoot = 'https://example.com';
|
|
163
|
-
const result = getEndpointUrl(endpoint, urlRoot);
|
|
164
|
-
assert.equal(result, 'https://example.com/api/data');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
GetEndpointUrl('handles urlRoot with trailing slash correctly', () => {
|
|
168
|
-
const endpoint = 'api/data';
|
|
169
|
-
const urlRoot = 'https://example.com/';
|
|
170
|
-
const result = getEndpointUrl(endpoint, urlRoot);
|
|
171
|
-
assert.equal(result, 'https://example.com/api/data');
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
GetEndpointUrl('handles urlRoot with path correctly', () => {
|
|
175
|
-
const endpoint = 'api/data';
|
|
176
|
-
const urlRoot = 'https://example.com/base/path';
|
|
177
|
-
const result = getEndpointUrl(endpoint, urlRoot);
|
|
178
|
-
assert.equal(result, 'https://example.com/base/path/api/data');
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
GetEndpointUrl('uses sessionStorage hostUrl when urlRoot is not provided', () => {
|
|
182
|
-
sessionStorage.setItem('hostUrl', 'https://example.com/base');
|
|
183
|
-
const endpoint = 'api/data';
|
|
184
|
-
const result = getEndpointUrl(endpoint);
|
|
185
|
-
assert.equal(result, 'https://example.com/base/api/data');
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
GetEndpointUrl('throws error when no valid URL is provided', () => {
|
|
189
|
-
const endpoint = 'api/data';
|
|
190
|
-
assert.throws(() => getEndpointUrl(endpoint), 'Invalid URL');
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
GetEndpointUrl.run();
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Connect, Message, Session } from '@genesislcap/foundation-comms';
|
|
2
|
-
import { DI } from '@genesislcap/web-core';
|
|
3
|
-
import { Genesis } from '../types';
|
|
4
|
-
|
|
5
|
-
export const tryReadFromSession = (key: string) => {
|
|
6
|
-
const container = DI.getOrCreateDOMContainer();
|
|
7
|
-
const session = container.get(Session);
|
|
8
|
-
// session.getSessionStorageItem accounts for namespaced storage
|
|
9
|
-
return session.getSessionStorageItem(key) || sessionStorage.getItem(key) || '';
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const getEndpointUrl = (
|
|
13
|
-
endpoint: string,
|
|
14
|
-
urlRoot: string = tryReadFromSession('hostUrl'),
|
|
15
|
-
): string => {
|
|
16
|
-
const url = new URL(urlRoot);
|
|
17
|
-
const path =
|
|
18
|
-
url.pathname && url.pathname[url.pathname.length - 1] == '/'
|
|
19
|
-
? url.pathname
|
|
20
|
-
: `${url.pathname}/`;
|
|
21
|
-
if (urlRoot.includes('localhost')) {
|
|
22
|
-
return `http://${url.host}${path}${endpoint}`;
|
|
23
|
-
} else {
|
|
24
|
-
return `https://${url.host}${path}${endpoint}`;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const getDatasourceSchema = (connect: Connect) => async (resourceName: string) => {
|
|
29
|
-
const result = await connect.getJSONSchema(resourceName);
|
|
30
|
-
// A server-side failure (e.g. JSON_SCHEMA_NACK) comes back as an error message rather
|
|
31
|
-
// than a schema. Surface that error directly instead of masking it as a shape problem.
|
|
32
|
-
const errors = (result as unknown as Message)?.ERROR;
|
|
33
|
-
if (Array.isArray(errors) && errors.length) {
|
|
34
|
-
throw new Error(
|
|
35
|
-
`Failed to fetch JSON schema for ${resourceName}: ${errors
|
|
36
|
-
.map((error) => [error?.STATUS_CODE, error?.CODE, error?.TEXT].filter(Boolean).join(' - '))
|
|
37
|
-
.join('; ')}`,
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
if (
|
|
41
|
-
typeof result.OUTBOUND?.properties?.['REPLY'] !== 'object' ||
|
|
42
|
-
!result.OUTBOUND?.properties?.['REPLY'].items ||
|
|
43
|
-
typeof result.OUTBOUND?.properties?.['REPLY'].items === 'boolean'
|
|
44
|
-
)
|
|
45
|
-
throw new Error(`Invalid response shape for ${resourceName}`);
|
|
46
|
-
// TODO: Karim checking this
|
|
47
|
-
if (Array.isArray(result.OUTBOUND?.properties?.['REPLY']?.items))
|
|
48
|
-
throw new Error(`Items is an array`);
|
|
49
|
-
if (
|
|
50
|
-
Object.values(result.OUTBOUND?.properties?.['REPLY']?.items?.properties ?? {}).some(
|
|
51
|
-
(p) => typeof p === 'boolean',
|
|
52
|
-
)
|
|
53
|
-
)
|
|
54
|
-
throw new Error(`Properties contain invalid values`);
|
|
55
|
-
if (
|
|
56
|
-
Object.values(
|
|
57
|
-
(<Genesis.JSONSchema7>result.OUTBOUND?.properties?.['REPLY']?.items)?.properties ?? {},
|
|
58
|
-
).some((p) => !p.genesisType)
|
|
59
|
-
)
|
|
60
|
-
throw new Error(`Schema properties don't contain 'genesisType' field`);
|
|
61
|
-
return result.OUTBOUND?.properties?.['REPLY']?.items as Genesis.JSONSchema7;
|
|
62
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export enum ReportingEvents {
|
|
2
|
-
highlightGridRow = 'highlight-grid-row',
|
|
3
|
-
setReportConfigDisplayMode = 'set-report-config-disp-mode',
|
|
4
|
-
refreshColumnFormatGrid = 'refresh-column-format-grid',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type ReportingEventDetailMap = {
|
|
8
|
-
[ReportingEvents.highlightGridRow]: string;
|
|
9
|
-
[ReportingEvents.setReportConfigDisplayMode]: 'list' | 'edit';
|
|
10
|
-
[ReportingEvents.refreshColumnFormatGrid]: void;
|
|
11
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Genesis } from '../types';
|
|
2
|
-
|
|
3
|
-
export const getDefaultFormat = (type: Genesis.GenesisFieldTypes) => {
|
|
4
|
-
if (isNumericFieldType(type)) {
|
|
5
|
-
if (type === 'BIGDECIMAL' || type === 'DOUBLE') {
|
|
6
|
-
return '#.##';
|
|
7
|
-
}
|
|
8
|
-
return '#';
|
|
9
|
-
} else if (type === 'DATE') {
|
|
10
|
-
return 'dd/MM/yyyy';
|
|
11
|
-
} else if (type === 'DATETIME') {
|
|
12
|
-
return 'dd/MM/yyyy HH:mm:ss';
|
|
13
|
-
}
|
|
14
|
-
return '';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// Helper function to check if a field type is numeric
|
|
18
|
-
const isNumericFieldType = (
|
|
19
|
-
fieldType: string,
|
|
20
|
-
): fieldType is 'DOUBLE' | 'BIGDECIMAL' | 'INT' | 'SHORT' | 'LONG' => {
|
|
21
|
-
return ['DOUBLE', 'BIGDECIMAL', 'INT', 'SHORT', 'LONG'].includes(fieldType);
|
|
22
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DateStandardFormats,
|
|
3
|
-
DateTimeFormats,
|
|
4
|
-
DateYearFormats,
|
|
5
|
-
} from '../main/edit-config/data-transforms-derived-fields/data-transforms.types';
|
|
6
|
-
|
|
7
|
-
export const formatDate = (timestamp) => {
|
|
8
|
-
if (!timestamp) {
|
|
9
|
-
return ''; // to show blank cell in case date is not provided, otherwise defaults to timestamp
|
|
10
|
-
}
|
|
11
|
-
const date = new Date(timestamp);
|
|
12
|
-
return new Intl.DateTimeFormat('en-GB', {
|
|
13
|
-
day: '2-digit',
|
|
14
|
-
month: 'short',
|
|
15
|
-
year: 'numeric',
|
|
16
|
-
}).format(date);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const getFormattedDateTime = (timestamp) => {
|
|
20
|
-
const dateTime = new Date(timestamp);
|
|
21
|
-
return `${formatDate(timestamp)} ${dateTime.toLocaleTimeString()}`;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const getDateFormatOptions = (gridFormat): Intl.DateTimeFormatOptions => ({
|
|
25
|
-
year: gridFormat.year === DateYearFormats.Full ? DateStandardFormats.Numeric : gridFormat.year,
|
|
26
|
-
month: gridFormat.month,
|
|
27
|
-
day: gridFormat.day,
|
|
28
|
-
timeZone: 'UTC',
|
|
29
|
-
...(gridFormat.hour && gridFormat.hour !== DateTimeFormats.Hide ? { hour: gridFormat.hour } : {}),
|
|
30
|
-
...(gridFormat.minute && gridFormat.minute !== DateTimeFormats.Hide
|
|
31
|
-
? { minute: gridFormat.minute }
|
|
32
|
-
: {}),
|
|
33
|
-
...(gridFormat.second && gridFormat.second !== DateTimeFormats.Hide
|
|
34
|
-
? { second: gridFormat.second }
|
|
35
|
-
: {}),
|
|
36
|
-
});
|
package/src/new/utils/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './alias-generator';
|
|
2
|
-
export * from './endpoint';
|
|
3
|
-
export * from './formatters';
|
|
4
|
-
export * from './notifications';
|
|
5
|
-
export * from './renderer';
|
|
6
|
-
export * from './rights';
|
|
7
|
-
export * from './sorter';
|
|
8
|
-
export * from './tooltip';
|
|
9
|
-
export * from './transformers';
|
|
10
|
-
export * from './validators';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getNotificationContainer,
|
|
3
|
-
ToastStructure,
|
|
4
|
-
showNotificationToast as toast,
|
|
5
|
-
} from '@genesislcap/foundation-notifications';
|
|
6
|
-
|
|
7
|
-
const container = getNotificationContainer('notify-container', 'rapid');
|
|
8
|
-
|
|
9
|
-
export const showNotificationToast = (config: ToastStructure) => toast(config, 'rapid', container);
|