@ministryofjustice/hmpps-digital-prison-reporting-frontend 5.2.3 → 5.3.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 (223) hide show
  1. package/README.md +26 -3
  2. package/_networkMocks/dashboard/data/empty-data/data.d.ts +30 -0
  3. package/_networkMocks/dashboard/data/empty-data/mocks.d.ts +68 -0
  4. package/_networkMocks/dashboard/data/partial-data/data-historic.d.ts +39 -0
  5. package/_networkMocks/dashboard/definitions/visualisations/complete-dataset/line/definition.d.ts +2 -0
  6. package/_networkMocks/dashboard/definitions/visualisations/complete-dataset/line/vis-definitions/cols-as-labels.d.ts +6 -0
  7. package/_networkMocks/dashboard/definitions/visualisations/complete-dataset/list/definition-invalid-vis-defs.d.ts +2 -0
  8. package/_networkMocks/dashboard/definitions/visualisations/complete-dataset/list/definition-invalid.d.ts +2 -0
  9. package/_networkMocks/dashboard/definitions/visualisations/complete-dataset/list/vis-definitions/invalid.d.ts +2 -0
  10. package/_networkMocks/dashboard/definitions/visualisations/complete-dataset/mixed/definition.d.ts +2 -0
  11. package/_networkMocks/dashboard/definitions/visualisations/mocks.d.ts +119 -0
  12. package/_networkMocks/dashboard/definitions/visualisations/partial-dataset/bar/definition-invalid.d.ts +2 -0
  13. package/_networkMocks/dashboard/definitions/visualisations/partial-dataset/bar/vis-definitions/invalid.d.ts +3 -0
  14. package/_networkMocks/dashboard/definitions/visualisations/partial-dataset/mixed/definition.d.ts +2 -0
  15. package/_networkMocks/dashboard/definitions/visualisations/partial-dataset/mixed-historic/definition.d.ts +2 -0
  16. package/_networkMocks/report/mocks.d.ts +15 -0
  17. package/all.js +2 -0
  18. package/all.js.map +1 -1
  19. package/cjs/dpr/components/_charts/chart/Chart.js +14 -18
  20. package/cjs/dpr/components/_charts/chart/Chart.js.map +1 -1
  21. package/cjs/dpr/components/_charts/chart/ChartColours.js +10 -2
  22. package/cjs/dpr/components/_charts/chart/ChartColours.js.map +1 -1
  23. package/cjs/dpr/components/_charts/chart/ChartLabels.js +49 -0
  24. package/cjs/dpr/components/_charts/chart/ChartLabels.js.map +1 -0
  25. package/cjs/dpr/components/_charts/chart/ChartTimeseries.js +10 -5
  26. package/cjs/dpr/components/_charts/chart/ChartTimeseries.js.map +1 -1
  27. package/cjs/dpr/components/_charts/chart/bar/BarChart.js +29 -38
  28. package/cjs/dpr/components/_charts/chart/bar/BarChart.js.map +1 -1
  29. package/cjs/dpr/components/_charts/chart/doughnut/DoughnutChart.js +3 -3
  30. package/cjs/dpr/components/_charts/chart/doughnut/DoughnutChart.js.map +1 -1
  31. package/cjs/dpr/components/_charts/chart/doughnut/validate.js +3 -1
  32. package/cjs/dpr/components/_charts/chart/doughnut/validate.js.map +1 -1
  33. package/cjs/dpr/components/_charts/chart/line/LineChart.js +1 -2
  34. package/cjs/dpr/components/_charts/chart/line/LineChart.js.map +1 -1
  35. package/cjs/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js +2 -3
  36. package/cjs/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js.map +1 -1
  37. package/cjs/dpr/components/_dashboards/dashboard-list/utils.js +16 -2
  38. package/cjs/dpr/components/_dashboards/dashboard-list/utils.js.map +1 -1
  39. package/cjs/dpr/components/_dashboards/dashboard-list/validate.js +22 -0
  40. package/cjs/dpr/components/_dashboards/dashboard-list/validate.js.map +1 -0
  41. package/cjs/dpr/components/_dashboards/dashboard-visualisation/Validate.js +11 -4
  42. package/cjs/dpr/components/_dashboards/dashboard-visualisation/Validate.js.map +1 -1
  43. package/cjs/dpr/components/_dashboards/dashboard-visualisation/types.js.map +1 -1
  44. package/cjs/dpr/components/_dashboards/dashboard-visualisation/utils.js +74 -0
  45. package/cjs/dpr/components/_dashboards/dashboard-visualisation/utils.js.map +1 -0
  46. package/cjs/dpr/components/_dashboards/scorecard/validate.js +2 -2
  47. package/cjs/dpr/components/_dashboards/scorecard/validate.js.map +1 -1
  48. package/cjs/dpr/components/_dashboards/scorecard-group/validate.js +2 -2
  49. package/cjs/dpr/components/_dashboards/scorecard-group/validate.js.map +1 -1
  50. package/cjs/dpr/data/reportingClient.js +8 -0
  51. package/cjs/dpr/data/reportingClient.js.map +1 -1
  52. package/cjs/dpr/routes/journeys/download-report/utils.js +22 -106
  53. package/cjs/dpr/routes/journeys/download-report/utils.js.map +1 -1
  54. package/cjs/dpr/routes/journeys/request-report/controller.js +1 -1
  55. package/cjs/dpr/routes/journeys/request-report/controller.js.map +1 -1
  56. package/cjs/dpr/routes/journeys/request-report/filters/controller.js +1 -1
  57. package/cjs/dpr/routes/journeys/request-report/filters/controller.js.map +1 -1
  58. package/cjs/dpr/routes/journeys/request-report/status/controller.js +1 -1
  59. package/cjs/dpr/routes/journeys/request-report/status/controller.js.map +1 -1
  60. package/cjs/dpr/routes/journeys/view-report/async/controller.js +1 -1
  61. package/cjs/dpr/routes/journeys/view-report/async/controller.js.map +1 -1
  62. package/cjs/dpr/routes/journeys/view-report/async/dashboard/controller.js +1 -1
  63. package/cjs/dpr/routes/journeys/view-report/async/dashboard/controller.js.map +1 -1
  64. package/cjs/dpr/routes/journeys/view-report/async/dashboard/utils.js +14 -6
  65. package/cjs/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
  66. package/cjs/dpr/routes/journeys/view-report/async/dashboard/validate.js +26 -0
  67. package/cjs/dpr/routes/journeys/view-report/async/dashboard/validate.js.map +1 -0
  68. package/cjs/dpr/routes/journeys/view-report/async/report/controller.js +1 -1
  69. package/cjs/dpr/routes/journeys/view-report/async/report/controller.js.map +1 -1
  70. package/cjs/dpr/routes/journeys/view-report/controller.js +1 -1
  71. package/cjs/dpr/routes/journeys/view-report/controller.js.map +1 -1
  72. package/cjs/dpr/routes/journeys/view-report/sync/dashboard/controller.js +1 -1
  73. package/cjs/dpr/routes/journeys/view-report/sync/dashboard/controller.js.map +1 -1
  74. package/cjs/dpr/routes/journeys/view-report/sync/report/controller.js +1 -1
  75. package/cjs/dpr/routes/journeys/view-report/sync/report/controller.js.map +1 -1
  76. package/cjs/dpr/services/reportingService.js +3 -0
  77. package/cjs/dpr/services/reportingService.js.map +1 -1
  78. package/cjs/dpr/utils/ErrorHandler/AggregatedValidationError.js +15 -0
  79. package/cjs/dpr/utils/ErrorHandler/AggregatedValidationError.js.map +1 -0
  80. package/cjs/dpr/utils/{ErrorHandler.js → ErrorHandler/ErrorHandler.js} +34 -12
  81. package/cjs/dpr/utils/ErrorHandler/ErrorHandler.js.map +1 -0
  82. package/cjs/dpr/utils/requestStatusHelper.js +1 -1
  83. package/cjs/dpr/utils/requestStatusHelper.js.map +1 -1
  84. package/cypress-tests/mockApis/dashboards.d.ts +15 -0
  85. package/cypress-tests/mockApis/reporting.d.ts +1 -0
  86. package/dpr/all.scss +0 -83
  87. package/dpr/components/_charts/chart/Chart.js +15 -19
  88. package/dpr/components/_charts/chart/Chart.js.map +1 -1
  89. package/dpr/components/_charts/chart/ChartColours.js +10 -2
  90. package/dpr/components/_charts/chart/ChartColours.js.map +1 -1
  91. package/dpr/components/_charts/chart/ChartLabels.js +47 -0
  92. package/dpr/components/_charts/chart/ChartLabels.js.map +1 -0
  93. package/dpr/components/_charts/chart/ChartTimeseries.js +11 -6
  94. package/dpr/components/_charts/chart/ChartTimeseries.js.map +1 -1
  95. package/dpr/components/_charts/chart/bar/BarChart.js +29 -38
  96. package/dpr/components/_charts/chart/bar/BarChart.js.map +1 -1
  97. package/dpr/components/_charts/chart/doughnut/DoughnutChart.js +3 -3
  98. package/dpr/components/_charts/chart/doughnut/DoughnutChart.js.map +1 -1
  99. package/dpr/components/_charts/chart/doughnut/validate.js +3 -1
  100. package/dpr/components/_charts/chart/doughnut/validate.js.map +1 -1
  101. package/dpr/components/_charts/chart/line/LineChart.js +1 -2
  102. package/dpr/components/_charts/chart/line/LineChart.js.map +1 -1
  103. package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js +2 -3
  104. package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js.map +1 -1
  105. package/dpr/components/_charts/chart-details/view.njk +3 -3
  106. package/dpr/components/_dashboards/dashboard-list/utils.js +16 -2
  107. package/dpr/components/_dashboards/dashboard-list/utils.js.map +1 -1
  108. package/dpr/components/_dashboards/dashboard-list/validate.js +20 -0
  109. package/dpr/components/_dashboards/dashboard-list/validate.js.map +1 -0
  110. package/dpr/components/_dashboards/dashboard-visualisation/Validate.js +9 -5
  111. package/dpr/components/_dashboards/dashboard-visualisation/Validate.js.map +1 -1
  112. package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +1 -1
  113. package/dpr/components/_dashboards/dashboard-visualisation/utils.js +72 -0
  114. package/dpr/components/_dashboards/dashboard-visualisation/utils.js.map +1 -0
  115. package/dpr/components/_dashboards/scorecard/Scorecard.js +2 -2
  116. package/dpr/components/_dashboards/scorecard/Scorecard.js.map +1 -1
  117. package/dpr/components/_dashboards/scorecard/validate.js +2 -2
  118. package/dpr/components/_dashboards/scorecard/validate.js.map +1 -1
  119. package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js +2 -2
  120. package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js.map +1 -1
  121. package/dpr/components/_dashboards/scorecard-group/validate.js +2 -2
  122. package/dpr/components/_dashboards/scorecard-group/validate.js.map +1 -1
  123. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/view.njk +2 -1
  124. package/dpr/components/error-summary/view.njk +9 -2
  125. package/dpr/data/reportingClient.d.ts +1 -0
  126. package/dpr/data/reportingClient.js +8 -0
  127. package/dpr/data/reportingClient.js.map +1 -1
  128. package/dpr/routes/journeys/download-report/utils.js +23 -106
  129. package/dpr/routes/journeys/download-report/utils.js.map +1 -1
  130. package/dpr/routes/journeys/request-report/controller.js +1 -1
  131. package/dpr/routes/journeys/request-report/controller.js.map +1 -1
  132. package/dpr/routes/journeys/request-report/filters/controller.js +1 -1
  133. package/dpr/routes/journeys/request-report/filters/controller.js.map +1 -1
  134. package/dpr/routes/journeys/request-report/status/controller.js +1 -1
  135. package/dpr/routes/journeys/request-report/status/controller.js.map +1 -1
  136. package/dpr/routes/journeys/view-report/async/controller.js +1 -1
  137. package/dpr/routes/journeys/view-report/async/controller.js.map +1 -1
  138. package/dpr/routes/journeys/view-report/async/dashboard/controller.js +1 -1
  139. package/dpr/routes/journeys/view-report/async/dashboard/controller.js.map +1 -1
  140. package/dpr/routes/journeys/view-report/async/dashboard/utils.js +9 -1
  141. package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
  142. package/dpr/routes/journeys/view-report/async/dashboard/validate.js +24 -0
  143. package/dpr/routes/journeys/view-report/async/dashboard/validate.js.map +1 -0
  144. package/dpr/routes/journeys/view-report/async/report/controller.js +1 -1
  145. package/dpr/routes/journeys/view-report/async/report/controller.js.map +1 -1
  146. package/dpr/routes/journeys/view-report/controller.js +1 -1
  147. package/dpr/routes/journeys/view-report/controller.js.map +1 -1
  148. package/dpr/routes/journeys/view-report/sync/dashboard/controller.js +1 -1
  149. package/dpr/routes/journeys/view-report/sync/dashboard/controller.js.map +1 -1
  150. package/dpr/routes/journeys/view-report/sync/report/controller.js +1 -1
  151. package/dpr/routes/journeys/view-report/sync/report/controller.js.map +1 -1
  152. package/dpr/services/reportingService.d.ts +1 -0
  153. package/dpr/services/reportingService.js +3 -0
  154. package/dpr/services/reportingService.js.map +1 -1
  155. package/dpr/utils/ErrorHandler/AggregatedValidationError.js +13 -0
  156. package/dpr/utils/ErrorHandler/AggregatedValidationError.js.map +1 -0
  157. package/dpr/utils/{ErrorHandler.js → ErrorHandler/ErrorHandler.js} +34 -12
  158. package/dpr/utils/ErrorHandler/ErrorHandler.js.map +1 -0
  159. package/dpr/utils/requestStatusHelper.js +1 -1
  160. package/dpr/utils/requestStatusHelper.js.map +1 -1
  161. package/package.json +1 -2
  162. package/playwright.config.d.ts +9 -0
  163. package/src/dpr/components/_charts/chart/Chart.d.ts +6 -3
  164. package/src/dpr/components/_charts/chart/ChartColours.d.ts +5 -1
  165. package/src/dpr/components/_charts/chart/ChartLabels.d.ts +26 -0
  166. package/src/dpr/components/_charts/chart/ChartTimeseries.d.ts +5 -1
  167. package/src/dpr/components/_charts/chart/bar/BarChart.d.ts +13 -2
  168. package/src/dpr/components/_charts/chart/bar/validate.d.ts +2 -2
  169. package/src/dpr/components/_charts/chart/bar-timeseries/validate.d.ts +2 -2
  170. package/src/dpr/components/_charts/chart/doughnut/validate.d.ts +2 -2
  171. package/src/dpr/components/_charts/chart/line/validate.d.ts +2 -2
  172. package/src/dpr/components/_charts/chart/line-timeseries/validate.d.ts +2 -2
  173. package/src/dpr/components/_dashboards/dashboard-list/validate.d.ts +7 -7
  174. package/src/dpr/components/_dashboards/dashboard-visualisation/Validate.d.ts +24 -16
  175. package/src/dpr/components/_dashboards/dashboard-visualisation/types.d.ts +2 -0
  176. package/src/dpr/components/_dashboards/dashboard-visualisation/utils.d.ts +2 -0
  177. package/src/dpr/components/_dashboards/scorecard-group/validate.d.ts +2 -2
  178. package/src/dpr/components/_dashboards/visual-regression-tests/line-timeseries-chart-complete-dataset.spec.d.ts +1 -0
  179. package/src/dpr/components/_dashboards/visual-regression-tests/line-timeseries-chart-partial-dataset.spec.d.ts +1 -0
  180. package/src/dpr/components/_dashboards/visual-regression-tests/mixed-charts-complete-dataset.spec.d.ts +1 -0
  181. package/src/dpr/components/_dashboards/visual-regression-tests/mixed-charts-partial-dataset.spec.d.ts +1 -0
  182. package/src/dpr/components/_dashboards/visual-regression-tests/mixed-charts-partial-historic-dataset.spec.d.ts +1 -0
  183. package/src/dpr/data/reportingClient.d.ts +1 -0
  184. package/src/dpr/routes/journeys/download-report/async-tests.cy.d.ts +1 -0
  185. package/src/dpr/routes/journeys/download-report/sync-tests.cy.d.ts +1 -0
  186. package/src/dpr/routes/journeys/download-report/utils.d.ts +0 -5
  187. package/src/dpr/routes/journeys/view-report/async/dashboard/utils.d.ts +4 -4
  188. package/src/dpr/routes/journeys/view-report/async/dashboard/validate.d.ts +122 -0
  189. package/src/dpr/routes/journeys/view-report/async/report/utils.d.ts +2 -2
  190. package/src/dpr/routes/journeys/view-report/sync/dashboard/utils.d.ts +4 -4
  191. package/src/dpr/routes/journeys/view-report/sync/report/utils.d.ts +4 -4
  192. package/src/dpr/services/reportingService.d.ts +1 -0
  193. package/src/dpr/utils/ErrorHandler/AggregatedValidationError.d.ts +11 -0
  194. package/src/dpr/utils/{ErrorHandler.d.ts → ErrorHandler/ErrorHandler.d.ts} +4 -4
  195. package/src/dpr/utils/localsHelper.d.ts +38 -24
  196. package/test-app/routes/components/dashboards/charts/bar/tests.cy.d.ts +1 -0
  197. package/test-app/routes/components/dashboards/charts/line/tests.cy.d.ts +1 -0
  198. package/test-app/routes/components/dashboards/charts/line/timeseries-tests.cy.d.ts +1 -0
  199. package/test-app/routes/components/dashboards/charts/pie/tests.cy.d.ts +1 -0
  200. package/test-app/routes/components/dashboards/mixed/tests.cy.d.ts +1 -0
  201. package/cjs/dpr/utils/ErrorHandler.js.map +0 -1
  202. package/dpr/components/report-list/list.njk +0 -6
  203. package/dpr/components/report-list/view.njk +0 -7
  204. package/dpr/utils/ErrorHandler.js.map +0 -1
  205. package/src/dpr/components/report-list/defaultTokenProvider.d.ts +0 -3
  206. package/src/dpr/components/report-list/utils.d.ts +0 -14
  207. package/test-app/mocks/mockClients/store/mockRequestedDashboardData.d.ts +0 -255
  208. package/test-app/mocks/mockClients/store/mockViewedUserListData.d.ts +0 -348
  209. package/test-app/mocks/mockSyncData/mockRenderData.d.ts +0 -464
  210. package/test-app/routes/embedded/sync-report/controller.d.ts +0 -5
  211. package/test-app/routes/embedded/sync-report/fail/controller.d.ts +0 -4
  212. package/test-app/routes/embedded/sync-report/fail/routes.d.ts +0 -2
  213. package/test-app/routes/embedded/sync-report/handler/controller.d.ts +0 -4
  214. package/test-app/routes/embedded/sync-report/handler/routes.d.ts +0 -2
  215. package/test-app/routes/embedded/sync-report/method/controller.d.ts +0 -4
  216. package/test-app/routes/embedded/sync-report/method/routes.d.ts +0 -2
  217. package/test-app/routes/embedded/sync-report/routes.d.ts +0 -2
  218. package/test-app/routes/embedded/sync-report/validation/controller.d.ts +0 -4
  219. package/test-app/routes/embedded/sync-report/validation/routes.d.ts +0 -2
  220. /package/src/dpr/components/{report-list/utils.test.d.ts → _dashboards/visual-regression-tests/bar-chart-complete-dataset.spec.d.ts} +0 -0
  221. /package/src/dpr/components/{user-reports/bookmarks/utils.test.d.ts → _dashboards/visual-regression-tests/bar-chart-partial-dataset.spec.d.ts} +0 -0
  222. /package/src/dpr/components/{user-reports/utils.test.d.ts → _dashboards/visual-regression-tests/doughnut-chart-complete-dataset.spec.d.ts} +0 -0
  223. /package/src/dpr/{routes/journeys/download-report/tests.cy.d.ts → components/_dashboards/visual-regression-tests/line-chart-complete-dataset.spec.d.ts} +0 -0
