@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.28.8 → 4.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dpr/all.js +6 -8
  2. package/dpr/all.js.map +3 -3
  3. package/dpr/all.scss +296 -414
  4. package/dpr/all.ts +6 -11
  5. package/dpr/components/_catalogue/catalogue-list/utils.test.ts +1 -1
  6. package/dpr/components/_charts/chart/ChartTimeseries.js +3 -2
  7. package/dpr/components/_charts/chart/ChartTimeseries.js.map +2 -2
  8. package/dpr/components/_charts/chart/ChartTimeseries.ts +4 -2
  9. package/dpr/components/_charts/chart/clientClass.js +1 -0
  10. package/dpr/components/_charts/chart/clientClass.js.map +2 -2
  11. package/dpr/components/_charts/chart/clientClass.ts +1 -0
  12. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js.map +1 -1
  13. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.js +1 -1
  14. package/dpr/components/_reports/report-heading/report-actions/clientClass.js.map +7 -0
  15. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.ts +1 -1
  16. package/dpr/components/_reports/report-heading/report-actions/types.d.js.map +7 -0
  17. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.ts +1 -1
  18. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js.map +1 -1
  19. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.test.ts +2 -2
  20. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.js +1 -3
  21. package/dpr/components/_reports/report-heading/report-columns/report-columns-form/clientClass.js.map +7 -0
  22. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.ts +1 -3
  23. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js.map +1 -1
  24. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.js +1 -1
  25. package/dpr/components/_reports/report-heading/report-columns/report-columns-form/utils.js.map +7 -0
  26. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.ts +2 -2
  27. package/dpr/components/_reports/{report-columns → report-heading/report-columns}/view.njk +1 -1
  28. package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.js +1 -1
  29. package/dpr/components/_reports/report-heading/report-download-message/clientClass.js.map +7 -0
  30. package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.ts +1 -1
  31. package/dpr/components/_reports/{report-filters → report-heading/report-filters}/view.njk +1 -1
  32. package/dpr/components/_reports/report-heading/view.njk +4 -4
  33. package/dpr/components/_reports/report-page/report-print-message/view.njk +10 -0
  34. package/dpr/components/_reports/report-page/report-template/report-no-data-message/styles.scss +8 -0
  35. package/dpr/components/_reports/report-page/report-template/report-no-data-message/view.njk +11 -0
  36. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.js +1 -1
  37. package/dpr/components/_reports/report-page/report-template/report-pagination/clientClass.js.map +7 -0
  38. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.ts +1 -1
  39. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.js.map +1 -1
  40. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js.map +1 -1
  41. package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/styles.scss +88 -0
  42. package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/view.njk +29 -0
  43. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.js +17 -10
  44. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/clientClass.js.map +7 -0
  45. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.ts +20 -10
  46. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/style.scss +35 -185
  47. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/types.d.js.map +7 -0
  48. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/types.d.ts +2 -2
  49. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/view.njk +27 -0
  50. package/dpr/components/_reports/report-page/report-template/report-section/styles.scss +33 -0
  51. package/dpr/components/_reports/report-page/report-template/report-section/view.njk +58 -0
  52. package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/styles.scss +21 -4
  53. package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js.map +1 -1
  54. package/dpr/components/_reports/report-page/report-template/styles.scss +5 -0
  55. package/dpr/components/_reports/report-page/report-template/template-config.js +66 -0
  56. package/dpr/components/_reports/report-page/report-template/template-config.js.map +7 -0
  57. package/dpr/components/_reports/report-page/report-template/template-config.ts +45 -0
  58. package/dpr/components/_reports/report-page/report-template/utils.js +82 -0
  59. package/dpr/components/_reports/report-page/report-template/utils.js.map +7 -0
  60. package/dpr/components/_reports/report-page/report-template/utils.ts +100 -0
  61. package/dpr/components/_reports/report-page/report-template/view.njk +61 -0
  62. package/dpr/components/_reports/{report-wrapper → report-page}/styles.scss +7 -5
  63. package/dpr/components/_reports/report-page/view.njk +26 -0
  64. package/dpr/components/card-group/view.njk +0 -4
  65. package/dpr/components/report-list/utils.js +11 -3
  66. package/dpr/components/report-list/utils.js.map +2 -2
  67. package/dpr/components/report-list/utils.ts +11 -1
  68. package/dpr/components/report-list/view.njk +2 -2
  69. package/dpr/components/show-more/style.scss +3 -4
  70. package/dpr/data/reportingClient.js.map +2 -2
  71. package/dpr/data/reportingClient.ts +4 -4
  72. package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
  73. package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
  74. package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +1 -1
  75. package/dpr/routes/journeys/view-report/async/report/controller.js.map +2 -2
  76. package/dpr/routes/journeys/view-report/async/report/controller.ts +0 -1
  77. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js +207 -56
  78. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +2 -2
  79. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.ts +333 -64
  80. package/dpr/routes/journeys/view-report/async/report/utils.js +9 -17
  81. package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
  82. package/dpr/routes/journeys/view-report/async/report/utils.ts +12 -22
  83. package/dpr/routes/journeys/view-report/report.njk +2 -2
  84. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +1 -1
  85. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +1 -1
  86. package/dpr/routes/journeys/view-report/sync/dashboard/utils.ts +1 -1
  87. package/dpr/routes/journeys/view-report/sync/report/utils.js +38 -11
  88. package/dpr/routes/journeys/view-report/sync/report/utils.js.map +3 -3
  89. package/dpr/routes/journeys/view-report/sync/report/utils.ts +39 -14
  90. package/dpr/routes/journeys/view-report/utils.js +1 -1
  91. package/dpr/routes/journeys/view-report/utils.js.map +1 -1
  92. package/dpr/routes/journeys/view-report/utils.ts +1 -1
  93. package/dpr/services/reportingService.js.map +2 -2
  94. package/dpr/services/reportingService.ts +2 -2
  95. package/dpr/types/ReportQuery.js +1 -1
  96. package/dpr/types/ReportQuery.js.map +1 -1
  97. package/dpr/types/ReportQuery.ts +1 -1
  98. package/dpr/types/UserReports.js.map +1 -1
  99. package/dpr/types/UserReports.ts +3 -3
  100. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js +193 -0
  101. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js.map +7 -0
  102. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.ts +203 -0
  103. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.js.map +7 -0
  104. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.ts +36 -0
  105. package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js +114 -0
  106. package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js.map +7 -0
  107. package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.ts +117 -0
  108. package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.js.map +7 -0
  109. package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.ts +6 -0
  110. package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js +202 -0
  111. package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js.map +7 -0
  112. package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.ts +246 -0
  113. package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js +17 -0
  114. package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js.map +7 -0
  115. package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.ts +41 -0
  116. package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.js → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js} +6 -8
  117. package/dpr/utils/TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js.map +7 -0
  118. package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.test.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.test.ts} +4 -4
  119. package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.ts} +6 -9
  120. package/dpr/utils/TemplateBuilder/TemplateBuilder.js +74 -0
  121. package/dpr/utils/TemplateBuilder/TemplateBuilder.js.map +7 -0
  122. package/dpr/utils/TemplateBuilder/TemplateBuilder.ts +68 -0
  123. package/dpr/utils/definitionUtils.js +22 -2
  124. package/dpr/utils/definitionUtils.js.map +2 -2
  125. package/dpr/utils/definitionUtils.ts +26 -1
  126. package/package.json +1 -1
  127. package/dpr/DprLoadingHelper.js +0 -51
  128. package/dpr/DprLoadingHelper.js.map +0 -7
  129. package/dpr/DprLoadingHelper.ts +0 -27
  130. package/dpr/components/_reports/report/view.njk +0 -40
  131. package/dpr/components/_reports/report-actions/clientClass.js.map +0 -7
  132. package/dpr/components/_reports/report-actions/types.d.js.map +0 -7
  133. package/dpr/components/_reports/report-columns-form/clientClass.js.map +0 -7
  134. package/dpr/components/_reports/report-columns-form/utils.js.map +0 -7
  135. package/dpr/components/_reports/report-data-table/clientClass.js.map +0 -7
  136. package/dpr/components/_reports/report-data-table/types.d.js.map +0 -7
  137. package/dpr/components/_reports/report-data-table/utils.js +0 -123
  138. package/dpr/components/_reports/report-data-table/utils.js.map +0 -7
  139. package/dpr/components/_reports/report-data-table/utils.test.ts +0 -604
  140. package/dpr/components/_reports/report-data-table/utils.ts +0 -150
  141. package/dpr/components/_reports/report-data-table/view.njk +0 -24
  142. package/dpr/components/_reports/report-data-table-wrapper/view.njk +0 -27
  143. package/dpr/components/_reports/report-download-message/clientClass.js.map +0 -7
  144. package/dpr/components/_reports/report-no-data-message/styles.scss +0 -4
  145. package/dpr/components/_reports/report-no-data-message/view.njk +0 -13
  146. package/dpr/components/_reports/report-pagination/clientClass.js.map +0 -7
  147. package/dpr/components/_reports/report-print-message/view.njk +0 -8
  148. package/dpr/components/_reports/report-template/view.njk +0 -44
  149. package/dpr/components/_reports/report-wrapper/view.njk +0 -19
  150. package/dpr/components/loading-anim/styles.scss +0 -117
  151. package/dpr/components/loading-anim/view.njk +0 -18
  152. package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +0 -7
  153. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js +0 -202
  154. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +0 -7
  155. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.test.ts +0 -503
  156. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.ts +0 -224
  157. package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +0 -7
  158. package/dpr/utils/ParentChildDataTableBuilder/types.d.ts +0 -11
  159. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js +0 -311
  160. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +0 -7
  161. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.test.ts +0 -492
  162. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.ts +0 -342
  163. package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +0 -7
  164. package/dpr/utils/SectionedDataTableBuilder/types.d.ts +0 -5
  165. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js +0 -146
  166. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +0 -7
  167. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.test.ts +0 -140
  168. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.ts +0 -150
  169. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js +0 -0
  170. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.ts +0 -0
  171. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/style.scss +0 -0
  172. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.js +0 -0
  173. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js +0 -0
  174. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.ts +0 -0
  175. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/view.njk +0 -0
  176. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/style.scss +0 -0
  177. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js +0 -0
  178. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.ts +0 -0
  179. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/view.njk +0 -0
  180. /package/dpr/components/_reports/{report-columns → report-heading/report-columns}/styles.scss +0 -0
  181. /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/style.scss +0 -0
  182. /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/view.njk +0 -0
  183. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/style.scss +0 -0
  184. /package/dpr/components/_reports/{report-data-table → report-page/report-template/report-pagination}/types.d.js +0 -0
  185. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.ts +0 -0
  186. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js +0 -0
  187. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.test.ts +0 -0
  188. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.ts +0 -0
  189. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/view.njk +0 -0
  190. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-section/report-data-table}/types.d.js +0 -0
  191. /package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/view.njk +0 -0
  192. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/style.scss +0 -0
  193. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js +0 -0
  194. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.ts +0 -0
  195. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/view.njk +0 -0
  196. /package/dpr/utils/{ParentChildDataTableBuilder → TemplateBuilder/ParentChildDataBuilder}/types.d.js +0 -0
  197. /package/dpr/utils/{SectionedDataTableBuilder → TemplateBuilder/ReportBuilder}/types.d.js +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../dpr/components/report-list/utils.ts"],
