@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.27.0 → 4.28.0

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 (468) hide show
  1. package/dpr/assets/app.js.map +2 -2
  2. package/dpr/components/_async/async-filters-form/sortByTemplate.js +60 -1
  3. package/dpr/components/_async/async-filters-form/sortByTemplate.js.map +2 -2
  4. package/dpr/components/_async/async-filters-form/types.d.js +16 -1
  5. package/dpr/components/_async/async-filters-form/types.d.js.map +2 -2
  6. package/dpr/components/_async/async-filters-form/utils.js +180 -1
  7. package/dpr/components/_async/async-filters-form/utils.js.map +2 -2
  8. package/dpr/components/_catalogue/catalogue/types.js +16 -1
  9. package/dpr/components/_catalogue/catalogue/types.js.map +2 -2
  10. package/dpr/components/_catalogue/catalogue/utils.js +83 -1
  11. package/dpr/components/_catalogue/catalogue/utils.js.map +2 -2
  12. package/dpr/components/_catalogue/catalogue-list/utils.js +140 -1
  13. package/dpr/components/_catalogue/catalogue-list/utils.js.map +2 -2
  14. package/dpr/components/_charts/chart/Chart.js +99 -1
  15. package/dpr/components/_charts/chart/Chart.js.map +2 -2
  16. package/dpr/components/_charts/chart/ChartColours.js +61 -1
  17. package/dpr/components/_charts/chart/ChartColours.js.map +2 -2
  18. package/dpr/components/_charts/chart/ChartTimeseries.js +101 -1
  19. package/dpr/components/_charts/chart/ChartTimeseries.js.map +2 -2
  20. package/dpr/components/_charts/chart/bar/BarChart.js +193 -1
  21. package/dpr/components/_charts/chart/bar/BarChart.js.map +2 -2
  22. package/dpr/components/_charts/chart/bar/types.js +16 -1
  23. package/dpr/components/_charts/chart/bar/types.js.map +2 -2
  24. package/dpr/components/_charts/chart/bar/validate.js +73 -1
  25. package/dpr/components/_charts/chart/bar/validate.js.map +2 -2
  26. package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js +80 -1
  27. package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js.map +2 -2
  28. package/dpr/components/_charts/chart/bar-timeseries/types.js +16 -1
  29. package/dpr/components/_charts/chart/bar-timeseries/types.js.map +2 -2
  30. package/dpr/components/_charts/chart/bar-timeseries/validate.js +48 -1
  31. package/dpr/components/_charts/chart/bar-timeseries/validate.js.map +2 -2
  32. package/dpr/components/_charts/chart/buckets/Buckets.js +194 -1
  33. package/dpr/components/_charts/chart/buckets/Buckets.js.map +2 -2
  34. package/dpr/components/_charts/chart/buckets/types.js +16 -1
  35. package/dpr/components/_charts/chart/buckets/types.js.map +2 -2
  36. package/dpr/components/_charts/chart/buckets/validate.js +40 -1
  37. package/dpr/components/_charts/chart/buckets/validate.js.map +2 -2
  38. package/dpr/components/_charts/chart/chart-config.js +62 -1
  39. package/dpr/components/_charts/chart/chart-config.js.map +2 -2
  40. package/dpr/components/_charts/chart/doughnut/DoughnutChart.js +96 -1
  41. package/dpr/components/_charts/chart/doughnut/DoughnutChart.js.map +2 -2
  42. package/dpr/components/_charts/chart/doughnut/types.js +16 -1
  43. package/dpr/components/_charts/chart/doughnut/types.js.map +2 -2
  44. package/dpr/components/_charts/chart/doughnut/validate.js +48 -1
  45. package/dpr/components/_charts/chart/doughnut/validate.js.map +2 -2
  46. package/dpr/components/_charts/chart/heatmap/HeatmapChart.js +213 -1
  47. package/dpr/components/_charts/chart/heatmap/HeatmapChart.js.map +2 -2
  48. package/dpr/components/_charts/chart/heatmap/types.js +16 -1
  49. package/dpr/components/_charts/chart/heatmap/types.js.map +2 -2
  50. package/dpr/components/_charts/chart/heatmap/validate.js +40 -1
  51. package/dpr/components/_charts/chart/heatmap/validate.js.map +2 -2
  52. package/dpr/components/_charts/chart/line/LineChart.js +107 -1
  53. package/dpr/components/_charts/chart/line/LineChart.js.map +2 -2
  54. package/dpr/components/_charts/chart/line/types.js +16 -1
  55. package/dpr/components/_charts/chart/line/types.js.map +2 -2
  56. package/dpr/components/_charts/chart/line/validate.js +48 -1
  57. package/dpr/components/_charts/chart/line/validate.js.map +2 -2
  58. package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js +81 -1
  59. package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js.map +2 -2
  60. package/dpr/components/_charts/chart/line-timeseries/types.js +16 -1
  61. package/dpr/components/_charts/chart/line-timeseries/types.js.map +2 -2
  62. package/dpr/components/_charts/chart/line-timeseries/validate.js +48 -1
  63. package/dpr/components/_charts/chart/line-timeseries/validate.js.map +2 -2
  64. package/dpr/components/_charts/utils.js +240 -1
  65. package/dpr/components/_charts/utils.js.map +2 -2
  66. package/dpr/components/_dashboards/dashboard-list/types.js +16 -1
  67. package/dpr/components/_dashboards/dashboard-list/types.js.map +2 -2
  68. package/dpr/components/_dashboards/dashboard-list/utils.js +170 -1
  69. package/dpr/components/_dashboards/dashboard-list/utils.js.map +2 -2
  70. package/dpr/components/_dashboards/dashboard-list/validate.js +43 -1
  71. package/dpr/components/_dashboards/dashboard-list/validate.js.map +2 -2
  72. package/dpr/components/_dashboards/dashboard-visualisation/Validate.js +95 -1
  73. package/dpr/components/_dashboards/dashboard-visualisation/Validate.js.map +2 -2
  74. package/dpr/components/_dashboards/dashboard-visualisation/types.js +40 -1
  75. package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +2 -2
  76. package/dpr/components/_dashboards/scorecard/Scorecard.js +176 -1
  77. package/dpr/components/_dashboards/scorecard/Scorecard.js.map +2 -2
  78. package/dpr/components/_dashboards/scorecard/types.js +16 -1
  79. package/dpr/components/_dashboards/scorecard/types.js.map +2 -2
  80. package/dpr/components/_dashboards/scorecard/utils.js +61 -1
  81. package/dpr/components/_dashboards/scorecard/utils.js.map +2 -2
  82. package/dpr/components/_dashboards/scorecard/validate.js +50 -1
  83. package/dpr/components/_dashboards/scorecard/validate.js.map +2 -2
  84. package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js +212 -1
  85. package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js.map +2 -2
  86. package/dpr/components/_dashboards/scorecard-group/types.js +16 -1
  87. package/dpr/components/_dashboards/scorecard-group/types.js.map +2 -2
  88. package/dpr/components/_dashboards/scorecard-group/validate.js +50 -1
  89. package/dpr/components/_dashboards/scorecard-group/validate.js.map +2 -2
  90. package/dpr/components/_filters/filter-input/enum.js +38 -1
  91. package/dpr/components/_filters/filter-input/enum.js.map +2 -2
  92. package/dpr/components/_filters/filter-input/filters.js +37 -1
  93. package/dpr/components/_filters/filter-input/filters.js.map +2 -2
  94. package/dpr/components/_filters/filter-input/types.d.js +16 -1
  95. package/dpr/components/_filters/filter-input/types.d.js.map +2 -2
  96. package/dpr/components/_filters/filters-selected/utils.js +314 -1
  97. package/dpr/components/_filters/filters-selected/utils.js.map +2 -2
  98. package/dpr/components/_filters/filtersTypeEnum.js +32 -1
  99. package/dpr/components/_filters/filtersTypeEnum.js.map +2 -2
  100. package/dpr/components/_filters/types.d.js +16 -1
  101. package/dpr/components/_filters/types.d.js.map +2 -2
  102. package/dpr/components/_filters/utils.js +385 -1
  103. package/dpr/components/_filters/utils.js.map +2 -2
  104. package/dpr/components/_inputs/autocomplete-text-input/utils.js +45 -1
  105. package/dpr/components/_inputs/autocomplete-text-input/utils.js.map +2 -2
  106. package/dpr/components/_inputs/date-input/utils.js +88 -1
  107. package/dpr/components/_inputs/date-input/utils.js.map +2 -2
  108. package/dpr/components/_inputs/date-range/types.js +38 -1
  109. package/dpr/components/_inputs/date-range/types.js.map +2 -2
  110. package/dpr/components/_inputs/date-range/utils.js +229 -1
  111. package/dpr/components/_inputs/date-range/utils.js.map +2 -2
  112. package/dpr/components/_inputs/granular-date-range/types.js +70 -1
  113. package/dpr/components/_inputs/granular-date-range/types.js.map +2 -2
  114. package/dpr/components/_inputs/granular-date-range/utils.js +445 -1
  115. package/dpr/components/_inputs/granular-date-range/utils.js.map +2 -2
  116. package/dpr/components/_inputs/multi-select/utils.js +88 -1
  117. package/dpr/components/_inputs/multi-select/utils.js.map +2 -2
  118. package/dpr/components/_inputs/start-end-date/utils.js +84 -1
  119. package/dpr/components/_inputs/start-end-date/utils.js.map +2 -2
  120. package/dpr/components/_reports/report-actions/actionsTemplate.js +59 -1
  121. package/dpr/components/_reports/report-actions/actionsTemplate.js.map +2 -2
  122. package/dpr/components/_reports/report-actions/types.d.js +16 -1
  123. package/dpr/components/_reports/report-actions/types.d.js.map +2 -2
  124. package/dpr/components/_reports/report-actions/utils.js +97 -1
  125. package/dpr/components/_reports/report-actions/utils.js.map +2 -2
  126. package/dpr/components/_reports/report-columns-form/types.d.js +16 -1
  127. package/dpr/components/_reports/report-columns-form/types.d.js.map +2 -2
  128. package/dpr/components/_reports/report-columns-form/utils.js +65 -1
  129. package/dpr/components/_reports/report-columns-form/utils.js.map +2 -2
  130. package/dpr/components/_reports/report-data-table/types.d.js +16 -1
  131. package/dpr/components/_reports/report-data-table/types.d.js.map +2 -2
  132. package/dpr/components/_reports/report-data-table/utils.js +122 -1
  133. package/dpr/components/_reports/report-data-table/utils.js.map +2 -2
  134. package/dpr/components/_reports/report-pagination/types.d.js +16 -1
  135. package/dpr/components/_reports/report-pagination/types.d.js.map +2 -2
  136. package/dpr/components/_reports/report-pagination/utils.js +105 -1
  137. package/dpr/components/_reports/report-pagination/utils.js.map +2 -2
  138. package/dpr/components/_reports/report-totals/utils.js +42 -1
  139. package/dpr/components/_reports/report-totals/utils.js.map +2 -2
  140. package/dpr/components/card-group/utils.js +57 -1
  141. package/dpr/components/card-group/utils.js.map +2 -2
  142. package/dpr/components/report-list/defaultTokenProvider.js +36 -1
  143. package/dpr/components/report-list/defaultTokenProvider.js.map +2 -2
  144. package/dpr/components/report-list/types.d.js +16 -1
  145. package/dpr/components/report-list/types.d.js.map +2 -2
  146. package/dpr/components/report-list/utils.js +238 -1
  147. package/dpr/components/report-list/utils.js.map +2 -2
  148. package/dpr/components/show-more/utils.js +38 -3
  149. package/dpr/components/show-more/utils.js.map +2 -2
  150. package/dpr/components/user-reports/bookmarks/utils.js +198 -1
  151. package/dpr/components/user-reports/bookmarks/utils.js.map +2 -2
  152. package/dpr/components/user-reports/requested/utils.js +65 -1
  153. package/dpr/components/user-reports/requested/utils.js.map +2 -2
  154. package/dpr/components/user-reports/types.d.js +16 -1
  155. package/dpr/components/user-reports/types.d.js.map +2 -2
  156. package/dpr/components/user-reports/utils.js +365 -1
  157. package/dpr/components/user-reports/utils.js.map +2 -2
  158. package/dpr/components/user-reports/viewed/utils.js +37 -1
  159. package/dpr/components/user-reports/viewed/utils.js.map +2 -2
  160. package/dpr/data/agentConfig.js +35 -1
  161. package/dpr/data/agentConfig.js.map +2 -2
  162. package/dpr/data/dashboardClient.js +108 -1
  163. package/dpr/data/dashboardClient.js.map +2 -2
  164. package/dpr/data/dprReportingClient.js +55 -1
  165. package/dpr/data/dprReportingClient.js.map +2 -2
  166. package/dpr/data/missingReportClient.js +55 -1
  167. package/dpr/data/missingReportClient.js.map +2 -2
  168. package/dpr/data/productCollectionClient.js +58 -1
  169. package/dpr/data/productCollectionClient.js.map +2 -2
  170. package/dpr/data/reportDataStore.js +77 -1
  171. package/dpr/data/reportDataStore.js.map +2 -2
  172. package/dpr/data/reportingClient.js +173 -1
  173. package/dpr/data/reportingClient.js.map +2 -2
  174. package/dpr/data/restClient.js +143 -1
  175. package/dpr/data/restClient.js.map +2 -2
  176. package/dpr/data/types.d.js +16 -1
  177. package/dpr/data/types.d.js.map +2 -2
  178. package/dpr/middleware/reportAuthoriser.js +63 -1
  179. package/dpr/middleware/reportAuthoriser.js.map +2 -2
  180. package/dpr/middleware/setUpDprResources.js +173 -1
  181. package/dpr/middleware/setUpDprResources.js.map +2 -2
  182. package/dpr/middleware/setUpNestedRoute.js +35 -1
  183. package/dpr/middleware/setUpNestedRoute.js.map +2 -2
  184. package/dpr/routes/index.js +50 -1
  185. package/dpr/routes/index.js.map +2 -2
  186. package/dpr/routes/journeys/api-failures.cy.js +295 -1
  187. package/dpr/routes/journeys/api-failures.cy.js.map +2 -2
  188. package/dpr/routes/journeys/download-report/controller.js +65 -1
  189. package/dpr/routes/journeys/download-report/controller.js.map +2 -2
  190. package/dpr/routes/journeys/download-report/request-download/form/controller.js +98 -1
  191. package/dpr/routes/journeys/download-report/request-download/form/controller.js.map +2 -2
  192. package/dpr/routes/journeys/download-report/request-download/form/routes.js +50 -1
  193. package/dpr/routes/journeys/download-report/request-download/form/routes.js.map +2 -2
  194. package/dpr/routes/journeys/download-report/request-download/form/submitted/controller.js +68 -1
  195. package/dpr/routes/journeys/download-report/request-download/form/submitted/controller.js.map +2 -2
  196. package/dpr/routes/journeys/download-report/request-download/form/submitted/routes.js +47 -1
  197. package/dpr/routes/journeys/download-report/request-download/form/submitted/routes.js.map +2 -2
  198. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js +17 -1
  199. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js.map +1 -1
  200. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js +24 -1
  201. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js.map +2 -2
  202. package/dpr/routes/journeys/download-report/request-download/routes.js +46 -1
  203. package/dpr/routes/journeys/download-report/request-download/routes.js.map +2 -2
  204. package/dpr/routes/journeys/download-report/request-download/service.js +90 -1
  205. package/dpr/routes/journeys/download-report/request-download/service.js.map +2 -2
  206. package/dpr/routes/journeys/download-report/routes.js +63 -1
  207. package/dpr/routes/journeys/download-report/routes.js.map +2 -2
  208. package/dpr/routes/journeys/download-report/tests.cy.js +104 -1
  209. package/dpr/routes/journeys/download-report/tests.cy.js.map +2 -2
  210. package/dpr/routes/journeys/download-report/utils.js +196 -1
  211. package/dpr/routes/journeys/download-report/utils.js.map +2 -2
  212. package/dpr/routes/journeys/my-reports/bookmarks/controller.js +58 -1
  213. package/dpr/routes/journeys/my-reports/bookmarks/controller.js.map +2 -2
  214. package/dpr/routes/journeys/my-reports/bookmarks/list/controller.js +56 -1
  215. package/dpr/routes/journeys/my-reports/bookmarks/list/controller.js.map +2 -2
  216. package/dpr/routes/journeys/my-reports/bookmarks/list/routes.js +47 -1
  217. package/dpr/routes/journeys/my-reports/bookmarks/list/routes.js.map +2 -2
  218. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js +32 -1
  219. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js.map +2 -2
  220. package/dpr/routes/journeys/my-reports/bookmarks/routes.js +49 -1
  221. package/dpr/routes/journeys/my-reports/bookmarks/routes.js.map +2 -2
  222. package/dpr/routes/journeys/my-reports/bookmarks/service.js +123 -4
  223. package/dpr/routes/journeys/my-reports/bookmarks/service.js.map +2 -2
  224. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js +448 -1
  225. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js.map +2 -2
  226. package/dpr/routes/journeys/my-reports/bookmarks/utils.js +44 -1
  227. package/dpr/routes/journeys/my-reports/bookmarks/utils.js.map +2 -2
  228. package/dpr/routes/journeys/my-reports/recently-viewed/controller.js +53 -1
  229. package/dpr/routes/journeys/my-reports/recently-viewed/controller.js.map +2 -2
  230. package/dpr/routes/journeys/my-reports/recently-viewed/list/controller.js +65 -1
  231. package/dpr/routes/journeys/my-reports/recently-viewed/list/controller.js.map +2 -2
  232. package/dpr/routes/journeys/my-reports/recently-viewed/list/routes.js +47 -1
  233. package/dpr/routes/journeys/my-reports/recently-viewed/list/routes.js.map +2 -2
  234. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js +83 -1
  235. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js.map +2 -2
  236. package/dpr/routes/journeys/my-reports/recently-viewed/routes.js +49 -1
  237. package/dpr/routes/journeys/my-reports/recently-viewed/routes.js.map +2 -2
  238. package/dpr/routes/journeys/my-reports/recently-viewed/service.js +118 -1
  239. package/dpr/routes/journeys/my-reports/recently-viewed/service.js.map +2 -2
  240. package/dpr/routes/journeys/my-reports/requested-reports/controller.js +52 -1
  241. package/dpr/routes/journeys/my-reports/requested-reports/controller.js.map +2 -2
  242. package/dpr/routes/journeys/my-reports/requested-reports/list/controller.js +65 -1
  243. package/dpr/routes/journeys/my-reports/requested-reports/list/controller.js.map +2 -2
  244. package/dpr/routes/journeys/my-reports/requested-reports/list/routes.js +47 -1
  245. package/dpr/routes/journeys/my-reports/requested-reports/list/routes.js.map +2 -2
  246. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js +15 -1
  247. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js.map +2 -2
  248. package/dpr/routes/journeys/my-reports/requested-reports/routes.js +49 -1
  249. package/dpr/routes/journeys/my-reports/requested-reports/routes.js.map +2 -2
  250. package/dpr/routes/journeys/my-reports/requested-reports/service.js +200 -1
  251. package/dpr/routes/journeys/my-reports/requested-reports/service.js.map +2 -2
  252. package/dpr/routes/journeys/my-reports/routes.js +59 -1
  253. package/dpr/routes/journeys/my-reports/routes.js.map +2 -2
  254. package/dpr/routes/journeys/product-collection/routes.js +45 -1
  255. package/dpr/routes/journeys/product-collection/routes.js.map +2 -2
  256. package/dpr/routes/journeys/product-collection/selected/controller.js +55 -1
  257. package/dpr/routes/journeys/product-collection/selected/controller.js.map +2 -2
  258. package/dpr/routes/journeys/product-collection/selected/routes.js +37 -1
  259. package/dpr/routes/journeys/product-collection/selected/routes.js.map +2 -2
  260. package/dpr/routes/journeys/product-collection/selected/tests.cy.js +47 -1
  261. package/dpr/routes/journeys/product-collection/selected/tests.cy.js.map +2 -2
  262. package/dpr/routes/journeys/product-collection/selected/validation.js +41 -1
  263. package/dpr/routes/journeys/product-collection/selected/validation.js.map +2 -2
  264. package/dpr/routes/journeys/request-missing-report/form/controller.js +104 -1
  265. package/dpr/routes/journeys/request-missing-report/form/controller.js.map +2 -2
  266. package/dpr/routes/journeys/request-missing-report/form/routes.js +50 -1
  267. package/dpr/routes/journeys/request-missing-report/form/routes.js.map +2 -2
  268. package/dpr/routes/journeys/request-missing-report/form/tests.cy.js +22 -1
  269. package/dpr/routes/journeys/request-missing-report/form/tests.cy.js.map +2 -2
  270. package/dpr/routes/journeys/request-missing-report/form/validation.js +43 -1
  271. package/dpr/routes/journeys/request-missing-report/form/validation.js.map +2 -2
  272. package/dpr/routes/journeys/request-missing-report/routes.js +57 -1
  273. package/dpr/routes/journeys/request-missing-report/routes.js.map +2 -2
  274. package/dpr/routes/journeys/request-missing-report/submitted/controller.js +65 -1
  275. package/dpr/routes/journeys/request-missing-report/submitted/controller.js.map +2 -2
  276. package/dpr/routes/journeys/request-missing-report/submitted/routes.js +47 -1
  277. package/dpr/routes/journeys/request-missing-report/submitted/routes.js.map +2 -2
  278. package/dpr/routes/journeys/request-missing-report/submitted/tests.cy.js +14 -1
  279. package/dpr/routes/journeys/request-missing-report/submitted/tests.cy.js.map +2 -2
  280. package/dpr/routes/journeys/request-missing-report/tests.cy.js +37 -1
  281. package/dpr/routes/journeys/request-missing-report/tests.cy.js.map +2 -2
  282. package/dpr/routes/journeys/request-report/controller.js +79 -1
  283. package/dpr/routes/journeys/request-report/controller.js.map +2 -2
  284. package/dpr/routes/journeys/request-report/filters/controller.js +127 -1
  285. package/dpr/routes/journeys/request-report/filters/controller.js.map +2 -2
  286. package/dpr/routes/journeys/request-report/filters/routes.js +50 -1
  287. package/dpr/routes/journeys/request-report/filters/routes.js.map +2 -2
  288. package/dpr/routes/journeys/request-report/filters/tests.cy.js +451 -1
  289. package/dpr/routes/journeys/request-report/filters/tests.cy.js.map +2 -2
  290. package/dpr/routes/journeys/request-report/filters/utils.js +331 -1
  291. package/dpr/routes/journeys/request-report/filters/utils.js.map +2 -2
  292. package/dpr/routes/journeys/request-report/routes.js +100 -1
  293. package/dpr/routes/journeys/request-report/routes.js.map +2 -2
  294. package/dpr/routes/journeys/request-report/status/controller.js +80 -1
  295. package/dpr/routes/journeys/request-report/status/controller.js.map +2 -2
  296. package/dpr/routes/journeys/request-report/status/routes.js +48 -1
  297. package/dpr/routes/journeys/request-report/status/routes.js.map +2 -2
  298. package/dpr/routes/journeys/request-report/status/tests.cy.js +127 -1
  299. package/dpr/routes/journeys/request-report/status/tests.cy.js.map +2 -2
  300. package/dpr/routes/journeys/request-report/status/utils.js +72 -1
  301. package/dpr/routes/journeys/request-report/status/utils.js.map +2 -2
  302. package/dpr/routes/journeys/request-report/tests.cy.js +307 -1
  303. package/dpr/routes/journeys/request-report/tests.cy.js.map +2 -2
  304. package/dpr/routes/journeys/routes.js +46 -1
  305. package/dpr/routes/journeys/routes.js.map +2 -2
  306. package/dpr/routes/journeys/view-report/async/controller.js +89 -1
  307. package/dpr/routes/journeys/view-report/async/controller.js.map +2 -2
  308. package/dpr/routes/journeys/view-report/async/dashboard/controller.js +82 -1
  309. package/dpr/routes/journeys/view-report/async/dashboard/controller.js.map +2 -2
  310. package/dpr/routes/journeys/view-report/async/dashboard/routes.js +48 -1
  311. package/dpr/routes/journeys/view-report/async/dashboard/routes.js.map +2 -2
  312. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js +33 -1
  313. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js.map +2 -2
  314. package/dpr/routes/journeys/view-report/async/dashboard/utils.js +242 -1
  315. package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +2 -2
  316. package/dpr/routes/journeys/view-report/async/report/controller.js +83 -1
  317. package/dpr/routes/journeys/view-report/async/report/controller.js.map +2 -2
  318. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js +76 -1
  319. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +2 -2
  320. package/dpr/routes/journeys/view-report/async/report/routes.js +53 -1
  321. package/dpr/routes/journeys/view-report/async/report/routes.js.map +2 -2
  322. package/dpr/routes/journeys/view-report/async/report/tests.cy.js +895 -1
  323. package/dpr/routes/journeys/view-report/async/report/tests.cy.js.map +2 -2
  324. package/dpr/routes/journeys/view-report/async/report/types.js +16 -1
  325. package/dpr/routes/journeys/view-report/async/report/types.js.map +2 -2
  326. package/dpr/routes/journeys/view-report/async/report/utils.js +427 -1
  327. package/dpr/routes/journeys/view-report/async/report/utils.js.map +2 -2
  328. package/dpr/routes/journeys/view-report/async/routes.js +52 -1
  329. package/dpr/routes/journeys/view-report/async/routes.js.map +2 -2
  330. package/dpr/routes/journeys/view-report/controller.js +62 -1
  331. package/dpr/routes/journeys/view-report/controller.js.map +2 -2
  332. package/dpr/routes/journeys/view-report/routes.js +87 -1
  333. package/dpr/routes/journeys/view-report/routes.js.map +2 -2
  334. package/dpr/routes/journeys/view-report/sync/dashboard/controller.js +68 -1
  335. package/dpr/routes/journeys/view-report/sync/dashboard/controller.js.map +2 -2
  336. package/dpr/routes/journeys/view-report/sync/dashboard/routes.js +48 -1
  337. package/dpr/routes/journeys/view-report/sync/dashboard/routes.js.map +2 -2
  338. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +144 -1
  339. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +2 -2
  340. package/dpr/routes/journeys/view-report/sync/load-report/controller.js +102 -1
  341. package/dpr/routes/journeys/view-report/sync/load-report/controller.js.map +2 -2
  342. package/dpr/routes/journeys/view-report/sync/load-report/routes.js +47 -1
  343. package/dpr/routes/journeys/view-report/sync/load-report/routes.js.map +2 -2
  344. package/dpr/routes/journeys/view-report/sync/report/controller.js +99 -1
  345. package/dpr/routes/journeys/view-report/sync/report/controller.js.map +2 -2
  346. package/dpr/routes/journeys/view-report/sync/report/routes.js +51 -1
  347. package/dpr/routes/journeys/view-report/sync/report/routes.js.map +2 -2
  348. package/dpr/routes/journeys/view-report/sync/report/utils.js +298 -1
  349. package/dpr/routes/journeys/view-report/sync/report/utils.js.map +2 -2
  350. package/dpr/routes/journeys/view-report/sync/routes.js +51 -1
  351. package/dpr/routes/journeys/view-report/sync/routes.js.map +2 -2
  352. package/dpr/routes/journeys/view-report/sync/tests.cy.js +43 -1
  353. package/dpr/routes/journeys/view-report/sync/tests.cy.js.map +2 -2
  354. package/dpr/routes/journeys/view-report/utils.js +173 -1
  355. package/dpr/routes/journeys/view-report/utils.js.map +2 -2
  356. package/dpr/services/dashboardService.js +66 -1
  357. package/dpr/services/dashboardService.js.map +2 -2
  358. package/dpr/services/defaultFilterValuesService.js +114 -1
  359. package/dpr/services/defaultFilterValuesService.js.map +2 -2
  360. package/dpr/services/featureFlagService.js +65 -1
  361. package/dpr/services/featureFlagService.js.map +2 -2
  362. package/dpr/services/featureFlags.cy.js +72 -1
  363. package/dpr/services/featureFlags.cy.js.map +2 -2
  364. package/dpr/services/index.js +59 -1
  365. package/dpr/services/index.js.map +2 -2
  366. package/dpr/services/missingReport/missingReportService.js +52 -1
  367. package/dpr/services/missingReport/missingReportService.js.map +2 -2
  368. package/dpr/services/productCollection/productCollectionService.js +55 -1
  369. package/dpr/services/productCollection/productCollectionService.js.map +2 -2
  370. package/dpr/services/productCollection/productCollectionStoreService.js +61 -1
  371. package/dpr/services/productCollection/productCollectionStoreService.js.map +2 -2
  372. package/dpr/services/reportStoreService.js +51 -1
  373. package/dpr/services/reportStoreService.js.map +2 -2
  374. package/dpr/services/reportingService.js +81 -1
  375. package/dpr/services/reportingService.js.map +2 -2
  376. package/dpr/setUpNunjucksFilters.js +66 -1
  377. package/dpr/setUpNunjucksFilters.js.map +2 -2
  378. package/dpr/types/AsyncReportUtils.js +16 -1
  379. package/dpr/types/AsyncReportUtils.js.map +2 -2
  380. package/dpr/types/Bookmark.js +16 -1
  381. package/dpr/types/Bookmark.js.map +2 -2
  382. package/dpr/types/Charts.js +16 -1
  383. package/dpr/types/Charts.js.map +2 -2
  384. package/dpr/types/Download.js +16 -1
  385. package/dpr/types/Download.js.map +2 -2
  386. package/dpr/types/DprConfig.js +16 -1
  387. package/dpr/types/DprConfig.js.map +2 -2
  388. package/dpr/types/DprUser.js +43 -1
  389. package/dpr/types/DprUser.js.map +2 -2
  390. package/dpr/types/EmbeddedReportUtils.js +33 -1
  391. package/dpr/types/EmbeddedReportUtils.js.map +2 -2
  392. package/dpr/types/ExecutionData.d.js +16 -1
  393. package/dpr/types/ExecutionData.d.js.map +2 -2
  394. package/dpr/types/Metrics.js +16 -1
  395. package/dpr/types/Metrics.js.map +2 -2
  396. package/dpr/types/ReportQuery.js +168 -1
  397. package/dpr/types/ReportQuery.js.map +2 -2
  398. package/dpr/types/ReportStore.js +16 -1
  399. package/dpr/types/ReportStore.js.map +2 -2
  400. package/dpr/types/Services.d.js +16 -1
  401. package/dpr/types/Services.d.js.map +2 -2
  402. package/dpr/types/Templates.d.js +16 -1
  403. package/dpr/types/Templates.d.js.map +2 -2
  404. package/dpr/types/UserReports.js +55 -1
  405. package/dpr/types/UserReports.js.map +2 -2
  406. package/dpr/types/api.d.js +16 -1
  407. package/dpr/types/api.d.js.map +2 -2
  408. package/dpr/types/index.d.js +16 -1
  409. package/dpr/types/index.d.js.map +2 -2
  410. package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js +91 -1
  411. package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +2 -2
  412. package/dpr/utils/CreateDprServices.js +66 -1
  413. package/dpr/utils/CreateDprServices.js.map +2 -2
  414. package/dpr/utils/DataTableBuilder/DataTableBuilder.js +304 -1
  415. package/dpr/utils/DataTableBuilder/DataTableBuilder.js.map +2 -2
  416. package/dpr/utils/DataTableBuilder/types.d.js +16 -1
  417. package/dpr/utils/DataTableBuilder/types.d.js.map +2 -2
  418. package/dpr/utils/DateMapper/DateMapper.js +125 -1
  419. package/dpr/utils/DateMapper/DateMapper.js.map +2 -2
  420. package/dpr/utils/DateMapper/types.d.js +16 -1
  421. package/dpr/utils/DateMapper/types.d.js.map +2 -2
  422. package/dpr/utils/ErrorHandler.js +94 -1
  423. package/dpr/utils/ErrorHandler.js.map +2 -2
  424. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js +201 -1
  425. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +2 -2
  426. package/dpr/utils/ParentChildDataTableBuilder/types.d.js +16 -1
  427. package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +2 -2
  428. package/dpr/utils/Personalisation/personalisationUtils.js +202 -1
  429. package/dpr/utils/Personalisation/personalisationUtils.js.map +2 -2
  430. package/dpr/utils/Personalisation/types.d.js +16 -1
  431. package/dpr/utils/Personalisation/types.d.js.map +2 -2
  432. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js +310 -1
  433. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +2 -2
  434. package/dpr/utils/SectionedDataTableBuilder/types.d.js +16 -1
  435. package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +2 -2
  436. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js +145 -1
  437. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +2 -2
  438. package/dpr/utils/SummaryDataTableBuilder/SummaryDataTableBuilder.js +60 -1
  439. package/dpr/utils/SummaryDataTableBuilder/SummaryDataTableBuilder.js.map +2 -2
  440. package/dpr/utils/UserStoreItemBuilder.js +247 -1
  441. package/dpr/utils/UserStoreItemBuilder.js.map +2 -2
  442. package/dpr/utils/arrayUtils.js +28 -1
  443. package/dpr/utils/arrayUtils.js.map +2 -2
  444. package/dpr/utils/datasetHelper.js +229 -1
  445. package/dpr/utils/datasetHelper.js.map +2 -2
  446. package/dpr/utils/definitionUtils.js +133 -1
  447. package/dpr/utils/definitionUtils.js.map +2 -2
  448. package/dpr/utils/index.js +44 -1
  449. package/dpr/utils/index.js.map +2 -2
  450. package/dpr/utils/indexedAccesHelper.js +41 -1
  451. package/dpr/utils/indexedAccesHelper.js.map +2 -2
  452. package/dpr/utils/localsHelper.js +105 -1
  453. package/dpr/utils/localsHelper.js.map +2 -2
  454. package/dpr/utils/logger.js +48 -1
  455. package/dpr/utils/logger.js.map +2 -2
  456. package/dpr/utils/reportListsHelper.js +128 -12
  457. package/dpr/utils/reportListsHelper.js.map +2 -2
  458. package/dpr/utils/reportStoreHelper.js +65 -1
  459. package/dpr/utils/reportStoreHelper.js.map +2 -2
  460. package/dpr/utils/requestStatusHelper.js +172 -1
  461. package/dpr/utils/requestStatusHelper.js.map +2 -2
  462. package/dpr/utils/sanitisedError.js +45 -1
  463. package/dpr/utils/sanitisedError.js.map +2 -2
  464. package/dpr/utils/urlHelper.js +103 -1
  465. package/dpr/utils/urlHelper.js.map +2 -2
  466. package/dpr/validation/validate.js +52 -1
  467. package/dpr/validation/validate.js.map +2 -2
  468. package/package.json +1 -1
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.ts"],
4
4
  "sourcesContent": ["import Dict = NodeJS.Dict\nimport { components } from '../../types/api'\nimport { Cell, DataTable } from '../DataTableBuilder/types'\nimport type { SummaryTemplate, Template } from '../../types/Templates'\nimport DataTableBuilder from '../DataTableBuilder/DataTableBuilder'\nimport { distinct } from '../arrayUtils'\nimport SummaryDataTableBuilder from '../SummaryDataTableBuilder/SummaryDataTableBuilder'\nimport { SectionSortKey } from './types'\n\nclass SectionedDataTableBuilder extends DataTableBuilder {\n sections: Array<string>\n\n template: Template\n\n constructor(specification: components['schemas']['Specification']) {\n const { fields, sections, template } = specification\n super(fields)\n this.sections = sections\n this.template = template\n }\n\n /**\n * Creates the section heading strings\n *\n * @param {Dict<string>[]} data\n * @param {FieldDefinition[]} sectionFields\n * @return {*} {string[]} array of section headings\n */\n private createSectionHeadings(\n data: Dict<string>[],\n sectionFields: components['schemas']['FieldDefinition'][],\n ): string[] {\n return data\n .map(\n (rowData): SectionSortKey => ({\n description: this.mapSectionDescription(rowData),\n sortKey: this.getSortKey(rowData, sectionFields),\n }),\n )\n .sort(this.sortKeyComparison())\n .map((s) => s.description)\n .reduce(distinct, [])\n }\n\n /**\n * Initialise section heading arrays\n *\n * @private\n * @param {string[]} sectionDescriptions\n * @return {*}\n * @memberof SectionedDataTableBuilder\n */\n initSectionData(sectionDescriptions: string[]) {\n const sectionedData: Dict<Cell[][]> | Dict<Array<Dict<string>>> = {}\n sectionDescriptions.forEach((sectionDescription) => {\n sectionedData[sectionDescription] = []\n })\n return sectionedData\n }\n\n /**\n * Maps the rows to the correct section\n *\n * @private\n * @param {Array<Dict<string>>} data\n * @param {Dict<Cell[][]>} sectionedData\n * @return {*}\n * @memberof SectionedDataTableBuilder\n */\n private mapRowsToSection(data: Array<Dict<string>>, sectionedData: Dict<Cell[][]>) {\n return data.reduce((previousValue, rowData) => {\n const sectionDescription: string = this.mapSectionDescription(rowData)\n const mappedData = this.mapRow(rowData)\n const previousValueDescription = previousValue[sectionDescription]\n\n return {\n ...previousValue,\n ...(previousValueDescription && {\n [sectionDescription]: previousValueDescription.concat([mappedData]),\n }),\n }\n }, sectionedData)\n }\n\n /**\n * Maps the rows to the correct section\n *\n * @private\n * @param {Array<Dict<string>>} data\n * @param {Dict<Cell[][]>} sectionedData\n * @return {*}\n * @memberof SectionedDataTableBuilder\n */\n private mapDataToSection(data: Array<Dict<string>>, sectionedData: Dict<Array<Dict<string>>>) {\n return data.reduce((previousValue, rowData) => {\n const sectionDescription: string = this.mapSectionDescription(rowData)\n const previousValueDescription = previousValue[sectionDescription]\n const section = {\n ...previousValue,\n ...(previousValueDescription && {\n [sectionDescription]: previousValueDescription.concat([rowData]),\n }),\n }\n return section\n }, sectionedData)\n }\n\n /**\n * Gets the counts for rows in section\n *\n * @param {Dict<Cell[][]>} sectionedData\n * @param {string} sectionDescription\n * @return {*}\n * @memberof SectionedDataTableBuilder\n */\n getSectionCount(sectionedData: Dict<Cell[][]> | Dict<Dict<string>[]>, sectionDescription: string) {\n const count = sectionedData[sectionDescription] ? sectionedData[sectionDescription].length : 0\n const countDescription = `${count} result${count === 1 ? '' : 's'}`\n\n return {\n count,\n countDescription,\n }\n }\n\n /**\n * Creates the summaries and builds the table with summaries\n *\n * @private\n * @param {string} sectionDescription\n * @param {Cell[][]} mappedTableData\n * @param {Cell[]} header\n * @return {*}\n * @memberof SectionedDataTableBuilder\n */\n private mapSummariesAndCreateTable(sectionDescription: string, mappedTableData: Cell[][], header: Cell[]) {\n let tableContent: Cell[][] = []\n\n let mappedSectionHeaderSummary: Cell[][] = []\n let mappedHeaderSummary: Cell[][] = []\n let mappedFooterSummary: Cell[][] = []\n let mappedSectionFooterSummary: Cell[][] = []\n\n mappedSectionHeaderSummary = this.mapSectionSummaryTables(sectionDescription, 'section-header', this.columns.length)\n mappedHeaderSummary = this.mapSectionSummaryRows('table-header', sectionDescription)\n mappedFooterSummary = this.mapSectionSummaryRows('table-footer', sectionDescription)\n mappedSectionFooterSummary = this.mapSectionSummaryTables(sectionDescription, 'section-footer', this.columns.length)\n\n tableContent = mappedSectionHeaderSummary\n .concat(mappedTableData.length > 0 ? [header] : [])\n .concat(mappedHeaderSummary)\n .concat(mappedTableData)\n .concat(mappedFooterSummary)\n .concat(mappedSectionFooterSummary)\n\n return tableContent\n }\n\n /**\n * Creates the table data\n * - if summaries are present, includes the summaries data\n *\n * @private\n * @param {string[]} sectionDescriptions\n * @param {Dict<Cell[][]>} sectionedData\n * @param {Cell[]} header\n * @return {*}\n * @memberof SectionedDataTableBuilder\n */\n private createTableContent(sectionDescriptions: string[], sectionedData: Dict<Cell[][]>, header: Cell[]) {\n return sectionDescriptions.flatMap((sectionDescription, index) => {\n const { count, countDescription } = this.getSectionCount(sectionedData, sectionDescription)\n const mappedTableData = sectionedData[sectionDescription]\n\n let tableContent: Cell[][] = []\n if (mappedTableData) {\n if (Object.keys(this.reportSummaries).length) {\n tableContent = this.mapSummariesAndCreateTable(sectionDescription, mappedTableData, header)\n } else {\n tableContent = tableContent.concat(mappedTableData.length > 0 ? [header] : []).concat(mappedTableData)\n }\n }\n\n const sectionHeader = this.createSectionHeader(sectionDescription, index, count, countDescription)\n\n return [...sectionHeader, ...tableContent]\n })\n }\n\n createSectionHeader(sectionDescription: string, index: number, count?: number, countDescription?: string) {\n const header = []\n if (index !== 0) {\n header.push([\n {\n classes: 'dpr-section-header-spacer',\n colspan: this.columns.length,\n text: '',\n },\n ])\n }\n header.push([\n {\n classes: 'dpr-section-header',\n colspan: this.columns.length,\n html: `<h2 class=\"govuk-heading-m\">${sectionDescription}${\n count && count > 0 ? ` <span class='govuk-caption-m'>${countDescription}</span>` : ''\n }</h2>`,\n },\n ])\n header.push([\n {\n classes: 'dpr-section-header-spacer-bottom',\n colspan: this.columns.length,\n text: '',\n },\n ])\n return header\n }\n\n private mapSectionSummaryRows(template: SummaryTemplate, sectionDescription: string): Cell[][] {\n if (this.reportSummaries[template]) {\n return this.reportSummaries[template].flatMap((reportSummary) =>\n reportSummary.data\n .filter((rowData) => this.mapSectionDescription(rowData) === sectionDescription)\n .map((rowData) =>\n this.mapRow(\n rowData,\n `dpr-report-summary-cell dpr-report-summary-cell-${template}`,\n <components['schemas']['FieldDefinition'][]>reportSummary.fields,\n ),\n ),\n )\n }\n return []\n }\n\n private mapSectionSummaryTables(\n sectionDescription: string,\n summaryTemplate: SummaryTemplate,\n columnsLength: number,\n ): Cell[][] {\n const summaries = this.reportSummaries[summaryTemplate]\n if (summaries) {\n const htmlTables = summaries.map((summary) => {\n const data = summary.data.filter((row) => this.mapSectionDescription(row) === sectionDescription)\n\n if (data.length > 0) {\n const dataTable = new SummaryDataTableBuilder(summary, this.sections).buildTable(data)\n\n const htmlTable = this.convertDataTableToHtml(dataTable)\n\n return `<div class='dpr-summary-container'>${htmlTable}</div>`\n }\n return ''\n })\n\n const summaryContent = htmlTables.join('')\n if (summaryContent.length > 0) {\n return [\n [\n {\n classes: 'dpr-summary-cell',\n colspan: columnsLength,\n html: `<div class='dpr-summary-container-group dpr-summary-container-group-${summaryTemplate}'>${summaryContent}</div>`,\n },\n ],\n ]\n }\n }\n return []\n }\n\n mapSectionDescription(rowData: NodeJS.Dict<string>): string {\n const { sections } = this\n\n return this.mapNamesToFields(sections)\n .map((s) => `${s.display}: ${this.mapCellValue(s, rowData[s.name])}`)\n .join(', ')\n }\n\n mapSections(data: Array<Dict<string>>) {\n const sectionHeadings = this.initSectionedHeadings(data)\n let { sectionedData } = sectionHeadings\n\n // Maps data to sections\n if (this.template !== 'summary-section') {\n if (this.template === 'parent-child-section') {\n sectionedData = this.mapDataToSection(data, sectionedData as Dict<Dict<string>[]>)\n } else {\n sectionedData = this.mapRowsToSection(data, sectionedData as Dict<Cell[][]>)\n }\n }\n\n return {\n sectionDescriptions: sectionHeadings.sectionDescriptions,\n sectionedData,\n }\n }\n\n initSectionedHeadings(data: Array<Dict<string>>) {\n // Get the section definition data\n const sectionFields = this.mapNamesToFields(this.sections)\n // create the sectionHeadings\n const sectionDescriptions = this.createSectionHeadings(data, sectionFields)\n // init empty sections\n const sectionedData = this.initSectionData(sectionDescriptions)\n\n return {\n sectionDescriptions,\n sectionedData,\n }\n }\n\n /**\n * Creates the table rows.\n *\n * @private\n * @param {Array<Dict<string>>} data\n * @param {Cell[]} header\n * @return {*} {Cell[][]}\n * @memberof SectionedDataTableBuilder\n */\n private mapSectionedData(data: Array<Dict<string>>, header: Cell[]): Cell[][] {\n const { sectionDescriptions, sectionedData } = this.mapSections(data)\n // Create the table\n const tableContent = this.createTableContent(sectionDescriptions, sectionedData as Dict<Cell[][]>, header)\n\n return tableContent\n }\n\n override buildTable(data: Array<Dict<string>>): DataTable {\n return {\n head: null,\n rows: this.mapSectionedData(data, this.mapHeader(true, 'govuk-table__header')),\n rowCount: data.length,\n colCount: this.columns.length,\n }\n }\n}\n\nexport { SectionedDataTableBuilder }\nexport default SectionedDataTableBuilder\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAIA,IAAAK,EAA6B,mDAC7BC,EAAyB,yBACzBC,EAAoC,iEAGpC,MAAML,UAAkC,EAAAM,OAAiB,CACvD,SAEA,SAEA,YAAYC,EAAuD,CACjE,KAAM,CAAE,OAAAC,EAAQ,SAAAC,EAAU,SAAAC,CAAS,EAAIH,EACvC,MAAMC,CAAM,EACZ,KAAK,SAAWC,EAChB,KAAK,SAAWC,CAClB,CASQ,sBACNC,EACAC,EACU,CACV,OAAOD,EACJ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KAAK,aAAaA,EAAGD,EAAQC,EAAE,IAAI,CAAC,CAAC,EAAE,EACnE,KAAK,IAAI,CACd,CAEA,YAAYH,EAA2B,CACrC,MAAM6B,EAAkB,KAAK,sBAAsB7B,CAAI,EACvD,GAAI,CAAE,cAAAK,CAAc,EAAIwB,EAGxB,OAAI,KAAK,WAAa,oBAChB,KAAK,WAAa,uBACpBxB,EAAgB,KAAK,iBAAiBL,EAAMK,CAAqC,EAEjFA,EAAgB,KAAK,iBAAiBL,EAAMK,CAA+B,GAIxE,CACL,oBAAqBwB,EAAgB,oBACrC,cAAAxB,CACF,CACF,CAEA,sBAAsBL,EAA2B,CAE/C,MAAMC,EAAgB,KAAK,iBAAiB,KAAK,QAAQ,EAEnDG,EAAsB,KAAK,sBAAsBJ,EAAMC,CAAa,EAEpEI,EAAgB,KAAK,gBAAgBD,CAAmB,EAE9D,MAAO,CACL,oBAAAA,EACA,cAAAC,CACF,CACF,CAWQ,iBAAiBL,EAA2Ba,EAA0B,CAC5E,KAAM,CAAE,oBAAAT,EAAqB,cAAAC,CAAc,EAAI,KAAK,YAAYL,CAAI,EAIpE,OAFqB,KAAK,mBAAmBI,EAAqBC,EAAiCQ,CAAM,CAG3G,CAES,WAAWb,EAAsC,CACxD,MAAO,CACL,KAAM,KACN,KAAM,KAAK,iBAAiBA,EAAM,KAAK,UAAU,GAAM,qBAAqB,CAAC,EAC7E,SAAUA,EAAK,OACf,SAAU,KAAK,QAAQ,MACzB,CACF,CACF,CAGA,IAAOV,EAAQD",
6
- "names": ["SectionedDataTableBuilder_exports", "__export", "SectionedDataTableBuilder", "SectionedDataTableBuilder_default", "__toCommonJS", "import_DataTableBuilder", "import_arrayUtils", "import_SummaryDataTableBuilder", "DataTableBuilder", "specification", "fields", "sections", "template", "data", "sectionFields", "rowData", "s", "sectionDescriptions", "sectionedData", "sectionDescription", "previousValue", "mappedData", "previousValueDescription", "count", "countDescription", "mappedTableData", "header", "tableContent", "mappedSectionHeaderSummary", "mappedHeaderSummary", "mappedFooterSummary", "mappedSectionFooterSummary", "index", "reportSummary", "summaryTemplate", "columnsLength", "summaries", "summaryContent", "summary", "row", "dataTable", "SummaryDataTableBuilder", "sectionHeadings"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,8BAA6B;AAC7B,wBAAyB;AACzB,qCAAoC;AAGpC,MAAM,kCAAkC,wBAAAA,QAAiB;AAAA,EACvD;AAAA,EAEA;AAAA,EAEA,YAAY,eAAuD;AACjE,UAAM,EAAE,QAAQ,UAAU,SAAS,IAAI;AACvC,UAAM,MAAM;AACZ,SAAK,WAAW;AAChB,SAAK,WAAW;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASQ,sBACN,MACA,eACU;AACV,WAAO,KACJ;AAAA,MACC,CAAC,aAA6B;AAAA,QAC5B,aAAa,KAAK,sBAAsB,OAAO;AAAA,QAC/C,SAAS,KAAK,WAAW,SAAS,aAAa;AAAA,MACjD;AAAA,IACF,EACC,KAAK,KAAK,kBAAkB,CAAC,EAC7B,IAAI,CAAC,MAAM,EAAE,WAAW,EACxB,OAAO,4BAAU,CAAC,CAAC;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,gBAAgB,qBAA+B;AAC7C,UAAM,gBAA4D,CAAC;AACnE,wBAAoB,QAAQ,CAAC,uBAAuB;AAClD,oBAAc,kBAAkB,IAAI,CAAC;AAAA,IACvC,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWQ,iBAAiB,MAA2B,eAA+B;AACjF,WAAO,KAAK,OAAO,CAAC,eAAe,YAAY;AAC7C,YAAM,qBAA6B,KAAK,sBAAsB,OAAO;AACrE,YAAM,aAAa,KAAK,OAAO,OAAO;AACtC,YAAM,2BAA2B,cAAc,kBA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N,MAAM,KAAK,iBAAiB,MAAM,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAAA,MAC7E,UAAU,KAAK;AAAA,MACf,UAAU,KAAK,QAAQ;AAAA,IACzB;AAAA,EACF;AACF;AAGA,IAAO,oCAAQ;",
6
+ "names": ["DataTableBuilder", "SummaryDataTableBuilder"]
7
7
  }
@@ -1,2 +1,17 @@
1
- "use strict";var i=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!p.call(t,r)&&r!==n&&i(t,r,{get:()=>e[r],enumerable:!(o=S(e,r))||o.enumerable});return t};var y=t=>s(i({},"__esModule",{value:!0}),t);var K={};module.exports=y(K);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_d_exports = {};
16
+ module.exports = __toCommonJS(types_d_exports);
2
17
  //# sourceMappingURL=types.d.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/SectionedDataTableBuilder/types.d.ts"],