package/README.md CHANGED
@@ -21,12 +21,35 @@ Both tasks use the `package` directory.
21
21
 
22
22
  ## Test Application
23
23
 
24
- To start the Test Application, run: `npm run start-test-app`. This builds the NPM package and starts the server at http://localhost:3010.
24
+ To start the Test Application, run: `npm run start:dev:noMockClients` as well as `npm run wiremock` in a separate tab. This builds the NPM package and starts the server at http://localhost:3010.
25
25
 
26
26
  The Test Application is used both for visually checking components, and also by the integration tests (run using Cypress).
27
27
 
28
- ## Running and testing local builds
29
- To run the app in dev mode, use `start:dev` for the test app, and `docs:local` for the docs. To run the production build of docs, you should run `npm run docs`, then you'll need to configure a reverse proxy - nginx is the easiest. Install it through homebrew `brew install nginx`, then ensure it's running by running `brew services start nginx`. then run `sudo nginx -t` and you should see it's got a default config at `/opt/homebrew/etc/nginx/nginx.conf` - if it isn't there, just use whatever path it gives back, then add a new file into `/opt/homebrew/etc/nginx/servers/dev.conf` with this content:
28
+ ## Running and testing local builds
29
+ To run the main suite of browser-based tests, start up the main app by running `npm run start:dev:noMockClients` then `npm run int-test` or `npm run int-test-ui` for getting the cypress UI up to choose individual tests to run.
30
+
31
+ There are also a few jest tests - you can run these plus the small docs tests by running `npm run test`.
32
+
33
+ We also have a small number of visual regression tests using Playwright that are **only** for our chart based pages - you can run these with `npm run int-test-visual` which will start up the server and mocks itself. Please ensure any other running server processes are stopped before running this!
34
+
35
+ ### How to update and create new visual regression tests
36
+ There may ocassionally be the need to create new visual regression tests, again, only for our charting based pages. To do this, you should develop the test as normal, but use `npm run int-test-visual-ui` which will allow you to see what the test is doing in the UI. Once you have the test on the page you want to capture a screenshot of for comparison, use
37
+
38
+ ```typescript
39
+ await expect(page).toHaveScreenshot({
40
+ fullPage: true,
41
+ })
42
+ ```
43
+
44
+ and then run your test. It will fail locally on this last step, which is expected, as you are not creating screenshots. These will be created by CI as screenshots on different OSes can have slightly different pixel values. You should push this branch and make a PR, which will set off the CI run, and if all is well, create the screenshots as an artifact of the CI run in GitHub Actions (but fail the run). You should create a folder based on the name of the file running the test - if the file is called `some-chart-test.spec.ts`, create a folder called `some-chart-test.spec.ts-screenshots/` and download the screenshots artifact and put the new screenshots in there. You should then double check these to ensure no sensitive data is being captured, then commit and push them up. This time, the CI run should use these screenshots and pass. If they do not, some common pitfalls include:
45
+
46
+ - Animations: Ideally set or disable animations so the snapshot isn't capturing charts, CSS animations etc half way through loading.
47
+ - Noise: Things like "Last Updated" timestamps can be very annoying and will break the test every time the clock ticks. You should mask those bits out so Playwright ignores them.
48
+ - As a last resort, look at having some **small** pixel tolerances - no more than 1 or 2% - on the `toHaveScreenshot` call - use `maxDiffPixelRatio` which has a range from 0-1, so no more than 0.01-0.02 here.
49
+
50
+ ### Running the app in dev mode
51
+
52
+ To run the app in dev mode, use `start:dev:noMockClients` for the test app, and `docs:local` for the docs. To run the production build of docs, you should run `npm run docs`, then you'll need to configure a reverse proxy - nginx is the easiest. Install it through homebrew `brew install nginx`, then ensure it's running by running `brew services start nginx`. then run `sudo nginx -t` and you should see it's got a default config at `/opt/homebrew/etc/nginx/nginx.conf` - if it isn't there, just use whatever path it gives back, then add a new file into `/opt/homebrew/etc/nginx/servers/dev.conf` with this content:
30
53
 