4
- "sourcesContent": ["import { NextFunction, Request, RequestHandler, Response } from 'express'\n\nimport ReportQuery from '../../types/ReportQuery'\n\nimport {\n ListDataSources,\n RenderListWithDataInput,\n RenderListWithDefinitionInput,\n CreateRequestHandlerInput,\n} from './types'\nimport ReportingClient from '../../data/reportingClient'\nimport { ListWithWarnings, Warnings } from '../../data/types'\nimport { components } from '../../types/api'\nimport Dict = NodeJS.Dict\nimport ReportActionsUtils from '../_reports/report-actions/utils'\nimport { Template } from '../../types/Templates'\nimport { SyncReportUtils } from '../../utils'\nimport FiltersUtils from '../_filters/utils'\nimport { ReportType } from '../../types/UserReports'\nimport { FiltersType } from '../_filters/filtersTypeEnum'\n\nfunction isListWithWarnings(data: Dict<string>[] | ListWithWarnings): data is ListWithWarnings {\n return (data as ListWithWarnings).data !== undefined\n}\n\nexport async function renderList(\n listData: ListDataSources,\n variantDefinition: components['schemas']['VariantDefinition'],\n reportQuery: ReportQuery,\n req: Request,\n response: Response,\n next: NextFunction,\n title: string,\n layoutTemplate: string,\n otherOptions?: NodeJS.Dict<object>,\n reportName?: string,\n) {\n await Promise.all([listData.data, listData.count])\n .then(async (resolvedData) => {\n let data\n let warnings: Warnings = {}\n const { specification, classification, printable, description, name: variantName } = variantDefinition\n if (specification) {\n const { template } = specification\n const count = resolvedData[1]\n\n if (isListWithWarnings(resolvedData[0])) {\n // eslint-disable-next-line prefer-destructuring\n data = resolvedData[0].data\n warnings = resolvedData[0].warnings\n } else {\n // eslint-disable-next-line prefer-destructuring\n data = resolvedData[0]\n }\n\n const reportRenderData = await SyncReportUtils.getReportRenderData({\n req,\n count,\n specification,\n reportQuery,\n data,\n filtersType: FiltersType.REQUEST,\n })\n\n const actions = ReportActionsUtils.getActions({\n print: {\n enabled: Boolean(variantDefinition.printable),\n },\n share: {\n reportName: reportName || 'Product',\n name: variantDefinition.name,\n url: reportRenderData.fullUrl,\n },\n copy: {\n url: reportRenderData.fullUrl,\n },\n })\n\n const renderData = {\n renderData: {\n ...reportRenderData,\n reportName,\n name: title || variantName,\n description,\n count,\n classification,\n printable,\n actions,\n template,\n warnings,\n type: ReportType.REPORT,\n ...otherOptions,\n },\n layoutTemplate,\n }\n\n response.render(`dpr/components/report-list/list`, renderData)\n } else {\n throw new Error('No specification in definition')\n }\n })\n .catch((err) => next(err))\n}\n\nexport const renderListWithDefinition = async ({\n title,\n definitionName,\n variantName,\n request,\n response,\n next,\n otherOptions,\n layoutTemplate,\n token,\n apiUrl,\n apiTimeout,\n definitionsPath,\n}: RenderListWithDefinitionInput) => {\n const reportingClient = new ReportingClient({\n url: apiUrl,\n agent: {\n timeout: apiTimeout,\n },\n })\n\n const { dataProductDefinitionsPath } = request.query\n const reportDef = <string>dataProductDefinitionsPath || definitionsPath\n\n try {\n const reportDefinition = await reportingClient.getDefinition(token, definitionName, variantName, reportDef)\n const reportName: string = reportDefinition.name\n const variantDefinition = reportDefinition.variant\n const { specification, resourceName } = variantDefinition\n if (specification) {\n const { fields, template } = specification\n const reportQuery = new ReportQuery({\n fields,\n template: template as Template,\n queryParams: request.query,\n ...(reportDef && { definitionsPath: reportDef }),\n })\n\n if (!FiltersUtils.redirectWithDefaultFilters(reportQuery, variantDefinition, response, request)) {\n const getListData: ListDataSources = {\n data: reportingClient.getListWithWarnings(resourceName, token, reportQuery),\n count: reportingClient.getCount(resourceName, token, reportQuery),\n }\n\n await renderList(\n getListData,\n variantDefinition,\n reportQuery,\n request,\n response,\n next,\n `${variantDefinition.name}`,\n layoutTemplate,\n otherOptions,\n title || `${reportName}`,\n )\n }\n } else {\n throw new Error('No specification in definition')\n }\n } catch (error) {\n next(error)\n }\n}\n\nexport const renderListWithData = async ({\n title,\n reportName,\n variantDefinition,\n request,\n response,\n next,\n getListDataSources,\n otherOptions,\n layoutTemplate,\n}: RenderListWithDataInput) => {\n const { specification } = variantDefinition\n const { fields, template } = <components['schemas']['Specification']>specification\n const reportQuery = new ReportQuery({\n fields,\n template: template as Template,\n queryParams: request.query,\n definitionsPath: <string>request.query['dataProductDefinitionsPath'],\n })\n\n const listData = getListDataSources(reportQuery)\n await renderList(\n listData,\n variantDefinition,\n reportQuery,\n request,\n response,\n next,\n title,\n layoutTemplate,\n otherOptions,\n reportName,\n )\n}\n\nexport const createReportListRequestHandler = ({\n title,\n definitionName,\n variantName,\n apiUrl,\n apiTimeout,\n otherOptions,\n layoutTemplate,\n tokenProvider,\n definitionsPath,\n}: CreateRequestHandlerInput): RequestHandler => {\n return (request: Request, response: Response, next: NextFunction) => {\n renderListWithDefinition({\n title: title || '',\n definitionName,\n variantName,\n request,\n response,\n next,\n layoutTemplate,\n token: tokenProvider(request, response, next),\n apiUrl,\n apiTimeout,\n ...(otherOptions && { otherOptions }),\n ...(definitionsPath && { definitionsPath }),\n })\n }\n}\n\nexport default {\n renderListWithData,\n createReportListRequestHandler,\n renderListWithDefinition,\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAwB;AAQxB,6BAA4B;AAI5B,mBAA+B;AAE/B,IAAAA,gBAAgC;AAChC,IAAAA,gBAAyB;AACzB,yBAA2B;AAC3B,6BAA4B;AAE5B,SAAS,mBAAmB,MAAmE;AAC7F,SAAQ,KAA0B,SAAS;AAC7C;AAEA,eAAsB,WACpB,UACA,mBACA,aACA,KACA,UACA,MACA,OACA,gBACA,cACA,YACA;AACA,QAAM,QAAQ,IAAI,CAAC,SAAS,MAAM,SAAS,KAAK,CAAC,EAC9C,KAAK,OAAO,iBAAiB;AAC5B,QAAI;AACJ,QAAI,WAAqB,CAAC;AAC1B,UAAM,EAAE,eAAe,gBAAgB,WAAW,aAAa,MAAM,YAAY,IAAI;AACrF,QAAI,eAAe;AACjB,YAAM,EAAE,SAAS,IAAI;AACrB,YAAM,QAAQ,aAAa,CAAC;AAE5B,UAAI,mBAAmB,aAAa,CAAC,CAAC,GAAG;AAEvC,eAAO,aAAa,CAAC,EAAE;AACvB,mBAAW,aAAa,CAAC,EAAE;AAAA,MAC7B,OAAO;AAEL,eAAO,aAAa,CAAC;AAAA,MACvB;AAEA,YA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AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,iCAAiC,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAiD;AAC/C,SAAO,CAAC,SAAkB,UAAoB,SAAuB;AACnE,6BAAyB;AAAA,MACvB,OAAO,SAAS;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,cAAc,SAAS,UAAU,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,MACA,GAAI,gBAAgB,EAAE,aAAa;AAAA,MACnC,GAAI,mBAAmB,EAAE,gBAAgB;AAAA,IAC3C,CAAC;AAAA,EACH;AACF;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
4
+ "sourcesContent": ["import { NextFunction, Request, RequestHandler, Response } from 'express'\n\nimport ReportQuery from '../../types/ReportQuery'\n\nimport {\n ListDataSources,\n RenderListWithDataInput,\n RenderListWithDefinitionInput,\n CreateRequestHandlerInput,\n} from './types'\nimport ReportingClient from '../../data/reportingClient'\nimport { ListWithWarnings, Warnings } from '../../data/types'\nimport { components } from '../../types/api'\nimport Dict = NodeJS.Dict\nimport ReportActionsUtils from '../_reports/report-heading/report-actions/utils'\nimport { Template } from '../../types/Templates'\nimport { SyncReportUtils } from '../../utils'\nimport FiltersUtils from '../_filters/utils'\nimport { ReportType } from '../../types/UserReports'\nimport { FiltersType } from '../_filters/filtersTypeEnum'\n\nfunction isListWithWarnings(data: Dict<string>[] | ListWithWarnings): data is ListWithWarnings {\n return (data as ListWithWarnings).data !== undefined\n}\n\nexport async function renderList(\n listData: ListDataSources,\n variantDefinition: components['schemas']['VariantDefinition'],\n definition: components['schemas']['SingleVariantReportDefinition'],\n reportQuery: ReportQuery,\n req: Request,\n response: Response,\n next: NextFunction,\n title: string,\n layoutTemplate: string,\n otherOptions?: NodeJS.Dict<object>,\n reportName?: string,\n) {\n await Promise.all([listData.data, listData.count])\n .then(async (resolvedData) => {\n let data\n let warnings: Warnings = {}\n const { specification, classification, printable, description, name: variantName } = variantDefinition\n if (specification) {\n const { template } = specification\n const count = resolvedData[1]\n\n if (isListWithWarnings(resolvedData[0])) {\n // eslint-disable-next-line prefer-destructuring\n data = resolvedData[0].data\n warnings = resolvedData[0].warnings\n } else {\n // eslint-disable-next-line prefer-destructuring\n data = resolvedData[0]\n }\n\n const reportRenderData = await SyncReportUtils.getReportRenderData({\n req,\n count,\n specification,\n reportQuery,\n data,\n filtersType: FiltersType.REQUEST,\n definition,\n })\n\n const actions = ReportActionsUtils.getActions({\n print: {\n enabled: Boolean(variantDefinition.printable),\n },\n share: {\n reportName: reportName || 'Product',\n name: variantDefinition.name,\n url: reportRenderData.fullUrl,\n },\n copy: {\n url: reportRenderData.fullUrl,\n },\n })\n\n const renderData = {\n renderData: {\n ...reportRenderData,\n reportName,\n name: title || variantName,\n description,\n count,\n classification,\n printable,\n actions,\n template,\n warnings,\n type: ReportType.REPORT,\n ...otherOptions,\n },\n layoutTemplate,\n }\n\n response.render(`dpr/components/report-list/list`, renderData)\n } else {\n throw new Error('No specification in definition')\n }\n })\n .catch((err) => next(err))\n}\n\nexport const renderListWithDefinition = async ({\n title,\n definitionName,\n variantName,\n request,\n response,\n next,\n otherOptions,\n layoutTemplate,\n token,\n apiUrl,\n apiTimeout,\n definitionsPath,\n}: RenderListWithDefinitionInput) => {\n const reportingClient = new ReportingClient({\n url: apiUrl,\n agent: {\n timeout: apiTimeout,\n },\n })\n\n const { dataProductDefinitionsPath } = request.query\n const reportDef = <string>dataProductDefinitionsPath || definitionsPath\n\n try {\n const reportDefinition = await reportingClient.getDefinition(token, definitionName, variantName, reportDef)\n const reportName: string = reportDefinition.name\n const variantDefinition = reportDefinition.variant\n const { specification, resourceName } = variantDefinition\n if (specification) {\n const { fields, template } = specification\n const reportQuery = new ReportQuery({\n fields,\n template: template as Template,\n queryParams: request.query,\n ...(reportDef && { definitionsPath: reportDef }),\n })\n\n if (!FiltersUtils.redirectWithDefaultFilters(reportQuery, variantDefinition, response, request)) {\n const getListData: ListDataSources = {\n data: reportingClient.getListWithWarnings(resourceName, token, reportQuery),\n count: reportingClient.getCount(resourceName, token, reportQuery),\n }\n\n await renderList(\n getListData,\n variantDefinition,\n reportDefinition,\n reportQuery,\n request,\n response,\n next,\n `${variantDefinition.name}`,\n layoutTemplate,\n otherOptions,\n title || `${reportName}`,\n )\n }\n } else {\n throw new Error('No specification in definition')\n }\n } catch (error) {\n next(error)\n }\n}\n\nexport const renderListWithData = async ({\n title,\n reportName,\n variantDefinition,\n request,\n response,\n next,\n getListDataSources,\n otherOptions,\n layoutTemplate,\n}: RenderListWithDataInput) => {\n const { specification } = variantDefinition\n const { fields, template } = <components['schemas']['Specification']>specification\n const reportQuery = new ReportQuery({\n fields,\n template: template as Template,\n queryParams: request.query,\n definitionsPath: <string>request.query['dataProductDefinitionsPath'],\n })\n\n const definition: components['schemas']['SingleVariantReportDefinition'] = {\n id: variantDefinition.id,\n name: variantDefinition.name,\n variant: variantDefinition,\n }\n\n const listData = getListDataSources(reportQuery)\n await renderList(\n listData,\n variantDefinition,\n definition,\n reportQuery,\n request,\n response,\n next,\n title,\n layoutTemplate,\n otherOptions,\n reportName,\n )\n}\n\nexport const createReportListRequestHandler = ({\n title,\n definitionName,\n variantName,\n apiUrl,\n apiTimeout,\n otherOptions,\n layoutTemplate,\n tokenProvider,\n definitionsPath,\n}: CreateRequestHandlerInput): RequestHandler => {\n return (request: Request, response: Response, next: NextFunction) => {\n renderListWithDefinition({\n title: title || '',\n definitionName,\n variantName,\n request,\n response,\n next,\n layoutTemplate,\n token: tokenProvider(request, response, next),\n apiUrl,\n apiTimeout,\n ...(otherOptions && { otherOptions }),\n ...(definitionsPath && { definitionsPath }),\n })\n }\n}\n\nexport default {\n renderListWithData,\n createReportListRequestHandler,\n renderListWithDefinition,\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAwB;AAQxB,6BAA4B;AAI5B,mBAA+B;AAE/B,IAAAA,gBAAgC;AAChC,IAAAA,gBAAyB;AACzB,yBAA2B;AAC3B,6BAA4B;AAE5B,SAAS,mBAAmB,MAAmE;AAC7F,SAAQ,KAA0B,SAAS;AAC7C;AAEA,eAAsB,WACpB,UACA,mBACA,YACA,aACA,KACA,UACA,MACA,OACA,gBACA,cACA,YACA;AACA,QAAM,QAAQ,IAAI,CAAC,SAAS,MAAM,SAAS,KAAK,CAAC,EAC9C,KAAK,OAAO,iBAAiB;AAC5B,QAAI;AACJ,QAAI,WAAqB,CAAC;AAC1B,UAAM,EAAE,eAAe,gBAAgB,WAAW,aAAa,MAAM,YAAY,IAAI;AACrF,QAAI,eAAe;AACjB,YAAM,EAAE,SAAS,IAAI;AACrB,YAAM,QAAQ,aAAa,CAAC;AAE5B,UAAI,mBAAmB,aAAa,CAAC,CAAC,GAAG;AAEvC,eAAO,aAAa,CAAC,EAAE;AACvB,mBAAW,aAAa,CAAC,EAAE;AAAA,MAC7B,OAAO;AAEL,eAAO,aAAa,CAAC;AAAA,MACvB;AAEA,YAAM,mBAAmB,MAAM,8BAAgB,oBAAoB;AAAA,QACjE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAa,mCAAY;AAAA,QACzB;AAAA,MACF,CAAC;AAED,YAAM,UAAU,aAAAC,QAAmB,WAAW;AAAA,QAC5C,OAAO;AAAA,UACL,SAAS,QAAQ,kBAAkB,SAAS;AAAA,QAC9C;AAAA,QACA,OAAO;AAAA,UACL,YAAY,cAAc;AAAA,UAC1B,MAAM,kBAAkB;AAAA,UACxB,KAAK,iBAA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AAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAiD;AAC/C,SAAO,CAAC,SAAkB,UAAoB,SAAuB;AACnE,6BAAyB;AAAA,MACvB,OAAO,SAAS;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,cAAc,SAAS,UAAU,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,MACA,GAAI,gBAAgB,EAAE,aAAa;AAAA,MACnC,GAAI,mBAAmB,EAAE,gBAAgB;AAAA,IAC3C,CAAC;AAAA,EACH;AACF;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_utils", "ReportActionsUtils", "ReportingClient", "ReportQuery", "FiltersUtils"]
7
7
  }