4
4
  "sourcesContent": ["import { SortKey } from '../DataTableBuilder/types'\n\nexport interface SectionSortKey extends SortKey {\n description: string\n}\n"],
5
- "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
- "names": ["types_d_exports", "__toCommonJS"]
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,146 @@
1
- "use strict";var m=Object.create;var o=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var g=(a,i)=>{for(var t in i)o(a,t,{get:i[t],enumerable:!0})},h=(a,i,t,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let e of u(i))!F.call(a,e)&&e!==t&&o(a,e,{get:()=>i[e],enumerable:!(d=f(i,e))||d.enumerable});return a};var y=(a,i,t)=>(t=a!=null?m(D(a)):{},h(i||!a||!a.__esModule?o(t,"default",{value:a,enumerable:!0}):t,a)),C=a=>h(o({},"__esModule",{value:!0}),a);var T={};g(T,{SectionedFieldsDataTableBuilder:()=>c,default:()=>S});module.exports=C(T);var p=y(require("../ParentChildDataTableBuilder/ParentChildDataTableBuilder"));class c extends p.default{sectionedFields;constructor(i){const{sectionedFields:t,template:d}=i.specification;super(i),this.sectionedFields=t,this.sections=this.sectionedFields.map(e=>e.name),this.template=d,this.childVariants=this.variant.childVariants||[]}getChildFields(i){const t=this.childVariants.find(e=>e.id===i);let d=[];if(t){const{specification:e}=t;d=e?e.fields:d}return d}getJoinKey(){return this.childVariants[0].joinFields[0]}initSectionedData(i){return i.flatMap(t=>this.sectionedFields.map(e=>{const s=this.mapNamesToFields([e.name])[0];let n=[];const{child:r}=e;return e.fields?n=this.mapNamesToFields(e.fields):e.child&&(n=this.getChildFields(e.child)),{header:s,fields:n,child:r}}).map(e=>{if(e.child){const s=this.getChildData(e.child),n=e.fields.filter(l=>l.visible),r=this.getJoinKey();return{header:e.header.display,fields:s?s.data.filter(l=>l[r]===t[r]).map(l=>({heading:l[n[0]?.name]||"Not found",data:l[n[1]?.name]||"Not found"})):[]}}return{header:e.header.display,fields:e.fields.filter(s=>s.visible).map(s=>({heading:s.display,data:t[s.name]}))}}))}getChildData(i){return this.childData.find(t=>t.id===i)}createRows(i){return this.initSectionedData(i).flatMap((e,s)=>{let n=[];e.header&&(n=this.createSectionHeader(e.header,s));const r=e.fields.map(l=>[{text:l.heading,classes:"dpr-row-heading"},{text:l.data,classes:"dpr-row-heading-data"}]);return[...n,...r]})}buildTable(i){return{head:[],rows:this.createRows(i),rowCount:i.length,colCount:this.columns.length}}}var S=c;0&&(module.exports={SectionedFieldsDataTableBuilder});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var SectionedFieldsTableBuilder_exports = {};
30
+ __export(SectionedFieldsTableBuilder_exports, {
31
+ SectionedFieldsDataTableBuilder: () => SectionedFieldsDataTableBuilder,
32
+ default: () => SectionedFieldsTableBuilder_default
33
+ });
34
+ module.exports = __toCommonJS(SectionedFieldsTableBuilder_exports);
35
+ var import_ParentChildDataTableBuilder = __toESM(require("../ParentChildDataTableBuilder/ParentChildDataTableBuilder"));
36
+ class SectionedFieldsDataTableBuilder extends import_ParentChildDataTableBuilder.default {
37
+ // TODO: change this to use schema type if ever implemented in the backend
38
+ sectionedFields;
39
+ constructor(variant) {
40
+ const { sectionedFields, template } = variant.specification;
41
+ super(variant);
42
+ this.sectionedFields = sectionedFields;
43
+ this.sections = this.sectionedFields.map((f) => f.name);
44
+ this.template = template;
45
+ this.childVariants = this.variant.childVariants || [];
46
+ }
47
+ getChildFields(childId) {
48
+ const childVariant = this.childVariants.find((child) => child.id === childId);
49
+ let fields = [];
50
+ if (childVariant) {
51
+ const { specification } = childVariant;
52
+ fields = specification ? specification.fields : fields;
53
+ }
54
+ return fields;
55
+ }
56
+ getJoinKey() {
57
+ return this.childVariants[0].joinFields[0];
58
+ }
59
+ initSectionedData(data) {
60
+ return data.flatMap((row) => {
61
+ const initialisedSectionsWithFields = this.sectionedFields.map((section) => {
62
+ const sectionHeader = this.mapNamesToFields([section.name])[0];
63
+ let fields = [];
64
+ const { child } = section;
65
+ if (section.fields) {
66
+ fields = this.mapNamesToFields(section.fields);
67
+ } else if (section.child) {
68
+ fields = this.getChildFields(section.child);
69
+ }
70
+ return {
71
+ header: sectionHeader,
72
+ fields,
73
+ child
74
+ };
75
+ });
76
+ return initialisedSectionsWithFields.map((section) => {
77
+ if (section.child) {
78
+ const childData = this.getChildData(section.child);
79
+ const displayFields = section.fields.filter((f) => f.visible);
80
+ const joinKey = this.getJoinKey();
81
+ return {
82
+ header: section.header.display,
83
+ fields: childData ? childData.data.filter((cd) => cd[joinKey] === row[joinKey]).map((cd) => {
84
+ return {
85
+ heading: cd[displayFields[0]?.name] || "Not found",
86
+ data: cd[displayFields[1]?.name] || "Not found"
87
+ };
88
+ }) : []
89
+ };
90
+ }
91
+ return {
92
+ header: section.header.display,
93
+ fields: section.fields.filter((f) => f.visible).map((f) => {
94
+ return {
95
+ heading: f.display,
96
+ data: row[f.name]
97
+ };
98
+ })
99
+ };
100
+ });
101
+ });
102
+ }
103
+ getChildData(childId) {
104
+ return this.childData.find((d) => d.id === childId);
105
+ }
106
+ createRows(data) {
107
+ const sectionedData = this.initSectionedData(data);
108
+ const rows = sectionedData.flatMap((section, index) => {
109
+ let sectionHeaderRow = [];
110
+ if (section.header) {
111
+ sectionHeaderRow = this.createSectionHeader(section.header, index);
112
+ }
113
+ const sectionRows = section.fields.map((field) => {
114
+ return [
115
+ {
116
+ text: field.heading,
117
+ classes: "dpr-row-heading"
118
+ },
119
+ {
120
+ text: field.data,
121
+ classes: "dpr-row-heading-data"
122
+ }
123
+ ];
124
+ });
125
+ return [...sectionHeaderRow, ...sectionRows];
126
+ });
127
+ return rows;
128
+ }
129
+ buildTable(data) {
130
+ return {
131
+ head: [
132
+ // { text: '', classes: 'dpr-row-section-header' },
133
+ // { text: '', classes: 'dpr-row-section-header-value' },
134
+ ],
135
+ rows: this.createRows(data),
136
+ rowCount: data.length,
137
+ colCount: this.columns.length
138
+ };
139
+ }
140
+ }
141
+ var SectionedFieldsTableBuilder_default = SectionedFieldsDataTableBuilder;
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ SectionedFieldsDataTableBuilder
145
+ });
2
146
  //# sourceMappingURL=SectionedFieldsTableBuilder.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.ts"],
