@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.17.0 → 4.17.2

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 (169) hide show
  1. package/dpr/components/_catalogue/catalogue-list/utils.js +1 -1
  2. package/dpr/components/_catalogue/catalogue-list/utils.js.map +3 -3
  3. package/dpr/components/_catalogue/catalogue-list/utils.ts +4 -5
  4. package/dpr/components/_catalogue/catalogue-search/view.njk +1 -0
  5. package/dpr/components/_charts/chart/Buckets.js +1 -1
  6. package/dpr/components/_charts/chart/Buckets.js.map +3 -3
  7. package/dpr/components/_charts/chart/Buckets.ts +44 -36
  8. package/dpr/components/_charts/chart/heatmap/HeatmapChart.js +1 -1
  9. package/dpr/components/_charts/chart/heatmap/HeatmapChart.js.map +2 -2
  10. package/dpr/components/_charts/chart/heatmap/HeatmapChart.ts +22 -14
  11. package/dpr/components/_charts/chart/heatmap/types.js +2 -0
  12. package/dpr/components/_charts/chart/heatmap/types.js.map +7 -0
  13. package/dpr/components/_charts/chart/heatmap/types.ts +6 -0
  14. package/dpr/components/_charts/utils.js +1 -1
  15. package/dpr/components/_charts/utils.js.map +3 -3
  16. package/dpr/components/_charts/utils.test.ts +10 -7
  17. package/dpr/components/_charts/utils.ts +57 -50
  18. package/dpr/components/_dashboards/dashboard/view.njk +1 -1
  19. package/dpr/components/_dashboards/dashboard-list/utils.js +1 -1
  20. package/dpr/components/_dashboards/dashboard-list/utils.js.map +2 -2
  21. package/dpr/components/_dashboards/dashboard-list/utils.test.ts +3 -3
  22. package/dpr/components/_dashboards/dashboard-list/utils.ts +16 -12
  23. package/dpr/components/_dashboards/dashboard-section/view.njk +1 -1
  24. package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.js +2 -0
  25. package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.js.map +7 -0
  26. package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.ts +40 -0
  27. package/dpr/components/_dashboards/dashboard-visualisation/types.js +2 -0
  28. package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +7 -0
  29. package/dpr/components/_dashboards/dashboard-visualisation/types.ts +102 -0
  30. package/dpr/components/_dashboards/dashboard-visualisation/view.njk +1 -1
  31. package/dpr/components/_dashboards/scorecard/Scorecard.js +1 -1
  32. package/dpr/components/_dashboards/scorecard/Scorecard.js.map +2 -2
  33. package/dpr/components/_dashboards/scorecard/Scorecard.ts +37 -29
  34. package/dpr/components/_dashboards/scorecard/types.js.map +1 -1
  35. package/dpr/components/_dashboards/scorecard/types.ts +1 -0
  36. package/dpr/components/_dashboards/scorecard/utils.js +1 -1
  37. package/dpr/components/_dashboards/scorecard/utils.js.map +2 -2
  38. package/dpr/components/_dashboards/scorecard/utils.test.ts +13 -4
  39. package/dpr/components/_dashboards/scorecard/utils.ts +6 -5
  40. package/dpr/components/_dashboards/scorecard/view.njk +6 -5
  41. package/dpr/components/_dashboards/scorecard-group/view.njk +4 -4
  42. package/dpr/components/_reports/report-actions/types.d.js.map +1 -1
  43. package/dpr/components/_reports/report-actions/types.d.ts +1 -1
  44. package/dpr/components/_reports/report-heading/view.njk +1 -1
  45. package/dpr/data/dashboardClient.js +1 -1
  46. package/dpr/data/dashboardClient.js.map +2 -2
  47. package/dpr/data/dashboardClient.ts +8 -7
  48. package/dpr/data/reportingClient.js +1 -1
  49. package/dpr/data/reportingClient.js.map +1 -1
  50. package/dpr/data/reportingClient.ts +1 -1
  51. package/dpr/middleware/reportAuthoriser.js +1 -1
  52. package/dpr/middleware/reportAuthoriser.js.map +3 -3
  53. package/dpr/middleware/reportAuthoriser.ts +9 -20
  54. package/dpr/routes/journeys/download-report/controller.js +1 -1
  55. package/dpr/routes/journeys/download-report/controller.js.map +3 -3
  56. package/dpr/routes/journeys/download-report/controller.ts +4 -1
  57. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js +1 -1
  58. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js.map +2 -2
  59. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.ts +1 -0
  60. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js +1 -1
  61. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js.map +2 -2
  62. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.ts +1 -0
  63. package/dpr/routes/journeys/download-report/tests.cy.js +1 -1
  64. package/dpr/routes/journeys/download-report/tests.cy.js.map +2 -2
  65. package/dpr/routes/journeys/download-report/tests.cy.ts +2 -8
  66. package/dpr/routes/journeys/download-report/utils.js +1 -1
  67. package/dpr/routes/journeys/download-report/utils.js.map +3 -3
  68. package/dpr/routes/journeys/download-report/utils.ts +10 -7
  69. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js +1 -1
  70. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js.map +2 -2
  71. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.ts +1 -0
  72. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js +1 -1
  73. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js.map +3 -3
  74. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.ts +5 -14
  75. package/dpr/routes/journeys/my-reports/bookmarks/utils.js +1 -1
  76. package/dpr/routes/journeys/my-reports/bookmarks/utils.js.map +3 -3
  77. package/dpr/routes/journeys/my-reports/bookmarks/utils.ts +11 -5
  78. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js +1 -1
  79. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js.map +3 -3
  80. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.ts +4 -7
  81. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js +1 -1
  82. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js.map +2 -2
  83. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.ts +1 -0
  84. package/dpr/routes/journeys/request-missing-report/form/tests.cy.js +1 -1
  85. package/dpr/routes/journeys/request-missing-report/form/tests.cy.js.map +2 -2
  86. package/dpr/routes/journeys/request-missing-report/form/tests.cy.ts +1 -0
  87. package/dpr/routes/journeys/request-missing-report/tests.cy.js +1 -1
  88. package/dpr/routes/journeys/request-missing-report/tests.cy.js.map +2 -2
  89. package/dpr/routes/journeys/request-missing-report/tests.cy.ts +3 -5
  90. package/dpr/routes/journeys/request-report/filters/tests.cy.js +1 -1
  91. package/dpr/routes/journeys/request-report/filters/tests.cy.js.map +3 -3
  92. package/dpr/routes/journeys/request-report/filters/tests.cy.ts +3 -6
  93. package/dpr/routes/journeys/request-report/filters/utils.js +1 -1
  94. package/dpr/routes/journeys/request-report/filters/utils.js.map +2 -2
  95. package/dpr/routes/journeys/request-report/filters/utils.ts +2 -3
  96. package/dpr/routes/journeys/request-report/status/tests.cy.js +1 -1
  97. package/dpr/routes/journeys/request-report/status/tests.cy.js.map +2 -2
  98. package/dpr/routes/journeys/request-report/status/tests.cy.ts +2 -7
  99. package/dpr/routes/journeys/request-report/tests.cy.js +1 -1
  100. package/dpr/routes/journeys/request-report/tests.cy.js.map +3 -3
  101. package/dpr/routes/journeys/request-report/tests.cy.ts +5 -21
  102. package/dpr/routes/journeys/view-report/async/controller.js.map +2 -2
  103. package/dpr/routes/journeys/view-report/async/controller.ts +2 -2
  104. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js +1 -1
  105. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js.map +2 -2
  106. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.ts +2 -10
  107. package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
  108. package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +3 -3
  109. package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +100 -95
  110. package/dpr/routes/journeys/view-report/async/report/controller.js +1 -1
  111. package/dpr/routes/journeys/view-report/async/report/controller.js.map +3 -3
  112. package/dpr/routes/journeys/view-report/async/report/controller.ts +4 -6
  113. package/dpr/routes/journeys/view-report/async/report/tests.cy.js +1 -1
  114. package/dpr/routes/journeys/view-report/async/report/tests.cy.js.map +2 -2
  115. package/dpr/routes/journeys/view-report/async/report/tests.cy.ts +8 -19
  116. package/dpr/routes/journeys/view-report/async/report/types.js +2 -0
  117. package/dpr/routes/journeys/view-report/async/report/types.js.map +7 -0
  118. package/dpr/routes/journeys/view-report/async/report/types.ts +31 -0
  119. package/dpr/routes/journeys/view-report/async/report/utils.js +1 -1
  120. package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
  121. package/dpr/routes/journeys/view-report/async/report/utils.ts +173 -136
  122. package/dpr/routes/journeys/view-report/sync/tests.cy.js +1 -1
  123. package/dpr/routes/journeys/view-report/sync/tests.cy.js.map +3 -3
  124. package/dpr/routes/journeys/view-report/sync/tests.cy.ts +3 -5
  125. package/dpr/services/dashboardService.js +1 -1
  126. package/dpr/services/dashboardService.js.map +2 -2
  127. package/dpr/services/dashboardService.ts +7 -5
  128. package/dpr/services/productCollection/productCollectionService.js +1 -1
  129. package/dpr/services/productCollection/productCollectionService.js.map +2 -2
  130. package/dpr/services/productCollection/productCollectionService.ts +3 -3
  131. package/dpr/services/reportingService.js +1 -1
  132. package/dpr/services/reportingService.js.map +1 -1
  133. package/dpr/services/reportingService.ts +1 -1
  134. package/dpr/types/AsyncReportUtils.js.map +1 -1
  135. package/dpr/types/AsyncReportUtils.ts +3 -4
  136. package/dpr/types/Charts.js +1 -1
  137. package/dpr/types/Charts.js.map +3 -3
  138. package/dpr/types/Charts.ts +0 -82
  139. package/dpr/types/Metrics.js +1 -1
  140. package/dpr/types/Metrics.js.map +1 -1
  141. package/dpr/types/Metrics.ts +7 -0
  142. package/dpr/types/ReportQuery.js +1 -1
  143. package/dpr/types/ReportQuery.js.map +3 -3
  144. package/dpr/types/ReportQuery.ts +24 -15
  145. package/dpr/types/Services.d.js +1 -1
  146. package/dpr/types/Services.d.js.map +1 -1
  147. package/dpr/types/Services.d.ts +2 -0
  148. package/dpr/types/api.d.js.map +1 -1
  149. package/dpr/types/api.d.ts +14 -16
  150. package/dpr/utils/Personalisation/personalisationUtils.js +1 -1
  151. package/dpr/utils/Personalisation/personalisationUtils.js.map +3 -3
  152. package/dpr/utils/Personalisation/personalisationUtils.ts +15 -6
  153. package/dpr/utils/UserStoreItemBuilder.js +1 -1
  154. package/dpr/utils/UserStoreItemBuilder.js.map +1 -1
  155. package/dpr/utils/UserStoreItemBuilder.ts +2 -2
  156. package/dpr/utils/datasetHelper.js +1 -1
  157. package/dpr/utils/datasetHelper.js.map +3 -3
  158. package/dpr/utils/datasetHelper.test.ts +11 -11
  159. package/dpr/utils/datasetHelper.ts +23 -8
  160. package/dpr/utils/logger.js +1 -1
  161. package/dpr/utils/logger.js.map +3 -3
  162. package/dpr/utils/logger.ts +6 -1
  163. package/package.json +2 -1
  164. package/dpr/components/_charts/chart/DashboardVisualisation.js +0 -2
  165. package/dpr/components/_charts/chart/DashboardVisualisation.js.map +0 -7
  166. package/dpr/components/_charts/chart/DashboardVisualisation.ts +0 -43
  167. package/dpr/components/_dashboards/dashboard/types.js +0 -2
  168. package/dpr/components/_dashboards/dashboard/types.js.map +0 -7
  169. package/dpr/components/_dashboards/dashboard/types.ts +0 -120