31
54
  ```
32
55
  server {
@@ -0,0 +1,30 @@
1
+ export declare const undefinedDashboardData: {
2
+ tables: undefined;
3
+ };
4
+ export declare const emptyDashboardData: never[];
5
+ export declare const missingFirstRowDashboardData: ({
6
+ ts: {
7
+ raw: string;
8
+ };
9
+ establishment_id: {
10
+ raw: string;
11
+ };
12
+ has_metric_one: {
13
+ raw: number;
14
+ };
15
+ metric_one_is_missing: {
16
+ raw: number;
17
+ };
18
+ has_metric_two: {
19
+ raw: number;
20
+ };
21
+ metric_two_is_missing: {
22
+ raw: number;
23
+ };
24
+ has_metric_three: {
25
+ raw: number;
26
+ };
27
+ metric_three_is_missing: {
28
+ raw: number;
29
+ };
30
+ }[] | undefined)[];
@@ -0,0 +1,68 @@
1
+ export declare const dashboardResultUndefinedMock: {
2
+ priority: number;
3
+ request: {
4
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
5
+ queryParameters?: object | undefined;
6
+ bodyPatterns?: Array<object> | undefined;
7
+ urlPathPattern: string;
8
+ };
9
+ response: {
10
+ status: number;
11
+ headers: {
12
+ "Content-Type": "application/json;charset=UTF-8";
13
+ };
14
+ jsonBody: object;
15
+ fixedDelayMilliseconds: number;
16
+ };
17
+ };
18
+ export declare const dashboardResultEmptyDataSyncMock: {
19
+ priority: number;
20
+ request: {
21
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
22
+ queryParameters?: object | undefined;
23
+ bodyPatterns?: Array<object> | undefined;
24
+ urlPathPattern: string;
25
+ };
26
+ response: {
27
+ status: number;
28
+ headers: {
29
+ "Content-Type": "application/json;charset=UTF-8";
30
+ };
31
+ jsonBody: object;
32
+ fixedDelayMilliseconds: number;
33
+ };
34
+ };
35
+ export declare const dashboardResultMissingFirstRowDataSyncMock: {
36
+ priority: number;
37
+ request: {
38
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
39
+ queryParameters?: object | undefined;
40
+ bodyPatterns?: Array<object> | undefined;
41
+ urlPathPattern: string;
42
+ };
43
+ response: {
44
+ status: number;
45
+ headers: {
46
+ "Content-Type": "application/json;charset=UTF-8";
47
+ };
48
+ jsonBody: object;
49
+ fixedDelayMilliseconds: number;
50
+ };
51
+ };
52
+ export declare const mocks: {
53
+ priority: number;
54
+ request: {
55
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
56
+ queryParameters?: object | undefined;
57
+ bodyPatterns?: Array<object> | undefined;
58
+ urlPathPattern: string;
59
+ };
60
+ response: {
61
+ status: number;
62
+ headers: {
63
+ "Content-Type": "application/json;charset=UTF-8";
64
+ };
65
+ jsonBody: object;
66
+ fixedDelayMilliseconds: number;
67
+ };
68
+ }[];
@@ -0,0 +1,39 @@
1
+ export declare const historicPartialData: ({
2
+ ts: {
3
+ raw: string;
4
+ };
5
+ establishment_id: {
6
+ raw: string;
7
+ };
8
+ wing: {
9
+ raw: string;
10
+ };
11
+ cell: {
12
+ raw: string;
13
+ };
14
+ diet: {
15
+ raw: string;
16
+ };
17
+ count: {
18
+ raw: number;
19
+ };
20
+ } | {
21
+ ts: {
22
+ raw: string;
23
+ };
24
+ establishment_id: {
25
+ raw: string;
26
+ };
27
+ wing: {
28
+ raw: string;
29
+ };
30
+ cell: {
31
+ raw: string;
32
+ };
33
+ diet: {
34
+ raw: string;
35
+ };
36
+ count: {
37
+ raw: string;
38
+ };
39
+ })[];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -0,0 +1,6 @@
1
+ import { components } from '../../../../../../../src/dpr/types/api';
2
+ export declare const dataQualityMetricOneLine: components['schemas']['DashboardVisualisationDefinition'];
3
+ export declare const dataQualityMetricThreeLine: components['schemas']['DashboardVisualisationDefinition'];
4
+ export declare const dataQualityMetricTwoLine: components['schemas']['DashboardVisualisationDefinition'];
5
+ export declare const dataQualityMetricOneMetricTwoLine: components['schemas']['DashboardVisualisationDefinition'];
6
+ export declare const dataQualityAllLine: components['schemas']['DashboardVisualisationDefinition'];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../../src/dpr/types/api';
2
+ export declare const invalidDefinition: components['schemas']['DashboardVisualisationDefinition'];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -66,6 +66,40 @@ export declare const listPartialDatasetHistoricMock: {
66
66
  fixedDelayMilliseconds: number;
67
67
  };
68
68
  };
69
+ export declare const listInvalidVisDefMock: {
70
+ priority: number;
71
+ request: {
72
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
73
+ queryParameters?: object | undefined;
74
+ bodyPatterns?: Array<object> | undefined;
75
+ urlPathPattern: string;
76
+ };
77
+ response: {
78
+ status: number;
79
+ headers: {
80
+ "Content-Type": "application/json;charset=UTF-8";
81
+ };
82
+ jsonBody: object;
83
+ fixedDelayMilliseconds: number;
84
+ };
85
+ };
86
+ export declare const listInvalidDefMock: {
87
+ priority: number;
88
+ request: {
89
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
90
+ queryParameters?: object | undefined;
91
+ bodyPatterns?: Array<object> | undefined;
92
+ urlPathPattern: string;
93
+ };
94
+ response: {
95
+ status: number;
96
+ headers: {
97
+ "Content-Type": "application/json;charset=UTF-8";
98
+ };
99
+ jsonBody: object;
100
+ fixedDelayMilliseconds: number;
101
+ };
102
+ };
69
103
  export declare const scorecardsCompleteDatasetMock: {
70
104
  priority: number;
71
105
  request: {
@@ -168,6 +202,23 @@ export declare const barPartialDatasetMock: {
168
202
  fixedDelayMilliseconds: number;
169
203
  };
170
204
  };
205
+ export declare const barInvalidMock: {
206
+ priority: number;
207
+ request: {
208
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
209
+ queryParameters?: object | undefined;
210
+ bodyPatterns?: Array<object> | undefined;
211
+ urlPathPattern: string;
212
+ };
213
+ response: {
214
+ status: number;
215
+ headers: {
216
+ "Content-Type": "application/json;charset=UTF-8";
217
+ };
218
+ jsonBody: object;
219
+ fixedDelayMilliseconds: number;
220
+ };
221
+ };
171
222
  export declare const doughnutCompleteDatasetMock: {
172
223
  priority: number;
173
224
  request: {
@@ -219,6 +270,74 @@ export declare const lineTimeseriesPartialDatasetMock: {
219
270
  fixedDelayMilliseconds: number;
220
271
  };
221
272
  };
273
+ export declare const lineCompleteDatasetMock: {
274
+ priority: number;
275
+ request: {
276
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
277
+ queryParameters?: object | undefined;
278
+ bodyPatterns?: Array<object> | undefined;
279
+ urlPathPattern: string;
280
+ };
281
+ response: {
282
+ status: number;
283
+ headers: {
284
+ "Content-Type": "application/json;charset=UTF-8";
285
+ };
286
+ jsonBody: object;
287
+ fixedDelayMilliseconds: number;
288
+ };
289
+ };
290
+ export declare const mixedCompleteDatasetMock: {
291
+ priority: number;
292
+ request: {
293
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
294
+ queryParameters?: object | undefined;
295
+ bodyPatterns?: Array<object> | undefined;
296
+ urlPathPattern: string;
297
+ };
298
+ response: {
299
+ status: number;
300
+ headers: {
301
+ "Content-Type": "application/json;charset=UTF-8";
302
+ };
303
+ jsonBody: object;
304
+ fixedDelayMilliseconds: number;
305
+ };
306
+ };
307
+ export declare const mixedPartialDatasetMock: {
308
+ priority: number;
309
+ request: {
310
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
311
+ queryParameters?: object | undefined;
312
+ bodyPatterns?: Array<object> | undefined;
313
+ urlPathPattern: string;
314
+ };
315
+ response: {
316
+ status: number;
317
+ headers: {
318
+ "Content-Type": "application/json;charset=UTF-8";
319
+ };
320
+ jsonBody: object;
321
+ fixedDelayMilliseconds: number;
322
+ };
323
+ };
324
+ export declare const mixedPartialDatasetHistoricMock: {
325
+ priority: number;
326
+ request: {
327
+ method: "GET" | "POST" | "DELETE" | "PUT" | "OPTIONS";
328
+ queryParameters?: object | undefined;
329
+ bodyPatterns?: Array<object> | undefined;
330
+ urlPathPattern: string;
331
+ };
332
+ response: {
333
+ status: number;
334
+ headers: {
335
+ "Content-Type": "application/json;charset=UTF-8";
336
+ };
337
+ jsonBody: object;
338
+ fixedDelayMilliseconds: number;
339
+ };
340
+ };
222
341
  export declare const mocks: {
223
342
  priority: number;
224
343
  request: {
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -0,0 +1,3 @@
1
+ import { components } from '../../../../../../../src/dpr/types/api';
2
+ export declare const invalidAxisXBar: components['schemas']['DashboardVisualisationDefinition'];
3
+ export declare const invalidAxisYBar: components['schemas']['DashboardVisualisationDefinition'];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -0,0 +1,2 @@
1
+ import { components } from '../../../../../../src/dpr/types/api';
2
+ export declare const definition: components['schemas']['DashboardDefinition'];
@@ -99,6 +99,21 @@ export declare const getAsyncReportDownloadMock: {
99
99
  body: string;
100
100
  };
101
101
  };
102
+ export declare const getSyncReportDownloadMock: {
103
+ priority: number;
104
+ request: {
105
+ method: string;
106
+ urlPathPattern: string;
107
+ };
108
+ response: {
109
+ status: number;
110
+ headers: {
111
+ 'Content-Type': string;
112
+ 'Content-Disposition': string;
113
+ };
114
+ body: string;
115
+ };
116
+ };
102
117
  export declare const reportsFinishedStatusMock: {
103
118
  priority: number;
104
119
  request: {
package/all.js CHANGED
@@ -834,11 +834,13 @@ class DataTable extends DprClientClass {
834
834
  // Headers
835
835
  const header = this.table.createTHead();
836
836
  const classificationHeaderRow = header.insertRow(0);
837
+ classificationHeaderRow.classList.add('print-header-footer');
837
838
  const classificationHeaderCell = classificationHeaderRow.insertCell(0);
838
839
  classificationHeaderCell.outerHTML = `<th class="govuk-table__header govuk-table__cell--content print-header-footer print-header-footer--header" colspan=${headLength}>${classificationContent}</th>`;
839
840
  // Footers
840
841
  const footer = this.table.createTFoot();
841
842
  const classificationFooterRow = footer.insertRow(0);
843
+ classificationFooterRow.classList.add('print-header-footer');
842
844
  const classificationFooterCell = classificationFooterRow.insertCell(0);
843
845
  classificationFooterCell.outerHTML = `<td class="govuk-table__cell govuk-table__cell--content print-header-footer table-row--no-border print-header-footer--footer" colspan=${headLength}>${classificationContent}</td>`;
844
846
  }