4
4
  "sourcesContent": ["import Dict = NodeJS.Dict\nimport { components } from '../../types/api'\nimport { Cell, DataTable, FieldDefinition } from '../DataTableBuilder/types'\nimport type { Template } from '../../types/Templates'\nimport ParentChildDataTableBuilder from '../ParentChildDataTableBuilder/ParentChildDataTableBuilder'\n\nexport interface SectionedField {\n name: string\n fields?: string[]\n child?: string\n}\n\nclass SectionedFieldsDataTableBuilder extends ParentChildDataTableBuilder {\n // TODO: change this to use schema type if ever implemented in the backend\n sectionedFields: SectionedField[]\n\n declare template: Template\n\n declare childVariants: components['schemas']['ChildVariantDefinition'][]\n\n constructor(variant: components['schemas']['VariantDefinition']) {\n // TODO: removed the union if sectionedFields changed to use schema type\n const { sectionedFields, template } = variant.specification as components['schemas']['Specification'] & {\n sectionedFields: SectionedField[]\n }\n super(variant)\n\n this.sectionedFields = sectionedFields\n this.sections = this.sectionedFields.map((f) => f.name)\n this.template = template\n this.childVariants = this.variant.childVariants || []\n }\n\n getChildFields(childId: string): FieldDefinition[] {\n const childVariant = this.childVariants.find((child) => child.id === childId)\n let fields: FieldDefinition[] = []\n if (childVariant) {\n const { specification } = childVariant\n fields = specification ? specification.fields : fields\n }\n return fields\n }\n\n getJoinKey() {\n return this.childVariants[0].joinFields[0]\n }\n\n initSectionedData(data: Array<Dict<string>>) {\n return data.flatMap((row) => {\n const initialisedSectionsWithFields = this.sectionedFields.map((section) => {\n const sectionHeader = this.mapNamesToFields([section.name])[0]\n\n let fields: FieldDefinition[] = []\n const { child } = section\n\n if (section.fields) {\n fields = this.mapNamesToFields(section.fields)\n } else if (section.child) {\n fields = this.getChildFields(section.child)\n }\n\n return {\n header: sectionHeader,\n fields,\n child,\n }\n })\n\n return initialisedSectionsWithFields.map((section) => {\n if (section.child) {\n const childData = this.getChildData(section.child)\n const displayFields = section.fields.filter((f) => f.visible)\n const joinKey = this.getJoinKey()\n\n return {\n header: section.header.display,\n fields: childData\n ? childData.data\n .filter((cd) => cd[joinKey] === row[joinKey])\n .map((cd) => {\n return {\n heading: cd[displayFields[0]?.name] || 'Not found',\n data: cd[displayFields[1]?.name] || 'Not found',\n }\n })\n : [],\n }\n }\n return {\n header: section.header.display,\n fields: section.fields\n .filter((f) => f.visible)\n .map((f) => {\n return {\n heading: f.display,\n data: row[f.name],\n }\n }),\n }\n })\n })\n }\n\n getChildData(childId: string) {\n return this.childData.find((d) => d.id === childId)\n }\n\n createRows(data: Array<Dict<string>>): Cell[][] {\n const sectionedData = this.initSectionedData(data)\n\n const rows = sectionedData.flatMap((section, index) => {\n let sectionHeaderRow: Cell[][] = []\n if (section.header) {\n sectionHeaderRow = this.createSectionHeader(section.header, index)\n }\n\n const sectionRows = section.fields.map((field) => {\n return [\n {\n text: field.heading,\n classes: 'dpr-row-heading',\n },\n {\n text: field.data,\n classes: 'dpr-row-heading-data',\n },\n ]\n })\n\n return [...sectionHeaderRow, ...sectionRows]\n })\n\n return rows\n }\n\n override buildTable(data: Array<Dict<string>>): DataTable {\n return {\n head: [\n // { text: '', classes: 'dpr-row-section-header' },\n // { text: '', classes: 'dpr-row-section-header-value' },\n ],\n rows: this.createRows(data),\n rowCount: data.length,\n colCount: this.columns.length,\n }\n }\n}\n\nexport { SectionedFieldsDataTableBuilder }\nexport default SectionedFieldsDataTableBuilder\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAIA,IAAAK,EAAwC,yEAQxC,MAAMH,UAAwC,EAAAI,OAA4B,CAExE,gBAMA,YAAYC,EAAqD,CAE/D,KAAM,CAAE,gBAAAC,EAAiB,SAAAC,CAAS,EAAIF,EAAQ,cAG9C,MAAMA,CAAO,EAEb,KAAK,gBAAkBC,EACvB,KAAK,SAAW,KAAK,gBAAgB,IAAKE,GAAMA,EAAE,IAAI,EACtD,KAAK,SAAWD,EAChB,KAAK,cAAgB,KAAK,QAAQ,eAAiB,CAAC,CACtD,CAEA,eAAeE,EAAoC,CACjD,MAAMC,EAAe,KAAK,cAAc,KAAMC,GAAUA,EAAM,KAAOF,CAAO,EAC5E,IAAIG,EAA4B,CAAC,EACjC,GAAIF,EAAc,CAChB,KAAM,CAAE,cAAAG,CAAc,EAAIH,EAC1BE,EAASC,EAAgBA,EAAc,OAASD,CAClD,CACA,OAAOA,CACT,CAEA,YAAa,CACX,OAAO,KA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,CAACE,EAASO,IAAU,CACrD,IAAIC,EAA6B,CAAC,EAC9BR,EAAQ,SACVQ,EAAmB,KAAK,oBAAoBR,EAAQ,OAAQO,CAAK,GAGnE,MAAME,EAAcT,EAAQ,OAAO,IAAKU,GAC/B,CACL,CACE,KAAMA,EAAM,QACZ,QAAS,iBACX,EACA,CACE,KAAMA,EAAM,KACZ,QAAS,sBACX,CACF,CACD,EAED,MAAO,CAAC,GAAGF,EAAkB,GAAGC,CAAW,CAC7C,CAAC,CAGH,CAES,WAAWX,EAAsC,CACxD,MAAO,CACL,KAAM,CAGN,EACA,KAAM,KAAK,WAAWA,CAAI,EAC1B,SAAUA,EAAK,OACf,SAAU,KAAK,QAAQ,MACzB,CACF,CACF,CAGA,IAAOb,EAAQD",
6
- "names": ["SectionedFieldsTableBuilder_exports", "__export", "SectionedFieldsDataTableBuilder", "SectionedFieldsTableBuilder_default", "__toCommonJS", "import_ParentChildDataTableBuilder", "ParentChildDataTableBuilder", "variant", "sectionedFields", "template", "f", "childId", "childVariant", "child", "fields", "specification", "data", "row", "section", "sectionHeader", "childData", "displayFields", "joinKey", "cd", "d", "index", "sectionHeaderRow", "sectionRows", "field"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yCAAwC;AAQxC,MAAM,wCAAwC,mCAAAA,QAA4B;AAAA;AAAA,EAExE;AAAA,EAMA,YAAY,SAAqD;AAE/D,UAAM,EAAE,iBAAiB,SAAS,IAAI,QAAQ;AAG9C,UAAM,OAAO;AAEb,SAAK,kBAAkB;AACvB,SAAK,WAAW,KAAK,gBAAgB,IAAI,CAAC,MAAM,EAAE,IAAI;AACtD,SAAK,WAAW;AAChB,SAAK,gBAAgB,KAAK,QAAQ,iBAAiB,CAAC;AAAA,EACtD;AAAA,EAEA,eAAe,SAAoC;AACjD,UAAM,eAAe,KAAK,cAAc,KAAK,CAAC,UAAU,MAAM,OAAO,OAAO;AAC5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ty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var y=(a,e)=>{for(var r in e)l(a,r,{get:e[r],enumerable:!0})},o=(a,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of d(e))!p.call(a,t)&&t!==r&&l(a,t,{get:()=>e[t],enumerable:!(s=c(e,t))||s.enumerable});return a};var b=(a,e,r)=>(r=a!=null?n(f(a)):{},o(e||!a||!a.__esModule?l(r,"default",{value:a,enumerable:!0}):r,a)),T=a=>o(l({},"__esModule",{value:!0}),a);var S={};y(S,{SummaryDataTableBuilder:()=>i,default:()=>D});module.exports=T(S);var u=b(require("../DataTableBuilder/DataTableBuilder"));class i extends u.default{summary;constructor(e,r){const s=e.fields.filter(m=>!r||!r.includes(m.name)).map(m=>m.name),t=e.fields.map(m=>({...m,calculated:!1,sortable:!1,defaultsort:!1,mandatory:!0,visible:!0}));super(t,!0),this.summary=e,this.columns=s}buildSummaryTable(){return super.buildTable(this.summary.data)}}var D=i;0&&(module.exports={SummaryDataTableBuilder});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var SummaryDataTableBuilder_exports = {};
30
+ __export(SummaryDataTableBuilder_exports, {
31
+ SummaryDataTableBuilder: () => SummaryDataTableBuilder,
32
+ default: () => SummaryDataTableBuilder_default
33
+ });
34
+ module.exports = __toCommonJS(SummaryDataTableBuilder_exports);
35
+ var import_DataTableBuilder = __toESM(require("../DataTableBuilder/DataTableBuilder"));
36
+ class SummaryDataTableBuilder extends import_DataTableBuilder.default {
37
+ summary;
38
+ constructor(summary, sections) {
39
+ const columns = summary.fields.filter((field) => !sections || !sections.includes(field.name)).map((field) => field.name);
40
+ const fields = summary.fields.map((field) => ({
41
+ ...field,
42
+ calculated: false,
43
+ sortable: false,
44
+ defaultsort: false,
45
+ mandatory: true,
46
+ visible: true
47
+ }));
48
+ super(fields, true);
49
+ this.summary = summary;
50
+ this.columns = columns;
51
+ }
52
+ buildSummaryTable() {
53
+ return super.buildTable(this.summary.data);
54
+ }
55
+ }
56
+ var SummaryDataTableBuilder_default = SummaryDataTableBuilder;
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ SummaryDataTableBuilder
60
+ });
2
61
  //# sourceMappingURL=SummaryDataTableBuilder.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/SummaryDataTableBuilder/SummaryDataTableBuilder.ts"],