@@ -1,120 +0,0 @@
1
- import { components } from '../../../types/api'
2
- import { ChartCardData, MoJTable, UnitType } from '../../../types/Charts'
3
- import { Scorecard, ScorecardGroup } from '../scorecard/types'
4
-
5
- export interface DashboardDefinition {
6
- id: string
7
- name: string
8
- description?: string
9
- sections: DashboardSection[]
10
- isMissing?: boolean
11
- filterFields: components['schemas']['FieldDefinition'][]
12
- }
13
-
14
- export interface DashboardSection {
15
- id: string
16
- display?: string
17
- description?: string
18
- visualisations: DashboardVisualisation[]
19
- }
20
-
21
- export interface DashboardUISection {
22
- id: string
23
- title?: string
24
- description?: string
25
- visualisations?: DashboardUIVisualisation[]
26
- }
27
-
28
- export interface DashboardUIVisualisation {
29
- id: string
30
- type: DashboardVisualisationType
31
- title?: string
32
- description?: string
33
- data: Scorecard | Scorecard[] | ScorecardGroup[] | ChartCardData | { table: MoJTable; ts: string }
34
- }
35
-
36
- export interface DashboardVisualisation {
37
- id: string
38
- type: DashboardVisualisationType
39
- display?: string
40
- description?: string
41
- columns: DashboardVisualisationColumns
42
- options: DashboardVisualisationOptions
43
- }
44
-
45
- export type DashboardVisualisationOptions = ListDashboardVisualisationOptions | BucketDashboardVisualisationOptions
46
-
47
- export interface ListDashboardVisualisationOptions {
48
- showLatest?: boolean
49
- columnsAsList?: boolean
50
- }
51
-
52
- export interface BucketDashboardVisualisationOptions {
53
- useRagColours?: boolean
54
- buckets?: DashboardVisualisationBucket[]
55
- baseColour?: string
56
- }
57
-
58
- export interface DashboardVisualisationBucket {
59
- min?: number
60
- max?: number
61
- hexColour?: string
62
- }
63
-
64
- export interface ListVisualisation extends DashboardVisualisation {
65
- type: DashboardVisualisationType.LIST
66
- }
67
-
68
- export enum DashboardVisualisationType {
69
- LIST = 'list',
70
- DONUT = 'doughnut',
71
- BAR = 'bar',
72
- LINE = 'line',
73
- MATRIX = 'matrix',
74
- MATRIX_TIMESERIES = 'matrix-timeseries',
75
- BAR_TIMESERIES = 'bar-timeseries',
76
- LINE_TIMESERIES = 'line-timeseries',
77
- SCORECARD = 'scorecard',
78
- SCORECARD_GROUP = 'scorecard-group',
79
- }
80
-
81
- export interface DashboardVisualisationColumns {
82
- keys?: DashboardVisualisationColumnKey[]
83
- measures: DashboardVisualisationColumnMeasure[]
84
- filters?: DashboardVisualisationColumnFilter[]
85
- expectNulls: boolean
86
- }
87
-
88
- export interface DashboardVisualisationColumn {
89
- id: string
90
- display?: string
91
- }
92
-
93
- export interface DashboardVisualisationColumnKey extends DashboardVisualisationColumn {
94
- optional?: boolean
95
- }
96
-
97
- export interface DashboardVisualisationColumnMeasure extends DashboardVisualisationColumn {
98
- aggregate?: AggregateType
99
- displayValue?: boolean
100
- unit?: UnitType
101
- axis?: 'x' | 'y'
102
- }
103
-
104
- export interface DashboardVisualisationColumnFilter {
105
- id: string
106
- equals: string | number
107
- }
108
-
109
- export interface BarChartVisualisationColumn extends DashboardVisualisationColumnMeasure {
110
- axis?: 'x' | 'y'
111
- }
112
-
113
- export interface ScorecardVisualisationColumn extends DashboardVisualisationColumn {
114
- displayValue: boolean
115
- }
116
-
117
- export enum AggregateType {
118
- SUM = 'sum',
119
- AVG = 'average',
120
- }