@@ -12,7 +12,7 @@ import ReportingClient from '../../data/reportingClient'
12
12
  import { ListWithWarnings, Warnings } from '../../data/types'
13
13
  import { components } from '../../types/api'
14
14
  import Dict = NodeJS.Dict
15
- import ReportActionsUtils from '../_reports/report-actions/utils'
15
+ import ReportActionsUtils from '../_reports/report-heading/report-actions/utils'
16
16
  import { Template } from '../../types/Templates'
17
17
  import { SyncReportUtils } from '../../utils'
18
18
  import FiltersUtils from '../_filters/utils'
@@ -26,6 +26,7 @@ function isListWithWarnings(data: Dict<string>[] | ListWithWarnings): data is Li
26
26
  export async function renderList(
27
27
  listData: ListDataSources,
28
28
  variantDefinition: components['schemas']['VariantDefinition'],
29
+ definition: components['schemas']['SingleVariantReportDefinition'],
29
30
  reportQuery: ReportQuery,
30
31
  req: Request,
31
32
  response: Response,
@@ -60,6 +61,7 @@ export async function renderList(
60
61
  reportQuery,
61
62
  data,
62
63
  filtersType: FiltersType.REQUEST,
64
+ definition,
63
65
  })
64
66
 
65
67
  const actions = ReportActionsUtils.getActions({
@@ -149,6 +151,7 @@ export const renderListWithDefinition = async ({
149
151
  await renderList(
150
152
  getListData,
151
153
  variantDefinition,
154
+ reportDefinition,
152
155
  reportQuery,
153
156
  request,
154
157
  response,
@@ -187,10 +190,17 @@ export const renderListWithData = async ({
187
190
  definitionsPath: <string>request.query['dataProductDefinitionsPath'],
188
191
  })
189
192
 
193
+ const definition: components['schemas']['SingleVariantReportDefinition'] = {
194
+ id: variantDefinition.id,
195
+ name: variantDefinition.name,
196
+ variant: variantDefinition,
197
+ }
198
+
190
199
  const listData = getListDataSources(reportQuery)
191
200
  await renderList(
192
201
  listData,
193
202
  variantDefinition,
203
+ definition,
194
204
  reportQuery,
195
205
  request,
196
206
  response,
@@ -1,7 +1,7 @@
1
- {% from "dpr/components/_reports/report-wrapper/view.njk" import dprReportWrapper %}
1
+ {% from "dpr/components/_reports/report-page/view.njk" import dprReportPage %}
2
2
 
3
3
  {% macro dprReportList(renderData) %}
4
4
  <div id="dpr-embedded-report-list">
5
- {{ dprReportWrapper(renderData)}}
5
+ {{ dprReportPage(renderData)}}
6
6
  <div>
7
7
  {% endmacro %}
@@ -1,6 +1,6 @@
1
1
  .dpr-show-more {
2
2
  .dpr-show-hide-button {
3
- display: inline-block
3
+ display: inline-block;
4
4
  }
5
5
 
6
6
  .dpr-show-more-content {
@@ -22,7 +22,7 @@ ul.dpr-card-group__item__filters-list {
22
22
  margin-bottom: govuk-spacing(1);
23
23
  margin-right: govuk-spacing(1);
24
24
  }
25
-
25
+
26
26
  li.dpr-query-summary {
27
27
  background-color: govuk-colour('light-grey');
28
28
  }
@@ -32,7 +32,6 @@ ul.dpr-card-group__item__filters-list {
32
32
  }
33
33
 
34
34
  li:last-child {
35
- margin-bottom: govuk-spacing(0);
35
+ margin-bottom: govuk-spacing(0);
36
36
  }
37
37
  }
38
-
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../dpr/data/reportingClient.ts"],
4
- "sourcesContent": ["import { Response } from 'express'\nimport ReportQuery from '../types/ReportQuery'\nimport logger from '../utils/logger'\nimport RestClient from './restClient'\nimport Dict = NodeJS.Dict\nimport { components, operations } from '../types/api'\nimport { ApiConfig, Count, ListWithWarnings } from './types'\nimport type { ResultWithHeaders } from './restClient'\n\nclass ReportingClient {\n restClient: RestClient\n\n constructor(config: ApiConfig) {\n this.restClient = new RestClient('Reporting API Client', config)\n }\n\n getCount(resourceName: string, token: string, countRequest: ReportQuery): Promise<number> {\n logger.info(`Reporting client: Get count. { resourceName: ${resourceName} }`)\n\n return this.restClient\n .get({\n path: `/${resourceName}/count`,\n query: countRequest.toRecordWithFilterPrefix(true),\n token,\n })\n .then((response) => (<Count>response).count)\n }\n\n getList(resourceName: string, token: string, listRequest: ReportQuery): Promise<Array<Dict<string>>> {\n return this.getListWithWarnings(resourceName, token, listRequest).then((response) => response.data)\n }\n\n getListWithWarnings(resourceName: string, token: string, listRequest: ReportQuery): Promise<ListWithWarnings> {\n logger.info(`Reporting client: Get list. { resourceName: ${resourceName} }`)\n\n return this.restClient\n .getWithHeaders<Array<Dict<string>>>({\n path: `/${resourceName}`,\n query: listRequest.toRecordWithFilterPrefix(true),\n token,\n })\n .then((response: ResultWithHeaders<Array<Dict<string>>>) => ({\n data: response.data,\n warnings: {\n noDataAvailable: response.headers['x-no-data-warning'],\n },\n }))\n }\n\n getDefinitionSummary(\n token: string,\n reportId: string,\n definitionsPath?: string,\n ): Promise<components['schemas']['ReportDefinitionSummary']> {\n this.logInfo('Get definition summary', { reportId })\n\n const queryParams: operations['definitionSummary']['parameters']['query'] = {\n ...(definitionsPath && { dataProductDefinitionsPath: definitionsPath }),\n }\n\n return this.restClient\n .get({\n path: `/definitions/${reportId}`,\n query: queryParams,\n token,\n })\n .then((response) => <components['schemas']['ReportDefinitionSummary']>response)\n }\n\n getDefinitions(\n token: string,\n definitionsPath?: string,\n ): Promise<Array<components['schemas']['ReportDefinitionSummary']>> {\n this.logInfo('Get definitions')\n\n const queryParams: operations['definitions_1']['parameters']['query'] = {\n renderMethod: 'HTML',\n ...(definitionsPath && { dataProductDefinitionsPath: definitionsPath }),\n }\n\n return this.restClient\n .get({\n path: '/definitions',\n query: queryParams,\n token,\n })\n .then((response) => <Array<components['schemas']['ReportDefinitionSummary']>>response)\n }\n\n getDefinition(\n token: string,\n reportId: string,\n variantId: string,\n definitionsPath?: string,\n queryData?: Dict<string | string[]>,\n ): Promise<components['schemas']['SingleVariantReportDefinition']> {\n const query = {\n ...queryData,\n dataProductDefinitionsPath: definitionsPath,\n }\n\n this.logInfo('Get definition', { reportId, variantId, ...query })\n\n return this.restClient\n .get({\n path: `/definitions/${reportId}/${variantId}`,\n query,\n token,\n })\n .then((response) => <components['schemas']['SingleVariantReportDefinition']>response)\n }\n\n requestAsyncReport(\n token: string,\n reportId: string,\n variantId: string,\n query: Record<string, string | boolean | number>,\n ): Promise<Dict<string>> {\n this.logInfo('Request report', { reportId, variantId })\n\n return this.restClient\n .get({\n path: `/async/reports/${reportId}/${variantId}`,\n token,\n query,\n })\n .then((response) => <Dict<string>>response)\n }\n\n cancelAsyncRequest(\n token: string,\n reportId: string,\n variantId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n ): Promise<Dict<string>> {\n this.logInfo('Cancel Request', { reportId, variantId, executionId })\n\n return this.restClient\n .delete({\n path: `/reports/${reportId}/${variantId}/statements/${executionId}`,\n token,\n query: {\n dataProductDefinitionsPath,\n },\n })\n .then((response) => <Dict<string>>response)\n }\n\n downloadAsyncReport(\n token: string,\n reportId: string,\n variantId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n res: Response,\n ): Promise<void> {\n this.logInfo('Streaming download data', { reportId, variantId, tableId })\n\n return this.restClient.getStream(\n {\n path: `/reports/${reportId}/${variantId}/tables/${tableId}/download`,\n query,\n token,\n },\n res,\n )\n }\n\n getAsyncReport(\n token: string,\n reportId: string,\n variantId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n ): Promise<Array<Dict<string>>> {\n this.logInfo('Get Data', { reportId, variantId, tableId })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${variantId}/tables/${tableId}/result`,\n token,\n query,\n })\n .then((response) => <Array<Dict<string>>>response)\n }\n\n getAsyncSummaryReport(\n token: string,\n reportId: string,\n variantId: string,\n tableId: string,\n summaryId: string,\n query: Dict<string | number>,\n ): Promise<Array<Dict<string>>> {\n this.logInfo('Get summary data', { reportId, variantId, tableId, summaryId })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${variantId}/tables/${tableId}/result/summary/${summaryId}`,\n token,\n query,\n })\n .then((response) => <Array<Dict<string>>>response)\n }\n\n getAsyncReportStatus(\n token: string,\n reportId: string,\n variantId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n tableId?: string,\n ): Promise<components['schemas']['StatementExecutionStatus']> {\n this.logInfo('Get status', { reportId, variantId, tableId, executionId })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${variantId}/statements/${executionId}/status`,\n token,\n query: {\n dataProductDefinitionsPath,\n tableId,\n },\n })\n .then((response) => <components['schemas']['StatementExecutionStatus']>response)\n }\n\n getAsyncCount(token: string, tableId: string, dataProductDefinitionsPath?: string): Promise<number> {\n this.logInfo('Get count', { tableId })\n\n return this.restClient\n .get({\n path: `/report/tables/${tableId}/count`,\n token,\n query: {\n dataProductDefinitionsPath,\n },\n })\n .then((response) => (<Count>response).count)\n }\n\n getAsyncInteractiveCount(\n token: string,\n tableId: string,\n reportId: string,\n id: string,\n filters: ReportQuery,\n ): Promise<number> {\n this.logInfo('Get interactive count', { tableId, reportId, id })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${id}/tables/${tableId}/count`,\n token,\n query: filters.toRecordWithFilterPrefix(true),\n })\n .then((response) => (<Count>response).count)\n }\n\n logInfo(title: string, args?: Dict<string>) {\n logger.info(`Reporting Client: ${title}:`)\n if (args && Object.keys(args).length) logger.info(JSON.stringify(args, null, 2))\n }\n}\n\nexport { ReportingClient }\nexport default ReportingClient\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAmB;AACn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OAAO;AAAA,QACL;AAAA,MACF;AAAA,IACF,CAAC,EACA,KAAK,CAAC,aAAqB,SAAU,KAAK;AAAA,EAC/C;AAAA,EAEA,yBACE,OACA,SACA,UACA,IACA,SACiB;AACjB,SAAK,QAAQ,yBAAyB,EAAE,SAAS,UAAU,GAAG,CAAC;AAE/D,WAAO,KAAK,WACT,IAAI;AAAA,MACH,MAAM,YAAY,QAAQ,IAAI,EAAE,WAAW,OAAO;AAAA,MAClD;AAAA,MACA,OAAO,QAAQ,yBAAyB,IAAI;AAAA,IAC9C,CAAC,EACA,KAAK,CAAC,aAAqB,SAAU,KAAK;AAAA,EAC/C;AAAA,EAEA,QAAQ,OAAe,MAAqB;AAC1C,kBAAAA,QAAO,KAAK,qBAAqB,KAAK,GAAG;AACzC,QAAI,QAAQ,OAAO,KAAK,IAAI,EAAE,OAAQ,eAAAA,QAAO,KAAK,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;AAAA,EACjF;AACF;AAGA,IAAO,0BAAQ;",
4
+ "sourcesContent": ["import { Response } from 'express'\nimport ReportQuery from '../types/ReportQuery'\nimport logger from '../utils/logger'\nimport RestClient from './restClient'\nimport Dict = NodeJS.Dict\nimport { components, operations } from '../types/api'\nimport { ApiConfig, Count, ListWithWarnings } from './types'\nimport type { ResultWithHeaders } from './restClient'\n\nclass ReportingClient {\n restClient: RestClient\n\n constructor(config: ApiConfig) {\n this.restClient = new RestClient('Reporting API Client', config)\n }\n\n getCount(resourceName: string, token: string, countRequest: ReportQuery): Promise<number> {\n logger.info(`Reporting client: Get count. { resourceName: ${resourceName} }`)\n\n return this.restClient\n .get({\n path: `/${resourceName}/count`,\n query: countRequest.toRecordWithFilterPrefix(true),\n token,\n })\n .then((response) => (<Count>response).count)\n }\n\n getList(resourceName: string, token: string, listRequest: ReportQuery): Promise<Array<Dict<string>>> {\n return this.getListWithWarnings(resourceName, token, listRequest).then((response) => response.data)\n }\n\n getListWithWarnings(resourceName: string, token: string, listRequest: ReportQuery): Promise<ListWithWarnings> {\n logger.info(`Reporting client: Get list. { resourceName: ${resourceName} }`)\n\n return this.restClient\n .getWithHeaders<Array<Dict<string>>>({\n path: `/${resourceName}`,\n query: listRequest.toRecordWithFilterPrefix(true),\n token,\n })\n .then((response: ResultWithHeaders<Array<Dict<string>>>) => ({\n data: response.data,\n warnings: {\n noDataAvailable: response.headers['x-no-data-warning'],\n },\n }))\n }\n\n getDefinitionSummary(\n token: string,\n reportId: string,\n definitionsPath?: string,\n ): Promise<components['schemas']['ReportDefinitionSummary']> {\n this.logInfo('Get definition summary', { reportId })\n\n const queryParams: operations['definitionSummary']['parameters']['query'] = {\n ...(definitionsPath && { dataProductDefinitionsPath: definitionsPath }),\n }\n\n return this.restClient\n .get({\n path: `/definitions/${reportId}`,\n query: queryParams,\n token,\n })\n .then((response) => <components['schemas']['ReportDefinitionSummary']>response)\n }\n\n getDefinitions(\n token: string,\n definitionsPath?: string,\n ): Promise<Array<components['schemas']['ReportDefinitionSummary']>> {\n this.logInfo('Get definitions')\n\n const queryParams: operations['definitions_1']['parameters']['query'] = {\n renderMethod: 'HTML',\n ...(definitionsPath && { dataProductDefinitionsPath: definitionsPath }),\n }\n\n return this.restClient\n .get({\n path: '/definitions',\n query: queryParams,\n token,\n })\n .then((response) => <Array<components['schemas']['ReportDefinitionSummary']>>response)\n }\n\n getDefinition(\n token: string,\n reportId: string,\n variantId: string,\n definitionsPath?: string,\n queryData?: Dict<string | string[]>,\n ): Promise<components['schemas']['SingleVariantReportDefinition']> {\n const query = {\n ...queryData,\n dataProductDefinitionsPath: definitionsPath,\n }\n\n this.logInfo('Get definition', { reportId, variantId, ...query })\n\n return this.restClient\n .get({\n path: `/definitions/${reportId}/${variantId}`,\n query,\n token,\n })\n .then((response) => <components['schemas']['SingleVariantReportDefinition']>response)\n }\n\n requestAsyncReport(\n token: string,\n reportId: string,\n variantId: string,\n query: Record<string, string | boolean | number>,\n ): Promise<Dict<string>> {\n this.logInfo('Request report', { reportId, variantId })\n\n return this.restClient\n .get({\n path: `/async/reports/${reportId}/${variantId}`,\n token,\n query,\n })\n .then((response) => <Dict<string>>response)\n }\n\n cancelAsyncRequest(\n token: string,\n reportId: string,\n variantId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n ): Promise<Dict<string>> {\n this.logInfo('Cancel Request', { reportId, variantId, executionId })\n\n return this.restClient\n .delete({\n path: `/reports/${reportId}/${variantId}/statements/${executionId}`,\n token,\n query: {\n dataProductDefinitionsPath,\n },\n })\n .then((response) => <Dict<string>>response)\n }\n\n downloadAsyncReport(\n token: string,\n reportId: string,\n variantId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n res: Response,\n ): Promise<void> {\n this.logInfo('Streaming download data', { reportId, variantId, tableId })\n\n return this.restClient.getStream(\n {\n path: `/reports/${reportId}/${variantId}/tables/${tableId}/download`,\n query,\n token,\n },\n res,\n )\n }\n\n getAsyncReport(\n token: string,\n reportId: string,\n variantId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n ): Promise<Array<Record<string, string>>> {\n this.logInfo('Get Data', { reportId, variantId, tableId })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${variantId}/tables/${tableId}/result`,\n token,\n query,\n })\n .then((response) => <Array<Record<string, string>>>response)\n }\n\n getAsyncSummaryReport(\n token: string,\n reportId: string,\n variantId: string,\n tableId: string,\n summaryId: string,\n query: Dict<string | number>,\n ): Promise<Array<Record<string, string>>> {\n this.logInfo('Get summary data', { reportId, variantId, tableId, summaryId })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${variantId}/tables/${tableId}/result/summary/${summaryId}`,\n token,\n query,\n })\n .then((response) => <Array<Record<string, string>>>response)\n }\n\n getAsyncReportStatus(\n token: string,\n reportId: string,\n variantId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n tableId?: string,\n ): Promise<components['schemas']['StatementExecutionStatus']> {\n this.logInfo('Get status', { reportId, variantId, tableId, executionId })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${variantId}/statements/${executionId}/status`,\n token,\n query: {\n dataProductDefinitionsPath,\n tableId,\n },\n })\n .then((response) => <components['schemas']['StatementExecutionStatus']>response)\n }\n\n getAsyncCount(token: string, tableId: string, dataProductDefinitionsPath?: string): Promise<number> {\n this.logInfo('Get count', { tableId })\n\n return this.restClient\n .get({\n path: `/report/tables/${tableId}/count`,\n token,\n query: {\n dataProductDefinitionsPath,\n },\n })\n .then((response) => (<Count>response).count)\n }\n\n getAsyncInteractiveCount(\n token: string,\n tableId: string,\n reportId: string,\n id: string,\n filters: ReportQuery,\n ): Promise<number> {\n this.logInfo('Get interactive count', { tableId, reportId, id })\n\n return this.restClient\n .get({\n path: `/reports/${reportId}/${id}/tables/${tableId}/count`,\n token,\n query: filters.toRecordWithFilterPrefix(true),\n })\n .then((response) => (<Count>response).count)\n }\n\n logInfo(title: string, args?: Dict<string>) {\n logger.info(`Reporting Client: ${title}:`)\n if (args && Object.keys(args).length) logger.info(JSON.stringify(args, null, 2))\n }\n}\n\nexport { ReportingClient }\nexport default ReportingClient\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAmB;AACnB,wBAAuB;AAMvB,MAAM,gBAAgB;AAAA,EACpB;AAAA,EAEA,YAAY,QAAmB;AAC7B,SAAK,aAAa,IAAI,kBAAAA,QAAW,wBAAwB,MAAM;AAAA,EACjE;AAAA,EAEA,SAAS,cAAsB,OAAe,cAA4C;AACxF,kBAAAC,QAAO,KAAK,gDAAgD,YAAY,IAAI;AAE5E,WAAO,KAAK,WACT,IAAI;AAAA,MACH,MAAM,IAAI,YAAY;AAAA,MACtB,OAAO,aAAa,yBAAyB,IAAI;AAAA,MACjD;AAAA,IACF,CAAC,EACA,KAAK,CAAC,aAAqB,SAAU,KAAK;AAAA,EAC/C;AAAA,EAEA,QAAQ,cAAsB,OAAe,aAAwD;AACnG,WAAO,KAAK,oBAAoB,cAAc,OAAO,WAAW,EAA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AI,QAAQ,OAAO,KAAK,IAAI,EAAE,OAAQ,eAAAA,QAAO,KAAK,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;AAAA,EACjF;AACF;AAGA,IAAO,0BAAQ;",
6
6
  "names": ["RestClient", "logger"]
7
7
  }
@@ -173,7 +173,7 @@ class ReportingClient {
173
173
  variantId: string,
174
174
  tableId: string,
175
175
  query: Record<string, string | string[]>,
176
- ): Promise<Array<Dict<string>>> {
176
+ ): Promise<Array<Record<string, string>>> {
177
177
  this.logInfo('Get Data', { reportId, variantId, tableId })
178
178
 
179
179
  return this.restClient
@@ -182,7 +182,7 @@ class ReportingClient {
182
182
  token,
183
183
  query,
184
184
  })
185
- .then((response) => <Array<Dict<string>>>response)
185
+ .then((response) => <Array<Record<string, string>>>response)
186
186
  }
187
187
 
188
188
  getAsyncSummaryReport(
@@ -192,7 +192,7 @@ class ReportingClient {
192
192
  tableId: string,
193
193
  summaryId: string,
194
194
  query: Dict<string | number>,
195
- ): Promise<Array<Dict<string>>> {
195
+ ): Promise<Array<Record<string, string>>> {
196
196
  this.logInfo('Get summary data', { reportId, variantId, tableId, summaryId })
197
197
 
198
198
  return this.restClient
@@ -201,7 +201,7 @@ class ReportingClient {
201
201
  token,
202
202
  query,
203
203
  })
204
- .then((response) => <Array<Dict<string>>>response)
204
+ .then((response) => <Array<Record<string, string>>>response)
205
205
  }
206
206
 
207
207
  getAsyncReportStatus(
@@ -42,7 +42,7 @@ var import_utils4 = __toESM(require("../../../../../components/_filters/utils"))
42
42
  var import_utils5 = __toESM(require("../../../../../components/_dashboards/scorecard/utils"));
43
43
  var import_Scorecard = __toESM(require("../../../../../components/_dashboards/scorecard/Scorecard"));
44
44
  var import_ScorecardGroup = __toESM(require("../../../../../components/_dashboards/scorecard-group/ScorecardGroup"));
45
- var import_utils6 = __toESM(require("../../../../../components/_reports/report-actions/utils"));
45
+ var import_utils6 = __toESM(require("../../../../../components/_reports/report-heading/report-actions/utils"));
46
46
  var import_ReportQuery = __toESM(require("../../../../../types/ReportQuery"));
47
47
  var import_localsHelper = __toESM(require("../../../../../utils/localsHelper"));
48
48
  var import_filtersTypeEnum = require("../../../../../components/_filters/filtersTypeEnum");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../dpr/routes/journeys/view-report/async/dashboard/utils.ts"],
4
- "sourcesContent": ["import { Request, Response } from 'express'\nimport { Services } from '../../../../../types/Services'\nimport Dict = NodeJS.Dict\nimport {\n DashboardSection,\n DashboardVisualisation,\n DashboardVisualisationType,\n} from '../../../../../components/_dashboards/dashboard-visualisation/types'\nimport type { AsyncReportUtilsParams } from '../../../../../types/AsyncReportUtils'\n\nimport type { DashboardDataResponse } from '../../../../../types/Metrics'\nimport type { RequestedReport } from '../../../../../types/UserReports'\nimport { ReportType } from '../../../../../types/UserReports'\nimport type { components } from '../../../../../types/api'\n\nimport ChartUtils from '../../../../../components/_charts/utils'\nimport DefinitionUtils from '../../../../../utils/definitionUtils'\nimport UserReportsUtils from '../../../../../components/user-reports/utils'\nimport DashboardListUtils from '../../../../../components/_dashboards/dashboard-list/utils'\nimport FilterUtils from '../../../../../components/_filters/utils'\nimport ScorecardsUtils from '../../../../../components/_dashboards/scorecard/utils'\nimport ScorecardVisualisation from '../../../../../components/_dashboards/scorecard/Scorecard'\nimport ScorecardGroupVisualisation from '../../../../../components/_dashboards/scorecard-group/ScorecardGroup'\nimport ReportActionsUtils from '../../../../../components/_reports/report-actions/utils'\nimport ReportQuery from '../../../../../types/ReportQuery'\nimport LocalsHelper from '../../../../../utils/localsHelper'\nimport { FilterValue, GranularDateRangeFilterValue, PartialDate } from '../../../../../components/_filters/types'\nimport { FiltersType } from '../../../../../components/_filters/filtersTypeEnum'\nimport { FilterType } from '../../../../../components/_filters/filter-input/enum'\n\nconst setDashboardActions = (\n dashboardDefinition: components['schemas']['DashboardDefinition'],\n reportDefinition: components['schemas']['ReportDefinitionSummary'],\n requestData?: RequestedReport,\n) => {\n const reportName = reportDefinition.name\n const { name } = dashboardDefinition\n const actionsUrl = requestData?.url?.request?.fullUrl\n const executionId = requestData?.executionId\n\n let actions = {}\n if (actionsUrl) {\n actions = {\n share: {\n reportName,\n name,\n url: actionsUrl,\n },\n copy: {\n url: actionsUrl,\n },\n }\n if (executionId) {\n actions = {\n ...actions,\n refresh: {\n url: actionsUrl,\n executionId,\n },\n }\n }\n }\n\n return ReportActionsUtils.getActions(actions)\n}\n\nconst getDefinitionData = async ({\n req,\n res,\n services,\n queryData,\n}: {\n req: Request\n res: Response\n services: Services\n queryData?: Dict<string | string[]> | undefined\n}) => {\n const { token } = LocalsHelper.getValues(res)\n const { reportId, id } = req.params\n const dataProductDefinitionsPath = <string>req.query['dataProductDefinitionsPath']\n\n // Dashboard Definition,\n const dashboardDefinition = await services.dashboardService.getDefinition(\n token,\n reportId,\n id,\n dataProductDefinitionsPath,\n queryData,\n )\n\n // Report summary data\n const reportDefinition = await DefinitionUtils.getReportSummary(\n reportId,\n services.reportingService,\n token,\n <string>dataProductDefinitionsPath,\n )\n\n // Get the filters\n const filtersData = await FilterUtils.getFilters({\n fields: dashboardDefinition.filterFields || [],\n req,\n filtersType: FiltersType.INTERACTIVE,\n })\n\n const filtersQuery = FilterUtils.setRequestQueryFromFilterValues(filtersData.filters)\n\n // Create the query\n const query = new ReportQuery({\n fields: dashboardDefinition.filterFields || [],\n queryParams: filtersQuery,\n definitionsPath: <string>dataProductDefinitionsPath,\n reportType: ReportType.DASHBOARD,\n }).toRecordWithFilterPrefix(true)\n\n return {\n query,\n filters: filtersData,\n dashboardDefinition,\n reportDefinition,\n }\n}\n\nconst getSections = (\n dashboardDefinition: components['schemas']['DashboardDefinition'],\n dashboardData: DashboardDataResponse[],\n query: Record<string, string | string[]>,\n partialDate?: PartialDate,\n): DashboardSection[] => {\n return dashboardDefinition.sections.map((section: components['schemas']['DashboardSectionDefinition']) => {\n const { id, display: title, description } = section\n\n let hasScorecard = false\n const visualisations: DashboardVisualisation[] = section.visualisations.map(\n (visDefinition: components['schemas']['DashboardVisualisationDefinition']) => {\n const { type, display, description: visDescription, id: visId } = visDefinition\n\n let data: DashboardVisualisation['data'] | undefined\n\n switch (type) {\n case DashboardVisualisationType.LIST:\n data = DashboardListUtils.createList(visDefinition, dashboardData)\n break\n\n case DashboardVisualisationType.SCORECARD:\n hasScorecard = true\n data = new ScorecardVisualisation().withDefinition(visDefinition).withData(dashboardData).build()\n break\n\n case DashboardVisualisationType.SCORECARD_GROUP:\n data = new ScorecardGroupVisualisation().withDefinition(visDefinition).withData(dashboardData).build()\n break\n\n case DashboardVisualisationType.BAR:\n case DashboardVisualisationType.LINE:\n case DashboardVisualisationType.DONUT: {\n data = ChartUtils.createChart(visDefinition, dashboardData, type)\n break\n }\n case DashboardVisualisationType.MATRIX_TIMESERIES:\n case DashboardVisualisationType.BAR_TIMESERIES:\n case DashboardVisualisationType.LINE_TIMESERIES: {\n data = ChartUtils.createTimeseriesCharts(visDefinition, dashboardData, type, query, partialDate)\n break\n }\n default:\n break\n }\n\n return {\n id: visId,\n title: display || '',\n description: visDescription || '',\n type,\n data,\n }\n },\n )\n\n if (hasScorecard) ScorecardsUtils.mergeScorecardsIntoGroup(visualisations)\n\n return { id, title: title || '', description: description || '', visualisations }\n })\n}\n\nconst updateStore = async (\n services: Services,\n tableId: string,\n userId: string,\n sections: DashboardSection[],\n req: Request,\n filters: FilterValue[],\n): Promise<RequestedReport | undefined> => {\n const { requestedReportService } = services\n const dashboardRequestData = await requestedReportService.getReportByTableId(tableId, userId)\n\n // Add to recently viewed\n if (sections && sections.length && dashboardRequestData) {\n UserReportsUtils.updateLastViewed({\n services,\n reportStateData: dashboardRequestData,\n userId,\n req,\n filters,\n })\n }\n\n return dashboardRequestData\n}\n\nconst getPartialDate = (filters: FilterValue[]) => {\n let partialDate: PartialDate | undefined\n const granularDateRangeFilter = <GranularDateRangeFilterValue | undefined>(\n filters.find((f) => f.type === FilterType.granularDateRange.toLowerCase())\n )\n if (granularDateRangeFilter) {\n partialDate = granularDateRangeFilter.value.partialDate\n }\n return partialDate\n}\n\nexport const renderAsyncDashboard = async ({ req, res, services }: AsyncReportUtilsParams) => {\n const { token, csrfToken, dprUser, nestedBaseUrl } = LocalsHelper.getValues(res)\n const { reportId, id, tableId } = req.params\n const { bookmarkService, requestedReportService } = services\n const { id: userId } = dprUser\n\n let requestData: RequestedReport | undefined = await requestedReportService.getReportByTableId(tableId, userId)\n const queryData = requestData?.query?.data\n\n // Get the definition Data\n const { query, filters, reportDefinition, dashboardDefinition } = await getDefinitionData({\n req,\n res,\n services,\n queryData,\n })\n\n // Get the results data\n const dashboardData: DashboardDataResponse[][] = await services.dashboardService.getAsyncDashboard(\n token,\n id,\n reportId,\n tableId,\n query,\n )\n\n const flattenedData: DashboardDataResponse[] = dashboardData.flat()\n const partialDate = getPartialDate(filters.filters)\n\n // Get the dashboard parts\n const sections: DashboardSection[] = getSections(dashboardDefinition, flattenedData, query, partialDate)\n\n // Update the store\n if (requestedReportService) {\n requestData = await updateStore(services, tableId, dprUser.id, sections, req, filters.filters)\n }\n\n return {\n dashboardData: {\n token,\n id,\n reportId,\n name: dashboardDefinition.name,\n description: dashboardDefinition.description,\n reportName: reportDefinition.name,\n bookmarked: await bookmarkService.isBookmarked(id, reportId, dprUser.id),\n nestedBaseUrl,\n csrfToken,\n sections,\n filters,\n type: ReportType.DASHBOARD,\n actions: setDashboardActions(dashboardDefinition, reportDefinition, requestData),\n },\n }\n}\n\nexport default {\n renderAsyncDashboard,\n getDefinitionData,\n getSections,\n setDashboardActions,\n}\n"],
4
+ "sourcesContent": ["import { Request, Response } from 'express'\nimport { Services } from '../../../../../types/Services'\nimport Dict = NodeJS.Dict\nimport {\n DashboardSection,\n DashboardVisualisation,\n DashboardVisualisationType,\n} from '../../../../../components/_dashboards/dashboard-visualisation/types'\nimport type { AsyncReportUtilsParams } from '../../../../../types/AsyncReportUtils'\n\nimport type { DashboardDataResponse } from '../../../../../types/Metrics'\nimport type { RequestedReport } from '../../../../../types/UserReports'\nimport { ReportType } from '../../../../../types/UserReports'\nimport type { components } from '../../../../../types/api'\n\nimport ChartUtils from '../../../../../components/_charts/utils'\nimport DefinitionUtils from '../../../../../utils/definitionUtils'\nimport UserReportsUtils from '../../../../../components/user-reports/utils'\nimport DashboardListUtils from '../../../../../components/_dashboards/dashboard-list/utils'\nimport FilterUtils from '../../../../../components/_filters/utils'\nimport ScorecardsUtils from '../../../../../components/_dashboards/scorecard/utils'\nimport ScorecardVisualisation from '../../../../../components/_dashboards/scorecard/Scorecard'\nimport ScorecardGroupVisualisation from '../../../../../components/_dashboards/scorecard-group/ScorecardGroup'\nimport ReportActionsUtils from '../../../../../components/_reports/report-heading/report-actions/utils'\nimport ReportQuery from '../../../../../types/ReportQuery'\nimport LocalsHelper from '../../../../../utils/localsHelper'\nimport { FilterValue, GranularDateRangeFilterValue, PartialDate } from '../../../../../components/_filters/types'\nimport { FiltersType } from '../../../../../components/_filters/filtersTypeEnum'\nimport { FilterType } from '../../../../../components/_filters/filter-input/enum'\n\nconst setDashboardActions = (\n dashboardDefinition: components['schemas']['DashboardDefinition'],\n reportDefinition: components['schemas']['ReportDefinitionSummary'],\n requestData?: RequestedReport,\n) => {\n const reportName = reportDefinition.name\n const { name } = dashboardDefinition\n const actionsUrl = requestData?.url?.request?.fullUrl\n const executionId = requestData?.executionId\n\n let actions = {}\n if (actionsUrl) {\n actions = {\n share: {\n reportName,\n name,\n url: actionsUrl,\n },\n copy: {\n url: actionsUrl,\n },\n }\n if (executionId) {\n actions = {\n ...actions,\n refresh: {\n url: actionsUrl,\n executionId,\n },\n }\n }\n }\n\n return ReportActionsUtils.getActions(actions)\n}\n\nconst getDefinitionData = async ({\n req,\n res,\n services,\n queryData,\n}: {\n req: Request\n res: Response\n services: Services\n queryData?: Dict<string | string[]> | undefined\n}) => {\n const { token } = LocalsHelper.getValues(res)\n const { reportId, id } = req.params\n const dataProductDefinitionsPath = <string>req.query['dataProductDefinitionsPath']\n\n // Dashboard Definition,\n const dashboardDefinition = await services.dashboardService.getDefinition(\n token,\n reportId,\n id,\n dataProductDefinitionsPath,\n queryData,\n )\n\n // Report summary data\n const reportDefinition = await DefinitionUtils.getReportSummary(\n reportId,\n services.reportingService,\n token,\n <string>dataProductDefinitionsPath,\n )\n\n // Get the filters\n const filtersData = await FilterUtils.getFilters({\n fields: dashboardDefinition.filterFields || [],\n req,\n filtersType: FiltersType.INTERACTIVE,\n })\n\n const filtersQuery = FilterUtils.setRequestQueryFromFilterValues(filtersData.filters)\n\n // Create the query\n const query = new ReportQuery({\n fields: dashboardDefinition.filterFields || [],\n queryParams: filtersQuery,\n definitionsPath: <string>dataProductDefinitionsPath,\n reportType: ReportType.DASHBOARD,\n }).toRecordWithFilterPrefix(true)\n\n return {\n query,\n filters: filtersData,\n dashboardDefinition,\n reportDefinition,\n }\n}\n\nconst getSections = (\n dashboardDefinition: components['schemas']['DashboardDefinition'],\n dashboardData: DashboardDataResponse[],\n query: Record<string, string | string[]>,\n partialDate?: PartialDate,\n): DashboardSection[] => {\n return dashboardDefinition.sections.map((section: components['schemas']['DashboardSectionDefinition']) => {\n const { id, display: title, description } = section\n\n let hasScorecard = false\n const visualisations: DashboardVisualisation[] = section.visualisations.map(\n (visDefinition: components['schemas']['DashboardVisualisationDefinition']) => {\n const { type, display, description: visDescription, id: visId } = visDefinition\n\n let data: DashboardVisualisation['data'] | undefined\n\n switch (type) {\n case DashboardVisualisationType.LIST:\n data = DashboardListUtils.createList(visDefinition, dashboardData)\n break\n\n case DashboardVisualisationType.SCORECARD:\n hasScorecard = true\n data = new ScorecardVisualisation().withDefinition(visDefinition).withData(dashboardData).build()\n break\n\n case DashboardVisualisationType.SCORECARD_GROUP:\n data = new ScorecardGroupVisualisation().withDefinition(visDefinition).withData(dashboardData).build()\n break\n\n case DashboardVisualisationType.BAR:\n case DashboardVisualisationType.LINE:\n case DashboardVisualisationType.DONUT: {\n data = ChartUtils.createChart(visDefinition, dashboardData, type)\n break\n }\n case DashboardVisualisationType.MATRIX_TIMESERIES:\n case DashboardVisualisationType.BAR_TIMESERIES:\n case DashboardVisualisationType.LINE_TIMESERIES: {\n data = ChartUtils.createTimeseriesCharts(visDefinition, dashboardData, type, query, partialDate)\n break\n }\n default:\n break\n }\n\n return {\n id: visId,\n title: display || '',\n description: visDescription || '',\n type,\n data,\n }\n },\n )\n\n if (hasScorecard) ScorecardsUtils.mergeScorecardsIntoGroup(visualisations)\n\n return { id, title: title || '', description: description || '', visualisations }\n })\n}\n\nconst updateStore = async (\n services: Services,\n tableId: string,\n userId: string,\n sections: DashboardSection[],\n req: Request,\n filters: FilterValue[],\n): Promise<RequestedReport | undefined> => {\n const { requestedReportService } = services\n const dashboardRequestData = await requestedReportService.getReportByTableId(tableId, userId)\n\n // Add to recently viewed\n if (sections && sections.length && dashboardRequestData) {\n UserReportsUtils.updateLastViewed({\n services,\n reportStateData: dashboardRequestData,\n userId,\n req,\n filters,\n })\n }\n\n return dashboardRequestData\n}\n\nconst getPartialDate = (filters: FilterValue[]) => {\n let partialDate: PartialDate | undefined\n const granularDateRangeFilter = <GranularDateRangeFilterValue | undefined>(\n filters.find((f) => f.type === FilterType.granularDateRange.toLowerCase())\n )\n if (granularDateRangeFilter) {\n partialDate = granularDateRangeFilter.value.partialDate\n }\n return partialDate\n}\n\nexport const renderAsyncDashboard = async ({ req, res, services }: AsyncReportUtilsParams) => {\n const { token, csrfToken, dprUser, nestedBaseUrl } = LocalsHelper.getValues(res)\n const { reportId, id, tableId } = req.params\n const { bookmarkService, requestedReportService } = services\n const { id: userId } = dprUser\n\n let requestData: RequestedReport | undefined = await requestedReportService.getReportByTableId(tableId, userId)\n const queryData = requestData?.query?.data\n\n // Get the definition Data\n const { query, filters, reportDefinition, dashboardDefinition } = await getDefinitionData({\n req,\n res,\n services,\n queryData,\n })\n\n // Get the results data\n const dashboardData: DashboardDataResponse[][] = await services.dashboardService.getAsyncDashboard(\n token,\n id,\n reportId,\n tableId,\n query,\n )\n\n const flattenedData: DashboardDataResponse[] = dashboardData.flat()\n const partialDate = getPartialDate(filters.filters)\n\n // Get the dashboard parts\n const sections: DashboardSection[] = getSections(dashboardDefinition, flattenedData, query, partialDate)\n\n // Update the store\n if (requestedReportService) {\n requestData = await updateStore(services, tableId, dprUser.id, sections, req, filters.filters)\n }\n\n return {\n dashboardData: {\n token,\n id,\n reportId,\n name: dashboardDefinition.name,\n description: dashboardDefinition.description,\n reportName: reportDefinition.name,\n bookmarked: await bookmarkService.isBookmarked(id, reportId, dprUser.id),\n nestedBaseUrl,\n csrfToken,\n sections,\n filters,\n type: ReportType.DASHBOARD,\n actions: setDashboardActions(dashboardDefinition, reportDefinition, requestData),\n },\n }\n}\n\nexport default {\n renderAsyncDashboard,\n getDefinitionData,\n getSections,\n setDashboardActions,\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAIO;AAKP,yBAA2B;AAG3B,mBAAuB;AACvB,6BAA4B;AAC5B,IAAAA,gBAA6B;AAC7B,IAAAA,gBAA+B;AAC/B,IAAAA,gBAAwB;AACxB,IAAAA,gBAA4B;AAC5B,uBAAmC;AACnC,4BAAwC;AACxC,IAAAA,gBAA+B;AAC/B,yBAAwB;AACxB,0BAAyB;AAEzB,6BAA4B;AAC5B,kBAA2B;AAE3B,MAAM,sBAAsB,CAC1B,qBACA,kBACA,gBACG;AACH,QAAM,aAAa,iBAAiB;AACpC,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,aAAa,aAAa,KAAK,SAAS;AAC9C,QAAM,cAAc,aAAa;AAEjC,MAAI,UAAU,CAAC;AACf,MAAI,YAAY;AACd,cAAU;AAAA,MACR,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA,KAAK;AAAA,MACP;AAAA,MACA,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,IACF;AACA,QAAI,aAAa;AACf,gBAAU;AAAA,QACR,GAAG;AAAA,QACH,SAAS;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AAA,MACA,MAAM,oBAAoB;AAAA,MAC1B,aAAa,oBAAoB;AAAA,MACjC,YAAY,iBAAiB;AAAA,MAC7B,YAAY,MAAM,gBAAgB,aAAa,IAAI,UAAU,QAAQ,EAAE;AAAA,MACvE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,8BAAW;AAAA,MACjB,SAAS,oBAAoB,qBAAqB,kBAAkB,WAAW;AAAA,IACjF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": ["import_utils", "ReportActionsUtils", "LocalsHelper", "DefinitionUtils", "FilterUtils", "ReportQuery", "DashboardListUtils", "ScorecardVisualisation", "ScorecardGroupVisualisation", "ChartUtils", "ScorecardsUtils", "UserReportsUtils"]
7
7
  }
@@ -21,7 +21,7 @@ import FilterUtils from '../../../../../components/_filters/utils'
21
21
  import ScorecardsUtils from '../../../../../components/_dashboards/scorecard/utils'
22
22
  import ScorecardVisualisation from '../../../../../components/_dashboards/scorecard/Scorecard'
23
23
  import ScorecardGroupVisualisation from '../../../../../components/_dashboards/scorecard-group/ScorecardGroup'
24
- import ReportActionsUtils from '../../../../../components/_reports/report-actions/utils'
24
+ import ReportActionsUtils from '../../../../../components/_reports/report-heading/report-actions/utils'
25
25
  import ReportQuery from '../../../../../types/ReportQuery'
26
26
  import LocalsHelper from '../../../../../utils/localsHelper'
27
27
  import { FilterValue, GranularDateRangeFilterValue, PartialDate } from '../../../../../components/_filters/types'
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../dpr/routes/journeys/view-report/async/report/controller.ts"],
4
- "sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../../types/Services'\nimport LocalsHelper from '../../../../../utils/localsHelper'\nimport AsyncReportUtils from './utils'\nimport ViewReportUtils from '../../utils'\nimport ErrorHandler from '../../../../../utils/ErrorHandler'\n\nclass ViewAyncReportController {\n layoutPath: string\n\n services: Services\n\n constructor(layoutPath: string, services: Services) {\n this.layoutPath = layoutPath\n this.services = services\n }\n\n GET: RequestHandler = async (req, res, next) => {\n const { type } = req.params\n try {\n const params = { req, res, services: this.services, next }\n\n const renderData = await AsyncReportUtils.renderReport(params)\n\n res.render(`dpr/routes/journeys/view-report/report`, {\n layoutPath: this.layoutPath,\n ...renderData,\n })\n } catch (error) {\n const dprError = new ErrorHandler(error).formatError()\n let refreshLink\n const { recentlyViewedService } = this.services\n if (dprError.status === 'EXPIRED' && recentlyViewedService) {\n const { dprUser } = LocalsHelper.getValues(res)\n refreshLink = await recentlyViewedService.asyncSetToExpiredByTableId(req.params['tableId'], dprUser.id)\n }\n req.body ??= {}\n req.body.title = `Failed to retrieve ${type}`\n req.body.error = dprError\n if (refreshLink) {\n req.body.refreshLink = refreshLink\n }\n next(error)\n }\n }\n\n applyFilters: RequestHandler = async (req, res, _next) => {\n await ViewReportUtils.applyReportInteractiveQuery(req, res, this.services, 'filters')\n }\n\n applyColumns: RequestHandler = async (req, res, _next) => {\n await ViewReportUtils.applyReportInteractiveQuery(req, res, this.services, 'columns')\n }\n}\n\nexport { ViewAyncReportController }\nexport default ViewAyncReportController\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAyB;AACzB,mBAA6B;AAC7B,IAAAA,gBAA4B;AAC5B,0BAAyB;AAEzB,MAAM,yBAAyB;AAAA,EAC7B;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAsB,OAAO,KAAK,KAAK,SAAS;AAC9C,UAAM,EAAE,KAAK,IAAI,IAAI;AACrB,QAAI;AACF,YAAM,SAAS,EAAE,KAAK,KAAK,UAAU,KAAK,UAAU,KAAK;AAEzD,YAAM,aAAa,MAAM,aAAAC,QAAiB,aAAa,MAAM;AAE7D,UAAI,OAAO,0CAA0C;AAAA,QACnD,YAAY,KAAK;AAAA,QACjB,GAAG;AAAA,MACL,CAAC;AAAA,IACH,SAAS,OAAO;AACd,YAAM,WAAW,IAAI,oBAAAC,QAAa,KAAK,EAAE,YAAY;AACrD,UAAI;AACJ,YAAM,EAAE,sBAAsB,IAAI,KAAK;AACvC,UAAI,SAAS,WAAW,aAAa,uBAAuB;AAC1D,cAAM,EAAE,QAAQ,IAAI,oBAAAC,QAAa,UAAU,GAAG;AAC9C,sBAAc,MAAM,sBAAsB,2BAA2B,IAAI,OAAO,SAAS,GAAG,QAAQ,EAAE;AAAA,MACxG;AACA,UAAI,SAAS,CAAC;AACd,UAAI,KAAK,QAAQ,sBAAsB,IAAI;AAC3C,UAAI,KAAK,QAAQ;AACjB,UAAI,aAAa;AACf,YAAI,KAAK,cAAc;AAAA,MACzB;AACA,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,eAA+B,OAAO,KAAK,KAAK,UAAU;AACxD,UAAM,cAAAC,QAAgB,4BAA4B,KAAK,KAAK,KAAK,UAAU,SAAS;AAAA,EACtF;AAAA,EAEA,eAA+B,OAAO,KAAK,KAAK,UAAU;AACxD,UAAM,cAAAA,QAAgB,4BAA4B,KAAK,KAAK,KAAK,UAAU,SAAS;AAAA,EACtF;AACF;AAGA,IAAO,qBAAQ;",
4
+ "sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../../types/Services'\nimport LocalsHelper from '../../../../../utils/localsHelper'\nimport AsyncReportUtils from './utils'\nimport ViewReportUtils from '../../utils'\nimport ErrorHandler from '../../../../../utils/ErrorHandler'\n\nclass ViewAyncReportController {\n layoutPath: string\n\n services: Services\n\n constructor(layoutPath: string, services: Services) {\n this.layoutPath = layoutPath\n this.services = services\n }\n\n GET: RequestHandler = async (req, res, next) => {\n const { type } = req.params\n try {\n const params = { req, res, services: this.services, next }\n const renderData = await AsyncReportUtils.renderReport(params)\n\n res.render(`dpr/routes/journeys/view-report/report`, {\n layoutPath: this.layoutPath,\n ...renderData,\n })\n } catch (error) {\n const dprError = new ErrorHandler(error).formatError()\n let refreshLink\n const { recentlyViewedService } = this.services\n if (dprError.status === 'EXPIRED' && recentlyViewedService) {\n const { dprUser } = LocalsHelper.getValues(res)\n refreshLink = await recentlyViewedService.asyncSetToExpiredByTableId(req.params['tableId'], dprUser.id)\n }\n req.body ??= {}\n req.body.title = `Failed to retrieve ${type}`\n req.body.error = dprError\n if (refreshLink) {\n req.body.refreshLink = refreshLink\n }\n next(error)\n }\n }\n\n applyFilters: RequestHandler = async (req, res, _next) => {\n await ViewReportUtils.applyReportInteractiveQuery(req, res, this.services, 'filters')\n }\n\n applyColumns: RequestHandler = async (req, res, _next) => {\n await ViewReportUtils.applyReportInteractiveQuery(req, res, this.services, 'columns')\n }\n}\n\nexport { ViewAyncReportController }\nexport default ViewAyncReportController\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAyB;AACzB,mBAA6B;AAC7B,IAAAA,gBAA4B;AAC5B,0BAAyB;AAEzB,MAAM,yBAAyB;AAAA,EAC7B;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAsB,OAAO,KAAK,KAAK,SAAS;AAC9C,UAAM,EAAE,KAAK,IAAI,IAAI;AACrB,QAAI;AACF,YAAM,SAAS,EAAE,KAAK,KAAK,UAAU,KAAK,UAAU,KAAK;AACzD,YAAM,aAAa,MAAM,aAAAC,QAAiB,aAAa,MAAM;AAE7D,UAAI,OAAO,0CAA0C;AAAA,QACnD,YAAY,KAAK;AAAA,QACjB,GAAG;AAAA,MACL,CAAC;AAAA,IACH,SAAS,OAAO;AACd,YAAM,WAAW,IAAI,oBAAAC,QAAa,KAAK,EAAE,YAAY;AACrD,UAAI;AACJ,YAAM,EAAE,sBAAsB,IAAI,KAAK;AACvC,UAAI,SAAS,WAAW,aAAa,uBAAuB;AAC1D,cAAM,EAAE,QAAQ,IAAI,oBAAAC,QAAa,UAAU,GAAG;AAC9C,sBAAc,MAAM,sBAAsB,2BAA2B,IAAI,OAAO,SAAS,GAAG,QAAQ,EAAE;AAAA,MACxG;AACA,UAAI,SAAS,CAAC;AACd,UAAI,KAAK,QAAQ,sBAAsB,IAAI;AAC3C,UAAI,KAAK,QAAQ;AACjB,UAAI,aAAa;AACf,YAAI,KAAK,cAAc;AAAA,MACzB;AACA,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,eAA+B,OAAO,KAAK,KAAK,UAAU;AACxD,UAAM,cAAAC,QAAgB,4BAA4B,KAAK,KAAK,KAAK,UAAU,SAAS;AAAA,EACtF;AAAA,EAEA,eAA+B,OAAO,KAAK,KAAK,UAAU;AACxD,UAAM,cAAAA,QAAgB,4BAA4B,KAAK,KAAK,KAAK,UAAU,SAAS;AAAA,EACtF;AACF;AAGA,IAAO,qBAAQ;",
6
6
  "names": ["import_utils", "AsyncReportUtils", "ErrorHandler", "LocalsHelper", "ViewReportUtils"]
7
7
  }
@@ -19,7 +19,6 @@ class ViewAyncReportController {
19
19
  const { type } = req.params
20
20
  try {
21
21
  const params = { req, res, services: this.services, next }
22
-
23
22
  const renderData = await AsyncReportUtils.renderReport(params)
24
23
 
25
24
  res.render(`dpr/routes/journeys/view-report/report`, {