@ministryofjustice/hmpps-digital-prison-reporting-frontend 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,18 +2,21 @@ import { components } from '../../types/api'
2
2
 
3
3
  export default {
4
4
  reportDefinitionsToCards: (
5
- reportDefinitions: Array<components['schemas']['ReportDefinition']>,
5
+ reportDefinitions: Array<components['schemas']['ReportDefinitionSummary']>,
6
6
  pathPrefix: string,
7
7
  ) => {
8
- return reportDefinitions.map((d: components['schemas']['ReportDefinition']) => ({
8
+ return reportDefinitions.map((d: components['schemas']['ReportDefinitionSummary']) => ({
9
9
  text: d.name,
10
10
  href: `${pathPrefix}/${d.id}`,
11
11
  description: d.description,
12
12
  }))
13
13
  },
14
14
 
15
- variantDefinitionsToCards: (reportDefinition: components['schemas']['ReportDefinition'], pathPrefix: string) => {
16
- return reportDefinition.variants.map((v: components['schemas']['VariantDefinition']) => ({
15
+ variantDefinitionsToCards: (
16
+ reportDefinition: components['schemas']['ReportDefinitionSummary'],
17
+ pathPrefix: string,
18
+ ) => {
19
+ return reportDefinition.variants.map((v: components['schemas']['VariantDefinitionSummary']) => ({
17
20
  text: v.name,
18
21
  href: `${pathPrefix}/${reportDefinition.id}/${v.id}`,
19
22
  description: v.description,
@@ -46,7 +46,7 @@ export default class ReportingClient {
46
46
  }))
47
47
  }
48
48
 
49
- getDefinitions(token: string): Promise<Array<components['schemas']['ReportDefinition']>> {
49
+ getDefinitions(token: string): Promise<Array<components['schemas']['ReportDefinitionSummary']>> {
50
50
  logger.info(`Reporting client: Get definitions`)
51
51
 
52
52
  const params: operations['definitions']['parameters'] = {
@@ -61,7 +61,7 @@ export default class ReportingClient {
61
61
  query: params.query,
62
62
  token,
63
63
  })
64
- .then((response) => <Array<components['schemas']['ReportDefinition']>>response)
64
+ .then((response) => <Array<components['schemas']['ReportDefinitionSummary']>>response)
65
65
  }
66
66
 
67
67
  getDefinition(
@@ -17,7 +17,7 @@ export interface paths {
17
17
  get: operations['configuredApiCount']
18
18
  }
19
19
  '/definitions': {
20
- /** @description Gets all report definitions */
20
+ /** @description Gets summaries of all report definitions */
21
21
  get: operations['definitions']
22
22
  }
23
23
  '/definitions/{reportId}/{variantId}': {
@@ -47,10 +47,23 @@ export interface components {
47
47
  */
48
48
  count: number
49
49
  }
50
+ ReportDefinitionSummary: {
51
+ id: string
52
+ name: string
53
+ description?: string
54
+ variants: components['schemas']['VariantDefinitionSummary'][]
55
+ }
56
+ VariantDefinitionSummary: {
57
+ id: string
58
+ name: string
59
+ description?: string
60
+ }
50
61
  DynamicFilterOption: {
51
62
  /** Format: int32 */
52
- minimumLength: number
63
+ minimumLength?: number
53
64
  returnAsStaticOptions: boolean
65
+ /** Format: int64 */
66
+ maximumOptions?: number
54
67
  }
55
68
  FieldDefinition: {
56
69
  name: string
@@ -74,11 +87,11 @@ export interface components {
74
87
  name: string
75
88
  display: string
76
89
  }
77
- ReportDefinition: {
90
+ SingleVariantReportDefinition: {
78
91
  id: string
79
92
  name: string
80
93
  description?: string
81
- variants: components['schemas']['VariantDefinition'][]
94
+ variant: components['schemas']['VariantDefinition']
82
95
  }
83
96
  Specification: {
84
97
  template: string
@@ -91,12 +104,6 @@ export interface components {
91
104
  description?: string
92
105
  specification?: components['schemas']['Specification']
93
106
  }
94
- SingleVariantReportDefinition: {
95
- id: string
96
- name: string
97
- description?: string
98
- variant: components['schemas']['VariantDefinition']
99
- }
100
107
  }
101
108
  responses: never
102
109
  parameters: never
@@ -287,7 +294,7 @@ export interface operations {
287
294
  }
288
295
  }
289
296
  }
290
- /** @description Gets all report definitions */
297
+ /** @description Gets summaries of all report definitions */
291
298
  definitions: {
292
299
  parameters: {
293
300
  query?: {
@@ -296,11 +303,6 @@ export interface operations {
296
303
  * @example HTML
297
304
  */
298
305
  renderMethod?: 'HTML' | 'PDF' | 'SVG'
299
- /**
300
- * @description This optional parameter sets the maximum number of static options returned when there is a dynamic filter and returnAsStaticOptions is true.
301
- * @example 30
302
- */
303
- maxStaticOptions?: number
304
306
  /**
305
307
  * @description This optional parameter sets the path of the directory of the data product definition files your application will use.
306
308
  * "This query parameter is intended to be used in conjunction with the `dpr.lib.dataProductDefinitions.host` property to retrieve definition files from another application by using a web client.
@@ -313,7 +315,7 @@ export interface operations {
313
315
  /** @description OK */
314
316
  200: {
315
317
  content: {
316
- 'application/json': components['schemas']['ReportDefinition'][]
318
+ 'application/json': components['schemas']['ReportDefinitionSummary'][]
317
319
  }
318
320
  }
319
321
  /** @description Bad Request */
@@ -334,11 +336,6 @@ export interface operations {
334
336
  definition: {
335
337
  parameters: {
336
338
  query?: {
337
- /**
338
- * @description This optional parameter sets the maximum number of static options returned when there is a dynamic filter and returnAsStaticOptions is true.
339
- * @example 30
340
- */
341
- maxStaticOptions?: number
342
339
  /**
343
340
  * @description This optional parameter sets the path of the directory of the data product definition files your application will use.
344
341
  * "This query parameter is intended to be used in conjunction with the `dpr.lib.dataProductDefinitions.host` property to retrieve definition files from another application by using a web client.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
3
3
  "description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "main": "dpr/assets/js/client.js",
6
6
  "sass": "dpr/all.scss",
7
7
  "engines": {
package/package.zip CHANGED
Binary file