@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.
Files changed (247) hide show
  1. package/dist/custom-elements.json +4247 -5382
  2. package/dist/dts/react.d.ts +44 -44
  3. package/dist/react.cjs +65 -65
  4. package/dist/react.mjs +57 -57
  5. package/package.json +22 -23
  6. package/.env +0 -3
  7. package/api-extractor.json +0 -4
  8. package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.test.d.ts +0 -2
  9. package/dist/dts/new/main/edit-config/col-filters/col-filters-grid.helpers.test.d.ts.map +0 -1
  10. package/dist/dts/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.d.ts +0 -2
  11. package/dist/dts/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.d.ts.map +0 -1
  12. package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.d.ts +0 -2
  13. package/dist/dts/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.d.ts.map +0 -1
  14. package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.d.ts +0 -2
  15. package/dist/dts/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.d.ts.map +0 -1
  16. package/dist/dts/new/main/edit-config/row-filters/row-filters.helpers.test.d.ts +0 -2
  17. package/dist/dts/new/main/edit-config/row-filters/row-filters.helpers.test.d.ts.map +0 -1
  18. package/dist/dts/new/main/edit-config/shared/datasource-data-base-component.test.d.ts +0 -5
  19. package/dist/dts/new/main/edit-config/shared/datasource-data-base-component.test.d.ts.map +0 -1
  20. package/dist/dts/new/utils/alias-generator.test.d.ts +0 -2
  21. package/dist/dts/new/utils/alias-generator.test.d.ts.map +0 -1
  22. package/dist/dts/new/utils/endpoint.test.d.ts +0 -2
  23. package/dist/dts/new/utils/endpoint.test.d.ts.map +0 -1
  24. package/dist/dts/new/utils/transformers.test.d.ts +0 -2
  25. package/dist/dts/new/utils/transformers.test.d.ts.map +0 -1
  26. package/dist/dts/new/utils/validators.test.d.ts +0 -2
  27. package/dist/dts/new/utils/validators.test.d.ts.map +0 -1
  28. package/dist/dts/old/main/main.test.d.ts +0 -2
  29. package/dist/dts/old/main/main.test.d.ts.map +0 -1
  30. package/dist/dts/old/utils/filterObjectArray.test.d.ts +0 -2
  31. package/dist/dts/old/utils/filterObjectArray.test.d.ts.map +0 -1
  32. package/dist/esm/new/main/edit-config/col-filters/col-filters-grid.helpers.test.js +0 -200
  33. package/dist/esm/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.js +0 -152
  34. package/dist/esm/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.js +0 -629
  35. package/dist/esm/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.js +0 -268
  36. package/dist/esm/new/main/edit-config/row-filters/row-filters.helpers.test.js +0 -1
  37. package/dist/esm/new/main/edit-config/shared/datasource-data-base-component.test.js +0 -426
  38. package/dist/esm/new/utils/alias-generator.test.js +0 -36
  39. package/dist/esm/new/utils/endpoint.test.js +0 -162
  40. package/dist/esm/new/utils/transformers.test.js +0 -469
  41. package/dist/esm/new/utils/validators.test.js +0 -139
  42. package/dist/esm/old/main/main.test.js +0 -5
  43. package/dist/esm/old/utils/filterObjectArray.test.js +0 -46
  44. package/dist/tsconfig.tsbuildinfo +0 -1
  45. package/src/globals.d.ts +0 -7
  46. package/src/index.federated.ts +0 -1
  47. package/src/index.ts +0 -8
  48. package/src/new/components/clone-report-config-modal/clone-report-config-modal.styles.ts +0 -47
  49. package/src/new/components/clone-report-config-modal/clone-report-config-modal.template.ts +0 -55
  50. package/src/new/components/clone-report-config-modal/clone-report-config-modal.ts +0 -173
  51. package/src/new/components/components.ts +0 -118
  52. package/src/new/components/renderers/data-transform-renderer.ts +0 -111
  53. package/src/new/components/reporting-configurations/reporting-configurations.styles.ts +0 -42
  54. package/src/new/components/reporting-configurations/reporting-configurations.template.ts +0 -59
  55. package/src/new/components/reporting-configurations/reporting-configurations.ts +0 -366
  56. package/src/new/components/shared/file-template-picker.template.ts +0 -45
  57. package/src/new/lib/redux-store/README.md +0 -55
  58. package/src/new/lib/redux-store/index.ts +0 -2
  59. package/src/new/lib/redux-store/state-utils.ts +0 -1
  60. package/src/new/lib/redux-store/store.ts +0 -135
  61. package/src/new/main/edit-config/base-config/base-config.styles.ts +0 -26
  62. package/src/new/main/edit-config/base-config/base-config.template.ts +0 -71
  63. package/src/new/main/edit-config/base-config/base-config.ts +0 -116
  64. package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.test.ts +0 -232
  65. package/src/new/main/edit-config/col-filters/col-filters-grid.helpers.ts +0 -35
  66. package/src/new/main/edit-config/col-filters/col-filters-grid.styles.ts +0 -22
  67. package/src/new/main/edit-config/col-filters/col-filters-grid.ts +0 -150
  68. package/src/new/main/edit-config/col-filters/col-filters-grid.types.ts +0 -7
  69. package/src/new/main/edit-config/col-filters/col-filters-tutorial.ts +0 -25
  70. package/src/new/main/edit-config/col-filters/col-fitlers-grid.template.ts +0 -15
  71. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.test.ts +0 -187
  72. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.helpers.ts +0 -89
  73. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.styles.ts +0 -22
  74. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.template.ts +0 -14
  75. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.ts +0 -119
  76. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-grid.types.ts +0 -10
  77. package/src/new/main/edit-config/col-rename-alias/col-rename-alias-tutorial.ts +0 -33
  78. package/src/new/main/edit-config/config-journey-orchestrator.styles.ts +0 -120
  79. package/src/new/main/edit-config/config-journey-orchestrator.template.ts +0 -149
  80. package/src/new/main/edit-config/config-journey-orchestrator.ts +0 -92
  81. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms-tutorial.ts +0 -127
  82. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.test.ts +0 -799
  83. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.helpers.ts +0 -371
  84. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.styles.ts +0 -22
  85. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.template.ts +0 -21
  86. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.ts +0 -162
  87. package/src/new/main/edit-config/data-transforms-derived-fields/data-transforms.types.ts +0 -211
  88. package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.styles.ts +0 -79
  89. package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.template.ts +0 -217
  90. package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/date-format-modal.ts +0 -280
  91. package/src/new/main/edit-config/data-transforms-derived-fields/date-format-modal/index.ts +0 -1
  92. package/src/new/main/edit-config/data-transforms-derived-fields/format-warning.ts +0 -43
  93. package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/index.ts +0 -1
  94. package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.styles.ts +0 -68
  95. package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.template.ts +0 -93
  96. package/src/new/main/edit-config/data-transforms-derived-fields/number-format-modal/number-format-modal.ts +0 -152
  97. package/src/new/main/edit-config/datasource-config/datasource-config-container.styles.ts +0 -22
  98. package/src/new/main/edit-config/datasource-config/datasource-config-item.styles.ts +0 -76
  99. package/src/new/main/edit-config/datasource-config/datasource-config-item.template.ts +0 -141
  100. package/src/new/main/edit-config/datasource-config/datasource-config-item.ts +0 -212
  101. package/src/new/main/edit-config/datasource-config/datasources-config-container.helpers.test.ts +0 -341
  102. package/src/new/main/edit-config/datasource-config/datasources-config-container.helpers.ts +0 -99
  103. package/src/new/main/edit-config/datasource-config/datasources-config-container.template.ts +0 -68
  104. package/src/new/main/edit-config/datasource-config/datasources-config-container.ts +0 -55
  105. package/src/new/main/edit-config/datasource-config/types.ts +0 -6
  106. package/src/new/main/edit-config/outputs-config/outputs-config.style.ts +0 -11
  107. package/src/new/main/edit-config/outputs-config/outputs-config.template.ts +0 -66
  108. package/src/new/main/edit-config/outputs-config/outputs-config.ts +0 -66
  109. package/src/new/main/edit-config/row-filters/row-filters-tutorial.styles.ts +0 -16
  110. package/src/new/main/edit-config/row-filters/row-filters-tutorial.template.ts +0 -229
  111. package/src/new/main/edit-config/row-filters/row-filters-tutorial.ts +0 -15
  112. package/src/new/main/edit-config/row-filters/row-filters.helpers.test.ts +0 -2
  113. package/src/new/main/edit-config/row-filters/row-filters.helpers.ts +0 -53
  114. package/src/new/main/edit-config/row-filters/row-filters.styles.ts +0 -23
  115. package/src/new/main/edit-config/row-filters/row-filters.template.ts +0 -15
  116. package/src/new/main/edit-config/row-filters/row-filters.ts +0 -58
  117. package/src/new/main/edit-config/row-filters/row-filters.types.ts +0 -14
  118. package/src/new/main/edit-config/scheduling/scheduling.styles.ts +0 -59
  119. package/src/new/main/edit-config/scheduling/scheduling.template.ts +0 -80
  120. package/src/new/main/edit-config/scheduling/scheduling.ts +0 -101
  121. package/src/new/main/edit-config/shared/datasource-data-base-component.helpers.ts.ts +0 -250
  122. package/src/new/main/edit-config/shared/datasource-data-base-component.test.ts +0 -568
  123. package/src/new/main/edit-config/shared/datasource-data-base-component.ts +0 -65
  124. package/src/new/main/edit-config/shared/datasource-data-base-component.types.ts +0 -55
  125. package/src/new/main/edit-config/shared/index.ts +0 -3
  126. package/src/new/main/edit-config/tabbed-datasource-container/index.ts +0 -2
  127. package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.styles.ts +0 -12
  128. package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.template.ts +0 -29
  129. package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.ts +0 -69
  130. package/src/new/main/edit-config/tabbed-datasource-container/tabbed-datasource-container.types.ts +0 -7
  131. package/src/new/main/generated-reports/generated-reports.styles.ts +0 -15
  132. package/src/new/main/generated-reports/generated-reports.template.ts +0 -29
  133. package/src/new/main/generated-reports/generated-reports.ts +0 -270
  134. package/src/new/main/index.ts +0 -3
  135. package/src/new/main/main.styles.ts +0 -31
  136. package/src/new/main/main.template.ts +0 -92
  137. package/src/new/main/main.ts +0 -117
  138. package/src/new/main/report-destinations/report-destinations.template.ts +0 -39
  139. package/src/new/main/report-destinations/report-destinations.ts +0 -63
  140. package/src/new/store/index.ts +0 -3
  141. package/src/new/store/slices/base-config.ts +0 -50
  142. package/src/new/store/slices/datasources-config.ts +0 -297
  143. package/src/new/store/slices/index.ts +0 -3
  144. package/src/new/store/slices/types.ts +0 -90
  145. package/src/new/store/store.ts +0 -36
  146. package/src/new/store/types.ts +0 -10
  147. package/src/new/styles/constraints.styles.ts +0 -32
  148. package/src/new/styles/forms.styles.ts +0 -38
  149. package/src/new/styles/index.ts +0 -3
  150. package/src/new/styles/misc.styles.ts +0 -25
  151. package/src/new/types/display.ts +0 -4
  152. package/src/new/types/index.ts +0 -4
  153. package/src/new/types/misc.ts +0 -73
  154. package/src/new/types/redux.ts +0 -73
  155. package/src/new/types/rights.ts +0 -28
  156. package/src/new/utils/alias-generator.test.ts +0 -44
  157. package/src/new/utils/alias-generator.ts +0 -18
  158. package/src/new/utils/date-filter-params.ts +0 -28
  159. package/src/new/utils/endpoint.test.ts +0 -193
  160. package/src/new/utils/endpoint.ts +0 -62
  161. package/src/new/utils/event-map.ts +0 -11
  162. package/src/new/utils/format-utils.ts +0 -22
  163. package/src/new/utils/formatters.ts +0 -36
  164. package/src/new/utils/index.ts +0 -10
  165. package/src/new/utils/notifications.ts +0 -9
  166. package/src/new/utils/renderer.ts +0 -38
  167. package/src/new/utils/rights.ts +0 -66
  168. package/src/new/utils/sorter.ts +0 -19
  169. package/src/new/utils/tooltip.ts +0 -94
  170. package/src/new/utils/transformers.test.ts +0 -549
  171. package/src/new/utils/transformers.ts +0 -174
  172. package/src/new/utils/validators.test.ts +0 -165
  173. package/src/new/utils/validators.ts +0 -81
  174. package/src/old/assets/images/index.ts +0 -69
  175. package/src/old/components/create-edit/create-edit.styles.ts +0 -16
  176. package/src/old/components/create-edit/create-edit.template.ts +0 -15
  177. package/src/old/components/create-edit/create-edit.ts +0 -70
  178. package/src/old/components/create-edit/index.ts +0 -3
  179. package/src/old/components/list/columns.ts +0 -175
  180. package/src/old/components/list/index.ts +0 -3
  181. package/src/old/components/list/list.styles.ts +0 -9
  182. package/src/old/components/list/list.template.ts +0 -40
  183. package/src/old/components/list/list.ts +0 -109
  184. package/src/old/components/preview/columns.ts +0 -58
  185. package/src/old/components/preview/index.ts +0 -3
  186. package/src/old/components/preview/preview.styles.ts +0 -22
  187. package/src/old/components/preview/preview.template.ts +0 -33
  188. package/src/old/components/preview/preview.ts +0 -143
  189. package/src/old/components/rapid-components.ts +0 -64
  190. package/src/old/components/renderers/custom-header-component.ts +0 -92
  191. package/src/old/components/renderers/filter-value-renderer.ts +0 -237
  192. package/src/old/components/renderers/row-select.renderer.ts +0 -148
  193. package/src/old/components/select-fields/columns.ts +0 -83
  194. package/src/old/components/select-fields/data.ts +0 -218
  195. package/src/old/components/select-fields/index.ts +0 -3
  196. package/src/old/components/select-fields/select-fields.styles.ts +0 -22
  197. package/src/old/components/select-fields/select-fields.template.ts +0 -58
  198. package/src/old/components/select-fields/select-fields.ts +0 -218
  199. package/src/old/components/select-filters/columns.ts +0 -78
  200. package/src/old/components/select-filters/index.ts +0 -3
  201. package/src/old/components/select-filters/select-filters.styles.ts +0 -21
  202. package/src/old/components/select-filters/select-filters.template.ts +0 -58
  203. package/src/old/components/select-filters/select-filters.ts +0 -255
  204. package/src/old/components/wizard/debug.ts +0 -35
  205. package/src/old/components/wizard/index.ts +0 -2
  206. package/src/old/components/wizard/steps/filters.ts +0 -13
  207. package/src/old/components/wizard/steps/index.ts +0 -4
  208. package/src/old/components/wizard/steps/name.ts +0 -72
  209. package/src/old/components/wizard/steps/run.ts +0 -14
  210. package/src/old/components/wizard/steps/select.ts +0 -14
  211. package/src/old/components/wizard/wizard.styles.ts +0 -198
  212. package/src/old/components/wizard/wizard.template.ts +0 -147
  213. package/src/old/components/wizard/wizard.ts +0 -398
  214. package/src/old/components/wizard/wizard.types.ts +0 -43
  215. package/src/old/components/zero-components.ts +0 -61
  216. package/src/old/config/config.ts +0 -59
  217. package/src/old/config/configure.ts +0 -66
  218. package/src/old/config/index.ts +0 -2
  219. package/src/old/config/templates.ts +0 -59
  220. package/src/old/constants/grid-config.ts +0 -19
  221. package/src/old/layouts/default.ts +0 -30
  222. package/src/old/layouts/index.ts +0 -2
  223. package/src/old/layouts/two-pane-horizontal.ts +0 -81
  224. package/src/old/main/index.ts +0 -3
  225. package/src/old/main/main.styles.ts +0 -69
  226. package/src/old/main/main.template.ts +0 -127
  227. package/src/old/main/main.test.ts +0 -7
  228. package/src/old/main/main.ts +0 -250
  229. package/src/old/main/types.ts +0 -29
  230. package/src/old/styles/colors.ts +0 -16
  231. package/src/old/styles/helpers.ts +0 -181
  232. package/src/old/styles/index.ts +0 -4
  233. package/src/old/styles/normalize.ts +0 -14
  234. package/src/old/styles/styles.ts +0 -24
  235. package/src/old/tags/index.ts +0 -1
  236. package/src/old/tags/tags.ts +0 -79
  237. package/src/old/tsconfig.json +0 -10
  238. package/src/old/utils/filterObjectArray.test.ts +0 -110
  239. package/src/old/utils/filterObjectArray.ts +0 -23
  240. package/src/old/utils/getFiltersByType.ts +0 -92
  241. package/src/old/utils/getSelectedFields.ts +0 -16
  242. package/src/old/utils/index.ts +0 -4
  243. package/src/old/utils/logger.ts +0 -3
  244. package/src/sandbox.ts +0 -51
  245. package/src/tsconfig.base.json +0 -24
  246. package/src/typings.d.ts +0 -1
  247. package/tsconfig.json +0 -9
