@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.28.0 → 4.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dpr/DprClientClass.js +43 -0
- package/dpr/DprClientClass.js.map +7 -0
- package/dpr/{DprClientClass.mjs → DprClientClass.ts} +1 -0
- package/dpr/DprFormValidationClass.js +157 -0
- package/dpr/DprFormValidationClass.js.map +7 -0
- package/dpr/{DprFormValidationClass.mjs → DprFormValidationClass.ts} +2 -1
- package/dpr/DprGenericFormClass.js +66 -0
- package/dpr/DprGenericFormClass.js.map +7 -0
- package/dpr/{DprGenericFormClass.mjs → DprGenericFormClass.ts} +2 -1
- package/dpr/DprLoadingHelper.js +51 -0
- package/dpr/DprLoadingHelper.js.map +7 -0
- package/dpr/{DprLoadingHelper.mjs → DprLoadingHelper.ts} +1 -0
- package/dpr/DprPollingStatusClass.js +79 -0
- package/dpr/DprPollingStatusClass.js.map +7 -0
- package/dpr/{DprPollingStatusClass.mjs → DprPollingStatusClass.ts} +2 -1
- package/dpr/DprQueryParamClass.js +231 -0
- package/dpr/DprQueryParamClass.js.map +7 -0
- package/dpr/{DprQueryParamClass.mjs → DprQueryParamClass.ts} +2 -1
- package/dpr/DprSyncLoading.js +44 -0
- package/dpr/DprSyncLoading.js.map +7 -0
- package/dpr/{DprSyncLoading.mjs → DprSyncLoading.ts} +2 -1
- package/dpr/all.js +111 -0
- package/dpr/all.js.map +7 -0
- package/dpr/{all.mjs → all.ts} +29 -28
- package/dpr/assets/app.js +1 -1
- package/dpr/assets/app.js.map +2 -2
- package/dpr/components/_async/async-filters-form/clientClass.js +76 -0
- package/dpr/components/_async/async-filters-form/clientClass.js.map +7 -0
- package/dpr/components/_async/async-filters-form/{clientClass.mjs → clientClass.ts} +3 -2
- package/dpr/components/_async/async-filters-form/sortByTemplate.js.map +1 -1
- package/dpr/components/_async/async-filters-form/types.d.js.map +1 -1
- package/dpr/components/_async/async-filters-form/utils.js.map +1 -1
- package/dpr/components/_async/async-polling/clientClass.js +78 -0
- package/dpr/components/_async/async-polling/clientClass.js.map +7 -0
- package/dpr/components/_async/async-polling/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_catalogue/catalogue/types.js.map +1 -1
- package/dpr/components/_catalogue/catalogue/utils.js.map +1 -1
- package/dpr/components/_catalogue/catalogue-filter-by-type/clientClass.js +94 -0
- package/dpr/components/_catalogue/catalogue-filter-by-type/clientClass.js.map +7 -0
- package/dpr/components/_catalogue/catalogue-filter-by-type/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_catalogue/catalogue-filters/clientClass.js +70 -0
- package/dpr/components/_catalogue/catalogue-filters/clientClass.js.map +7 -0
- package/dpr/components/_catalogue/catalogue-filters/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_catalogue/catalogue-list/utils.js.map +1 -1
- package/dpr/components/_catalogue/catalogue-search/clientClass.js +106 -0
- package/dpr/components/_catalogue/catalogue-search/clientClass.js.map +7 -0
- package/dpr/components/_catalogue/catalogue-search/{clientClass.mjs → clientClass.ts} +3 -2
- package/dpr/components/_catalogue/catalogue-unauthorised-toggle/clientClass.js +135 -0
- package/dpr/components/_catalogue/catalogue-unauthorised-toggle/clientClass.js.map +7 -0
- package/dpr/components/_catalogue/catalogue-unauthorised-toggle/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_charts/chart/Chart.js.map +1 -1
- package/dpr/components/_charts/chart/ChartColours.js.map +1 -1
- package/dpr/components/_charts/chart/ChartTimeseries.js.map +1 -1
- package/dpr/components/_charts/chart/bar/BarChart.js.map +1 -1
- package/dpr/components/_charts/chart/bar/clientClass.js +98 -0
- package/dpr/components/_charts/chart/bar/clientClass.js.map +7 -0
- package/dpr/components/_charts/chart/bar/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_charts/chart/bar/types.js.map +1 -1
- package/dpr/components/_charts/chart/bar/validate.js.map +1 -1
- package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js.map +1 -1
- package/dpr/components/_charts/chart/bar-timeseries/types.js.map +1 -1
- package/dpr/components/_charts/chart/bar-timeseries/validate.js.map +1 -1
- package/dpr/components/_charts/chart/buckets/Buckets.js.map +1 -1
- package/dpr/components/_charts/chart/buckets/types.js.map +1 -1
- package/dpr/components/_charts/chart/buckets/validate.js.map +1 -1
- package/dpr/components/_charts/chart/chart-config.js.map +1 -1
- package/dpr/components/_charts/chart/clientClass.js +136 -0
- package/dpr/components/_charts/chart/clientClass.js.map +7 -0
- package/dpr/components/_charts/chart/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_charts/chart/doughnut/DoughnutChart.js.map +1 -1
- package/dpr/components/_charts/chart/doughnut/clientClass.js +170 -0
- package/dpr/components/_charts/chart/doughnut/clientClass.js.map +7 -0
- package/dpr/components/_charts/chart/doughnut/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_charts/chart/doughnut/types.js.map +1 -1
- package/dpr/components/_charts/chart/doughnut/validate.js.map +1 -1
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.js.map +1 -1
- package/dpr/components/_charts/chart/heatmap/clientClass.js +118 -0
- package/dpr/components/_charts/chart/heatmap/clientClass.js.map +7 -0
- package/dpr/components/_charts/chart/heatmap/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_charts/chart/heatmap/types.js.map +1 -1
- package/dpr/components/_charts/chart/heatmap/validate.js.map +1 -1
- package/dpr/components/_charts/chart/line/LineChart.js.map +1 -1
- package/dpr/components/_charts/chart/line/clientClass.js +93 -0
- package/dpr/components/_charts/chart/line/clientClass.js.map +7 -0
- package/dpr/components/_charts/chart/line/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_charts/chart/line/types.js.map +1 -1
- package/dpr/components/_charts/chart/line/validate.js.map +1 -1
- package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js.map +1 -1
- package/dpr/components/_charts/chart/line-timeseries/types.js.map +1 -1
- package/dpr/components/_charts/chart/line-timeseries/validate.js.map +1 -1
- package/dpr/components/_charts/utils.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-list/types.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-list/utils.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-list/validate.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-visualisation/Validate.js.map +1 -1
- package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +1 -1
- package/dpr/components/_dashboards/scorecard/Scorecard.js.map +1 -1
- package/dpr/components/_dashboards/scorecard/clientClass.js +50 -0
- package/dpr/components/_dashboards/scorecard/clientClass.js.map +7 -0
- package/dpr/components/_dashboards/scorecard/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_dashboards/scorecard/types.js.map +1 -1
- package/dpr/components/_dashboards/scorecard/utils.js.map +1 -1
- package/dpr/components/_dashboards/scorecard/validate.js.map +1 -1
- package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js.map +1 -1
- package/dpr/components/_dashboards/scorecard-group/types.js.map +1 -1
- package/dpr/components/_dashboards/scorecard-group/validate.js.map +1 -1
- package/dpr/components/_filters/filter-input/enum.js.map +1 -1
- package/dpr/components/_filters/filter-input/filters.js.map +1 -1
- package/dpr/components/_filters/filter-input/types.d.js.map +1 -1
- package/dpr/components/_filters/filters-form/clientClass.js +104 -0
- package/dpr/components/_filters/filters-form/clientClass.js.map +7 -0
- package/dpr/components/_filters/filters-form/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_filters/filters-interactive/clientClass.js +55 -0
- package/dpr/components/_filters/filters-interactive/clientClass.js.map +7 -0
- package/dpr/components/_filters/filters-interactive/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_filters/filters-selected/clientClass.js +396 -0
- package/dpr/components/_filters/filters-selected/clientClass.js.map +7 -0
- package/dpr/components/_filters/filters-selected/{clientClass.mjs → clientClass.ts} +7 -7
- package/dpr/components/_filters/filters-selected/utils.js.map +1 -1
- package/dpr/components/_filters/filtersTypeEnum.js.map +1 -1
- package/dpr/components/_filters/types.d.js.map +1 -1
- package/dpr/components/_filters/utils.js.map +1 -1
- package/dpr/components/_inputs/autocomplete-text-input/clientClass.js +153 -0
- package/dpr/components/_inputs/autocomplete-text-input/clientClass.js.map +7 -0
- package/dpr/components/_inputs/autocomplete-text-input/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_inputs/autocomplete-text-input/utils.js.map +1 -1
- package/dpr/components/_inputs/date-input/clientClass.js +109 -0
- package/dpr/components/_inputs/date-input/clientClass.js.map +7 -0
- package/dpr/components/_inputs/date-input/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_inputs/date-input/utils.js.map +1 -1
- package/dpr/components/_inputs/date-range/clientClass.js +206 -0
- package/dpr/components/_inputs/date-range/clientClass.js.map +7 -0
- package/dpr/components/_inputs/date-range/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_inputs/date-range/types.js.map +1 -1
- package/dpr/components/_inputs/date-range/utils.js.map +1 -1
- package/dpr/components/_inputs/granular-date-range/clientClass.js +245 -0
- package/dpr/components/_inputs/granular-date-range/clientClass.js.map +7 -0
- package/dpr/components/_inputs/granular-date-range/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_inputs/granular-date-range/types.js.map +1 -1
- package/dpr/components/_inputs/granular-date-range/utils.js.map +1 -1
- package/dpr/components/_inputs/multi-select/utils.js.map +1 -1
- package/dpr/components/_inputs/start-end-date/utils.js.map +1 -1
- package/dpr/components/_reports/report-actions/actionsTemplate.js.map +1 -1
- package/dpr/components/_reports/report-actions/clientClass.js +103 -0
- package/dpr/components/_reports/report-actions/clientClass.js.map +7 -0
- package/dpr/components/_reports/report-actions/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_reports/report-actions/types.d.js.map +1 -1
- package/dpr/components/_reports/report-actions/utils.js.map +1 -1
- package/dpr/components/_reports/report-columns-form/clientClass.js +76 -0
- package/dpr/components/_reports/report-columns-form/clientClass.js.map +7 -0
- package/dpr/components/_reports/report-columns-form/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_reports/report-columns-form/types.d.js.map +1 -1
- package/dpr/components/_reports/report-columns-form/utils.js.map +1 -1
- package/dpr/components/_reports/report-data-table/clientClass.js +80 -0
- package/dpr/components/_reports/report-data-table/clientClass.js.map +7 -0
- package/dpr/components/_reports/report-data-table/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_reports/report-data-table/types.d.js.map +1 -1
- package/dpr/components/_reports/report-data-table/utils.js.map +1 -1
- package/dpr/components/_reports/report-download-message/clientClass.js +42 -0
- package/dpr/components/_reports/report-download-message/clientClass.js.map +7 -0
- package/dpr/components/_reports/report-download-message/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_reports/report-pagination/clientClass.js +61 -0
- package/dpr/components/_reports/report-pagination/clientClass.js.map +7 -0
- package/dpr/components/_reports/report-pagination/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/_reports/report-pagination/types.d.js.map +1 -1
- package/dpr/components/_reports/report-pagination/utils.js.map +1 -1
- package/dpr/components/_reports/report-totals/utils.js.map +1 -1
- package/dpr/components/_sync/sync-load/view.njk +1 -1
- package/dpr/components/bookmark-toggle/clientClass.js +111 -0
- package/dpr/components/bookmark-toggle/clientClass.js.map +7 -0
- package/dpr/components/bookmark-toggle/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/card-group/clientClass.js +53 -0
- package/dpr/components/card-group/clientClass.js.map +7 -0
- package/dpr/components/card-group/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/card-group/utils.js.map +1 -1
- package/dpr/components/report-list/defaultTokenProvider.js.map +1 -1
- package/dpr/components/report-list/types.d.js.map +1 -1
- package/dpr/components/report-list/utils.js.map +1 -1
- package/dpr/components/show-more/clientClass.js +63 -0
- package/dpr/components/show-more/clientClass.js.map +7 -0
- package/dpr/components/show-more/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/show-more/utils.js.map +1 -1
- package/dpr/components/user-reports/bookmarks/utils.js.map +1 -1
- package/dpr/components/user-reports/requested/clientClass.js +132 -0
- package/dpr/components/user-reports/requested/clientClass.js.map +7 -0
- package/dpr/components/user-reports/requested/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/user-reports/requested/utils.js.map +1 -1
- package/dpr/components/user-reports/types.d.js.map +1 -1
- package/dpr/components/user-reports/utils.js.map +1 -1
- package/dpr/components/user-reports/viewed/clientClass.js +102 -0
- package/dpr/components/user-reports/viewed/clientClass.js.map +7 -0
- package/dpr/components/user-reports/viewed/{clientClass.mjs → clientClass.ts} +2 -1
- package/dpr/components/user-reports/viewed/utils.js.map +1 -1
- package/dpr/data/agentConfig.js.map +1 -1
- package/dpr/data/dashboardClient.js.map +1 -1
- package/dpr/data/dprReportingClient.js.map +1 -1
- package/dpr/data/missingReportClient.js.map +1 -1
- package/dpr/data/productCollectionClient.js.map +1 -1
- package/dpr/data/reportDataStore.js.map +1 -1
- package/dpr/data/reportingClient.js.map +1 -1
- package/dpr/data/restClient.js.map +1 -1
- package/dpr/data/types.d.js.map +1 -1
- package/dpr/middleware/reportAuthoriser.js.map +1 -1
- package/dpr/middleware/setUpDprResources.js.map +1 -1
- package/dpr/middleware/setUpNestedRoute.js.map +1 -1
- package/dpr/routes/index.js.map +1 -1
- package/dpr/routes/journeys/api-failures.cy.js.map +1 -1
- package/dpr/routes/journeys/download-report/controller.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/controller.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/routes.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/submitted/controller.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/submitted/routes.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/routes.js.map +1 -1
- package/dpr/routes/journeys/download-report/request-download/service.js.map +1 -1
- package/dpr/routes/journeys/download-report/routes.js.map +1 -1
- package/dpr/routes/journeys/download-report/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/download-report/utils.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/controller.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/list/controller.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/list/routes.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/routes.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/service.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/my-reports/bookmarks/utils.js.map +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/controller.js.map +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/list/controller.js.map +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/list/routes.js.map +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/routes.js.map +1 -1
- package/dpr/routes/journeys/my-reports/recently-viewed/service.js.map +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/controller.js.map +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/list/controller.js.map +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/list/routes.js.map +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/routes.js.map +1 -1
- package/dpr/routes/journeys/my-reports/requested-reports/service.js.map +1 -1
- package/dpr/routes/journeys/my-reports/routes.js.map +1 -1
- package/dpr/routes/journeys/product-collection/routes.js.map +1 -1
- package/dpr/routes/journeys/product-collection/selected/controller.js.map +1 -1
- package/dpr/routes/journeys/product-collection/selected/routes.js.map +1 -1
- package/dpr/routes/journeys/product-collection/selected/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/product-collection/selected/validation.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/form/controller.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/form/routes.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/form/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/form/validation.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/routes.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/submitted/controller.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/submitted/routes.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/submitted/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/request-missing-report/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/request-report/controller.js.map +1 -1
- package/dpr/routes/journeys/request-report/filters/controller.js.map +1 -1
- package/dpr/routes/journeys/request-report/filters/routes.js.map +1 -1
- package/dpr/routes/journeys/request-report/filters/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/request-report/filters/utils.js.map +1 -1
- package/dpr/routes/journeys/request-report/routes.js.map +1 -1
- package/dpr/routes/journeys/request-report/status/controller.js.map +1 -1
- package/dpr/routes/journeys/request-report/status/routes.js.map +1 -1
- package/dpr/routes/journeys/request-report/status/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/request-report/status/utils.js.map +1 -1
- package/dpr/routes/journeys/request-report/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/controller.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/controller.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/report/controller.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/report/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/report/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/report/types.js.map +1 -1
- package/dpr/routes/journeys/view-report/async/report/utils.js +2 -2
- package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/report/utils.ts +2 -2
- package/dpr/routes/journeys/view-report/async/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/controller.js.map +2 -2
- package/dpr/routes/journeys/view-report/controller.ts +1 -1
- package/dpr/routes/journeys/view-report/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/controller.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/load-report/controller.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/load-report/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/report/controller.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/report/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/report/utils.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/routes.js.map +1 -1
- package/dpr/routes/journeys/view-report/sync/tests.cy.js.map +1 -1
- package/dpr/routes/journeys/view-report/utils.js.map +1 -1
- package/dpr/services/dashboardService.js.map +1 -1
- package/dpr/services/defaultFilterValuesService.js.map +1 -1
- package/dpr/services/featureFlagService.js.map +1 -1
- package/dpr/services/featureFlags.cy.js.map +1 -1
- package/dpr/services/index.js.map +1 -1
- package/dpr/services/missingReport/missingReportService.js.map +1 -1
- package/dpr/services/productCollection/productCollectionService.js.map +1 -1
- package/dpr/services/productCollection/productCollectionStoreService.js.map +1 -1
- package/dpr/services/reportStoreService.js.map +1 -1
- package/dpr/services/reportingService.js.map +1 -1
- package/dpr/setUpNunjucksFilters.js.map +1 -1
- package/dpr/types/AsyncReportUtils.js.map +1 -1
- package/dpr/types/Bookmark.js.map +1 -1
- package/dpr/types/Charts.js.map +1 -1
- package/dpr/types/Download.js.map +1 -1
- package/dpr/types/DprConfig.js.map +1 -1
- package/dpr/types/DprUser.js.map +1 -1
- package/dpr/types/EmbeddedReportUtils.js.map +1 -1
- package/dpr/types/ExecutionData.d.js.map +1 -1
- package/dpr/types/Metrics.js.map +1 -1
- package/dpr/types/ReportQuery.js.map +1 -1
- package/dpr/types/ReportStore.js.map +1 -1
- package/dpr/types/Services.d.js.map +1 -1
- package/dpr/types/Templates.d.js.map +1 -1
- package/dpr/types/UserReports.js.map +1 -1
- package/dpr/types/api.d.js.map +1 -1
- package/dpr/types/index.d.js.map +1 -1
- package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +1 -1
- package/dpr/utils/CreateDprServices.js.map +1 -1
- package/dpr/utils/DataTableBuilder/DataTableBuilder.js.map +1 -1
- package/dpr/utils/DataTableBuilder/types.d.js.map +1 -1
- package/dpr/utils/DateMapper/DateMapper.js.map +1 -1
- package/dpr/utils/DateMapper/types.d.js.map +1 -1
- package/dpr/utils/ErrorHandler.js.map +1 -1
- package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +1 -1
- package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +1 -1
- package/dpr/utils/Personalisation/personalisationUtils.js.map +1 -1
- package/dpr/utils/Personalisation/types.d.js.map +1 -1
- package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +1 -1
- package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +1 -1
- package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +1 -1
- package/dpr/utils/SummaryDataTableBuilder/SummaryDataTableBuilder.js.map +1 -1
- package/dpr/utils/UserStoreItemBuilder.js.map +1 -1
- package/dpr/utils/arrayUtils.js.map +1 -1
- package/dpr/utils/datasetHelper.js.map +1 -1
- package/dpr/utils/definitionUtils.js.map +1 -1
- package/dpr/utils/index.js.map +1 -1
- package/dpr/utils/indexedAccesHelper.js.map +1 -1
- package/dpr/utils/localsHelper.js.map +1 -1
- package/dpr/utils/logger.js.map +1 -1
- package/dpr/utils/reportListsHelper.js.map +1 -1
- package/dpr/utils/reportStoreHelper.js.map +1 -1
- package/dpr/utils/requestStatusHelper.js.map +1 -1
- package/dpr/utils/sanitisedError.js.map +1 -1
- package/dpr/utils/urlHelper.js.map +1 -1
- package/dpr/validation/validate.js.map +1 -1
- package/package.json +10 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/bookmarks/service.ts"],
|
|
4
4
|
"sourcesContent": ["import ReportStoreService from '../../../../services/reportStoreService'\nimport ReportDataStore from '../../../../data/reportDataStore'\nimport { ReportType } from '../../../../types/UserReports'\nimport { ReportStoreConfig } from '../../../../types/ReportStore'\nimport logger from '../../../../utils/logger'\nimport { BookmarkStoreData } from '../../../../types/Bookmark'\nimport { ServiceFeatureConfig } from '../../../../types/DprConfig'\n\nclass BookmarkService extends ReportStoreService {\n enabled: boolean\n\n constructor(reportDataStore: ReportDataStore, serviceFeatureConfig: ServiceFeatureConfig) {\n super(reportDataStore)\n this.enabled = Boolean(serviceFeatureConfig.bookmarking)\n if (!this.enabled) logger.info(`Bookmarking: disabled `)\n }\n\n async getAllBookmarks(userId: string): Promise<BookmarkStoreData[]> {\n if (!this.enabled) return []\n\n const userConfig = await this.getState(userId)\n return userConfig.bookmarks\n }\n\n async addBookmark(\n userId: string,\n reportId: string,\n id: string,\n type: ReportType,\n automatic?: boolean,\n ): Promise<void> {\n if (!this.enabled) return\n\n const userConfig = await this.getState(userId)\n if (!this.isBookmarkedCheck(userConfig, id, reportId)) {\n userConfig.bookmarks.unshift({ reportId, id, type, automatic })\n }\n await this.saveState(userId, userConfig)\n }\n\n async removeBookmark(userId: string, id: string, reportId: string): Promise<void> {\n if (!this.enabled) return\n\n const userConfig = await this.getState(userId)\n const index = userConfig.bookmarks.findIndex((bookmark) => {\n const bmVarId = bookmark.id\n return bmVarId === id && bookmark.reportId === reportId\n })\n if (index >= 0) {\n userConfig.bookmarks.splice(index, 1)\n }\n await this.saveState(userId, userConfig)\n }\n\n isBookmarked = async (id: string, reportId: string, userId: string): Promise<boolean | undefined> => {\n if (!this.enabled) return false\n\n const userConfig = await this.getState(userId)\n const isBookmarked = this.isBookmarkedCheck(userConfig, id, reportId)\n let bookmark\n if (isBookmarked) {\n bookmark = this.getBookmark(userConfig, id, reportId)\n }\n\n return bookmark?.automatic ? undefined : isBookmarked\n }\n\n private isBookmarkedCheck = (userConfig: ReportStoreConfig, id: string, reportId: string): boolean => {\n return userConfig.bookmarks.some((bookmark) => {\n const bmVarId = bookmark.id\n return bmVarId === id && bookmark.reportId === reportId\n })\n }\n\n private getBookmark = (userConfig: ReportStoreConfig, id: string, reportId: string) => {\n return userConfig.bookmarks.find((bookmark) => {\n const bmVarId = bookmark.id\n return bmVarId === id && bookmark.reportId === reportId\n })\n }\n\n async createBookMarkToggleHtml({\n userConfig,\n reportId,\n id,\n csrfToken,\n ctxId,\n reportType,\n isMissing,\n nestedBaseUrl,\n }: {\n userConfig: ReportStoreConfig\n reportId: string\n id: string\n csrfToken: string\n ctxId: string\n reportType: ReportType\n isMissing: boolean\n nestedBaseUrl: string | undefined\n }) {\n let tooltip = 'Add bookmark'\n let automatic = false\n let checked = null\n\n if (userConfig?.bookmarks) {\n const bookmark = this.getBookmark(userConfig, id, reportId)\n if (bookmark) {\n checked = 'checked'\n tooltip = 'Remove bookmark'\n automatic = Boolean(bookmark.automatic)\n }\n }\n\n const bookmarkButton = `<button class='dpr-bookmark dpr-bookmark-table' data-dpr-module='bookmark-toggle'>\n <input class='bookmark-input' type='checkbox' id='${reportId}-${id}-${ctxId}' data-report-id='${reportId}' data-id='${id}' data-report-type='${reportType}' data-csrf-token='${csrfToken}' data-base-url='${nestedBaseUrl}' ${checked} />\n <label tabindex='0' id='${id}-${reportId}-${ctxId}-bookmark-label' for='${reportId}-${id}-${ctxId}'><span class='dpr-bookmark-label govuk-body-s'>${tooltip}</span></label>\n</button>`\n\n return automatic || isMissing ? '' : bookmarkButton\n }\n}\n\nexport { BookmarkService }\nexport default BookmarkService\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAA+B;AAI/B,oBAAmB;AAInB,MAAM,wBAAwB,0BAAAA,QAAmB;AAAA,EAC/C;AAAA,EAEA,YAAY,iBAAkC,sBAA4C;AACxF,UAAM,eAAe;AACrB,SAAK,UAAU,QAAQ,qBAAqB,WAAW;AACvD,QAAI,CAAC,KAAK,QAAS,eAAAC,QAAO,KAAK,wBAAwB;AAAA,EACzD;AAAA,EAEA,MAAM,gBAAgB,QAA8C;AAClE,QAAI,CAAC,KAAK,QAAS,QAAO,CAAC;AAE3B,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,WAAO,WAAW;AAAA,EACpB;AAAA,EAEA,MAAM,YACJ,QACA,UACA,IACA,MACA,WACe;AACf,QAAI,CAAC,KAAK,QAAS;AAEnB,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,QAAI,CAAC,KAAK,kBAAkB,YAAY,IAAI,QAAQ,GAAG;AACrD,iBAAW,UAAU,QAAQ,EAAE,UAAU,IAAI,MAAM,UAAU,CAAC;AAAA,IAChE;AACA,UAAM,KAAK,UAAU,QAAQ,UAAU;AAAA,EACzC;AAAA,EAEA,MAAM,eAAe,QAAgB,IAAY,UAAiC;AAChF,QAAI,CAAC,KAAK,QAAS;AAEnB,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,UAAM,QAAQ,WAAW,UAAU,UAAU,CAAC,aAAa;AACzD,YAAM,UAAU,SAAS;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Q,IAAI,EAAE,IAAI,KAAK,qBAAqB,QAAQ,cAAc,EAAE,uBAAuB,UAAU,sBAAsB,SAAS,oBAAoB,aAAa,KAAK,OAAO;AAAA,4BAC7M,EAAE,IAAI,QAAQ,IAAI,KAAK,yBAAyB,QAAQ,IAAI,EAAE,IAAI,KAAK,mDAAmD,OAAO;AAAA;AAGzJ,WAAO,aAAa,YAAY,KAAK;AAAA,EACvC;AACF;AAGA,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["ReportStoreService", "logger"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/bookmarks/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["import { featureTestingUnprintable } from '@networkMocks/report/mockVariants/feature-testing/unprintable'\nimport { featureTestingEmptyQuery } from '@networkMocks/report/mockVariants/feature-testing/emptyQuery'\nimport { stubBaseTasks, stubDefinitionsTasks } from '../../../../../../cypress-tests/cypressUtils'\n\ncontext('Bookmarks list', () => {\n const path = '/embedded/platform/'\n\n describe('check the default starting state', () => {\n it('should have the default bookmarks from the caseload bookmark config', () => {\n stubBaseTasks()\n stubDefinitionsTasks()\n cy.visit(path)\n\n cy.findByRole('tab', { name: /Bookmarks/ }).click()\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n cy.findByRole('link', {\n name: (_, element) => (element as HTMLAnchorElement).href.includes(featureTestingUnprintable.id),\n })\n cy.findByRole('link', {\n name: (_, element) => (element as HTMLAnchorElement).href.includes(featureTestingEmptyQuery.id),\n })\n })\n })\n })\n })\n\n describe('check other interactions', () => {\n before(() => {\n stubBaseTasks()\n stubDefinitionsTasks()\n cy.task('stubDefinitionRequestExamplesSuccess')\n cy.task('stubListExampleDashboard')\n cy.task('stubDefinitionMockReportVariant35')\n cy.task('stubTestDashboard8')\n cy.task('stubDefinitionFeatureTestingInteractive')\n cy.task('stubDashboardSuccessResult20')\n cy.task('stubRequestSuccessResult20')\n cy.task('stubPollingReportEndpoint')\n })\n\n beforeEach(() => {\n cy.visit(path)\n })\n\n describe('Bookmarking via the catalogue', () => {\n describe('report', () => {\n it('should add a bookmark to the bookmarks list', () => {\n cy.findByRole('tab', { name: /Bookmarks/ }).click()\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n cy.findAllByRole('row').contains('Interactive Report with async filters').should('exist')\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).should('exist')\n })\n })\n })\n\n it('should remove a bookmark to the bookmarks list', () => {\n cy.findByRole('tab', { name: /Bookmarks/ }).click()\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).should('exist')\n })\n })\n })\n })\n\n describe('dashboard', () => {\n it('should add a bookmark to the bookmarks list', () => {\n cy.findByRole('tab', { name: /Bookmarks/ }).click()\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Data quality data set'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n cy.findAllByRole('row').contains('Data quality data set').should('exist')\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Data quality data set'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).should('exist')\n })\n })\n })\n\n it('should remove a bookmark from the bookmarks list', () => {\n cy.findByRole('tab', { name: /Bookmarks/ }).click()\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Data quality data set'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Data quality data set'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).should('exist')\n })\n })\n })\n })\n\n describe('missing report', () => {\n it('should not be able to be bookmarked', () => {\n cy.findByRole('tab', { name: /Bookmarks/ }).click()\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Description for missing report 1'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).should('not.exist')\n cy.findByRole('link', { name: /Request report/ }).should('be.visible')\n })\n })\n })\n })\n })\n\n describe('Removing via the user reports list', () => {\n it('should remove a dashboard bookmark', () => {\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Data quality data set'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Data quality data set'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n })\n\n it('should remove a report bookmark', () => {\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n })\n })\n\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n })\n })\n\n describe('Bookmarking via the report', () => {\n let viewReportUrl: string\n\n before(() => {\n cy.task('stubDefinitionFeatureTestingMissingDesc')\n cy.task('stubReportsFinishedStatus')\n cy.task('stubViewAsyncReportingResults')\n cy.task('stubRequestSuccessReportTablesCount')\n\n cy.visit(path)\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return (\n Boolean(element.textContent?.includes('Feature testing')) &&\n Boolean(element.textContent?.includes('Missing variant description')) &&\n Boolean(element.textContent?.includes('Example variants used for feature testing'))\n )\n },\n }).within(() => {\n cy.findByRole('link', { name: 'Request report' }).click()\n })\n })\n cy.findByRole('combobox', { name: /Field 2/ }).select('Value 2.1')\n cy.findByRole('button', { name: /Request report/ }).click()\n\n cy.findByRole('button', { name: /Enable download/ }).should('be.visible')\n cy.url().then((url) => {\n viewReportUrl = url\n })\n })\n\n it('should add a bookmark', () => {\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n\n cy.visit(viewReportUrl)\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n cy.findByRole('button', { name: /Bookmarked/ }).should('be.visible')\n\n cy.visit(path)\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n })\n\n it('should remove a bookmark', () => {\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n cy.visit(viewReportUrl)\n\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n cy.findByRole('button', { name: /Bookmark removed/ })\n\n cy.visit(path)\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n })\n })\n\n describe('Bookmarking via the dashboard', () => {\n let viewReportUrl: string\n\n before(() => {\n cy.task('stubTestDashboard8')\n cy.task('stubMockDashboardsStatusFinished')\n cy.task('stubViewAsyncResults')\n cy.task('stubDashboardSuccessResult20')\n\n cy.visit(path)\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return (\n Boolean(element.textContent?.includes('Test Dashboard')) &&\n Boolean(element.textContent?.includes('Dashboard used for testing testing'))\n )\n },\n }).within(() => {\n cy.findByRole('link', { name: 'Request dashboard' }).click()\n })\n })\n cy.findByRole('button', { name: /Request dashboard/ }).click()\n\n cy.url().then((url) => {\n viewReportUrl = url\n })\n })\n\n it('should add a bookmark', () => {\n cy.visit(viewReportUrl)\n cy.findByRole('button', { name: /Add bookmark/ })\n .click()\n .contains('Bookmarked')\n cy.visit(path)\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n })\n\n it('should remove a bookmark', () => {\n cy.visit(path)\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 3)\n })\n })\n cy.visit(viewReportUrl)\n cy.findByRole('button', { name: /Remove bookmark/ })\n .click()\n .contains('Bookmark removed')\n cy.visit(path)\n cy.findByLabelText(/Bookmarks.*/i).within(() => {\n cy.findAllByRole('rowgroup')\n .eq(1)\n .within(() => {\n cy.findAllByRole('row').should('have.length', 2)\n })\n })\n })\n })\n\n describe('bookmarking should be idempotent', () => {\n it('should not change the bookmark status of an already bookmarked item', () => {\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n // Deselect the bookmark hidden input so that we try to add it whilst it's already added\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.get('input').then((el) => {\n // eslint-disable-next-line no-param-reassign\n ;(el.get(0) as HTMLInputElement).checked = false\n el.get(0).removeAttribute('checked')\n })\n cy.get('input').invoke('attr', 'checked').should('equal', undefined)\n })\n })\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n })\n })\n cy.reload()\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).should('exist')\n })\n })\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Remove bookmark/ }).click()\n })\n })\n })\n\n it('should not change the bookmark status of an unbookmarked item', () => {\n // Select the bookmark hidden input so that we try to add it whilst it's already added\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.get('input').then((el) => {\n // eslint-disable-next-line no-param-reassign\n ;(el.get(0) as HTMLInputElement).checked = true\n el.get(0).setAttribute('checked', 'true')\n })\n // Browser does funny things with checked attribute, it can be 'checked' or 'true' or unset - just check its there and not false\n cy.get('input').invoke('attr', 'checked').should('not.equal', undefined).and('not.equal', false)\n })\n })\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n cy.reload()\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).should('exist')\n })\n })\n })\n })\n })\n})\n"],
|
|
5
5
|
"mappings": ";AAAA,yBAA0C;AAC1C,wBAAyC;AACzC,0BAAoD;AAEpD,QAAQ,kBAAkB,MAAM;AAC9B,QAAM,OAAO;AAEb,WAAS,oCAAoC,MAAM;AACjD,OAAG,uEAAuE,MAAM;AAC9E,6CAAc;AACd,oDAAqB;AACrB,SAAG,MAAM,IAAI;AAEb,SAAG,WAAW,OAAO,EAAE,MAAM,YAAY,CAAC,EAAE,MAAM;AAClD,SAAG,gBAAgB,cAAc,EAAE,OAAO,MAAM;AAC9C,WAAG,cAAc,UAAU,EACxB,GAAG,CAAC,EACJ,OAAO,MAAM;AACZ,aAAG,cAAc,KAAK,EAAE,OAAO,eAAe,CAAC;AAC/C,aAAG,WAAW,QAAQ;AAAA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ent": ["import { ReportType } from '../../../../types/UserReports'\nimport { AutomaticBookmarkStoreData } from '../../../../types/Bookmark'\nimport { Services } from '../../../../types/Services'\n\nexport interface BookmarksByCaseload {\n [caseLoadId: string]: AutomaticBookmarkStoreData[]\n}\n\nexport const preBookmarkReportsByRoleId = async (\n userId: string,\n activeCaseLoadId: string,\n services: Services,\n bookmarksByCaseload: BookmarksByCaseload = {},\n) => {\n const bookmarks: AutomaticBookmarkStoreData[] = bookmarksByCaseload[activeCaseLoadId] || []\n const { bookmarkService } = services\n\n // Add new automatic bookmarks\n for (let index = 0; index < bookmarks.length; index += 1) {\n const foundBookmark = bookmarks[index]\n if (foundBookmark && foundBookmark.variantId) {\n const { reportId, variantId } = foundBookmark\n // eslint-disable-next-line no-await-in-loop\n await bookmarkService.addBookmark(userId, reportId, <string>variantId, ReportType.REPORT, true)\n }\n }\n\n return bookmarks\n}\n\nexport default {\n preBookmarkReportsByRoleId,\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B;AAQpB,MAAM,6BAA6B,OACxC,QACA,kBACA,UACA,sBAA2C,CAAC,MACzC;AACH,QAAM,YAA0C,oBAAoB,gBAAgB,KAAK,CAAC;AAC1F,QAAM,EAAE,gBAAgB,IAAI;AAG5B,WAAS,QAAQ,GAAG,QAAQ,UAAU,QAAQ,SAAS,GAAG;AACxD,UAAM,gBAAgB,UAAU,KAAK;AACrC,QAAI,iBAAiB,cAAc,WAAW;AAC5C,YAAM,EAAE,UAAU,UAAU,IAAI;AAEhC,YAAM,gBAAgB,YAAY,QAAQ,UAAkB,WAAW,8BAAW,QAAQ,IAAI;AAAA,IAChG;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,gBAAQ;AAAA,EACb;AACF;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/recently-viewed/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../types/Services'\nimport LocalsHelper from '../../../../utils/localsHelper'\n\nclass RecentlyViewedReportsController {\n services: Services\n\n constructor(services: Services) {\n this.services = services\n }\n\n POST: RequestHandler = async (req, res) => {\n const { dprUser } = LocalsHelper.getValues(res)\n const { id } = req.params\n await this.services.recentlyViewedService.removeReport(id, dprUser.id)\n await this.services.requestedReportService.removeReport(id, dprUser.id)\n res.end()\n }\n}\n\nexport { RecentlyViewedReportsController }\nexport default RecentlyViewedReportsController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAyB;AAEzB,MAAM,gCAAgC;AAAA,EACpC;AAAA,EAEA,YAAY,UAAoB;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,OAAuB,OAAO,KAAK,QAAQ;AACzC,UAAM,EAAE,QAAQ,IAAI,oBAAAA,QAAa,UAAU,GAAG;AAC9C,UAAM,EAAE,GAAG,IAAI,IAAI;AACnB,UAAM,KAAK,SAAS,sBAAsB,aAAa,IAAI,QAAQ,EAAE;AACrE,UAAM,KAAK,SAAS,uBAAuB,aAAa,IAAI,QAAQ,EAAE;AACtE,QAAI,IAAI;AAAA,EACV;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["LocalsHelper"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../dpr/routes/journeys/my-reports/recently-viewed/list/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../../types/Services'\n\nimport RecentReportslistUtils from '../../../../../components/user-reports/viewed/utils'\nimport UserReportsListUtils from '../../../../../components/user-reports/utils'\nimport LocalsHelper from '../../../../../utils/localsHelper'\n\nclass RecentlyViewedReportsListController {\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) => {\n const { recentlyViewedReports } = LocalsHelper.getValues(res)\n\n const listParams = await UserReportsListUtils.renderList({\n reportsData: recentlyViewedReports,\n filterFunction: RecentReportslistUtils.filterReports,\n res,\n type: 'viewed',\n })\n\n res.render(`dpr/routes/journeys/my-reports/view`, {\n title: 'Recently viewed reports',\n id: 'recently-viewed-reports-list',\n layoutPath: this.layoutPath,\n ...listParams,\n })\n }\n}\n\nexport { RecentlyViewedReportsListController }\nexport default RecentlyViewedReportsListController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAmC;AACnC,IAAAA,gBAAiC;AACjC,0BAAyB;AAEzB,MAAM,oCAAoC;AAAA,EACxC;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAsB,OAAO,MAAM,QAAQ;AACzC,UAAM,EAAE,sBAAsB,IAAI,oBAAAC,QAAa,UAAU,GAAG;AAE5D,UAAM,aAAa,MAAM,cAAAC,QAAqB,WAAW;AAAA,MACvD,aAAa;AAAA,MACb,gBAAgB,aAAAC,QAAuB;AAAA,MACvC;AAAA,MACA,MAAM;AAAA,IACR,CAAC;AAED,QAAI,OAAO,uCAAuC;AAAA,MAChD,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,YAAY,KAAK;AAAA,MACjB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["import_utils", "LocalsHelper", "UserReportsListUtils", "RecentReportslistUtils"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../dpr/routes/journeys/my-reports/recently-viewed/list/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport RecentlyViewedReportsListController from './controller'\nimport { Services } from '../../../../../types/Services'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n\n const controller = new RecentlyViewedReportsListController(layoutPath, services)\n router.get(`/`, controller.GET)\n\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AACvB,wBAAgD;AAGzC,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,QAAM,aAAa,IAAI,kBAAAA,QAAoC,YAAY,QAAQ;AAC/E,SAAO,IAAI,KAAK,WAAW,GAAG;AAE9B,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["RecentlyViewedReportsListController"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["import { executeReportStubs } from '../../../../../../../cypress-tests/cypressUtils'\n\ncontext('Recently viewed list', () => {\n const path = '/embedded/platform/'\n\n const checkStatuses = () => {\n cy.task('stubReportsSubmittedStatus')\n cy.findByRole('strong').contains('SUBMITTED')\n cy.task('stubReportsPickedStatus')\n cy.findByRole('strong').contains('PICKED')\n cy.task('stubReportsStartedStatus')\n cy.findByRole('strong').contains('STARTED')\n cy.task('stubReportsFinishedStatus')\n }\n\n before(() => {\n cy.task('resetStubs')\n cy.task('resetRedis')\n cy.task('stubDefinitions')\n cy.task('stubSingleSummaries')\n })\n\n beforeEach(() => {\n executeReportStubs()\n cy.task('stubDefinitionRequestExamplesSuccess')\n cy.task('stubRequestSuccessResult20')\n cy.visit(path)\n })\n\n it('should have no reports in recently viewed', () => {\n cy.visit(path)\n cy.findByRole('tab', { name: /Viewed \\(0\\)/ }).should('be.visible')\n })\n\n it('should behave correctly for an expired request', () => {\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return (\n Boolean(element.textContent?.includes('Successful Report')) &&\n Boolean(element.textContent?.includes('this will succeed'))\n )\n },\n }).within(() => {\n cy.findByRole('link', { name: 'Request report' }).click()\n })\n })\n cy.url().should(\n 'have.string',\n '/embedded/platform/dpr/request-report/report/request-examples/request-example-success/filters',\n )\n cy.findByRole('button', { name: 'Request report' }).click()\n checkStatuses()\n cy.findByRole('button', { name: /Enable download/ }).should('be.visible')\n\n cy.task('stubReportsExpiredStatus')\n cy.visit(path)\n cy.findByRole('tab', { name: /Viewed/ }).click()\n cy.reload().reload().reload()\n cy.findByLabelText(/Viewed \\(/).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Successful Report'))\n },\n }).within(() => {\n cy.findByRole('link', { name: 'Remove' }).should('be.visible')\n cy.findByRole('cell', { name: 'EXPIRED' }).should('be.visible')\n cy.findByRole('link', { name: 'Refresh' }).click()\n })\n })\n const filtersHref = '/embedded/platform/dpr/request-report/report/request-examples/request-example-success/filters'\n cy.url().should('have.string', filtersHref)\n\n cy.visit(path)\n cy.findByRole('tab', { name: /Viewed/ }).click()\n cy.findByLabelText(/Viewed \\(/).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Successful Report'))\n },\n }).within(() => {\n cy.findByRole('link', { name: 'Remove' }).click()\n })\n })\n\n cy.findByLabelText(/Requested/i).within(() => {\n cy.findByRole('row', {\n name: (_, element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Y,EAAE,OAAO,MAAM;AAC5C,SAAG,WAAW,OAAO;AAAA,QACnB,MAAM,CAAC,GAAG,YAAY;AACpB,iBAAO,QAAQ,QAAQ,aAAa,SAAS,mBAAmB,CAAC;AAAA,QACnE;AAAA,MACF,CAAC,EAAE,OAAO,WAAW;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/recently-viewed/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport { Services } from '../../../../types/Services'\nimport RecentlyViewedReportsController from './controller'\nimport listRoutes from './list/routes'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n\n const controller = new RecentlyViewedReportsController(services)\n router.post('/:id', controller.POST)\n router.use(`/list`, listRoutes({ layoutPath, services }))\n\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAEvB,wBAA4C;AAC5C,oBAAuB;AAEhB,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,QAAM,aAAa,IAAI,kBAAAA,QAAgC,QAAQ;AAC/D,SAAO,KAAK,QAAQ,WAAW,IAAI;AACnC,SAAO,IAAI,aAAS,cAAAC,SAAW,EAAE,YAAY,SAAS,CAAC,CAAC;AAExD,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["RecentlyViewedReportsController", "listRoutes"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/recently-viewed/service.ts"],
|
|
4
4
|
"sourcesContent": ["import ReportStoreService from '../../../../services/reportStoreService'\nimport UserDataStore from '../../../../data/reportDataStore'\nimport { RequestStatus, RequestedReport, RecentlyViewedReport, StoredReportData } from '../../../../types/UserReports'\nimport { ReportStoreConfig } from '../../../../types/ReportStore'\n\nclass RecentlyViewedStoreService extends ReportStoreService {\n constructor(userDataStore: UserDataStore) {\n super(userDataStore)\n }\n\n async getAllReports(userId: string): Promise<StoredReportData[]> {\n const userConfig = await this.getState(userId)\n return userConfig.recentlyViewedReports\n }\n\n async getAllReportsById(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.recentlyViewedReports.filter((requested) => {\n return (requested.id && requested.id === id) || (requested.variantId && requested.variantId === id)\n })\n }\n\n async getReportById(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.recentlyViewedReports.find((viewed) => {\n return (viewed.id && viewed.id === id) || (viewed.variantId && viewed.variantId === id)\n })\n }\n\n async getReportByExecutionId(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.recentlyViewedReports.find((report) => report.executionId === id)\n }\n\n async getReportByTableId(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.recentlyViewedReports.find((report) => report.tableId === id)\n }\n\n async setRecentlyViewed(reportData: RequestedReport, userId: string) {\n const userConfig = await this.getState(userId)\n const { executionId } = reportData\n\n const index = executionId\n ? this.findIndexByExecutionId(executionId, userConfig.recentlyViewedReports)\n : await this.findIndexByReportId(reportData.id, userConfig.recentlyViewedReports)\n\n // Remove the old entry before inserting the new at index 0\n if (index > -1) {\n userConfig.recentlyViewedReports.splice(index, 1)\n await this.saveState(userId, userConfig)\n }\n\n await this.addReport(reportData, userId, userConfig)\n }\n\n async addReport(reportData: RecentlyViewedReport, userId: string, userConfig: ReportStoreConfig) {\n userConfig.recentlyViewedReports.unshift(reportData)\n await this.saveState(userId, userConfig)\n }\n\n async setToExpired(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByExecutionId(id, userConfig.recentlyViewedReports)\n await this.saveExpiredState(userConfig, index, userId)\n }\n\n async asyncSetToExpiredByTableId(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByTableId(id, userConfig.recentlyViewedReports)\n await this.saveExpiredState(userConfig, index, userId)\n\n const updatedItem = userConfig.recentlyViewedReports[index]\n const { url } = updatedItem\n\n return url?.request?.fullUrl || ''\n }\n\n async saveExpiredState(userConfig: ReportStoreConfig, index: number, userId: string) {\n let report: RecentlyViewedReport = userConfig.recentlyViewedReports[index]\n if (report) {\n report = {\n ...report,\n status: RequestStatus.EXPIRED,\n timestamp: {\n ...report.timestamp,\n expired: new Date(),\n },\n }\n // eslint-disable-next-line no-param-reassign\n userConfig.recentlyViewedReports[index] = report\n await this.saveState(userId, userConfig)\n }\n }\n\n async removeReport(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByExecutionId(id, userConfig.recentlyViewedReports)\n userConfig.recentlyViewedReports.splice(index, 1)\n await this.saveState(userId, userConfig)\n }\n}\n\nexport { RecentlyViewedStoreService }\nexport default RecentlyViewedStoreService\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAA+B;AAE/B,yBAAuF;AAGvF,MAAM,mCAAmC,0BAAAA,QAAmB;AAAA,EAC1D,YAAY,eAA8B;AACxC,UAAM,aAAa;AAAA,EACrB;AAAA,EAEA,MAAM,cAAc,QAA6C;AAC/D,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,WAAO,WAAW;AAAA,EACpB;AAAA,EAEA,MAAM,kBAAkB,IAAY,QAAgB;AAClD,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,WAAO,WAAW,sBAAsB,OAAO,CAAC,cAAc;AAC5D,aAAQ,U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AC7C,UAAM,QAAQ,KAAK,uBAAuB,IAAI,WAAW,qBAAqB;AAC9E,UAAM,KAAK,iBAAiB,YAAY,OAAO,MAAM;AAAA,EACvD;AAAA,EAEA,MAAM,2BAA2B,IAAY,QAAgB;AAC3D,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,UAAM,QAAQ,KAAK,mBAAmB,IAAI,WAAW,qBAAqB;AAC1E,UAAM,KAAK,iBAAiB,YAAY,OAAO,MAAM;AAErD,UAAM,cAAc,WAAW,sBAAsB,KAAK;AAC1D,UAAM,EAAE,IAAI,IAAI;AAEhB,WAAO,KAAK,SAAS,WAAW;AAAA,EAClC;AAAA,EAEA,MAAM,iBAAiB,YAA+B,OAAe,QAAgB;AACnF,QAAI,SAA+B,WAAW,sBAAsB,KAAK;AACzE,QAAI,QAAQ;AACV,eAAS;AAAA,QACP,GAAG;AAAA,QACH,QAAQ,iCAAc;AAAA,QACtB,WAAW;AAAA,UACT,GAAG,OAAO;AAAA,UACV,SAAS,oBAAI,KAAK;AAAA,QACpB;AAAA,MACF;AAEA,iBAAW,sBAAsB,KAAK,IAAI;AAC1C,YAAM,KAAK,UAAU,QAAQ,UAAU;AAAA,IACzC;AAAA,EACF;AAAA,EAEA,MAAM,aAAa,IAAY,QAAgB;AAC7C,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,UAAM,QAAQ,KAAK,uBAAuB,IAAI,WAAW,qBAAqB;AAC9E,eAAW,sBAAsB,OAAO,OAAO,CAAC;AAChD,UAAM,KAAK,UAAU,QAAQ,UAAU;AAAA,EACzC;AACF;AAGA,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["ReportStoreService"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/requested-reports/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../types/Services'\nimport LocalsHelper from '../../../../utils/localsHelper'\n\nclass RequestedReportsController {\n services: Services\n\n constructor(services: Services) {\n this.services = services\n }\n\n POST: RequestHandler = async (req, res) => {\n const { dprUser } = LocalsHelper.getValues(res)\n const { id } = req.params\n await this.services.requestedReportService.removeReport(id, dprUser.id)\n res.end()\n }\n}\n\nexport { RequestedReportsController }\nexport default RequestedReportsController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAyB;AAEzB,MAAM,2BAA2B;AAAA,EAC/B;AAAA,EAEA,YAAY,UAAoB;AAC9B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,OAAuB,OAAO,KAAK,QAAQ;AACzC,UAAM,EAAE,QAAQ,IAAI,oBAAAA,QAAa,UAAU,GAAG;AAC9C,UAAM,EAAE,GAAG,IAAI,IAAI;AACnB,UAAM,KAAK,SAAS,uBAAuB,aAAa,IAAI,QAAQ,EAAE;AACtE,QAAI,IAAI;AAAA,EACV;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["LocalsHelper"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../dpr/routes/journeys/my-reports/requested-reports/list/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../../types/Services'\n\nimport AsyncRequestListUtils from '../../../../../components/user-reports/requested/utils'\nimport UserReportsListUtils from '../../../../../components/user-reports/utils'\nimport LocalsHelper from '../../../../../utils/localsHelper'\n\nclass RequestedReportsListController {\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) => {\n const { requestedReports } = LocalsHelper.getValues(res)\n\n const listParams = await UserReportsListUtils.renderList({\n reportsData: requestedReports,\n filterFunction: AsyncRequestListUtils.filterReports,\n res,\n type: 'requested',\n })\n\n res.render(`dpr/routes/journeys/my-reports/view`, {\n title: 'Requested reports',\n id: 'requested-reports-list',\n layoutPath: this.layoutPath,\n ...listParams,\n })\n }\n}\n\nexport { RequestedReportsListController }\nexport default RequestedReportsListController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAkC;AAClC,IAAAA,gBAAiC;AACjC,0BAAyB;AAEzB,MAAM,+BAA+B;AAAA,EACnC;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,MAAsB,OAAO,MAAM,QAAQ;AACzC,UAAM,EAAE,iBAAiB,IAAI,oBAAAC,QAAa,UAAU,GAAG;AAEvD,UAAM,aAAa,MAAM,cAAAC,QAAqB,WAAW;AAAA,MACvD,aAAa;AAAA,MACb,gBAAgB,aAAAC,QAAsB;AAAA,MACtC;AAAA,MACA,MAAM;AAAA,IACR,CAAC;AAED,QAAI,OAAO,uCAAuC;AAAA,MAChD,OAAO;AAAA,MACP,IAAI;AAAA,MACJ,YAAY,KAAK;AAAA,MACjB,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["import_utils", "LocalsHelper", "UserReportsListUtils", "AsyncRequestListUtils"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../dpr/routes/journeys/my-reports/requested-reports/list/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport RequestedReportsListController from './controller'\nimport { Services } from '../../../../../types/Services'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n\n const controller = new RequestedReportsListController(layoutPath, services)\n router.get(`/`, controller.GET)\n\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AACvB,wBAA2C;AAGpC,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,QAAM,aAAa,IAAI,kBAAAA,QAA+B,YAAY,QAAQ;AAC1E,SAAO,IAAI,KAAK,WAAW,GAAG;AAE9B,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["RequestedReportsListController"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["context('Requested report list', () => {\n const path = '/embedded/platform/dpr/my-reports/requested-reports/list'\n\n before(() => {\n cy.task('resetStubs')\n cy.task('resetRedis')\n cy.task('stubDefinitions')\n cy.task('stubSingleSummaries')\n })\n\n it('is accessible', () => {\n cy.visit(path)\n cy.injectAxe()\n cy.checkA11y()\n })\n})\n"],
|
|
5
5
|
"mappings": ";AAAA,QAAQ,yBAAyB,MAAM;AACrC,QAAM,OAAO;AAEb,SAAO,MAAM;AACX,OAAG,KAAK,YAAY;AACpB,OAAG,KAAK,YAAY;AACpB,OAAG,KAAK,iBAAiB;AACzB,OAAG,KAAK,qBAAqB;AAAA,EAC/B,CAAC;AAED,KAAG,iBAAiB,MAAM;AACxB,OAAG,MAAM,IAAI;AACb,OAAG,UAAU;AACb,OAAG,UAAU;AAAA,EACf,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/requested-reports/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport { Services } from '../../../../types/Services'\nimport RequestedReportsController from './controller'\nimport listRoutes from './list/routes'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n\n const controller = new RequestedReportsController(services)\n router.post('/:id', controller.POST)\n\n router.use(`/list`, listRoutes({ layoutPath, services }))\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAEvB,wBAAuC;AACvC,oBAAuB;AAEhB,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,QAAM,aAAa,IAAI,kBAAAA,QAA2B,QAAQ;AAC1D,SAAO,KAAK,QAAQ,WAAW,IAAI;AAEnC,SAAO,IAAI,aAAS,cAAAC,SAAW,EAAE,YAAY,SAAS,CAAC,CAAC;AACxD,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["RequestedReportsController", "listRoutes"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/my-reports/requested-reports/service.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport UserDataStore from '../../../../data/reportDataStore'\nimport { RequestedReport, RequestStatus, StoredReportData } from '../../../../types/UserReports'\nimport ReportStoreService from '../../../../services/reportStoreService'\nimport { getDpdPathSuffix } from '../../../../utils/urlHelper'\nimport logger from '../../../../utils/logger'\n\nclass RequestedReportService extends ReportStoreService {\n constructor(userDataStore: UserDataStore) {\n super(userDataStore)\n }\n\n async addReport(userId: string, reportStateData: RequestedReport) {\n const userConfig = await this.getState(userId)\n userConfig.requestedReports.unshift(reportStateData)\n await this.saveState(userId, userConfig)\n }\n\n async removeReport(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByExecutionId(id, userConfig.requestedReports)\n userConfig.requestedReports.splice(index, 1)\n await this.saveState(userId, userConfig)\n }\n\n async getReportByExecutionId(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.requestedReports.find((report) => report.executionId === id)\n }\n\n async getReportByTableId(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.requestedReports.find((report) => report.tableId === id)\n }\n\n async getAllReports(userId: string): Promise<RequestedReport[]> {\n const userConfig = await this.getState(userId)\n return userConfig.requestedReports\n }\n\n async getAllReportsById(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n return userConfig.requestedReports.filter((requested) => {\n return (requested.id && requested.id === id) || (requested.variantId && requested.variantId === id)\n })\n }\n\n async updateLastViewed(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByExecutionId(id, userConfig.requestedReports)\n const report: RequestedReport = userConfig.requestedReports[index]\n report.timestamp.lastViewed = new Date()\n userConfig.requestedReports[index] = report\n await this.saveState(userId, userConfig)\n }\n\n async updateStatus(id: string, userId: string, status?: RequestStatus, errorMessage?: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByExecutionId(id, userConfig.requestedReports)\n let report: RequestedReport = userConfig.requestedReports[index]\n if (report) report = this.updateDataByStatus(report, status, errorMessage)\n userConfig.requestedReports[index] = report\n await this.saveState(userId, userConfig)\n }\n\n async setToExpired(id: string, userId: string) {\n const userConfig = await this.getState(userId)\n const index = this.findIndexByExecutionId(id, userConfig.requestedReports)\n let report: RequestedReport = userConfig.requestedReports[index]\n if (report) {\n report = {\n ...report,\n status: RequestStatus.EXPIRED,\n timestamp: {\n ...report.timestamp,\n expired: new Date(),\n },\n }\n userConfig.requestedReports[index] = report\n await this.saveState(userId, userConfig)\n }\n }\n\n /**\n * Removes old stale data from requested reports\n * - When a report is viewed it is given a lastViewed ts.\n * - If the requested data has a lastViewed ts and\n * - has no corresponding viewed entry\n * - then that requested data is stale and can be removed\n *\n * @param {string} userId\n * @param {StoredReportData[]} viewedReports\n * @memberof RequestedReportService\n */\n async cleanList(userId: string, viewedReports: StoredReportData[]) {\n const userConfig = await this.getState(userId)\n const allRequested = userConfig.requestedReports\n const viewedRequestedReports = allRequested.filter((requestedReport) => {\n return requestedReport.timestamp.lastViewed !== undefined\n })\n\n let count = 0\n await Promise.all(\n viewedRequestedReports.map(async (viewedRequestReport) => {\n const { executionId } = viewedRequestReport\n const viewedReport = viewedReports.find((report) => {\n const { executionId: viewedExecutionId } = report\n return viewedExecutionId && viewedExecutionId === executionId\n })\n if (!viewedReport && executionId) {\n await this.removeReport(executionId, userId)\n count += 1\n }\n }),\n )\n if (count > 0) logger.info(`RequestedReports: Removed ${count} stale reports from list`)\n }\n\n setReportUrl(report: RequestedReport) {\n const { tableId, url, dpdPathFromQuery, dataProductDefinitionsPath, type } = report\n\n let pathname\n let fullUrl\n\n if (url && url.polling?.pathname) {\n let reportUrlArr = Array.from(new Array(2))\n reportUrlArr = url.polling.pathname.replace('/request-report', '/view-report/async').split('/')\n reportUrlArr[reportUrlArr.length - 2] = tableId\n reportUrlArr[reportUrlArr.length - 1] = type\n const reportUrl = reportUrlArr.join('/')\n\n const search = url.report?.search ? url.report.search : ''\n const dpdPath =\n dataProductDefinitionsPath && dpdPathFromQuery ? `${getDpdPathSuffix(dataProductDefinitionsPath)}` : ''\n const searchPath = search || dpdPath\n pathname = `${reportUrl}${searchPath}`\n fullUrl = `${url.origin}${pathname}`\n }\n\n return {\n pathname,\n fullUrl,\n }\n }\n\n updateDataByStatus(report: RequestedReport, status?: RequestStatus | undefined, errorMessage?: string) {\n const ts = new Date()\n if (status) report.status = status\n switch (status) {\n case RequestStatus.FAILED:\n report.timestamp.failed = ts\n if (errorMessage) report.errorMessage = errorMessage\n break\n case RequestStatus.EXPIRED:\n report.timestamp.expired = ts\n break\n case RequestStatus.ABORTED:\n report.timestamp.aborted = ts\n break\n case RequestStatus.FINISHED: {\n report.timestamp.completed = ts\n if (report.url) {\n report.url.report = {\n ...report.url.report,\n ...this.setReportUrl(report),\n }\n }\n break\n }\n case RequestStatus.SUBMITTED:\n report.timestamp.requested = ts\n break\n case RequestStatus.STARTED:\n case RequestStatus.PICKED:\n break\n default:\n report.timestamp.lastViewed = ts\n break\n }\n\n return report\n }\n}\n\nexport { RequestedReportService }\nexport default RequestedReportService\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAiE;AACjE,gCAA+B;AAC/B,uBAAiC;AACjC,oBAAmB;AAEnB,MAAM,+BAA+B,0BAAAA,QAAmB;AAAA,EACtD,YAAY,eAA8B;AACxC,UAAM,aAAa;AAAA,EACrB;AAAA,EAEA,MAAM,UAAU,QAAgB,iBAAkC;AAChE,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,eAAW,iBAAiB,QAAQ,eAAe;AACnD,UAAM,KAAK,UAAU,QAAQ,UAAU;AAAA,EACzC;AAAA,EAEA,MAAM,aAAa,IAAY,QAAgB;AAC7C,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,UAAM,QAAQ,KAAK,uBAAuB,IAAI,WAAW,gBAAgB;AACzE,eAAW,iBAAiB,OAAO,OAAO,CAAC;AAC3C,UAAM,KAAK,UAAU,QAAQ,UAAU;AAAA,EACzC;AAAA,EAEA,MAAM,uBAAuB,IAAY,QAAgB;AACvD,UAAM,aAAa,MAAM,KAAK,SAAS,MAAM;AAC7C,WAAO,WAAW,iBAAiB,KAAK,CAAC,WAAW,OAAO,gBAAgB,EAAE;AAAA,EAC/E;AAAA,EAEA,MAAM,mBAAmB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oreService", "logger"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../dpr/routes/journeys/my-reports/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport { Services } from '../../../types/Services'\n\n// Routes\nimport bookmarkRoutes from './bookmarks/routes'\nimport recentlyViewedRoutes from './recently-viewed/routes'\nimport requestedReportsRoutes from './requested-reports/routes'\n\nexport function Routes({ layoutPath, services }: { services: Services; layoutPath: string }) {\n const router = Router({ mergeParams: true })\n\n router.use(`/bookmarks`, bookmarkRoutes({ layoutPath, services }))\n router.use(`/recently-viewed`, recentlyViewedRoutes({ layoutPath, services }))\n router.use(`/requested-reports`, requestedReportsRoutes({ layoutPath, services }))\n\n return router\n}\n\nexport const MyReportsRoutes = ({\n services,\n path,\n layoutPath,\n}: {\n services: Services\n path: string\n layoutPath: string\n}) => {\n const router = Router({ mergeParams: true })\n router.use(path, Routes({ services, layoutPath }))\n return router\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAIvB,oBAA2B;AAC3B,IAAAA,iBAAiC;AACjC,IAAAA,iBAAmC;AAE5B,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,SAAO,IAAI,kBAAc,cAAAC,SAAe,EAAE,YAAY,SAAS,CAAC,CAAC;AACjE,SAAO,IAAI,wBAAoB,eAAAC,SAAqB,EAAE,YAAY,SAAS,CAAC,CAAC;AAC7E,SAAO,IAAI,0BAAsB,eAAAC,SAAuB,EAAE,YAAY,SAAS,CAAC,CAAC;AAEjF,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,SAAO,IAAI,MAAM,OAAO,EAAE,UAAU,WAAW,CAAC,CAAC;AACjD,SAAO;AACT;",
|
|
6
6
|
"names": ["import_routes", "bookmarkRoutes", "recentlyViewedRoutes", "requestedReportsRoutes"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../dpr/routes/journeys/product-collection/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\n\n// Routes\nimport { routes as selectedRoutes } from './selected/routes'\nimport { Services } from '../../../types/Services'\n\nexport function Routes({ layoutPath, services }: { services: Services; layoutPath: string }) {\n const router = Router({ mergeParams: true })\n router.use(`/selected`, selectedRoutes({ layoutPath, services }))\n\n return router\n}\n\nexport const ProductCollectionRoutes = ({\n services,\n path,\n layoutPath,\n}: {\n services: Services\n path: string\n layoutPath: string\n}) => {\n const router = Router({ mergeParams: true })\n router.use(path, Routes({ services, layoutPath }))\n\n return router\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAGvB,oBAAyC;AAGlC,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,SAAO,IAAI,iBAAa,cAAAA,QAAe,EAAE,YAAY,SAAS,CAAC,CAAC;AAEhE,SAAO;AACT;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,SAAO,IAAI,MAAM,OAAO,EAAE,UAAU,WAAW,CAAC,CAAC;AAEjD,SAAO;AACT;",
|
|
6
6
|
"names": ["selectedRoutes"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/product-collection/selected/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { ProductCollectionStoreService } from '../../../../services/productCollection/productCollectionStoreService'\nimport LocalsHelper from '../../../../utils/localsHelper'\nimport { Services } from '../../../../types/Services'\n\nexport class SelectedProductCollectionController {\n layoutPath: string\n\n productCollectionStoreService: ProductCollectionStoreService\n\n constructor(layoutPath: string, services: Services) {\n this.layoutPath = layoutPath\n this.productCollectionStoreService = services.productCollectionStoreService\n }\n\n POST: RequestHandler = async (req, res, _next) => {\n const { productCollection } = req.body\n const { dprUser, nestedBaseUrl } = LocalsHelper.getValues(res)\n\n await this.productCollectionStoreService\n .setSelectedProductCollectionId(dprUser.id, productCollection === 'RESET' ? undefined : productCollection)\n .then(() => {\n res.redirect(`${nestedBaseUrl}/`)\n })\n .catch(() => {\n res.redirect(`${nestedBaseUrl}/`)\n })\n }\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAyB;AAGlB,MAAM,oCAAoC;AAAA,EAC/C;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,gCAAgC,SAAS;AAAA,EAChD;AAAA,EAEA,OAAuB,OAAO,KAAK,KAAK,UAAU;AAChD,UAAM,EAAE,kBAAkB,IAAI,IAAI;AAClC,UAAM,EAAE,SAAS,cAAc,IAAI,oBAAAA,QAAa,UAAU,GAAG;AAE7D,UAAM,KAAK,8BACR,+BAA+B,QAAQ,IAAI,sBAAsB,UAAU,SAAY,iBAAiB,EACxG,KAAK,MAAM;AACV,UAAI,SAAS,GAAG,aAAa,GAAG;AAAA,IAClC,CAAC,EACA,MAAM,MAAM;AACX,UAAI,SAAS,GAAG,aAAa,GAAG;AAAA,IAClC,CAAC;AAAA,EACL;AACF;",
|
|
6
6
|
"names": ["LocalsHelper"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/product-collection/selected/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport { SelectedProductCollectionController } from './controller'\nimport { Services } from '../../../../types/Services'\nimport { schema } from './validation'\nimport { validate } from '../../../../validation/validate'\n\nexport const routes = ({ layoutPath, services }: { layoutPath: string; services: Services }) => {\n const router = Router({ mergeParams: true })\n const controller = new SelectedProductCollectionController(layoutPath, services)\n\n router.post('/', validate(schema), controller.POST)\n\n return router\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AACvB,wBAAoD;AAEpD,wBAAuB;AACvB,sBAAyB;AAElB,MAAM,SAAS,CAAC,EAAE,YAAY,SAAS,MAAkD;AAC9F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,QAAM,aAAa,IAAI,sDAAoC,YAAY,QAAQ;AAE/E,SAAO,KAAK,SAAK,0BAAS,wBAAM,GAAG,WAAW,IAAI;AAElD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/product-collection/selected/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["import { summaries } from '@networkMocks/definitionSummaries'\nimport { stubBaseTasks } from 'cypress-tests/cypressUtils'\n\ncontext('Catalogue collections', () => {\n const path = '/embedded/platform/'\n\n describe('Check catalogue collections work properly', () => {\n it('should allow the user to choose from any collection', () => {\n stubBaseTasks()\n cy.task('stubDefinitions')\n cy.task('stubGetProductCollections')\n cy.task('getProductCollection1')\n cy.task('stubDefinitionUnprintable')\n cy.task('stubDefinitionEmptyReport')\n cy.task('stubDefinitionMockReportVariant35')\n\n cy.visit(path)\n\n cy.findByRole('combobox', { name: /Your collections/ })\n .should('be.visible')\n .within(() => cy.findAllByRole('option').should('have.length', 3))\n cy.findByDisplayValue(/Full catalogue/).should('be.visible')\n\n const totalReports = summaries.reduce((acc, cur) => acc + (cur.dashboards?.length ?? 0) + cur.variants.length, 0)\n cy.findAllByText((_text, el) =>\n new RegExp(`Showing ${totalReports} of ${totalReports} reports`).test(el?.textContent || ''),\n ).should('be.visible')\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Interactive Report with async filters'))\n },\n }).within(() => {\n cy.findByRole('button', { name: /Add bookmark/ }).click()\n })\n })\n\n cy.findByRole('combobox', { name: /Your collections/ }).select('My Starter Pack')\n const totalReportsStarterPack = [summaries[0], summaries[1]].reduce(\n (acc, cur) => acc + (cur.dashboards?.length ?? 0) + cur.variants.length,\n 0,\n )\n cy.findAllByText((_text, el) =>\n new RegExp(`Showing ${totalReportsStarterPack} of ${totalReportsStarterPack} reports`).test(\n el?.textContent || '',\n ),\n ).should('be.visible')\n\n cy.findByRole('combobox', { name: /Your collections/ }).select('Full catalogue')\n cy.findAllByText((_text, el) =>\n new RegExp(`Showing ${totalReports} of ${totalReports} reports`).test(el?.textContent || ''),\n ).should('be.visible')\n })\n })\n})\n"],
|
|
5
5
|
"mappings": ";AAAA,iCAA0B;AAC1B,0BAA8B;AAE9B,QAAQ,yBAAyB,MAAM;AACrC,QAAM,OAAO;AAEb,WAAS,6CAA6C,MAAM;AAC1D,OAAG,uDAAuD,MAAM;AAC9D,6CAAc;AACd,SAAG,KAAK,iBAAiB;AACzB,SAAG,KAAK,2BAA2B;AACnC,SAAG,KAAK,uBAAuB;AAC/B,SAA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AErB,SAAG,WAAW,YAAY,EAAE,MAAM,mBAAmB,CAAC,EAAE,OAAO,gBAAgB;AAC/E,SAAG;AAAA,QAAc,CAAC,OAAO,OACvB,IAAI,OAAO,WAAW,YAAY,OAAO,YAAY,UAAU,EAAE,KAAK,IAAI,eAAe,EAAE;AAAA,MAC7F,EAAE,OAAO,YAAY;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/product-collection/selected/validation.ts"],
|
|
4
4
|
"sourcesContent": ["import z from 'zod'\n\nexport const schema = z.object({\n productCollection: z.string().trim().min(1, 'Product Collection ID should exist'),\n})\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAc;AAEP,MAAM,SAAS,WAAAA,QAAE,OAAO;AAAA,EAC7B,mBAAmB,WAAAA,QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,oCAAoC;AAClF,CAAC;",
|
|
6
6
|
"names": ["z"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/form/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { captureException } from '@sentry/node'\nimport LocalsHelper from '../../../../utils/localsHelper'\nimport { components } from '../../../../types/api'\nimport { Services } from '../../../../types/Services'\nimport MissingReportService from '../../../../services/missingReport/missingReportService'\nimport { ReportingService } from '../../../../services'\n\nclass MissingReportFormController {\n layoutPath: string\n\n missingReportService: MissingReportService\n\n reportingService: ReportingService\n\n constructor(layoutPath: string, services: Services) {\n this.layoutPath = layoutPath\n this.missingReportService = services.missingReportService\n this.reportingService = services.reportingService\n }\n\n GET: RequestHandler = async (req, res, next) => {\n const { token, csrfToken, definitionsPath, dprUser } = LocalsHelper.getValues(res)\n const { reportId, variantId } = req.params\n\n const reportDefinition: components['schemas']['SingleVariantReportDefinition'] =\n await this.reportingService.getDefinition(\n token,\n reportId,\n variantId,\n definitionsPath ?? 'definitions/prisons/missing',\n )\n\n const { variant, name } = reportDefinition\n\n try {\n res.render(`dpr/routes/journeys/request-missing-report/form/view`, {\n title: 'This report is not available',\n report: {\n reportId,\n variantId,\n reportName: name,\n name: variant.name,\n description: variant.description || reportDefinition.description,\n },\n user: dprUser,\n csrfToken,\n layoutPath: this.layoutPath,\n postEndpoint: `/dpr/request-missing-report/${reportId}/${variantId}/form/submit`,\n })\n } catch (error) {\n next(error)\n }\n }\n\n POST: RequestHandler = async (req, res, _next) => {\n const { body } = req\n const { reportId, variantId, reportName, variantName, 'more-detail': requestDetails } = body\n\n const { token } = LocalsHelper.getValues(res)\n\n try {\n const submission = this.missingReportService.submitMissingReportEntry(token, reportId, variantId, requestDetails)\n if (submission) {\n submission.then(\n () => {\n const queryParams = `reportName=${reportName}&name=${variantName}&reportId=${reportId}&variantId=${variantId}`\n const redirect = `./submitted?${queryParams}`\n\n res.redirect(redirect)\n },\n (err) => {\n captureException(err)\n res.render(`dpr/components/serviceError/view`)\n },\n )\n }\n } catch (error) {\n captureException(error)\n res.render(`dpr/components/serviceError/view`)\n }\n }\n}\n\nexport { MissingReportFormController }\nexport default MissingReportFormController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAiC;AACjC,0BAAyB;AAMzB,MAAM,4BAA4B;AAAA,EAChC;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,uBAAuB,SAAS;AACrC,SAAK,mBAAmB,SAAS;AAAA,EACnC;AA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AAAA,IACF,SAAS,OAAO;AACd,wCAAiB,KAAK;AACtB,UAAI,OAAO,kCAAkC;AAAA,IAC/C;AAAA,EACF;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["LocalsHelper"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/form/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport MissingReportFormController from './controller'\nimport { Services } from '../../../../types/Services'\nimport { schema } from './validation'\nimport { validate } from '../../../../validation/validate'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n const controller = new MissingReportFormController(layoutPath, services)\n\n router.get(`/`, controller.GET)\n router.post('/', validate(schema), controller.POST)\n\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AACvB,wBAAwC;AAExC,wBAAuB;AACvB,sBAAyB;AAElB,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,QAAM,aAAa,IAAI,kBAAAA,QAA4B,YAAY,QAAQ;AAEvE,SAAO,IAAI,KAAK,WAAW,GAAG;AAC9B,SAAO,KAAK,SAAK,0BAAS,wBAAM,GAAG,WAAW,IAAI;AAElD,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["MissingReportFormController"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/form/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["context('Request missing report', () => {\n const path = '/embedded/platform/dpr/request-missing-report/feature-testing/feature-testing-missing-1/form'\n\n beforeEach(() => {\n cy.task('resetStubs')\n cy.task('resetRedis')\n cy.task('stubDefinitions')\n cy.task('stubSingleSummaries')\n cy.task('stubGetFeatureTestingMissing')\n })\n\n it('should show the form, and on successful submission, redirect to the success submitted page', () => {\n cy.task('stubSubmitMissingRequest')\n cy.visit(path)\n cy.injectAxe()\n cy.checkA11y()\n cy.findByRole('textbox', { name: /Request this report/ }).should('be.visible')\n cy.findByRole('button', { name: /Submit/ }).click()\n cy.findByRole('link', { name: /Please fill out the reason for needing the report/ })\n .should('be.visible')\n .click()\n cy.findByRole('textbox', { name: /Request this report/ }).should('be.focused')\n cy.findAllByRole('paragraph')\n .contains(/Please fill out the reason for needing the report/)\n .should('be.visible')\n })\n})\n"],
|
|
5
5
|
"mappings": ";AAAA,QAAQ,0BAA0B,MAAM;AACtC,QAAM,OAAO;AAEb,aAAW,MAAM;AACf,OAAG,KAAK,YAAY;AACpB,OAAG,KAAK,YAAY;AACpB,OAAG,KAAK,iBAAiB;AACzB,OAAG,KAAK,qBAAqB;AAC7B,OAAG,KAAK,8BAA8B;AAAA,EACxC,CAAC;AAED,KAAG,8FAA8F,MAAM;AACrG,OAAG,KAAK,0BAA0B;AAClC,OAAG,MAAM,IAAI;AACb,OAAG,UAAU;AACb,OAAG,UAAU;AACb,OAAG,WAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC,EAAE,OAAO,YAAY;AAC7E,OAAG,WAAW,UAAU,EAAE,MAAM,SAAS,CAAC,EAAE,MAAM;AAClD,OAAG,WAAW,QAAQ,EAAE,MAAM,oDAAoD,CAAC,EAChF,OAAO,YAAY,EACnB,MAAM;AACT,OAAG,WAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC,EAAE,OAAO,YAAY;AAC7E,OAAG,cAAc,WAAW,EACzB,SAAS,mDAAmD,EAC5D,OAAO,YAAY;AAAA,EACxB,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/form/validation.ts"],
|
|
4
4
|
"sourcesContent": ["import z from 'zod'\n\nexport const schema = z.object({\n reportId: z.string().trim().min(1, 'Report ID should exist'),\n variantId: z.string().trim().min(1, 'Report variant ID should exist'),\n 'more-detail': z.string().trim().min(1, 'Please fill out the reason for needing the report'),\n})\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAc;AAEP,MAAM,SAAS,WAAAA,QAAE,OAAO;AAAA,EAC7B,UAAU,WAAAA,QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,wBAAwB;AAAA,EAC3D,WAAW,WAAAA,QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,gCAAgC;AAAA,EACpE,eAAe,WAAAA,QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,mDAAmD;AAC7F,CAAC;",
|
|
6
6
|
"names": ["z"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../dpr/routes/journeys/request-missing-report/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\n\n// Routes\nimport formRoutes from './form/routes'\nimport submittedRoutes from './submitted/routes'\nimport { Services } from '../../../types/Services'\n\nexport function Routes({ layoutPath, services }: { services: Services; layoutPath: string }) {\n const router = Router({ mergeParams: true })\n\n router.use(`/:reportId/:variantId/submitted`, submittedRoutes({ layoutPath }))\n router.use(`/:reportId/:variantId/form`, formRoutes({ layoutPath, services }))\n\n return router\n}\n\nexport const RequestMissingReportRoutes = ({\n services,\n path,\n layoutPath,\n}: {\n services: Services\n path: string\n layoutPath: string\n}) => {\n const router = Router({ mergeParams: true })\n router.use(path, Routes({ services, layoutPath }))\n\n return router\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAGvB,oBAAuB;AACvB,IAAAA,iBAA4B;AAGrB,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,SAAO,IAAI,uCAAmC,eAAAC,SAAgB,EAAE,WAAW,CAAC,CAAC;AAC7E,SAAO,IAAI,kCAA8B,cAAAC,SAAW,EAAE,YAAY,SAAS,CAAC,CAAC;AAE7E,SAAO;AACT;AAEO,MAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,SAAO,IAAI,MAAM,OAAO,EAAE,UAAU,WAAW,CAAC,CAAC;AAEjD,SAAO;AACT;",
|
|
6
6
|
"names": ["import_routes", "submittedRoutes", "formRoutes"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/submitted/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport localsHelper from '../../../../utils/localsHelper'\n\nclass MissingReportSubmittedController {\n layoutPath: string\n\n constructor(layoutPath: string) {\n this.layoutPath = layoutPath\n }\n\n GET: RequestHandler = async (req, res, next) => {\n const { nestedBaseUrl } = localsHelper.getValues(res)\n const { reportId, variantId, reportName, name } = req.query\n\n try {\n res.render(`dpr/routes/journeys/request-missing-report/submitted/view`, {\n title: 'Request submitted',\n report: {\n reportId,\n variantId,\n reportName,\n name,\n },\n nestedBaseUrl,\n layoutPath: this.layoutPath,\n })\n } catch (error) {\n next(error)\n }\n }\n}\n\nexport { MissingReportSubmittedController }\nexport default MissingReportSubmittedController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAyB;AAEzB,MAAM,iCAAiC;AAAA,EACrC;AAAA,EAEA,YAAY,YAAoB;AAC9B,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,MAAsB,OAAO,KAAK,KAAK,SAAS;AAC9C,UAAM,EAAE,cAAc,IAAI,oBAAAA,QAAa,UAAU,GAAG;AACpD,UAAM,EAAE,UAAU,WAAW,YAAY,KAAK,IAAI,IAAI;AAEtD,QAAI;AACF,UAAI,OAAO,6DAA6D;AAAA,QACtE,OAAO;AAAA,QACP,QAAQ;AAAA,UACN;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA,YAAY,KAAK;AAAA,MACnB,CAAC;AAAA,IACH,SAAS,OAAO;AACd,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["localsHelper"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/submitted/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport MissingReportSubmittedController from './controller'\n\nexport function routes({ layoutPath }: { layoutPath: string }) {\n const router = Router({ mergeParams: true })\n\n const controller = new MissingReportSubmittedController(layoutPath)\n router.get(`/`, controller.GET)\n\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AACvB,wBAA6C;AAEtC,SAAS,OAAO,EAAE,WAAW,GAA2B;AAC7D,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAE3C,QAAM,aAAa,IAAI,kBAAAA,QAAiC,UAAU;AAClE,SAAO,IAAI,KAAK,WAAW,GAAG;AAE9B,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["MissingReportSubmittedController"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-missing-report/submitted/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["context('Request missing report submitted', () => {\n const path =\n '/embedded/platform/dpr/request-missing-report/feature-testing/feature-testing-missing-1/submitted?reportName=C%20Test%20Report&name=Missing%20Report%20about%20beans&reportId=feature-testing&variantId=feature-testing-missing-1'\n\n it('is accessible', () => {\n cy.visit(path)\n cy.injectAxe()\n cy.checkA11y()\n cy.findByRole('group').contains('Request details').click()\n cy.findAllByRole('cell', { name: 'Name:' }).should('exist')\n cy.findAllByRole('cell', { name: 'Missing Report about beans' }).should('exist')\n cy.findAllByRole('cell', { name: 'Product:' }).should('exist')\n cy.findAllByRole('cell', { name: 'C Test Report' }).should('exist')\n })\n})\n"],
|
|
5
5
|
"mappings": ";AAAA,QAAQ,oCAAoC,MAAM;AAChD,QAAM,OACJ;AAEF,KAAG,iBAAiB,MAAM;AACxB,OAAG,MAAM,IAAI;AACb,OAAG,UAAU;AACb,OAAG,UAAU;AACb,OAAG,WAAW,OAAO,EAAE,SAAS,iBAAiB,EAAE,MAAM;AACzD,OAAG,cAAc,QAAQ,EAAE,MAAM,QAAQ,CAAC,EAAE,OAAO,OAAO;AAC1D,OAAG,cAAc,QAAQ,EAAE,MAAM,6BAA6B,CAAC,EAAE,OAAO,OAAO;AAC/E,OAAG,cAAc,QAAQ,EAAE,MAAM,WAAW,CAAC,EAAE,OAAO,OAAO;AAC7D,OAAG,cAAc,QAAQ,EAAE,MAAM,gBAAgB,CAAC,EAAE,OAAO,OAAO;AAAA,EACpE,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../dpr/routes/journeys/request-missing-report/tests.cy.ts"],
|
|
4
4
|
"sourcesContent": ["import { checkA11y, stubBaseTasks, stubDefinitionsTasks } from '../../../../../cypress-tests/cypressUtils'\n\ncontext('Request missing report', () => {\n const path = '/embedded/platform/'\n\n beforeEach(() => {\n stubBaseTasks()\n stubDefinitionsTasks()\n cy.task('stubGetFeatureTestingMissing')\n cy.visit(path)\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Missing Report 1'))\n },\n }).within(() => {\n cy.findByRole('link', { name: 'Request report' }).click()\n })\n })\n checkA11y()\n })\n\n describe('Request form page', () => {\n it('should show the form, and on successful submission, redirect to the success submitted page', () => {\n cy.task('stubMissingRequestSubmitSuccess')\n cy.findByRole('textbox', { name: /Request this report/ })\n .should('be.visible')\n .type('abcd')\n cy.findByRole('button', { name: /Submit/ }).click()\n cy.findByRole('heading', { name: /We've received your request for report Missing Report 1/ }).should('be.visible')\n checkA11y()\n })\n\n it('should show the form, and on failed submission, redirect to the error page', () => {\n cy.task('stubMissingRequestSubmitFail')\n cy.findByRole('textbox', { name: /Request this report/ }).type('a reason')\n cy.findByRole('button', { name: /Submit/ }).click()\n cy.findByRole('heading', { name: /Sorry, there is a problem with the service/ }).should('be.visible')\n checkA11y()\n })\n })\n})\n"],
|
|
5
5
|
"mappings": ";AAAA,0BAA+D;AAE/D,QAAQ,0BAA0B,MAAM;AACtC,QAAM,OAAO;AAEb,aAAW,MAAM;AACf,2CAAc;AACd,kDAAqB;AACrB,OAAG,KAAK,8BAA8B;AACtC,OAAG,MAAM,IAAI;AACb,OAAG,gBAAgB,sBAAsB,EAAE,OAAO,MAAM;AACtD,SAAG,WAAW,OAAO;AAAA,QACnB,MAAM,CAAC,GAAG,YAAY;AACpB,iBAAO,QAAQ,QAAQ,aAAa,SAAS,kBAAkB,CAAC;AAAA,QAClE;AAAA,MACF,CAAC,EAAE,OAAO,MAAM;AACd,WAAG,WAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC,EAAE,MAAM;AAAA,MAC1D,CAAC;AAAA,IACH,CAAC;AACD,uCAAU;AAAA,EACZ,CAAC;AAED,WAAS,qBAAqB,MAAM;AAClC,OAAG,8FAA8F,MAAM;AACrG,SAAG,KAAK,iCAAiC;AACzC,SAAG,WAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC,EACrD,OAAO,YAAY,EACnB,KAAK,MAAM;AACd,SAAG,WAAW,UAAU,EAAE,MAAM,SAAS,CAAC,EAAE,MAAM;AAClD,SAAG,WAAW,WAAW,EAAE,MAAM,0DAA0D,CAAC,EAAE,OAAO,YAAY;AACjH,yCAAU;AAAA,IACZ,CAAC;AAED,OAAG,8EAA8E,MAAM;AACrF,SAAG,KAAK,8BAA8B;AACtC,SAAG,WAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC,EAAE,KAAK,UAAU;AACzE,SAAG,WAAW,UAAU,EAAE,MAAM,SAAS,CAAC,EAAE,MAAM;AAClD,SAAG,WAAW,WAAW,EAAE,MAAM,6CAA6C,CAAC,EAAE,OAAO,YAAY;AACpG,yCAAU;AAAA,IACZ,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../dpr/routes/journeys/request-report/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { ErrorRequestHandler, RequestHandler } from 'express'\nimport { captureException } from '@sentry/node'\nimport { Services } from '../../../types/Services'\nimport AsyncRequestUtils from './filters/utils'\nimport ErrorHandler from '../../../utils/ErrorHandler'\n\nclass RequestReportController {\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 errorHandler: ErrorRequestHandler = async (error, req, res, _next) => {\n captureException(error)\n res.render(`dpr/routes/journeys/view-report/error`, {\n layoutPath: this.layoutPath,\n ...(req.body && { ...req.body }),\n ...req.params,\n error: req.body?.error,\n params: req?.params,\n })\n }\n\n CANCEL: RequestHandler = async (req, res, _next) => {\n try {\n await AsyncRequestUtils.cancelRequest({\n req,\n res,\n services: this.services,\n })\n } catch (error) {\n req.body ??= {}\n req.body.title = 'Failed to abort request'\n req.body.errorDescription = 'We were unable to abort the report request for the following reason:'\n req.body.error = new ErrorHandler(error).formatError()\n\n req.flash('ERROR_BODY', JSON.stringify(req.body))\n req.flash('ERROR_PARAMS', JSON.stringify(req.params))\n req.flash('ERROR', JSON.stringify(req.body?.error || {}))\n\n return res.redirect(`${req.originalUrl}/failed`)\n }\n return res.redirect(req.originalUrl.replace('/cancel', '/status'))\n }\n}\n\nexport { RequestReportController }\nexport default RequestReportController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAiC;AAEjC,mBAA8B;AAC9B,0BAAyB;AAEzB,MAAM,wBAAwB;AAAA,EAC5B;AAAA,EAEA;AAAA,EAEA,YAAY,YAAoB,UAAoB;AAClD,SAAK,aAAa;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,eAAoC,OAAO,OAAO,KAAK,KAAK,UAAU;AACpE,sCAAiB,KAAK;AACtB,QAAI,OAAO,yCAAyC;AAAA,MAClD,YAAY,KAAK;AAAA,MACjB,GAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,KAAK;AAAA,MAC9B,GAAG,IAAI;AAAA,MACP,OAAO,IAAI,MAAM;AAAA,MACjB,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EAEA,SAAyB,OAAO,KAAK,KAAK,UAAU;AAClD,QAAI;AACF,YAAM,aAAAA,QAAkB,cAAc;AAAA,QACpC;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,MACjB,CAAC;AAAA,IACH,SAAS,OAAO;AACd,UAAI,SAAS,CAAC;AACd,UAAI,KAAK,QAAQ;AACjB,UAAI,KAAK,mBAAmB;AAC5B,UAAI,KAAK,QAAQ,IAAI,oBAAAC,QAAa,KAAK,EAAE,YAAY;AAErD,UAAI,MAAM,cAAc,KAAK,UAAU,IAAI,IAAI,CAAC;AAChD,UAAI,MAAM,gBAAgB,KAAK,UAAU,IAAI,MAAM,CAAC;AACpD,UAAI,MAAM,SAAS,KAAK,UAAU,IAAI,MAAM,SAAS,CAAC,CAAC,CAAC;AAExD,aAAO,IAAI,SAAS,GAAG,IAAI,WAAW,SAAS;AAAA,IACjD;AACA,WAAO,IAAI,SAAS,IAAI,YAAY,QAAQ,WAAW,SAAS,CAAC;AAAA,EACnE;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["AsyncRequestUtils", "ErrorHandler"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-report/filters/controller.ts"],
|
|
4
4
|
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../types/Services'\nimport { RequestDataResult } from '../../../../types/AsyncReportUtils'\nimport AysncRequestUtils from './utils'\nimport PersonalisationUtils from '../../../../utils/Personalisation/personalisationUtils'\nimport { FiltersType } from '../../../../components/_filters/filtersTypeEnum'\nimport ErrorHandler from '../../../../utils/ErrorHandler'\n\nclass RequestReportController {\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 // Render request page\n GET: RequestHandler = async (req, res, next) => {\n try {\n const requestRenderData = <RequestDataResult>await AysncRequestUtils.renderRequest({\n req,\n res,\n services: this.services,\n next,\n })\n\n res.render(`dpr/routes/journeys/request-report/filters/view`, {\n layoutPath: this.layoutPath,\n ...requestRenderData,\n })\n } catch (error) {\n req.body ??= {}\n req.body.title = 'Request failed'\n req.body.errorDescription = `Your ${req.params['type']} has failed to generate.`\n req.body.error = new ErrorHandler(error).formatError()\n next(req.body.error)\n }\n }\n\n // Request report\n POST: RequestHandler = async (req, res, next) => {\n try {\n const executionData = await AysncRequestUtils.request({\n req,\n res,\n services: this.services,\n next,\n })\n\n const { executionId, dataProductDefinitionsPath } = executionData\n\n if (executionId) {\n const redirect = dataProductDefinitionsPath\n ? `${executionId}/status?dataProductDefinitionsPath=${dataProductDefinitionsPath}`\n : `${executionId}/status`\n res.redirect(redirect)\n } else {\n res.end()\n }\n } catch (error) {\n const filters = AysncRequestUtils.getFiltersFromReqBody(req)\n\n req.body = {\n title: 'Request Failed',\n errorDescription: `Your ${req.params['type']} has failed to generate.`,\n error: new ErrorHandler(error).formatError(),\n retry: true,\n filters,\n ...(req.body && { ...req.body }),\n }\n next(error)\n }\n }\n\n saveDefaultFilterValues: RequestHandler = async (req, res, next) => {\n try {\n await PersonalisationUtils.saveDefaults(FiltersType.REQUEST, res, req, this.services)\n res.redirect(`${req.baseUrl}?defaultsSaved=true`)\n } catch (error) {\n req.body = {\n title: 'Failed to save defaults',\n error: new ErrorHandler(error).formatError(),\n ...(req.body && { ...req.body }),\n }\n next(error)\n }\n }\n\n removeDefaultFilterValues: RequestHandler = async (req, res, next) => {\n try {\n await PersonalisationUtils.removeDefaults(FiltersType.REQUEST, res, req, this.services)\n res.redirect(req.baseUrl)\n } catch (error) {\n req.body = {\n title: 'Failed to remove defaults',\n error: new ErrorHandler(error).formatError(),\n ...(req.body && { ...req.body }),\n }\n next(error)\n }\n }\n}\n\nexport { RequestReportController }\nexport default RequestReportController\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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kBAAkB,QAAQ,IAAI,OAAO,MAAM,CAAC;AAAA,QAC5C,OAAO,IAAI,oBAAAC,QAAa,KAAK,EAAE,YAAY;AAAA,QAC3C,OAAO;AAAA,QACP;AAAA,QACA,GAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,KAAK;AAAA,MAChC;AACA,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,0BAA0C,OAAO,KAAK,KAAK,SAAS;AAClE,QAAI;AACF,YAAM,4BAAAC,QAAqB,aAAa,mCAAY,SAAS,KAAK,KAAK,KAAK,QAAQ;AACpF,UAAI,SAAS,GAAG,IAAI,OAAO,qBAAqB;AAAA,IAClD,SAAS,OAAO;AACd,UAAI,OAAO;AAAA,QACT,OAAO;AAAA,QACP,OAAO,IAAI,oBAAAD,QAAa,KAAK,EAAE,YAAY;AAAA,QAC3C,GAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,KAAK;AAAA,MAChC;AACA,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,4BAA4C,OAAO,KAAK,KAAK,SAAS;AACpE,QAAI;AACF,YAAM,4BAAAC,QAAqB,eAAe,mCAAY,SAAS,KAAK,KAAK,KAAK,QAAQ;AACtF,UAAI,SAAS,IAAI,OAAO;AAAA,IAC1B,SAAS,OAAO;AACd,UAAI,OAAO;AAAA,QACT,OAAO;AAAA,QACP,OAAO,IAAI,oBAAAD,QAAa,KAAK,EAAE,YAAY;AAAA,QAC3C,GAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,KAAK;AAAA,MAChC;AACA,WAAK,KAAK;AAAA,IACZ;AAAA,EACF;AACF;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["AysncRequestUtils", "ErrorHandler", "PersonalisationUtils"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../dpr/routes/journeys/request-report/filters/routes.ts"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport RequestReportController from './controller'\nimport { Services } from '../../../../types/Services'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n const controller = new RequestReportController(layoutPath, services)\n\n router.get('/', controller.GET)\n router.post('/', controller.POST)\n router.post('/save-defaults', controller.saveDefaultFilterValues)\n router.post('/remove-defaults', controller.removeDefaultFilterValues)\n\n return router\n}\n\nexport default routes\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AACvB,wBAAoC;AAG7B,SAAS,OAAO,EAAE,YAAY,SAAS,GAA+C;AAC3F,QAAM,aAAS,uBAAO,EAAE,aAAa,KAAK,CAAC;AAC3C,QAAM,aAAa,IAAI,kBAAAA,QAAwB,YAAY,QAAQ;AAEnE,SAAO,IAAI,KAAK,WAAW,GAAG;AAC9B,SAAO,KAAK,KAAK,WAAW,IAAI;AAChC,SAAO,KAAK,kBAAkB,WAAW,uBAAuB;AAChE,SAAO,KAAK,oBAAoB,WAAW,yBAAyB;AAEpE,SAAO;AACT;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["RequestReportController"]
|