4
4
  "sourcesContent": ["import { components } from '../../types/api'\nimport { AsyncSummary } from '../../types/UserReports'\nimport DataTableBuilder from '../DataTableBuilder/DataTableBuilder'\nimport { DataTable } from '../DataTableBuilder/types'\n\nclass SummaryDataTableBuilder extends DataTableBuilder {\n private summary: AsyncSummary\n\n constructor(summary: AsyncSummary, sections?: Array<string>) {\n const columns = summary.fields\n .filter((field) => !sections || !sections.includes(field.name))\n .map((field) => field.name)\n\n const fields = summary.fields.map((field) => ({\n ...field,\n calculated: false,\n sortable: false,\n defaultsort: false,\n mandatory: true,\n visible: true,\n }))\n\n super(<components['schemas']['FieldDefinition'][]>fields, true)\n\n this.summary = summary\n this.columns = columns\n }\n\n buildSummaryTable(): DataTable {\n return super.buildTable(this.summary.data)\n }\n}\n\nexport { SummaryDataTableBuilder }\nexport default SummaryDataTableBuilder\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAEA,IAAAK,EAA6B,mDAG7B,MAAMH,UAAgC,EAAAI,OAAiB,CAC7C,QAER,YAAYC,EAAuBC,EAA0B,CAC3D,MAAMC,EAAUF,EAAQ,OACrB,OAAQG,GAAU,CAACF,GAAY,CAACA,EAAS,SAASE,EAAM,IAAI,CAAC,EAC7D,IAAKA,GAAUA,EAAM,IAAI,EAEtBC,EAASJ,EAAQ,OAAO,IAAKG,IAAW,CAC5C,GAAGA,EACH,WAAY,GACZ,SAAU,GACV,YAAa,GACb,UAAW,GACX,QAAS,EACX,EAAE,EAEF,MAAkDC,EAAQ,EAAI,EAE9D,KAAK,QAAUJ,EACf,KAAK,QAAUE,CACjB,CAEA,mBAA+B,CAC7B,OAAO,MAAM,WAAW,KAAK,QAAQ,IAAI,CAC3C,CACF,CAGA,IAAON,EAAQD",
6
- "names": ["SummaryDataTableBuilder_exports", "__export", "SummaryDataTableBuilder", "SummaryDataTableBuilder_default", "__toCommonJS", "import_DataTableBuilder", "DataTableBuilder", "summary", "sections", "columns", "field", "fields"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8BAA6B;AAG7B,MAAM,gCAAgC,wBAAAA,QAAiB;AAAA,EAC7C;AAAA,EAER,YAAY,SAAuB,UAA0B;AAC3D,UAAM,UAAU,QAAQ,OACrB,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,SAAS,MAAM,IAAI,CAAC,EAC7D,IAAI,CAAC,UAAU,MAAM,IAAI;AAE5B,UAAM,SAAS,QAAQ,OAAO,IAAI,CAAC,WAAW;AAAA,MAC5C,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,IACX,EAAE;AAEF,UAAkD,QAAQ,IAAI;AAE9D,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,oBAA+B;AAC7B,WAAO,MAAM,WAAW,KAAK,QAAQ,IAAI;AAAA,EAC3C;AACF;AAGA,IAAO,kCAAQ;",
6
+ "names": ["DataTableBuilder"]
7
7
  }
@@ -1,2 +1,248 @@
1
- "use strict";var I=Object.create;var u=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var f=(r,t)=>{for(var e in t)u(r,e,{get:t[e],enumerable:!0})},d=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of y(t))!g.call(r,s)&&s!==e&&u(r,s,{get:()=>t[s],enumerable:!(i=D(t,s))||i.enumerable});return r};var q=(r,t,e)=>(e=r!=null?I(R(r)):{},d(t||!r||!r.__esModule?u(e,"default",{value:r,enumerable:!0}):e,r)),U=r=>d(u({},"__esModule",{value:!0}),r);var b={};f(b,{UserStoreItemBuilder:()=>h,default:()=>E});module.exports=U(b);var p=q(require("parseurl")),o=require("../types/UserReports");class h{userStoreItem;requestFormData;constructor(t,e){this.requestFormData=e||{},this.userStoreItem=this.addReportData(t)}build=()=>this.userStoreItem;addReportData=({type:t,reportId:e,reportName:i,description:s,id:m,name:n})=>({type:t,reportId:e,reportName:i,description:s,id:m,name:n,timestamp:{}});addExecutionData=t=>(this.userStoreItem={...this.userStoreItem,...t},this);addChildExecutionData=t=>(this.userStoreItem={...this.userStoreItem,childExecutionData:t},this);addFilters=t=>{const e=new URLSearchParams(t).toString();return this.userStoreItem={...this.userStoreItem,filters:{data:t,queryString:e}},this};addSortData=t=>{const e=new URLSearchParams(t).toString();return this.userStoreItem={...this.userStoreItem,sortBy:{data:t,queryString:e}},this};addRequestUrls=t=>{const{origin:e,pathname:i,search:s,href:m}=this.requestFormData,{executionId:n,dataProductDefinitionsPath:S,dpdPathFromQuery:l}=this.userStoreItem;let a=t.baseUrl.replace("/filters",`/${n}/status`);l&&(a=`${a}?dataProductDefinitionsPath=${S}`);const c=`${e}${a}`;return this.userStoreItem={...this.userStoreItem,url:{origin:e,request:{fullUrl:m,pathname:i,search:s},polling:{fullUrl:c,pathname:a}}},this};addAsyncUrls=t=>(t&&(this.userStoreItem={...this.userStoreItem,url:t}),this);addReportUrls=t=>{const e=t.get("host"),i=`${t.protocol}://${t.get("host")}${t.originalUrl}`,s=(0,p.default)(t);return this.userStoreItem={...this.userStoreItem,url:{origin:e||this.userStoreItem.url?.origin||"",...this.userStoreItem.url?.request&&{request:this.userStoreItem.url.request},...this.userStoreItem.url?.polling&&{polling:this.userStoreItem.url.polling},report:{...this.userStoreItem.url?.report&&this.userStoreItem.url.report,fullUrl:i,...s&&s.search&&{search:s.search}}}},this};addLoadType=t=>(this.userStoreItem={...this.userStoreItem,loadType:t},this);addQuery=t=>(this.userStoreItem={...this.userStoreItem,...t&&{query:{data:t.query,summary:t.querySummary}}},this);addInteractiveQuery=t=>(t&&(this.userStoreItem={...this.userStoreItem,interactiveQuery:{data:t.query,summary:t.querySummary}}),this);addStatus=t=>(this.userStoreItem={...this.userStoreItem,status:t},this);addMetrics=t=>(this.userStoreItem={...this.userStoreItem,metrics:t.filter(e=>e.display).map(e=>({name:e.display||""}))},this);addTimestamp=()=>{const{status:t}=this.userStoreItem,e=new Date;switch(t){case o.RequestStatus.FAILED:this.userStoreItem.timestamp.failed=e;break;case o.RequestStatus.EXPIRED:this.userStoreItem.timestamp.expired=e;break;case o.RequestStatus.ABORTED:this.userStoreItem.timestamp.aborted=e;break;case o.RequestStatus.FINISHED:this.userStoreItem.timestamp.completed=e;break;case o.RequestStatus.SUBMITTED:this.userStoreItem.timestamp.requested=e;break;case o.RequestStatus.STARTED:case o.RequestStatus.PICKED:break;default:this.userStoreItem.timestamp.lastViewed=e;break}return this};addDefinitionsPath=(t,e)=>(t&&(this.userStoreItem={...this.userStoreItem,dataProductDefinitionsPath:t,dpdPathFromQuery:e}),this)}var E=h;0&&(module.exports={UserStoreItemBuilder});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var UserStoreItemBuilder_exports = {};
30
+ __export(UserStoreItemBuilder_exports, {
31
+ UserStoreItemBuilder: () => UserStoreItemBuilder,
32
+ default: () => UserStoreItemBuilder_default
33
+ });
34
+ module.exports = __toCommonJS(UserStoreItemBuilder_exports);
35
+ var import_parseurl = __toESM(require("parseurl"));
36
+ var import_UserReports = require("../types/UserReports");
37
+ class UserStoreItemBuilder {
38
+ userStoreItem;
39
+ requestFormData;
40
+ constructor(reportData, requestFormData) {
41
+ this.requestFormData = requestFormData || {};
42
+ this.userStoreItem = this.addReportData(reportData);
43
+ }
44
+ build = () => {
45
+ return this.userStoreItem;
46
+ };
47
+ addReportData = ({ type, reportId, reportName, description, id, name }) => {
48
+ return {
49
+ type,
50
+ reportId,
51
+ reportName,
52
+ description,
53
+ id,
54
+ name,
55
+ timestamp: {}
56
+ };
57
+ };
58
+ addExecutionData = (executionData) => {
59
+ this.userStoreItem = {
60
+ ...this.userStoreItem,
61
+ ...executionData
62
+ };
63
+ return this;
64
+ };
65
+ addChildExecutionData = (childExecutionData) => {
66
+ this.userStoreItem = {
67
+ ...this.userStoreItem,
68
+ childExecutionData
69
+ };
70
+ return this;
71
+ };
72
+ addFilters = (filterData) => {
73
+ const filtersQueryString = new URLSearchParams(filterData).toString();
74
+ this.userStoreItem = {
75
+ ...this.userStoreItem,
76
+ ...{
77
+ filters: {
78
+ data: filterData,
79
+ queryString: filtersQueryString
80
+ }
81
+ }
82
+ };
83
+ return this;
84
+ };
85
+ addSortData = (sortData) => {
86
+ const sortByQueryString = new URLSearchParams(sortData).toString();
87
+ this.userStoreItem = {
88
+ ...this.userStoreItem,
89
+ ...{
90
+ sortBy: {
91
+ data: sortData,
92
+ queryString: sortByQueryString
93
+ }
94
+ }
95
+ };
96
+ return this;
97
+ };
98
+ addRequestUrls = (req) => {
99
+ const { origin, pathname, search, href } = this.requestFormData;
100
+ const { executionId, dataProductDefinitionsPath, dpdPathFromQuery } = this.userStoreItem;
101
+ let pollingPath = req.baseUrl.replace("/filters", `/${executionId}/status`);
102
+ if (dpdPathFromQuery) {
103
+ pollingPath = `${pollingPath}?dataProductDefinitionsPath=${dataProductDefinitionsPath}`;
104
+ }
105
+ const pollingFullUrl = `${origin}${pollingPath}`;
106
+ this.userStoreItem = {
107
+ ...this.userStoreItem,
108
+ ...{
109
+ url: {
110
+ origin,
111
+ request: {
112
+ fullUrl: href,
113
+ pathname,
114
+ search
115
+ },
116
+ polling: {
117
+ fullUrl: pollingFullUrl,
118
+ pathname: pollingPath
119
+ }
120
+ }
121
+ }
122
+ };
123
+ return this;
124
+ };
125
+ addAsyncUrls = (url) => {
126
+ if (url) {
127
+ this.userStoreItem = {
128
+ ...this.userStoreItem,
129
+ ...{
130
+ url
131
+ }
132
+ };
133
+ }
134
+ return this;
135
+ };
136
+ addReportUrls = (req) => {
137
+ const origin = req.get("host");
138
+ const fullUrl = `${req.protocol}://${req.get("host")}${req.originalUrl}`;
139
+ const urlData = (0, import_parseurl.default)(req);
140
+ this.userStoreItem = {
141
+ ...this.userStoreItem,
142
+ ...{
143
+ url: {
144
+ origin: origin || this.userStoreItem.url?.origin || "",
145
+ ...this.userStoreItem.url?.request && { request: this.userStoreItem.url.request },
146
+ ...this.userStoreItem.url?.polling && { polling: this.userStoreItem.url.polling },
147
+ report: {
148
+ ...this.userStoreItem.url?.report && this.userStoreItem.url.report,
149
+ fullUrl,
150
+ ...urlData && urlData.search && { search: urlData.search }
151
+ }
152
+ }
153
+ }
154
+ };
155
+ return this;
156
+ };
157
+ addLoadType = (loadType) => {
158
+ this.userStoreItem = {
159
+ ...this.userStoreItem,
160
+ loadType
161
+ };
162
+ return this;
163
+ };
164
+ addQuery = (queryData) => {
165
+ this.userStoreItem = {
166
+ ...this.userStoreItem,
167
+ ...queryData && {
168
+ query: {
169
+ data: queryData.query,
170
+ summary: queryData.querySummary
171
+ }
172
+ }
173
+ };
174
+ return this;
175
+ };
176
+ addInteractiveQuery = (queryData) => {
177
+ if (queryData) {
178
+ this.userStoreItem = {
179
+ ...this.userStoreItem,
180
+ ...{
181
+ interactiveQuery: {
182
+ data: queryData.query,
183
+ summary: queryData.querySummary
184
+ }
185
+ }
186
+ };
187
+ }
188
+ return this;
189
+ };
190
+ addStatus = (status) => {
191
+ this.userStoreItem = {
192
+ ...this.userStoreItem,
193
+ status
194
+ };
195
+ return this;
196
+ };
197
+ addMetrics = (metrics) => {
198
+ this.userStoreItem = {
199
+ ...this.userStoreItem,
200
+ metrics: metrics.filter((metric) => metric.display).map((metric) => ({ name: metric.display || "" }))
201
+ };
202
+ return this;
203
+ };
204
+ addTimestamp = () => {
205
+ const { status } = this.userStoreItem;
206
+ const ts = /* @__PURE__ */ new Date();
207
+ switch (status) {
208
+ case import_UserReports.RequestStatus.FAILED:
209
+ this.userStoreItem.timestamp.failed = ts;
210
+ break;
211
+ case import_UserReports.RequestStatus.EXPIRED:
212
+ this.userStoreItem.timestamp.expired = ts;
213
+ break;
214
+ case import_UserReports.RequestStatus.ABORTED:
215
+ this.userStoreItem.timestamp.aborted = ts;
216
+ break;
217
+ case import_UserReports.RequestStatus.FINISHED:
218
+ this.userStoreItem.timestamp.completed = ts;
219
+ break;
220
+ case import_UserReports.RequestStatus.SUBMITTED:
221
+ this.userStoreItem.timestamp.requested = ts;
222
+ break;
223
+ case import_UserReports.RequestStatus.STARTED:
224
+ case import_UserReports.RequestStatus.PICKED:
225
+ break;
226
+ default:
227
+ this.userStoreItem.timestamp.lastViewed = ts;
228
+ break;
229
+ }
230
+ return this;
231
+ };
232
+ addDefinitionsPath = (definitionsPath, dpdPathFromQuery) => {
233
+ if (definitionsPath) {
234
+ this.userStoreItem = {
235
+ ...this.userStoreItem,
236
+ dataProductDefinitionsPath: definitionsPath,
237
+ dpdPathFromQuery
238
+ };
239
+ }
240
+ return this;
241
+ };
242
+ }
243
+ var UserStoreItemBuilder_default = UserStoreItemBuilder;
244
+ // Annotate the CommonJS export names for ESM import in node:
245
+ 0 && (module.exports = {
246
+ UserStoreItemBuilder
247
+ });
2
248
  //# sourceMappingURL=UserStoreItemBuilder.js.map