@@ -1,174 +0,0 @@
1
- import type { JSONSchema7 } from 'json-schema';
2
- import type { BaseConfig, DatasourceInputTypes, DatasourceName, ReportingConfig } from '../store';
3
- import type { TransformerConfig } from '../store/slices/types';
4
- import { Display, Genesis } from '../types';
5
-
6
- export function transformToServerPayload(state: ReportingConfig): Genesis.ServerReportConfig {
7
- const { datasourceConfig, baseConfig } = state;
8
- const { SCHEDULE, ...restBaseConfig } = baseConfig;
9
- return {
10
- ...restBaseConfig,
11
- AUTO_DISPATCH: true,
12
- SCHEDULES:
13
- baseConfig.SCHEDULE &&
14
- (baseConfig.SCHEDULE?.TIME_ZONE || baseConfig.SCHEDULE?.CRON_EXPRESSION !== '0 0 0 * * ?')
15
- ? [baseConfig.SCHEDULE]
16
- : [],
17
- // TODO: server workaround - currently need to explicitly set to null if unset
18
- DOCUMENT_TEMPLATE_ID: restBaseConfig.DOCUMENT_TEMPLATE_ID
19
- ? restBaseConfig.DOCUMENT_TEMPLATE_ID
20
- : null,
21
- DATA_SOURCES: Object.values(datasourceConfig).map((ds) => {
22
- // For NONE case we just don't send it to the server to be backwards compatible
23
- if (ds.GROUPING_STRATEGY === 'NONE') {
24
- const { GROUPING_STRATEGY, GROUP_KEY, ...rest } = ds;
25
- return rest;
26
- }
27
- return ds;
28
- }),
29
- };
30
- }
31
-
32
- /**
33
- * Cleans up orphaned field references from transformer configuration
34
- * by validating against current schema
35
- */
36
- function cleanupTransformerConfig(
37
- config: TransformerConfig,
38
- validFields: Set<string>,
39
- ): TransformerConfig {
40
- return {
41
- INCLUDE_COLUMNS: config.INCLUDE_COLUMNS?.filter((field) => validFields.has(field)),
42
- COLUMN_RENAMES: config.COLUMN_RENAMES
43
- ? Object.fromEntries(
44
- Object.entries(config.COLUMN_RENAMES).filter(([key]) => validFields.has(key)),
45
- )
46
- : undefined,
47
- COLUMN_FORMATS: config.COLUMN_FORMATS
48
- ? Object.fromEntries(
49
- Object.entries(config.COLUMN_FORMATS).filter(([key]) => validFields.has(key)),
50
- )
51
- : undefined,
52
- COLUMN_TRANSFORMS: config.COLUMN_TRANSFORMS
53
- ? Object.fromEntries(
54
- Object.entries(config.COLUMN_TRANSFORMS).filter(([key]) => validFields.has(key)),
55
- )
56
- : undefined,
57
- ROW_FILTERS: config.ROW_FILTERS,
58
- };
59
- }
60
-
61
- // TODO: we'll suppress the bigints on the server so won't need to do this
62
- // horrible destructing
63
- export async function transformFromServerPayload(
64
- payload: Genesis.ServerReportConfig,
65
- getSchema: (name: string) => Promise<JSONSchema7>,
66
- ): Promise<ReportingConfig> {
67
- const {
68
- DATA_SOURCES,
69
- ID,
70
- NAME,
71
- DESCRIPTION,
72
- OUTPUT_FORMAT,
73
- FILE_NAME,
74
- AUTO_DISPATCH,
75
- DESTINATION_IDS,
76
- SCHEDULES,
77
- OUTPUT_DIRECTORY,
78
- DOCUMENT_TEMPLATE_ID,
79
- } = payload;
80
- const baseConfig: BaseConfig = {
81
- ID,
82
- NAME,
83
- DESCRIPTION,
84
- OUTPUT_FORMAT,
85
- FILE_NAME,
86
- AUTO_DISPATCH,
87
- DESTINATION_IDS,
88
- OUTPUT_DIRECTORY,
89
- DOCUMENT_TEMPLATE_ID,
90
- ...(SCHEDULES.length > 0 && { SCHEDULE: SCHEDULES[0] }),
91
- };
92
-
93
- const cleanedDatasources = await Promise.all(
94
- DATA_SOURCES.map(
95
- async ({
96
- KEY,
97
- INPUT_TYPE,
98
- NAME: DS_NAME,
99
- OUTPUT_TYPE,
100
- TRANSFORMER_CONFIGURATION,
101
- ...rest
102
- }) => {
103
- try {
104
- const schema = await getSchema(DS_NAME);
105
- const validFields = new Set(Object.keys(schema.properties || {}));
106
- const { GROUPING_STRATEGY, GROUP_KEY } = rest as any;
107
-
108
- const cleanedConfig = cleanupTransformerConfig(
109
- TRANSFORMER_CONFIGURATION || {},
110
- validFields,
111
- );
112
-
113
- return {
114
- KEY,
115
- INPUT_TYPE,
116
- NAME: DS_NAME,
117
- OUTPUT_TYPE,
118
- TRANSFORMER_CONFIGURATION: cleanedConfig,
119
- GROUPING_STRATEGY: GROUPING_STRATEGY || 'NONE',
120
- GROUP_KEY: GROUP_KEY || null,
121
- };
122
- } catch (error) {
123
- // If schema fetch fails, log warning but keep original config
124
- console.warn(`Failed to fetch schema for ${KEY}, skipping cleanup:`, error);
125
- const { GROUPING_STRATEGY, GROUP_KEY } = rest as any;
126
- return {
127
- KEY,
128
- INPUT_TYPE,
129
- NAME: DS_NAME,
130
- OUTPUT_TYPE,
131
- TRANSFORMER_CONFIGURATION: TRANSFORMER_CONFIGURATION || {},
132
- GROUPING_STRATEGY: GROUPING_STRATEGY || 'NONE',
133
- GROUP_KEY: GROUP_KEY || null,
134
- };
135
- }
136
- },
137
- ),
138
- );
139
-
140
- return {
141
- baseConfig,
142
- datasourceConfig: cleanedDatasources.reduce(
143
- (acum, ds) => ({
144
- ...acum,
145
- [buildDatasourceName(ds.KEY, ds.NAME, ds.INPUT_TYPE)]: ds,
146
- }),
147
- {},
148
- ),
149
- };
150
- }
151
-
152
- export function datasourceInputForDisplay(
153
- input: DatasourceInputTypes,
154
- ): Display.DatasourceInputTypes {
155
- if (input === 'REQ_REP') return 'Snapshot';
156
- else if (input === 'DATA_PIPELINE') return 'Data Pipeline';
157
- else throw new Error(`datasourceInputForDisplay - Uncaught case ${input}`);
158
- }
159
-
160
- export function datasourceInputFromDisplay(
161
- display: Display.DatasourceInputTypes,
162
- ): DatasourceInputTypes {
163
- if (display === 'Snapshot') return 'REQ_REP';
164
- else if (display === 'Data Pipeline') return 'DATA_PIPELINE';
165
- else throw new Error(`datasourceInputFromDisplay - Uncaught case ${display}`);
166
- }
167
-
168
- export function buildDatasourceName(
169
- alias: string,
170
- resourceName: string,
171
- type: DatasourceInputTypes,
172
- ): DatasourceName {
173
- return `${type}_${resourceName}_${alias}`;
174
- }
@@ -1,165 +0,0 @@
1
- import { assert, suite } from '@genesislcap/foundation-testing';
2
- import { ReportingConfig } from '../store';
3
- import { validateDatasourceConfig } from './validators';
4
-
5
- const ValidateDatasourceConfig = suite('validateDatasourceConfig');
6
-
7
- ValidateDatasourceConfig('returns error when no datasources configured', () => {
8
- const config: ReportingConfig = {
9
- baseConfig: {
10
- DESTINATION_IDS: [],
11
- OUTPUT_DIRECTORY: 'test',
12
- },
13
- datasourceConfig: {},
14
- };
15
-
16
- const result = validateDatasourceConfig(config);
17
-
18
- assert.equal(result.k, 'err');
19
- if (result.k === 'err') {
20
- assert.ok(result.info.includes('At least one datasource needs to be configured'));
21
- }
22
- });
23
-
24
- ValidateDatasourceConfig('returns ok when single datasource configured', () => {
25
- const config: ReportingConfig = {
26
- baseConfig: {
27
- DESTINATION_IDS: [],
28
- OUTPUT_DIRECTORY: 'test',
29
- OUTPUT_FORMAT: 'CSV',
30
- },
31
- datasourceConfig: {
32
- REQ_REP_testSource_testAlias: {
33
- KEY: 'testAlias',
34
- NAME: 'testSource',
35
- INPUT_TYPE: 'REQ_REP',
36
- OUTPUT_TYPE: 'TABLE',
37
- TRANSFORMER_CONFIGURATION: {},
38
- GROUPING_STRATEGY: 'NONE',
39
- GROUP_KEY: null,
40
- },
41
- },
42
- };
43
-
44
- const result = validateDatasourceConfig(config);
45
-
46
- assert.equal(result.k, 'ok');
47
- });
48
-
49
- ValidateDatasourceConfig('returns ok when multiple datasources and PDF format', () => {
50
- const config: ReportingConfig = {
51
- baseConfig: {
52
- DESTINATION_IDS: [],
53
- OUTPUT_DIRECTORY: 'test',
54
- OUTPUT_FORMAT: 'PDF',
55
- DOCUMENT_TEMPLATE_ID: 'template1',
56
- },
57
- datasourceConfig: {
58
- REQ_REP_source1_alias1: {
59
- KEY: 'alias1',
60
- NAME: 'source1',
61
- INPUT_TYPE: 'REQ_REP',
62
- OUTPUT_TYPE: 'TABLE',
63
- TRANSFORMER_CONFIGURATION: {},
64
- GROUPING_STRATEGY: 'NONE',
65
- GROUP_KEY: null,
66
- },
67
- REQ_REP_source2_alias2: {
68
- KEY: 'alias2',
69
- NAME: 'source2',
70
- INPUT_TYPE: 'REQ_REP',
71
- OUTPUT_TYPE: 'TABLE',
72
- TRANSFORMER_CONFIGURATION: {},
73
- GROUPING_STRATEGY: 'NONE',
74
- GROUP_KEY: null,
75
- },
76
- },
77
- };
78
-
79
- const result = validateDatasourceConfig(config);
80
-
81
- assert.equal(result.k, 'ok');
82
- });
83
-
84
- ValidateDatasourceConfig(
85
- 'returns ok when multiple datasources and CSV format with template',
86
- () => {
87
- const config: ReportingConfig = {
88
- baseConfig: {
89
- DESTINATION_IDS: [],
90
- OUTPUT_DIRECTORY: 'test',
91
- OUTPUT_FORMAT: 'CSV',
92
- DOCUMENT_TEMPLATE_ID: 'template1',
93
- },
94
- datasourceConfig: {
95
- REQ_REP_source1_alias1: {
96
- KEY: 'alias1',
97
- NAME: 'source1',
98
- INPUT_TYPE: 'REQ_REP',
99
- OUTPUT_TYPE: 'TABLE',
100
- TRANSFORMER_CONFIGURATION: {},
101
- GROUPING_STRATEGY: 'NONE',
102
- GROUP_KEY: null,
103
- },
104
- REQ_REP_source2_alias2: {
105
- KEY: 'alias2',
106
- NAME: 'source2',
107
- INPUT_TYPE: 'REQ_REP',
108
- OUTPUT_TYPE: 'TABLE',
109
- TRANSFORMER_CONFIGURATION: {},
110
- GROUPING_STRATEGY: 'NONE',
111
- GROUP_KEY: null,
112
- },
113
- },
114
- };
115
-
116
- const result = validateDatasourceConfig(config);
117
-
118
- assert.equal(result.k, 'ok');
119
- },
120
- );
121
-
122
- ValidateDatasourceConfig(
123
- 'returns error when multiple datasources and CSV format without template',
124
- () => {
125
- const config: ReportingConfig = {
126
- baseConfig: {
127
- DESTINATION_IDS: [],
128
- OUTPUT_DIRECTORY: 'test',
129
- OUTPUT_FORMAT: 'CSV',
130
- DOCUMENT_TEMPLATE_ID: undefined,
131
- },
132
- datasourceConfig: {
133
- REQ_REP_source1_alias1: {
134
- KEY: 'alias1',
135
- NAME: 'source1',
136
- INPUT_TYPE: 'REQ_REP',
137
- OUTPUT_TYPE: 'TABLE',
138
- TRANSFORMER_CONFIGURATION: {},
139
- GROUPING_STRATEGY: 'NONE',
140
- GROUP_KEY: null,
141
- },
142
- REQ_REP_source2_alias2: {
143
- KEY: 'alias2',
144
- NAME: 'source2',
145
- INPUT_TYPE: 'REQ_REP',
146
- OUTPUT_TYPE: 'TABLE',
147
- TRANSFORMER_CONFIGURATION: {},
148
- GROUPING_STRATEGY: 'NONE',
149
- GROUP_KEY: null,
150
- },
151
- },
152
- };
153
-
154
- const result = validateDatasourceConfig(config);
155
-
156
- assert.equal(result.k, 'err');
157
- if (result.k === 'err') {
158
- assert.ok(
159
- result.info.some((err) => err.includes('You cannot select more than one datasource')),
160
- );
161
- }
162
- },
163
- );
164
-
165
- ValidateDatasourceConfig.run();
@@ -1,81 +0,0 @@
1
- import { Connect } from '@genesislcap/foundation-comms';
2
- import type { ReportingConfig } from '../store';
3
- import { Result } from '../types';
4
-
5
- const toResult = (errors: string[]): Result<undefined, string[]> =>
6
- errors.length
7
- ? {
8
- k: 'err',
9
- info: errors,
10
- }
11
- : { k: 'ok' };
12
-
13
- export const validateReportingConfig =
14
- (connect: Connect) =>
15
- async (config: ReportingConfig): Promise<Result<undefined, string[]>> => {
16
- const result = await connect.snapshot('ALL_REPORT_CONFIGS');
17
- const reportingConfigNames = new Set(
18
- result.ROW?.filter((d) => !config.baseConfig.ID || d.ID !== config.baseConfig.ID)?.map(
19
- (d) => <string>d.NAME,
20
- ),
21
- );
22
-
23
- const nameErr = reportingConfigNames.has(config.baseConfig.NAME)
24
- ? [`Reporting config name "${config.baseConfig.NAME}" already in use.`]
25
- : [];
26
-
27
- const baseSetupErrors = validateBaseSetup(config);
28
- const baseErr = baseSetupErrors.k === 'err' ? baseSetupErrors.info : [];
29
-
30
- const datasourceErrors = validateDatasourceConfig(config);
31
- const datasourceErr = datasourceErrors.k === 'err' ? datasourceErrors.info : [];
32
-
33
- const timezoneErr =
34
- config.baseConfig.SCHEDULE && !config.baseConfig.SCHEDULE?.TIME_ZONE
35
- ? [`Reporting config timezone unset or invalid.`]
36
- : [];
37
-
38
- return toResult([].concat(nameErr, baseErr, datasourceErr, timezoneErr));
39
- };
40
-
41
- export const validateBaseSetup = (config: ReportingConfig): Result<undefined, string[]> => {
42
- const errors: string[] = [];
43
- if (!config.baseConfig.NAME) {
44
- errors.push(`Reporting config name unset.`);
45
- }
46
-
47
- if (!config.baseConfig.FILE_NAME) {
48
- errors.push(`Reporting config file name unset.`);
49
- }
50
-
51
- if (!config.baseConfig.OUTPUT_DIRECTORY) {
52
- errors.push(`Reporting output directory name unset.`);
53
- }
54
-
55
- if (config.baseConfig.OUTPUT_FORMAT === 'PDF' && !config.baseConfig.DOCUMENT_TEMPLATE_ID) {
56
- errors.push(`You must select a template when using PDF output.`);
57
- }
58
-
59
- return toResult(errors);
60
- };
61
-
62
- export const validateDatasourceConfig = (config: ReportingConfig): Result<undefined, string[]> => {
63
- const errors: string[] = [];
64
- const datasourceKeys = Object.keys(config.datasourceConfig);
65
-
66
- if (datasourceKeys.length === 0) {
67
- errors.push('At least one datasource needs to be configured');
68
- }
69
-
70
- if (
71
- config.baseConfig.OUTPUT_FORMAT === 'CSV' &&
72
- !config.baseConfig.DOCUMENT_TEMPLATE_ID &&
73
- datasourceKeys.length > 1
74
- ) {
75
- errors.push(
76
- 'You cannot select more than one datasource if you are using csv output format, unless you select a template.\nSelect a template or change output type on the previous step, or remove all but one datasource.',
77
- );
78
- }
79
-
80
- return toResult(errors);
81
- };
@@ -1,69 +0,0 @@
1
- export const tickIcon = (slot = 'start') => `
2
- <svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="8px" height="8px" xmlns="http://www.w3.org/2000/svg">
3
- <defs>
4
- <mask fill="white" id="clip71">
5
- <path d="M 7.902293826332949 0.88531102710076 C 8.029418727016619 0.7318189595164379 8.032943724262715 0.4786004073434318 7.910168820180608 0.3196942814888426 C 7.7873939160985035 0.16078815563425342 7.584819074360098 0.15638190907663363 7.457694173676427 0.3098505391792663 C 7.455031675756503 0.3130614741707234 7.452406677807284 0.31634272160724874 7.449819179828765 0.3196942814888426 L 2.236067003072654 6.8369079399156725 L 0.5423058263235732 4.719706468979322 C 0.41518092563990183 4.566237838876688 0.212606083901497 4.570644085434308 0.08983117981939077 4.729550211288897 C -0.029943726606463585 4.884565715183035 -0.029943726606463585 5.130307710697101 0.08983117981939077 5.285323214591238 L 2.009829679820563 7.6853213395927025 C 2.134798332188803 7.841485280089625 2.337354423941856 7.841485280089625 2.4623043263247455 7.6853213395927025 L 7.902293826332949 0.88531102710076 Z " fill-rule="evenodd" />
6
- </mask>
7
- </defs>
8
- <g transform="matrix(1 0 0 1 -23 -68 )">
9
- <path d="M 7.902293826332949 0.88531102710076 C 8.029418727016619 0.7318189595164379 8.032943724262715 0.4786004073434318 7.910168820180608 0.3196942814888426 C 7.7873939160985035 0.16078815563425342 7.584819074360098 0.15638190907663363 7.457694173676427 0.3098505391792663 C 7.455031675756503 0.3130614741707234 7.452406677807284 0.31634272160724874 7.449819179828765 0.3196942814888426 L 2.236067003072654 6.8369079399156725 L 0.5423058263235732 4.719706468979322 C 0.41518092563990183 4.566237838876688 0.212606083901497 4.570644085434308 0.08983117981939077 4.729550211288897 C -0.029943726606463585 4.884565715183035 -0.029943726606463585 5.130307710697101 0.08983117981939077 5.285323214591238 L 2.009829679820563 7.6853213395927025 C 2.134798332188803 7.841485280089625 2.337354423941856 7.841485280089625 2.4623043263247455 7.6853213395927025 L 7.902293826332949 0.88531102710076 Z " fill-rule="nonzero" fill="#141414" stroke="none" transform="matrix(1 0 0 1 23 68 )" />
10
- <path d="M 7.902293826332949 0.88531102710076 C 8.029418727016619 0.7318189595164379 8.032943724262715 0.4786004073434318 7.910168820180608 0.3196942814888426 C 7.7873939160985035 0.16078815563425342 7.584819074360098 0.15638190907663363 7.457694173676427 0.3098505391792663 C 7.455031675756503 0.3130614741707234 7.452406677807284 0.31634272160724874 7.449819179828765 0.3196942814888426 L 2.236067003072654 6.8369079399156725 L 0.5423058263235732 4.719706468979322 C 0.41518092563990183 4.566237838876688 0.212606083901497 4.570644085434308 0.08983117981939077 4.729550211288897 C -0.029943726606463585 4.884565715183035 -0.029943726606463585 5.130307710697101 0.08983117981939077 5.285323214591238 L 2.009829679820563 7.6853213395927025 C 2.134798332188803 7.841485280089625 2.337354423941856 7.841485280089625 2.4623043263247455 7.6853213395927025 L 7.902293826332949 0.88531102710076 Z " stroke-width="6" stroke="#141414" fill="none" transform="matrix(1 0 0 1 23 68 )" mask="url(#clip71)" />
11
- </g>
12
- </svg>
13
- `;
14
-
15
- export const downloadIcon = (slot = 'start') => `
16
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
17
- <path d="M480 352h-133.5l-45.25 45.25C289.2 409.3 273.1 416 256 416s-33.16-6.656-45.25-18.75L165.5 352H32c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h448c17.67 0 32-14.33 32-32v-96C512 366.3 497.7 352 480 352zM432 456c-13.2 0-24-10.8-24-24c0-13.2 10.8-24 24-24s24 10.8 24 24C456 445.2 445.2 456 432 456zM233.4 374.6C239.6 380.9 247.8 384 256 384s16.38-3.125 22.62-9.375l128-128c12.49-12.5 12.49-32.75 0-45.25c-12.5-12.5-32.76-12.5-45.25 0L288 274.8V32c0-17.67-14.33-32-32-32C238.3 0 224 14.33 224 32v242.8L150.6 201.4c-12.49-12.5-32.75-12.5-45.25 0c-12.49 12.5-12.49 32.75 0 45.25L233.4 374.6z"/>
18
- </svg>
19
- `;
20
-
21
- export const savedReportsIcon = (slot = 'start') => `
22
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
23
- <path d="M256 0v128h128L256 0zM224 128L224 0H48C21.49 0 0 21.49 0 48v416C0 490.5 21.49 512 48 512h288c26.51 0 48-21.49 48-48V160h-127.1C238.3 160 224 145.7 224 128z"/>
24
- </svg>
25
- `;
26
-
27
- export const deleteIcon = (slot = 'start') => `
28
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
29
- <path d="M135.2 17.69C140.6 6.848 151.7 0 163.8 0H284.2C296.3 0 307.4 6.848 312.8 17.69L320 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H128L135.2 17.69zM31.1 128H416V448C416 483.3 387.3 512 352 512H95.1C60.65 512 31.1 483.3 31.1 448V128zM111.1 208V432C111.1 440.8 119.2 448 127.1 448C136.8 448 143.1 440.8 143.1 432V208C143.1 199.2 136.8 192 127.1 192C119.2 192 111.1 199.2 111.1 208zM207.1 208V432C207.1 440.8 215.2 448 223.1 448C232.8 448 240 440.8 240 432V208C240 199.2 232.8 192 223.1 192C215.2 192 207.1 199.2 207.1 208zM304 208V432C304 440.8 311.2 448 320 448C328.8 448 336 440.8 336 432V208C336 199.2 328.8 192 320 192C311.2 192 304 199.2 304 208z"/>
30
- </svg>
31
- `;
32
-
33
- export const chevronRightIcon = (slot = 'start') => `
34
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
35
- <path d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"/>
36
- </svg>
37
- `;
38
-
39
- export const chevronLeftIcon = (slot = 'start') => `
40
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
41
- <path d="M224 480c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25l192-192c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l169.4 169.4c12.5 12.5 12.5 32.75 0 45.25C240.4 476.9 232.2 480 224 480z"/>
42
- </svg>
43
- `;
44
-
45
- export const runIcon = (slot = 'start') => `
46
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
47
- <path d="M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z"/>
48
- </svg>
49
- `;
50
-
51
- export const addIcon = (slot = 'start') => `
52
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
53
- <path d="M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"/>
54
- </svg>
55
- `;
56
-
57
- export const editIcon = (slot = 'start') => `
58
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
59
- <path d="M490.3 40.4C512.2 62.27 512.2 97.73 490.3 119.6L460.3 149.7L362.3 51.72L392.4 21.66C414.3-.2135 449.7-.2135 471.6 21.66L490.3 40.4zM172.4 241.7L339.7 74.34L437.7 172.3L270.3 339.6C264.2 345.8 256.7 350.4 248.4 353.2L159.6 382.8C150.1 385.6 141.5 383.4 135 376.1C128.6 370.5 126.4 361 129.2 352.4L158.8 263.6C161.6 255.3 166.2 247.8 172.4 241.7V241.7zM192 63.1C209.7 63.1 224 78.33 224 95.1C224 113.7 209.7 127.1 192 127.1H96C78.33 127.1 64 142.3 64 159.1V416C64 433.7 78.33 448 96 448H352C369.7 448 384 433.7 384 416V319.1C384 302.3 398.3 287.1 416 287.1C433.7 287.1 448 302.3 448 319.1V416C448 469 405 512 352 512H96C42.98 512 0 469 0 416V159.1C0 106.1 42.98 63.1 96 63.1H192z"/>
60
- </svg>
61
- `;
62
-
63
- export const actionsOpenIcon = (slot = 'start') => `
64
- <svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="5px" height="16px" xmlns="http://www.w3.org/2000/svg">
65
- <g transform="matrix(1 0 0 1 -10 -5 )">
66
- <path d="M 0 2.3225806451612905 C 0 3.606451612903226 1.1180555555555556 4.645161290322581 2.5 4.645161290322581 C 3.881944444444445 4.645161290322581 5 3.606451612903226 5 2.3225806451612905 C 5 1.038709677419355 3.881944444444445 0 2.5 0 C 1.1180555555555551 0 0 1.038709677419355 0 2.3225806451612905 Z M 1.1111111111111112 2.3225806451612905 C 1.1111111111111112 1.6096774193548389 1.732638888888889 1.032258064516129 2.5 1.032258064516129 C 3.267361111111111 1.032258064516129 3.888888888888889 1.6096774193548387 3.888888888888889 2.3225806451612905 C 3.888888888888889 3.0354838709677416 3.267361111111111 3.6129032258064515 2.5 3.6129032258064515 C 1.732638888888889 3.6129032258064515 1.1111111111111112 3.0354838709677416 1.1111111111111112 2.3225806451612905 Z M 5 8 C 5 6.716129032258064 3.881944444444445 5.67741935483871 2.5 5.67741935483871 C 1.1180555555555556 5.67741935483871 0 6.716129032258064 0 8 C 0 9.283870967741937 1.1180555555555556 10.32258064516129 2.5 10.32258064516129 C 3.881944444444445 10.32258064516129 5 9.283870967741937 5 8 Z M 3.888888888888889 8 C 3.888888888888889 8.712903225806452 3.267361111111111 9.290322580645162 2.5 9.290322580645162 C 1.732638888888889 9.290322580645162 1.1111111111111112 8.712903225806452 1.1111111111111112 8 C 1.1111111111111112 7.2870967741935475 1.732638888888889 6.709677419354839 2.5 6.709677419354839 C 3.267361111111111 6.709677419354839 3.888888888888889 7.287096774193548 3.888888888888889 8 Z M 5 13.67741935483871 C 5 12.393548387096773 3.881944444444445 11.35483870967742 2.5 11.35483870967742 C 1.1180555555555556 11.35483870967742 0 12.393548387096773 0 13.67741935483871 C 0 14.961290322580645 1.1180555555555556 16 2.5 16 C 3.881944444444445 16 5 14.961290322580645 5 13.67741935483871 Z M 3.888888888888889 13.67741935483871 C 3.888888888888889 14.390322580645162 3.267361111111111 14.96774193548387 2.5 14.96774193548387 C 1.732638888888889 14.96774193548387 1.1111111111111112 14.390322580645162 1.1111111111111112 13.67741935483871 C 1.1111111111111112 12.964516129032257 1.732638888888889 12.387096774193548 2.5 12.387096774193548 C 3.267361111111111 12.387096774193548 3.888888888888889 12.964516129032257 3.888888888888889 13.67741935483871 Z " fill-rule="nonzero" fill="inherit" stroke="none" transform="matrix(1 0 0 1 10 5 )" />
67
- </g>
68
- </svg>
69
- `;
@@ -1,16 +0,0 @@
1
- import { css } from '@genesislcap/web-core';
2
-
3
- export const CreateEditStyles = css`
4
- .create-edit {
5
- width: 100%;
6
- height: 98%;
7
- margin: 0;
8
- padding: 0;
9
- color: var(--neutral-foreground-rest);
10
- }
11
-
12
- .container {
13
- max-width: 1737px;
14
- margin: 0 auto;
15
- }
16
- `;
@@ -1,15 +0,0 @@
1
- import { html } from '@genesislcap/web-core';
2
- import type { CreateEdit } from './create-edit';
3
-
4
- export const CreateEditTemplate = html<CreateEdit>`
5
- <div class="create-edit page" data-test-id="create-edit-page">
6
- <div class="container create-edit page">
7
- <reporting-wizard
8
- :report=${(x) => x.report}
9
- :saveReport=${(x) => x.saveReport}
10
- :datasourceSettings=${(x) => x.datasourceSettings}
11
- data-test-id="reporting-wizard"
12
- />
13
- </div>
14
- </div>
15
- `;
@@ -1,70 +0,0 @@
1
- import { Connect } from '@genesislcap/foundation-comms';
2
- import { customElement, GenesisElement, observable } from '@genesislcap/web-core';
3
- import { ReportingEventListeners } from '../../main/types';
4
- import { CreateEditStyles as styles } from './create-edit.styles';
5
- import { CreateEditTemplate as template } from './create-edit.template';
6
-
7
- const name = 'reporting-create-edit';
8
-
9
- /**
10
- * Create or edit a saved report (legacy).
11
- * @public
12
- *
13
- * @fires listReports
14
- * @fires notify - Fired when a user notification should be shown. detail: `ReportNotification`
15
- */
16
- @customElement({
17
- name,
18
- template,
19
- styles,
20
- })
21
- export class CreateEdit extends GenesisElement {
22
- @Connect connect: Connect;
23
- @observable id!: string;
24
- @observable report: any = {};
25
- @observable datasourceSettings;
26
-
27
- /**
28
- * Trigger parent event listReports that navigates to list reports tab
29
- */
30
- public navigateToListReports() {
31
- this.$emit(ReportingEventListeners.listReports, {});
32
- }
33
-
34
- /**
35
- * Create report save handle
36
- */
37
- public saveReport = async (isEdit, body) => {
38
- let notification = null;
39
- const payload = {
40
- ...body,
41
- REPORT_COLUMNS: JSON.stringify(body['REPORT_COLUMNS']),
42
- };
43
- const event = isEdit ? 'EVENT_SAVED_REPORTS_UPDATE' : 'EVENT_SAVED_REPORTS_INSERT';
44
- const result = await this.connect.commitEvent(event, {
45
- DETAILS: {
46
- ...payload,
47
- ...(isEdit ? { REPORT_ID: this.report.REPORT_ID } : {}),
48
- },
49
- IGNORE_WARNINGS: true,
50
- VALIDATE: false,
51
- });
52
- if (result.MESSAGE_TYPE === 'EVENT_ACK') {
53
- notification = {
54
- message: `'${body.REPORT_NAME}' was added`,
55
- title: 'Success:',
56
- type: 'success',
57
- autoClose: true,
58
- };
59
- this.navigateToListReports();
60
- } else {
61
- notification = {
62
- message: `'${body.REPORT_NAME}' was not added due to the following error "${result.ERROR[0].TEXT}"`,
63
- title: 'Error:',
64
- type: 'warning',
65
- autoClose: true,
66
- };
67
- }
68
- this.$emit(ReportingEventListeners.notify, notification);
69
- };
70
- }
@@ -1,3 +0,0 @@
1
- export * from './create-edit';
2
- export * from './create-edit.styles';
3
- export * from './create-edit.template';