@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.28.8 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dpr/all.js +6 -8
- package/dpr/all.js.map +3 -3
- package/dpr/all.scss +296 -414
- package/dpr/all.ts +6 -11
- package/dpr/components/_catalogue/catalogue-list/utils.test.ts +1 -1
- package/dpr/components/_charts/chart/clientClass.js +1 -0
- package/dpr/components/_charts/chart/clientClass.js.map +2 -2
- package/dpr/components/_charts/chart/clientClass.ts +1 -0
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js.map +1 -1
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.js +1 -1
- package/dpr/components/_reports/report-heading/report-actions/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.ts +1 -1
- package/dpr/components/_reports/report-heading/report-actions/types.d.js.map +7 -0
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.ts +1 -1
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js.map +1 -1
- package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.test.ts +2 -2
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.js +1 -3
- package/dpr/components/_reports/report-heading/report-columns/report-columns-form/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.ts +1 -3
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js.map +1 -1
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.js +1 -1
- package/dpr/components/_reports/report-heading/report-columns/report-columns-form/utils.js.map +7 -0
- package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.ts +2 -2
- package/dpr/components/_reports/{report-columns → report-heading/report-columns}/view.njk +1 -1
- package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.js +1 -1
- package/dpr/components/_reports/report-heading/report-download-message/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.ts +1 -1
- package/dpr/components/_reports/{report-filters → report-heading/report-filters}/view.njk +1 -1
- package/dpr/components/_reports/report-heading/view.njk +4 -4
- package/dpr/components/_reports/report-page/report-print-message/view.njk +10 -0
- package/dpr/components/_reports/report-page/report-template/report-no-data-message/styles.scss +8 -0
- package/dpr/components/_reports/report-page/report-template/report-no-data-message/view.njk +11 -0
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.js +1 -1
- package/dpr/components/_reports/report-page/report-template/report-pagination/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.ts +1 -1
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.js.map +1 -1
- package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js.map +1 -1
- package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/styles.scss +88 -0
- package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/view.njk +29 -0
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.js +17 -10
- package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/clientClass.js.map +7 -0
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.ts +20 -10
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/style.scss +35 -185
- package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/types.d.js.map +7 -0
- package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/types.d.ts +2 -2
- package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/view.njk +27 -0
- package/dpr/components/_reports/report-page/report-template/report-section/styles.scss +33 -0
- package/dpr/components/_reports/report-page/report-template/report-section/view.njk +58 -0
- package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/styles.scss +21 -4
- package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js.map +1 -1
- package/dpr/components/_reports/report-page/report-template/styles.scss +5 -0
- package/dpr/components/_reports/report-page/report-template/template-config.js +66 -0
- package/dpr/components/_reports/report-page/report-template/template-config.js.map +7 -0
- package/dpr/components/_reports/report-page/report-template/template-config.ts +45 -0
- package/dpr/components/_reports/report-page/report-template/utils.js +82 -0
- package/dpr/components/_reports/report-page/report-template/utils.js.map +7 -0
- package/dpr/components/_reports/report-page/report-template/utils.ts +100 -0
- package/dpr/components/_reports/report-page/report-template/view.njk +61 -0
- package/dpr/components/_reports/{report-wrapper → report-page}/styles.scss +7 -5
- package/dpr/components/_reports/report-page/view.njk +26 -0
- package/dpr/components/card-group/view.njk +0 -4
- package/dpr/components/report-list/utils.js +11 -3
- package/dpr/components/report-list/utils.js.map +2 -2
- package/dpr/components/report-list/utils.ts +11 -1
- package/dpr/components/report-list/view.njk +2 -2
- package/dpr/components/show-more/style.scss +3 -4
- package/dpr/data/reportingClient.js.map +2 -2
- package/dpr/data/reportingClient.ts +4 -4
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +1 -1
- package/dpr/routes/journeys/view-report/async/report/controller.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/report/controller.ts +0 -1
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js +207 -56
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.ts +333 -64
- package/dpr/routes/journeys/view-report/async/report/utils.js +9 -17
- package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/report/utils.ts +12 -22
- package/dpr/routes/journeys/view-report/report.njk +2 -2
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.ts +1 -1
- package/dpr/routes/journeys/view-report/sync/report/utils.js +38 -11
- package/dpr/routes/journeys/view-report/sync/report/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/sync/report/utils.ts +39 -14
- package/dpr/routes/journeys/view-report/utils.js +1 -1
- package/dpr/routes/journeys/view-report/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/utils.ts +1 -1
- package/dpr/services/reportingService.js.map +2 -2
- package/dpr/services/reportingService.ts +2 -2
- package/dpr/types/ReportQuery.js +1 -1
- package/dpr/types/ReportQuery.js.map +1 -1
- package/dpr/types/ReportQuery.ts +1 -1
- package/dpr/types/UserReports.js.map +1 -1
- package/dpr/types/UserReports.ts +3 -3
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js +193 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.ts +203 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.ts +36 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js +114 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.ts +117 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.js.map +7 -0
- package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.ts +6 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js +202 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js.map +7 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.ts +246 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js +17 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js.map +7 -0
- package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.ts +41 -0
- package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.js → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js} +6 -8
- package/dpr/utils/TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js.map +7 -0
- package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.test.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.test.ts} +4 -4
- package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.ts} +6 -9
- package/dpr/utils/TemplateBuilder/TemplateBuilder.js +74 -0
- package/dpr/utils/TemplateBuilder/TemplateBuilder.js.map +7 -0
- package/dpr/utils/TemplateBuilder/TemplateBuilder.ts +68 -0
- package/dpr/utils/definitionUtils.js +22 -2
- package/dpr/utils/definitionUtils.js.map +2 -2
- package/dpr/utils/definitionUtils.ts +26 -1
- package/package.json +1 -1
- package/dpr/DprLoadingHelper.js +0 -51
- package/dpr/DprLoadingHelper.js.map +0 -7
- package/dpr/DprLoadingHelper.ts +0 -27
- package/dpr/components/_reports/report/view.njk +0 -40
- package/dpr/components/_reports/report-actions/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-actions/types.d.js.map +0 -7
- package/dpr/components/_reports/report-columns-form/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-columns-form/utils.js.map +0 -7
- package/dpr/components/_reports/report-data-table/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-data-table/types.d.js.map +0 -7
- package/dpr/components/_reports/report-data-table/utils.js +0 -123
- package/dpr/components/_reports/report-data-table/utils.js.map +0 -7
- package/dpr/components/_reports/report-data-table/utils.test.ts +0 -604
- package/dpr/components/_reports/report-data-table/utils.ts +0 -150
- package/dpr/components/_reports/report-data-table/view.njk +0 -24
- package/dpr/components/_reports/report-data-table-wrapper/view.njk +0 -27
- package/dpr/components/_reports/report-download-message/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-no-data-message/styles.scss +0 -4
- package/dpr/components/_reports/report-no-data-message/view.njk +0 -13
- package/dpr/components/_reports/report-pagination/clientClass.js.map +0 -7
- package/dpr/components/_reports/report-print-message/view.njk +0 -8
- package/dpr/components/_reports/report-template/view.njk +0 -44
- package/dpr/components/_reports/report-wrapper/view.njk +0 -19
- package/dpr/components/loading-anim/styles.scss +0 -117
- package/dpr/components/loading-anim/view.njk +0 -18
- package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +0 -7
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js +0 -202
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +0 -7
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.test.ts +0 -503
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.ts +0 -224
- package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +0 -7
- package/dpr/utils/ParentChildDataTableBuilder/types.d.ts +0 -11
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js +0 -311
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +0 -7
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.test.ts +0 -492
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.ts +0 -342
- package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +0 -7
- package/dpr/utils/SectionedDataTableBuilder/types.d.ts +0 -5
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js +0 -146
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +0 -7
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.test.ts +0 -140
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.ts +0 -150
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.ts +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/style.scss +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.ts +0 -0
- /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/view.njk +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/style.scss +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.ts +0 -0
- /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/view.njk +0 -0
- /package/dpr/components/_reports/{report-columns → report-heading/report-columns}/styles.scss +0 -0
- /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/style.scss +0 -0
- /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/view.njk +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/style.scss +0 -0
- /package/dpr/components/_reports/{report-data-table → report-page/report-template/report-pagination}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.ts +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.test.ts +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.ts +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/view.njk +0 -0
- /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-section/report-data-table}/types.d.js +0 -0
- /package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/view.njk +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/style.scss +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.ts +0 -0
- /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/view.njk +0 -0
- /package/dpr/utils/{ParentChildDataTableBuilder → TemplateBuilder/ParentChildDataBuilder}/types.d.js +0 -0
- /package/dpr/utils/{SectionedDataTableBuilder → TemplateBuilder/ReportBuilder}/types.d.js +0 -0
|
@@ -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<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAA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A,OACA,KACe;AACf,SAAK,QAAQ,2BAA2B,EAAE,UAAU,WAAW,QAAQ,CAAC;AAExE,WAAO,KAAK,WAAW;AAAA,MACrB;AAAA,QACE,MAAM,YAAY,QAAQ,IAAI,SAAS,WAAW,OAAO;AAAA,QACzD;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,eACE,OACA,UACA,WACA,SACA,
|
|
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,EAAE,KAAK,CAAC,aAAa,SAAS,IAAI;AAAA,EACpG;AAAA,EAEA,oBAAoB,cAAsB,OAAe,aAAqD;AAC5G,kBAAAA,QAAO,KAAK,+CAA+C,YAAY,IAAI;AAE3E,WAAO,KAAK,WACT,eAAoC;AAAA,MACnC,MAAM,IAAI,YAAY;AAAA,MACtB,OAAO,YAAY,yBAAyB,IAAI;AAAA,MAChD;AAAA,IACF,CAAC,EACA,KAAK,CAAC,cAAsD;AAAA,MAC3D,MAAM,SAAS;AAAA,MACf,UAAU;AAAA,QACR,iBAAiB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,WAAW,SAAS,YAAY,CAAC;AAExE,WAAO,KAAK,WACT,IAAI;AAAA,MACH,MAAM,YAAY,QAAQ,IAAI,SAAS,eAAe,WAAW;AAAA,MACjE;AAAA,MACA,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC,EACA,KAAK,CAAC,aAAgE,QAAQ;AAAA,EACnF;AAAA,EAEA,cAAc,OAAe,SAAiB,4BAAsD;AAClG,SAAK,QAAQ,aAAa,EAAE,QAAQ,CAAC;AAErC,WAAO,KAAK,WACT,IAAI;AAAA,MACH,MAAM,kBAAkB,OAAO;AAAA,MAC/B;AAAA,MACA,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;",
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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;AAAA,UACP,KAAK;AAAA,UACL;AAAA,QACF;AAAA,MACF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oB;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
|
|
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;
|
|
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`, {
|
|
@@ -7,70 +7,221 @@ context("Viewing a report", () => {
|
|
|
7
7
|
(0, import_cypressUtils.stubBaseTasks)();
|
|
8
8
|
(0, import_cypressUtils.executeReportStubs)();
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
describe("list-section", () => {
|
|
11
|
+
const listSectionReport = {
|
|
12
|
+
name: "List-section",
|
|
13
|
+
description: "list-section template"
|
|
14
|
+
};
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
cy.task("stubListSectionDefinitionRequest");
|
|
17
|
+
cy.task("stubResultSuccessResult");
|
|
18
|
+
});
|
|
19
|
+
it("should display a list-section variant", () => {
|
|
20
|
+
cy.visit(path);
|
|
21
|
+
(0, import_cypressUtils.requestReportByNameAndDescription)(listSectionReport);
|
|
22
|
+
cy.findByRole("heading", { level: 1, name: /List-section/ });
|
|
23
|
+
cy.findAllByRole("heading", { name: /First.*Second/ }).should("have.length", 4);
|
|
24
|
+
cy.findByRole("heading", { name: /First: One, Second: A 4 results/ }).should("be.visible").scrollIntoView();
|
|
25
|
+
cy.findByRole("heading", { name: /First: One, Second: B 6 results/ }).should("be.visible").scrollIntoView();
|
|
26
|
+
cy.findByRole("heading", { name: /First: Two, Second: A 3 results/ }).should("be.visible").scrollIntoView();
|
|
27
|
+
cy.findByRole("heading", { name: /First: Two, Second: B 7 results/ }).should("be.visible").scrollIntoView();
|
|
28
|
+
cy.findAllByLabelText(/First: One, Second: A 4 results/).eq(1).within(() => {
|
|
29
|
+
cy.findAllByRole("table").should("have.length", 1);
|
|
30
|
+
});
|
|
31
|
+
cy.findAllByLabelText(/First: One, Second: B 6 results/).eq(1).within(() => {
|
|
32
|
+
cy.findAllByRole("table").should("have.length", 1);
|
|
33
|
+
});
|
|
34
|
+
cy.findAllByLabelText(/First: Two, Second: A 3 results/).eq(1).within(() => {
|
|
35
|
+
cy.findAllByRole("table").should("have.length", 1);
|
|
36
|
+
});
|
|
37
|
+
cy.findAllByLabelText(/First: Two, Second: B 7 results/).eq(1).within(() => {
|
|
38
|
+
cy.findAllByRole("table").should("have.length", 1);
|
|
32
39
|
});
|
|
33
40
|
});
|
|
34
|
-
|
|
35
|
-
cy.
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
it("should sort the sections correctly", () => {
|
|
42
|
+
cy.visit(path);
|
|
43
|
+
(0, import_cypressUtils.startReportRequest)(listSectionReport);
|
|
44
|
+
cy.findByRole("group", { name: /Column/ }).findByRole("radio", { name: "Second" }).check();
|
|
45
|
+
cy.findByRole("button", { name: /Request/ }).click();
|
|
46
|
+
cy.findByRole("heading", { level: 1, name: /List-section/ });
|
|
47
|
+
cy.findAllByRole("heading", { name: /First.*Second/ }).should("have.length", 4).each((heading, index) => {
|
|
48
|
+
switch (index) {
|
|
49
|
+
case 0:
|
|
50
|
+
cy.wrap(heading).contains("First: One, Second: A 4 results");
|
|
51
|
+
break;
|
|
52
|
+
case 1:
|
|
53
|
+
cy.wrap(heading).contains("First: Two, Second: A 3 results");
|
|
54
|
+
break;
|
|
55
|
+
case 2:
|
|
56
|
+
cy.wrap(heading).contains("First: One, Second: B 6 results");
|
|
57
|
+
break;
|
|
58
|
+
case 3:
|
|
59
|
+
cy.wrap(heading).contains("First: Two, Second: B 7 results");
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe("summary-section", () => {
|
|
68
|
+
it("should display a summary section variant", () => {
|
|
69
|
+
cy.task("stubSummarySectionDefinitionRequest");
|
|
70
|
+
cy.task("stubAsyncSummaryReport");
|
|
71
|
+
cy.task("stubResultSuccessResultDifferentValues");
|
|
72
|
+
cy.visit(path);
|
|
73
|
+
(0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Summary-section", description: "Summary-section template" });
|
|
74
|
+
cy.findByRole("heading", { level: 1, name: /Summary-section/ }).should("be.visible");
|
|
75
|
+
cy.findAllByLabelText(/First: One, Second: A/).eq(0).within(() => {
|
|
76
|
+
cy.findAllByRole("table").should("have.length", 2).each((table) => {
|
|
77
|
+
cy.wrap(table).within(() => {
|
|
78
|
+
cy.findAllByRole("row").should("have.length", 5);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
cy.findAllByLabelText(/First: One, Second: B/).eq(0).within(() => {
|
|
83
|
+
cy.findAllByRole("table").should("have.length", 2).each((table) => {
|
|
84
|
+
cy.wrap(table).within(() => {
|
|
85
|
+
cy.findAllByRole("row").should("have.length", 7);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
cy.findAllByLabelText(/First: Two, Second: A/).eq(0).within(() => {
|
|
90
|
+
cy.findAllByRole("table").should("have.length", 2).each((table) => {
|
|
91
|
+
cy.wrap(table).within(() => {
|
|
92
|
+
cy.findAllByRole("row").should("have.length", 4);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
cy.findAllByLabelText(/First: Two, Second: B/).eq(0).within(() => {
|
|
97
|
+
cy.findAllByRole("table").should("have.length", 2).each((table) => {
|
|
98
|
+
cy.wrap(table).within(() => {
|
|
99
|
+
cy.findAllByRole("row").should("have.length", 8);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
38
102
|
});
|
|
39
|
-
cy.findByRole("row", { name: /val330/ }).should("be.visible");
|
|
40
|
-
cy.findByRole("row", { name: /val331/ }).should("be.visible");
|
|
41
|
-
cy.findByRole("row", { name: /val332/ }).should("be.visible");
|
|
42
103
|
});
|
|
43
104
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
105
|
+
describe("parent-child-section", () => {
|
|
106
|
+
const ParentChildSectionReport = {
|
|
107
|
+
name: "Parent-child-section",
|
|
108
|
+
description: "Parent-child-section template"
|
|
109
|
+
};
|
|
110
|
+
beforeEach(() => {
|
|
111
|
+
cy.task("stubParentChildSectionDefinitionRequest");
|
|
112
|
+
cy.task("stubResultSuccessResultDifferentValues");
|
|
113
|
+
});
|
|
114
|
+
it("should display a parent child section variant", () => {
|
|
115
|
+
cy.visit(path);
|
|
116
|
+
(0, import_cypressUtils.requestReportByNameAndDescription)(ParentChildSectionReport);
|
|
117
|
+
cy.findByRole("heading", { level: 1, name: /Parent-child-section/ }).should("be.visible");
|
|
118
|
+
cy.findByRole("heading", { name: /Section 1: One, Section 2: A 5 results/ }).scrollIntoView().should("be.visible");
|
|
119
|
+
cy.findByRole("heading", { name: /Section 1: One, Section 2: B 2 results/ }).scrollIntoView().should("be.visible");
|
|
120
|
+
cy.findByRole("heading", { name: /Section 1: Two, Section 2: A 8 results/ }).scrollIntoView().should("be.visible");
|
|
121
|
+
cy.findByRole("heading", { name: /Section 1: Two, Section 2: B 5 results/ }).scrollIntoView().should("be.visible");
|
|
122
|
+
cy.findAllByLabelText("Section 1: One, Section 2: A 5 results").eq(1).within(() => {
|
|
123
|
+
cy.findAllByRole("table").should("have.length", 10);
|
|
124
|
+
cy.findAllByLabelText("Parent 1").eq(0).within(() => {
|
|
125
|
+
cy.findAllByRole("table").should("have.length", 2);
|
|
126
|
+
cy.findAllByLabelText("Parent 1").eq(0).within(() => {
|
|
127
|
+
cy.findByRole("table").within(() => {
|
|
128
|
+
cy.findAllByRole("row").should("have.length", 4);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
cy.findAllByLabelText("Child Report").eq(0).within(() => {
|
|
132
|
+
cy.findByRole("table").within(() => {
|
|
133
|
+
cy.findAllByRole("row").should("have.length", 23);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
cy.findAllByLabelText("Section 1: Two, Section 2: A 8 results").eq(1).within(() => {
|
|
139
|
+
cy.findAllByRole("table").should("have.length", 16);
|
|
140
|
+
cy.findAllByLabelText("Parent 1").eq(0).within(() => {
|
|
141
|
+
cy.findAllByRole("table").should("have.length", 2);
|
|
142
|
+
cy.findAllByLabelText("Parent 1").eq(0).within(() => {
|
|
143
|
+
cy.findByRole("table").within(() => {
|
|
144
|
+
cy.findAllByRole("row").should("have.length", 4);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
cy.findAllByLabelText("Child Report").eq(0).within(() => {
|
|
148
|
+
cy.findByRole("table").within(() => {
|
|
149
|
+
cy.findAllByRole("row").should("have.length", 23);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
it("should sort the sections correctly", () => {
|
|
156
|
+
cy.visit(path);
|
|
157
|
+
(0, import_cypressUtils.startReportRequest)(ParentChildSectionReport);
|
|
158
|
+
cy.findByRole("group", { name: /Column/ }).findByRole("radio", { name: "Section 2" }).check();
|
|
159
|
+
cy.findByRole("button", { name: /Request/ }).click();
|
|
160
|
+
cy.findByRole("heading", { level: 1, name: /Parent-child-section/ }).should("be.visible");
|
|
161
|
+
cy.findAllByRole("heading", { name: /Section 1.*Section 2/ }).should("have.length", 4).each((heading, index) => {
|
|
162
|
+
switch (index) {
|
|
163
|
+
case 0:
|
|
164
|
+
cy.wrap(heading).contains("Section 1: One, Section 2: A 5 results");
|
|
165
|
+
break;
|
|
166
|
+
case 1:
|
|
167
|
+
cy.wrap(heading).contains("Section 1: Two, Section 2: A 8 results");
|
|
168
|
+
break;
|
|
169
|
+
case 2:
|
|
170
|
+
cy.wrap(heading).contains("Section 1: One, Section 2: B 2 results");
|
|
171
|
+
break;
|
|
172
|
+
case 3:
|
|
173
|
+
cy.wrap(heading).contains("Section 1: Two, Section 2: B 5 results");
|
|
174
|
+
break;
|
|
175
|
+
default:
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
54
179
|
});
|
|
55
180
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
cy.
|
|
181
|
+
describe("parent-child", () => {
|
|
182
|
+
it("should display a parent-child variant", () => {
|
|
183
|
+
cy.task("stubParentChildDefinitionRequest");
|
|
184
|
+
cy.task("stubResultSuccessResultDifferentValues");
|
|
185
|
+
cy.visit(path);
|
|
186
|
+
(0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Parent-child", description: "Parent-child template" });
|
|
187
|
+
cy.findByRole("heading", { level: 1, name: /Parent-child/ }).should("be.visible");
|
|
188
|
+
cy.findAllByLabelText("Parent 1").eq(0).within(() => {
|
|
189
|
+
cy.findAllByRole("table").should("have.length", 3);
|
|
190
|
+
cy.findAllByLabelText("Parent 1").eq(0).within(() => {
|
|
191
|
+
cy.findByRole("table").within(() => {
|
|
192
|
+
cy.findAllByRole("row").should("have.length", 4);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
cy.findAllByLabelText("Child Report").eq(0).within(() => {
|
|
196
|
+
cy.findByRole("table").within(() => {
|
|
197
|
+
cy.findAllByRole("row").should("have.length", 10);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
cy.findAllByLabelText("Child Report 2").eq(0).within(() => {
|
|
201
|
+
cy.findByRole("table").within(() => {
|
|
202
|
+
cy.findAllByRole("row").should("have.length", 10);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
cy.findAllByLabelText("Parent 8").eq(0).within(() => {
|
|
207
|
+
cy.findAllByRole("table").should("have.length", 3);
|
|
208
|
+
cy.findAllByLabelText("Parent 8").eq(0).within(() => {
|
|
209
|
+
cy.findByRole("table").within(() => {
|
|
210
|
+
cy.findAllByRole("row").should("have.length", 4);
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
cy.findAllByLabelText("Child Report").eq(0).within(() => {
|
|
214
|
+
cy.findByRole("table").within(() => {
|
|
215
|
+
cy.findAllByRole("row").should("have.length", 16);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
cy.findAllByLabelText("Child Report 2").eq(0).within(() => {
|
|
219
|
+
cy.findByRole("table").within(() => {
|
|
220
|
+
cy.findAllByRole("row").should("have.length", 16);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
});
|
|
64
224
|
});
|
|
65
|
-
cy.findByRole("heading", { name: /Section 1: One, Section 2: A 5 results/ }).should("be.visible");
|
|
66
|
-
cy.findByRole("heading", { name: /Section 1: One, Section 2: B 2 results/ }).should("be.visible");
|
|
67
|
-
cy.findByRole("heading", { name: /Section 1: Two, Section 2: A 8 results/ }).should("be.visible");
|
|
68
|
-
cy.findByRole("heading", { name: /Section 1: Two, Section 2: B 5 results/ }).should("be.visible");
|
|
69
|
-
cy.findAllByRole("row", {
|
|
70
|
-
name: (textContent) => {
|
|
71
|
-
return textContent.includes("val");
|
|
72
|
-
}
|
|
73
|
-
}).filter((_idx, el) => [...el.querySelectorAll("td")].length === 2).should("have.length", 100);
|
|
74
225
|
});
|
|
75
226
|
});
|
|
76
227
|
});
|