@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.19.0 → 4.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dpr/components/_async/async-polling/clientClass.mjs +0 -22
- package/dpr/components/_async/async-polling/view.njk +11 -8
- package/dpr/components/_catalogue/catalogue-list/utils.js +1 -1
- package/dpr/components/_catalogue/catalogue-list/utils.js.map +3 -3
- package/dpr/components/_catalogue/catalogue-list/utils.ts +50 -57
- package/dpr/components/_sync/sync-load/view.njk +1 -1
- package/dpr/components/user-reports/utils.js +1 -1
- package/dpr/components/user-reports/utils.js.map +2 -2
- package/dpr/components/user-reports/utils.ts +4 -4
- package/dpr/data/dashboardClient.js +1 -1
- package/dpr/data/dashboardClient.js.map +2 -2
- package/dpr/data/dashboardClient.ts +17 -0
- package/dpr/data/reportingClient.js +1 -1
- package/dpr/data/reportingClient.js.map +3 -3
- package/dpr/data/reportingClient.ts +1 -24
- package/dpr/middleware/setUpDprResources.js +1 -1
- package/dpr/middleware/setUpDprResources.js.map +3 -3
- package/dpr/middleware/setUpDprResources.ts +21 -3
- package/dpr/routes/authError.njk +10 -0
- package/dpr/routes/index.js +1 -1
- package/dpr/routes/index.js.map +3 -3
- package/dpr/routes/index.ts +7 -1
- package/dpr/routes/journeys/api-failures.cy.js +2 -0
- package/dpr/routes/journeys/api-failures.cy.js.map +7 -0
- package/dpr/routes/journeys/api-failures.cy.ts +377 -0
- package/dpr/routes/journeys/my-reports/bookmarks/service.js.map +2 -2
- package/dpr/routes/journeys/my-reports/bookmarks/service.ts +1 -0
- package/dpr/routes/journeys/request-report/controller.js +1 -1
- package/dpr/routes/journeys/request-report/controller.js.map +3 -3
- package/dpr/routes/journeys/request-report/controller.ts +25 -5
- package/dpr/routes/journeys/request-report/filters/controller.js +1 -1
- package/dpr/routes/journeys/request-report/filters/controller.js.map +2 -2
- package/dpr/routes/journeys/request-report/filters/controller.ts +1 -1
- package/dpr/routes/journeys/request-report/filters/utils.js +1 -1
- package/dpr/routes/journeys/request-report/filters/utils.js.map +2 -2
- package/dpr/routes/journeys/request-report/filters/utils.ts +1 -1
- package/dpr/routes/journeys/request-report/routes.js +1 -1
- package/dpr/routes/journeys/request-report/routes.js.map +3 -3
- package/dpr/routes/journeys/request-report/routes.ts +16 -0
- package/dpr/routes/journeys/request-report/status/controller.js +1 -1
- package/dpr/routes/journeys/request-report/status/controller.js.map +3 -3
- package/dpr/routes/journeys/request-report/status/controller.ts +0 -17
- package/dpr/routes/journeys/request-report/status/routes.js +1 -1
- package/dpr/routes/journeys/request-report/status/routes.js.map +2 -2
- package/dpr/routes/journeys/request-report/status/routes.ts +0 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +12 -4
- package/dpr/routes/journeys/view-report/sync/dashboard/controller.js +2 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/controller.js.map +7 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/controller.ts +39 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/routes.js +2 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/routes.js.map +7 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/routes.ts +18 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +2 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +7 -0
- package/dpr/routes/journeys/view-report/sync/dashboard/utils.ts +149 -0
- package/dpr/routes/journeys/view-report/sync/load-report/controller.js +1 -1
- package/dpr/routes/journeys/view-report/sync/load-report/controller.js.map +3 -3
- package/dpr/routes/journeys/view-report/sync/load-report/controller.ts +43 -13
- package/dpr/routes/journeys/view-report/sync/report/routes.js +1 -1
- package/dpr/routes/journeys/view-report/sync/report/routes.js.map +3 -3
- package/dpr/routes/journeys/view-report/sync/report/routes.ts +2 -2
- package/dpr/routes/journeys/view-report/sync/routes.js +1 -1
- package/dpr/routes/journeys/view-report/sync/routes.js.map +3 -3
- package/dpr/routes/journeys/view-report/sync/routes.ts +2 -0
- package/dpr/routes/journeys/view-report/sync/tests.cy.js +1 -1
- package/dpr/routes/journeys/view-report/sync/tests.cy.js.map +2 -2
- package/dpr/routes/journeys/view-report/sync/tests.cy.ts +21 -1
- package/dpr/routes/serviceProblem.njk +10 -0
- package/dpr/services/dashboardService.js +1 -1
- package/dpr/services/dashboardService.js.map +2 -2
- package/dpr/services/dashboardService.ts +9 -0
- package/dpr/types/api.d.js +1 -1
- package/dpr/types/api.d.js.map +1 -1
- package/dpr/types/api.d.ts +139 -3
- package/package.json +6 -7
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Request, Response } from 'express'
|
|
2
|
+
import Dict = NodeJS.Dict
|
|
3
|
+
|
|
4
|
+
import type { Services } from '../../../../../types/Services'
|
|
5
|
+
import { ReportType, RequestStatus } from '../../../../../types/UserReports'
|
|
6
|
+
import { FilterValue } from '../../../../../components/_filters/types'
|
|
7
|
+
import SelectedFiltersUtils from '../../../../../components/_filters/filters-selected/utils'
|
|
8
|
+
import LocalsHelper from '../../../../../utils/localsHelper'
|
|
9
|
+
import UserStoreItemBuilder from '../../../../../utils/UserStoreItemBuilder'
|
|
10
|
+
import { DashboardDataResponse } from '../../../../../types/Metrics'
|
|
11
|
+
import AsyncDashboardUtils from '../../async/dashboard/utils'
|
|
12
|
+
import { DashboardSection } from '../../../../../components/_dashboards/dashboard-visualisation/types'
|
|
13
|
+
import { components } from '../../../../../types/api'
|
|
14
|
+
import ReportActionsUtils from '../../../../../components/_reports/report-actions/utils'
|
|
15
|
+
|
|
16
|
+
const setAsRecentlyViewed = async ({
|
|
17
|
+
req,
|
|
18
|
+
services,
|
|
19
|
+
reportName,
|
|
20
|
+
name,
|
|
21
|
+
description,
|
|
22
|
+
reportId,
|
|
23
|
+
id,
|
|
24
|
+
userId,
|
|
25
|
+
filters,
|
|
26
|
+
}: {
|
|
27
|
+
req: Request
|
|
28
|
+
services: Services
|
|
29
|
+
reportName: string
|
|
30
|
+
name: string
|
|
31
|
+
description: string
|
|
32
|
+
reportId: string
|
|
33
|
+
id: string
|
|
34
|
+
userId: string
|
|
35
|
+
filters: FilterValue[]
|
|
36
|
+
}) => {
|
|
37
|
+
const stateData = {
|
|
38
|
+
type: ReportType.DASHBOARD,
|
|
39
|
+
reportId,
|
|
40
|
+
id,
|
|
41
|
+
reportName,
|
|
42
|
+
description,
|
|
43
|
+
name,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const interactiveQueryData: { query: Dict<string>; querySummary: Array<Dict<string>> } = {
|
|
47
|
+
query: <Dict<string>>req.query,
|
|
48
|
+
querySummary: SelectedFiltersUtils.getQuerySummary(<Dict<string>>req.query, filters),
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const recentlyViewedData = new UserStoreItemBuilder(stateData)
|
|
52
|
+
.addInteractiveQuery(interactiveQueryData)
|
|
53
|
+
.addStatus(RequestStatus.READY)
|
|
54
|
+
.addTimestamp()
|
|
55
|
+
.addReportUrls(req)
|
|
56
|
+
.build()
|
|
57
|
+
|
|
58
|
+
await services.recentlyViewedService.setRecentlyViewed(recentlyViewedData, userId)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const renderSyncDashboard = async ({
|
|
62
|
+
req,
|
|
63
|
+
res,
|
|
64
|
+
services,
|
|
65
|
+
}: {
|
|
66
|
+
req: Request
|
|
67
|
+
res: Response
|
|
68
|
+
services: Services
|
|
69
|
+
}) => {
|
|
70
|
+
const { token, csrfToken, dprUser, nestedBaseUrl } = LocalsHelper.getValues(res)
|
|
71
|
+
const { reportId, id } = req.params
|
|
72
|
+
const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`
|
|
73
|
+
|
|
74
|
+
const {
|
|
75
|
+
query,
|
|
76
|
+
filters: filterData,
|
|
77
|
+
reportDefinition,
|
|
78
|
+
dashboardDefinition,
|
|
79
|
+
} = await AsyncDashboardUtils.getDefinitionData({
|
|
80
|
+
req,
|
|
81
|
+
res,
|
|
82
|
+
services,
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const dashboardData: DashboardDataResponse[][] = await services.dashboardService.getSyncDashboard(
|
|
86
|
+
token,
|
|
87
|
+
reportId,
|
|
88
|
+
reportId,
|
|
89
|
+
query,
|
|
90
|
+
)
|
|
91
|
+
const flattenedData: DashboardDataResponse[] = dashboardData.flat()
|
|
92
|
+
|
|
93
|
+
// Get the dashboard parts
|
|
94
|
+
const sections: DashboardSection[] = AsyncDashboardUtils.getSections(dashboardDefinition, flattenedData, query)
|
|
95
|
+
|
|
96
|
+
await setAsRecentlyViewed({
|
|
97
|
+
req,
|
|
98
|
+
services,
|
|
99
|
+
reportName: reportDefinition.name,
|
|
100
|
+
name: dashboardDefinition.name,
|
|
101
|
+
description: dashboardDefinition.description || reportDefinition.description || '',
|
|
102
|
+
reportId,
|
|
103
|
+
id,
|
|
104
|
+
userId: dprUser.id,
|
|
105
|
+
filters: filterData.filters,
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
dashboardData: {
|
|
110
|
+
token,
|
|
111
|
+
id,
|
|
112
|
+
reportId,
|
|
113
|
+
name: dashboardDefinition.name,
|
|
114
|
+
description: dashboardDefinition.description,
|
|
115
|
+
reportName: reportDefinition.name,
|
|
116
|
+
bookmarked: await services.bookmarkService.isBookmarked(id, reportId, dprUser.id),
|
|
117
|
+
nestedBaseUrl,
|
|
118
|
+
csrfToken,
|
|
119
|
+
sections,
|
|
120
|
+
filters: filterData,
|
|
121
|
+
type: ReportType.DASHBOARD,
|
|
122
|
+
actions: setActions(dashboardDefinition, reportDefinition, fullUrl),
|
|
123
|
+
},
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const setActions = (
|
|
128
|
+
definition: components['schemas']['DashboardDefinition'],
|
|
129
|
+
summaryDefinition: components['schemas']['ReportDefinitionSummary'],
|
|
130
|
+
url: string,
|
|
131
|
+
) => {
|
|
132
|
+
const { name: reportName } = summaryDefinition
|
|
133
|
+
const { name } = definition
|
|
134
|
+
|
|
135
|
+
return ReportActionsUtils.getActions({
|
|
136
|
+
share: {
|
|
137
|
+
reportName,
|
|
138
|
+
name,
|
|
139
|
+
url,
|
|
140
|
+
},
|
|
141
|
+
copy: {
|
|
142
|
+
url,
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default {
|
|
148
|
+
renderSyncDashboard,
|
|
149
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var w=Object.create;var a=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var i in e)a(t,i,{get:e[i],enumerable:!0})},v=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of T(e))!q.call(t,r)&&r!==i&&a(t,r,{get:()=>e[r],enumerable:!(n=H(e,r))||n.enumerable});return t};var E=(t,e,i)=>(i=t!=null?w(b(t)):{},v(e||!t||!t.__esModule?a(i,"default",{value:t,enumerable:!0}):i,t)),L=t=>v(a({},"__esModule",{value:!0}),t);var j={};x(j,{LoadReportController:()=>f,default:()=>V});module.exports=L(j);var y=E(require("../../../../../utils/localsHelper")),g=require("../../../../../types/UserReports");class f{constructor(e,i){this.GET=async(e,i,n)=>{try{const{token:r}=y.default.getValues(i),{reportId:s,id:c,type:u}=e.params,{dataProductDefinitionsPath:p}=e.query,D=await this.services.reportingService.getDefinitionSummary(r,s,p);let o,h,d,m;if(u===g.ReportType.REPORT){o=await this.services.reportingService.getDefinition(r,s,c,p);const{variant:l}=o;h=l.classification,d=l.description,m=l.name}else o=await this.services.dashboardService.getDefinition(r,s,c,p),d=o.description,m=o.name;const{name:S,description:P}=D,R={reportId:s,id:c,type:u,reportName:S,name:m,classification:h,description:d||P};i.render("dpr/routes/journeys/view-report/sync/load-report/view",{renderData:R,layoutPath:this.layoutPath})}catch{n()}};this.layoutPath=e,this.services=i}}var V=f;0&&(module.exports={LoadReportController});
|
|
2
2
|
//# sourceMappingURL=controller.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/dpr/routes/journeys/view-report/sync/load-report/controller.ts"],
|
|
4
|
-
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../../types/Services'\nimport LocalsHelper from '../../../../../utils/localsHelper'\nimport { ReportType } from '../../../../../types/UserReports'\n\nclass LoadReportController {\n layoutPath: string\n\n services: Services\n\n constructor(layoutPath: string, services: Services) {\n this.layoutPath = layoutPath\n this.services = services\n }\n\n GET: RequestHandler = async (req, res, next) => {\n try {\n const { token } = LocalsHelper.getValues(res)\n const { reportId, id } = req.params\n const { dataProductDefinitionsPath } = req.query\n\n const
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAEA,IAAAK,EAAyB,gDACzBC,EAA2B,
|
|
6
|
-
"names": ["controller_exports", "__export", "LoadReportController", "controller_default", "__toCommonJS", "import_localsHelper", "import_UserReports", "layoutPath", "services", "req", "res", "next", "token", "LocalsHelper", "reportId", "id", "dataProductDefinitionsPath", "definition", "
|
|
4
|
+
"sourcesContent": ["import { RequestHandler } from 'express'\nimport { Services } from '../../../../../types/Services'\nimport LocalsHelper from '../../../../../utils/localsHelper'\nimport { ReportType } from '../../../../../types/UserReports'\nimport { components } from '../../../../../types/api'\n\nclass LoadReportController {\n layoutPath: string\n\n services: Services\n\n constructor(layoutPath: string, services: Services) {\n this.layoutPath = layoutPath\n this.services = services\n }\n\n GET: RequestHandler = async (req, res, next) => {\n try {\n const { token } = LocalsHelper.getValues(res)\n const { reportId, id, type } = req.params\n const { dataProductDefinitionsPath } = req.query\n\n const definitionSummary = await this.services.reportingService.getDefinitionSummary(\n token,\n reportId,\n <string | undefined>dataProductDefinitionsPath,\n )\n\n let definition:\n | components['schemas']['SingleVariantReportDefinition']\n | components['schemas']['DashboardDefinition']\n\n let classification\n let description\n let name\n if (type === ReportType.REPORT) {\n definition = await this.services.reportingService.getDefinition(\n token,\n reportId,\n id,\n <string | undefined>dataProductDefinitionsPath,\n )\n const { variant } = definition\n classification = variant.classification\n description = variant.description\n name = variant.name\n } else {\n definition = await this.services.dashboardService.getDefinition(\n token,\n reportId,\n id,\n <string | undefined>dataProductDefinitionsPath,\n )\n description = definition.description\n name = definition.name\n }\n const { name: reportName, description: reportDescription } = definitionSummary\n\n const renderData = {\n reportId,\n id,\n type,\n reportName,\n name,\n classification,\n description: description || reportDescription,\n }\n\n res.render(`dpr/routes/journeys/view-report/sync/load-report/view`, {\n renderData,\n layoutPath: this.layoutPath,\n })\n } catch (error) {\n next()\n }\n }\n}\n\nexport { LoadReportController }\nexport default LoadReportController\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAEA,IAAAK,EAAyB,gDACzBC,EAA2B,4CAG3B,MAAMJ,CAAqB,CAKzB,YAAYK,EAAoBC,EAAoB,CAKpD,SAAsB,MAAOC,EAAKC,EAAKC,IAAS,CAC9C,GAAI,CACF,KAAM,CAAE,MAAAC,CAAM,EAAI,EAAAC,QAAa,UAAUH,CAAG,EACtC,CAAE,SAAAI,EAAU,GAAAC,EAAI,KAAAC,CAAK,EAAIP,EAAI,OAC7B,CAAE,2BAAAQ,CAA2B,EAAIR,EAAI,MAErCS,EAAoB,MAAM,KAAK,SAAS,iBAAiB,qBAC7DN,EACAE,EACoBG,CACtB,EAEA,IAAIE,EAIAC,EACAC,EACAC,EACJ,GAAIN,IAAS,aAAW,OAAQ,CAC9BG,EAAa,MAAM,KAAK,SAAS,iBAAiB,cAChDP,EACAE,EACAC,EACoBE,CACtB,EACA,KAAM,CAAE,QAAAM,CAAQ,EAAIJ,EACpBC,EAAiBG,EAAQ,eACzBF,EAAcE,EAAQ,YACtBD,EAAOC,EAAQ,IACjB,MACEJ,EAAa,MAAM,KAAK,SAAS,iBAAiB,cAChDP,EACAE,EACAC,EACoBE,CACtB,EACAI,EAAcF,EAAW,YACzBG,EAAOH,EAAW,KAEpB,KAAM,CAAE,KAAMK,EAAY,YAAaC,CAAkB,EAAIP,EAEvDQ,EAAa,CACjB,SAAAZ,EACA,GAAAC,EACA,KAAAC,EACA,WAAAQ,EACA,KAAAF,EACA,eAAAF,EACA,YAAaC,GAAeI,CAC9B,EAEAf,EAAI,OAAO,wDAAyD,CAClE,WAAAgB,EACA,WAAY,KAAK,UACnB,CAAC,CACH,MAAgB,CACdf,EAAK,CACP,CACF,EA/DE,KAAK,WAAaJ,EAClB,KAAK,SAAWC,CAClB,CA8DF,CAGA,IAAOL,EAAQD",
|
|
6
|
+
"names": ["controller_exports", "__export", "LoadReportController", "controller_default", "__toCommonJS", "import_localsHelper", "import_UserReports", "layoutPath", "services", "req", "res", "next", "token", "LocalsHelper", "reportId", "id", "type", "dataProductDefinitionsPath", "definitionSummary", "definition", "classification", "description", "name", "variant", "reportName", "reportDescription", "renderData"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,7 @@ import { RequestHandler } from 'express'
|
|
|
2
2
|
import { Services } from '../../../../../types/Services'
|
|
3
3
|
import LocalsHelper from '../../../../../utils/localsHelper'
|
|
4
4
|
import { ReportType } from '../../../../../types/UserReports'
|
|
5
|
+
import { components } from '../../../../../types/api'
|
|
5
6
|
|
|
6
7
|
class LoadReportController {
|
|
7
8
|
layoutPath: string
|
|
@@ -16,28 +17,57 @@ class LoadReportController {
|
|
|
16
17
|
GET: RequestHandler = async (req, res, next) => {
|
|
17
18
|
try {
|
|
18
19
|
const { token } = LocalsHelper.getValues(res)
|
|
19
|
-
const { reportId, id } = req.params
|
|
20
|
+
const { reportId, id, type } = req.params
|
|
20
21
|
const { dataProductDefinitionsPath } = req.query
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
+
const definitionSummary = await this.services.reportingService.getDefinitionSummary(
|
|
23
24
|
token,
|
|
24
25
|
reportId,
|
|
25
|
-
id,
|
|
26
26
|
<string | undefined>dataProductDefinitionsPath,
|
|
27
27
|
)
|
|
28
|
-
const { name: reportName, variant, description: reportDescription } = definition
|
|
29
|
-
const { classification, description, name } = variant
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
let definition:
|
|
30
|
+
| components['schemas']['SingleVariantReportDefinition']
|
|
31
|
+
| components['schemas']['DashboardDefinition']
|
|
32
|
+
|
|
33
|
+
let classification
|
|
34
|
+
let description
|
|
35
|
+
let name
|
|
36
|
+
if (type === ReportType.REPORT) {
|
|
37
|
+
definition = await this.services.reportingService.getDefinition(
|
|
38
|
+
token,
|
|
39
|
+
reportId,
|
|
40
|
+
id,
|
|
41
|
+
<string | undefined>dataProductDefinitionsPath,
|
|
42
|
+
)
|
|
43
|
+
const { variant } = definition
|
|
44
|
+
classification = variant.classification
|
|
45
|
+
description = variant.description
|
|
46
|
+
name = variant.name
|
|
47
|
+
} else {
|
|
48
|
+
definition = await this.services.dashboardService.getDefinition(
|
|
49
|
+
token,
|
|
33
50
|
reportId,
|
|
34
51
|
id,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
<string | undefined>dataProductDefinitionsPath,
|
|
53
|
+
)
|
|
54
|
+
description = definition.description
|
|
55
|
+
name = definition.name
|
|
56
|
+
}
|
|
57
|
+
const { name: reportName, description: reportDescription } = definitionSummary
|
|
58
|
+
|
|
59
|
+
const renderData = {
|
|
60
|
+
reportId,
|
|
61
|
+
id,
|
|
62
|
+
type,
|
|
63
|
+
reportName,
|
|
64
|
+
name,
|
|
65
|
+
classification,
|
|
66
|
+
description: description || reportDescription,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
res.render(`dpr/routes/journeys/view-report/sync/load-report/view`, {
|
|
70
|
+
renderData,
|
|
41
71
|
layoutPath: this.layoutPath,
|
|
42
72
|
})
|
|
43
73
|
} catch (error) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.create;var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var v=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},a=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of f(r))!d.call(e,l)&&l!==t&&s(e,l,{get:()=>r[l],enumerable:!(o=m(r,l))||o.enumerable});return e};var y=(e,r,t)=>(t=e!=null?n(c(e)):{},a(r||!e||!e.__esModule?s(t,"default",{value:e,enumerable:!0}):t,e)),g=e=>a(s({},"__esModule",{value:!0}),e);var F={};v(F,{default:()=>w,routes:()=>i});module.exports=g(F);var p=require("express"),u=y(require("./controller"));function i({layoutPath:e,services:r}){const t=(0,p.Router)({mergeParams:!0}),o=new u.default(e,r);return t.get(["/","/download-disabled"],o.GET),t.post("/apply-filters",o.applyFilters),t.post("/apply-columns",o.applyColumns),t.post("/save-defaults",o.saveDefaultFilterValues),t.post("/remove-defaults",o.removeDefaultFilterValues),t}var w=i;0&&(module.exports={routes});
|
|
2
2
|
//# sourceMappingURL=routes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/dpr/routes/journeys/view-report/sync/report/routes.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,WAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAuB,mBACvBC,
|
|
6
|
-
"names": ["routes_exports", "__export", "routes_default", "routes", "__toCommonJS", "import_express", "import_controller", "layoutPath", "services", "router", "controller", "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport ViewSyncReportController 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 ViewSyncReportController(layoutPath, services)\n\n router.get([`/`, `/download-disabled`], controller.GET)\n\n // Interactive controls\n router.post('/apply-filters', controller.applyFilters)\n router.post('/apply-columns', controller.applyColumns)\n\n // User defined defaults\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
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,WAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAuB,mBACvBC,EAAqC,2BAG9B,SAASH,EAAO,CAAE,WAAAI,EAAY,SAAAC,CAAS,EAA+C,CAC3F,MAAMC,KAAS,UAAO,CAAE,YAAa,EAAK,CAAC,EACrCC,EAAa,IAAI,EAAAC,QAAyBJ,EAAYC,CAAQ,EAEpE,OAAAC,EAAO,IAAI,CAAC,IAAK,oBAAoB,EAAGC,EAAW,GAAG,EAGtDD,EAAO,KAAK,iBAAkBC,EAAW,YAAY,EACrDD,EAAO,KAAK,iBAAkBC,EAAW,YAAY,EAGrDD,EAAO,KAAK,iBAAkBC,EAAW,uBAAuB,EAChED,EAAO,KAAK,mBAAoBC,EAAW,yBAAyB,EAE7DD,CACT,CAEA,IAAOP,EAAQC",
|
|
6
|
+
"names": ["routes_exports", "__export", "routes_default", "routes", "__toCommonJS", "import_express", "import_controller", "layoutPath", "services", "router", "controller", "ViewSyncReportController"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
import { Router } from 'express'
|
|
3
|
-
import
|
|
3
|
+
import ViewSyncReportController from './controller'
|
|
4
4
|
import { Services } from '../../../../../types/Services'
|
|
5
5
|
|
|
6
6
|
export function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {
|
|
7
7
|
const router = Router({ mergeParams: true })
|
|
8
|
-
const controller = new
|
|
8
|
+
const controller = new ViewSyncReportController(layoutPath, services)
|
|
9
9
|
|
|
10
10
|
router.get([`/`, `/download-disabled`], controller.GET)
|
|
11
11
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var b=Object.create;var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var c=(r,o)=>{for(var e in o)m(r,e,{get:o[e],enumerable:!0})},s=(r,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of w(o))!S.call(r,t)&&t!==e&&m(r,t,{get:()=>o[t],enumerable:!(i=g(o,t))||i.enumerable});return r};var p=(r,o,e)=>(e=r!=null?b(x(r)):{},s(o||!r||!r.__esModule?m(e,"default",{value:r,enumerable:!0}):e,r)),v=r=>s(m({},"__esModule",{value:!0}),r);var D={};c(D,{default:()=>A,routes:()=>a});module.exports=v(D);var f=require("express"),d=p(require("./load-report/routes")),R=p(require("./report/routes")),n=p(require("./dashboard/routes")),u=p(require("../../../../middleware/reportAuthoriser"));function a({layoutPath:r,services:o}){const e=(0,f.Router)({mergeParams:!0});return e.use("/report",(0,u.default)(o,r),(0,R.default)({layoutPath:r,services:o})),e.use("/dashboard",(0,u.default)(o,r),(0,n.default)({layoutPath:r,services:o})),e.use("/load-report",(0,d.default)({layoutPath:r,services:o})),e}var A=a;0&&(module.exports={routes});
|
|
2
2
|
//# sourceMappingURL=routes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/dpr/routes/journeys/view-report/sync/routes.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport { Services } from '../../../../types/Services'\n\n// Routes\nimport loadReportRoutes from './load-report/routes'\nimport viewReportRoutes from './report/routes'\n\n// middleware\nimport reportAuthoriser from '../../../../middleware/reportAuthoriser'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n\n router.use('/report', reportAuthoriser(services, layoutPath), viewReportRoutes({ layoutPath, services }))\n router.use(`/load-report`, loadReportRoutes({ layoutPath, services }))\n\n return router\n}\n\nexport default routes\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,WAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAuB,mBAIvBC,EAA6B,mCAC7BA,EAA6B,
|
|
6
|
-
"names": ["routes_exports", "__export", "routes_default", "routes", "__toCommonJS", "import_express", "import_routes", "import_reportAuthoriser", "layoutPath", "services", "router", "reportAuthoriser", "viewReportRoutes", "loadReportRoutes"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Router } from 'express'\nimport { Services } from '../../../../types/Services'\n\n// Routes\nimport loadReportRoutes from './load-report/routes'\nimport viewReportRoutes from './report/routes'\nimport viewDashboardRoutes from './dashboard/routes'\n\n// middleware\nimport reportAuthoriser from '../../../../middleware/reportAuthoriser'\n\nexport function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {\n const router = Router({ mergeParams: true })\n\n router.use('/report', reportAuthoriser(services, layoutPath), viewReportRoutes({ layoutPath, services }))\n router.use('/dashboard', reportAuthoriser(services, layoutPath), viewDashboardRoutes({ layoutPath, services }))\n router.use(`/load-report`, loadReportRoutes({ layoutPath, services }))\n\n return router\n}\n\nexport default routes\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,WAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAuB,mBAIvBC,EAA6B,mCAC7BA,EAA6B,8BAC7BA,EAAgC,iCAGhCC,EAA6B,sDAEtB,SAASJ,EAAO,CAAE,WAAAK,EAAY,SAAAC,CAAS,EAA+C,CAC3F,MAAMC,KAAS,UAAO,CAAE,YAAa,EAAK,CAAC,EAE3C,OAAAA,EAAO,IAAI,aAAW,EAAAC,SAAiBF,EAAUD,CAAU,KAAG,EAAAI,SAAiB,CAAE,WAAAJ,EAAY,SAAAC,CAAS,CAAC,CAAC,EACxGC,EAAO,IAAI,gBAAc,EAAAC,SAAiBF,EAAUD,CAAU,KAAG,EAAAK,SAAoB,CAAE,WAAAL,EAAY,SAAAC,CAAS,CAAC,CAAC,EAC9GC,EAAO,IAAI,kBAAgB,EAAAI,SAAiB,CAAE,WAAAN,EAAY,SAAAC,CAAS,CAAC,CAAC,EAE9DC,CACT,CAEA,IAAOR,EAAQC",
|
|
6
|
+
"names": ["routes_exports", "__export", "routes_default", "routes", "__toCommonJS", "import_express", "import_routes", "import_reportAuthoriser", "layoutPath", "services", "router", "reportAuthoriser", "viewReportRoutes", "viewDashboardRoutes", "loadReportRoutes"]
|
|
7
7
|
}
|
|
@@ -5,6 +5,7 @@ import { Services } from '../../../../types/Services'
|
|
|
5
5
|
// Routes
|
|
6
6
|
import loadReportRoutes from './load-report/routes'
|
|
7
7
|
import viewReportRoutes from './report/routes'
|
|
8
|
+
import viewDashboardRoutes from './dashboard/routes'
|
|
8
9
|
|
|
9
10
|
// middleware
|
|
10
11
|
import reportAuthoriser from '../../../../middleware/reportAuthoriser'
|
|
@@ -13,6 +14,7 @@ export function routes({ layoutPath, services }: { layoutPath: string; services:
|
|
|
13
14
|
const router = Router({ mergeParams: true })
|
|
14
15
|
|
|
15
16
|
router.use('/report', reportAuthoriser(services, layoutPath), viewReportRoutes({ layoutPath, services }))
|
|
17
|
+
router.use('/dashboard', reportAuthoriser(services, layoutPath), viewDashboardRoutes({ layoutPath, services }))
|
|
16
18
|
router.use(`/load-report`, loadReportRoutes({ layoutPath, services }))
|
|
17
19
|
|
|
18
20
|
return router
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../../../../../../cypress-tests/cypressUtils");context("Platform sync tests",()=>{const
|
|
1
|
+
"use strict";var e=require("../../../../../../cypress-tests/cypressUtils");context("Platform sync tests",()=>{const s="/embedded/platform/";describe("Sync tests from the platform",()=>{before(()=>{(0,e.executeDashboardStubs)(),(0,e.executeReportStubs)(),cy.task("stubDefinitionSyncReport"),cy.task("stubDefinitionSyncDashboard"),cy.task("stubRequestSuccessResult20"),cy.task("stubSyncRequestDataSuccess"),cy.task("stubSyncDashboardRequestDataSuccess"),cy.task("stubSyncRequestDataSuccessCount")}),it("should load a sync report",()=>{cy.visit(s),cy.findByLabelText(/Reports catalogue.*/i).within(()=>{cy.findByRole("row",{name:(n,t)=>!!t.textContent?.includes("This is an sync report")}).within(()=>{cy.findByRole("link",{name:/Load report/}).click()})}),cy.findByRole("heading",{name:/Sync report/,level:1}).should("be.visible")}),it("should load a sync dashboard",()=>{cy.visit(s),cy.findByLabelText(/Reports catalogue.*/i).within(()=>{cy.findByRole("row",{name:(n,t)=>!!t.textContent?.includes("Sync Dashboard used for testing")}).within(()=>{cy.findByRole("link",{name:/Load dashboard/}).click()})}),cy.findByRole("heading",{name:/Sync Dashboard/,level:1}).should("be.visible")})})});
|
|
2
2
|
//# sourceMappingURL=tests.cy.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/dpr/routes/journeys/view-report/sync/tests.cy.ts"],
|
|
4
|
-
"sourcesContent": ["import { executeReportStubs } from '../../../../../../cypress-tests/cypressUtils'\n\ncontext('Platform sync tests', () => {\n const path = '/embedded/platform/'\n\n describe('Sync tests from the platform', () => {\n before(() => {\n executeReportStubs()\n cy.task('stubDefinitionSyncReport')\n cy.task('stubRequestSuccessResult20')\n cy.task('stubSyncRequestDataSuccess')\n cy.task('stubSyncRequestDataSuccessCount')\n })\n it('should load a sync report', () => {\n cy.visit(path)\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('This is an sync report'))\n },\n }).within(() => {\n cy.findByRole('link', { name: /Load report/ }).click()\n })\n })\n\n cy.findByRole('heading', { name: /Sync report/, level: 1 }).should('be.visible')\n })\n })\n})\n"],
|
|
5
|
-
"mappings": "aAAA,IAAAA,
|
|
4
|
+
"sourcesContent": ["import { executeReportStubs, executeDashboardStubs } from '../../../../../../cypress-tests/cypressUtils'\n\ncontext('Platform sync tests', () => {\n const path = '/embedded/platform/'\n\n describe('Sync tests from the platform', () => {\n before(() => {\n executeDashboardStubs()\n executeReportStubs()\n cy.task('stubDefinitionSyncReport')\n cy.task('stubDefinitionSyncDashboard')\n cy.task('stubRequestSuccessResult20')\n cy.task('stubSyncRequestDataSuccess')\n cy.task('stubSyncDashboardRequestDataSuccess')\n cy.task('stubSyncRequestDataSuccessCount')\n })\n\n it('should load a sync report', () => {\n cy.visit(path)\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('This is an sync report'))\n },\n }).within(() => {\n cy.findByRole('link', { name: /Load report/ }).click()\n })\n })\n\n cy.findByRole('heading', { name: /Sync report/, level: 1 }).should('be.visible')\n })\n\n it('should load a sync dashboard', () => {\n cy.visit(path)\n\n cy.findByLabelText(/Reports catalogue.*/i).within(() => {\n cy.findByRole('row', {\n name: (_, element) => {\n return Boolean(element.textContent?.includes('Sync Dashboard used for testing'))\n },\n }).within(() => {\n cy.findByRole('link', { name: /Load dashboard/ }).click()\n })\n })\n\n cy.findByRole('heading', { name: /Sync Dashboard/, level: 1 }).should('be.visible')\n })\n })\n})\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAA0D,wDAE1D,QAAQ,sBAAuB,IAAM,CACnC,MAAMC,EAAO,sBAEb,SAAS,+BAAgC,IAAM,CAC7C,OAAO,IAAM,IACX,yBAAsB,KACtB,sBAAmB,EACnB,GAAG,KAAK,0BAA0B,EAClC,GAAG,KAAK,6BAA6B,EACrC,GAAG,KAAK,4BAA4B,EACpC,GAAG,KAAK,4BAA4B,EACpC,GAAG,KAAK,qCAAqC,EAC7C,GAAG,KAAK,iCAAiC,CAC3C,CAAC,EAED,GAAG,4BAA6B,IAAM,CACpC,GAAG,MAAMA,CAAI,EAEb,GAAG,gBAAgB,sBAAsB,EAAE,OAAO,IAAM,CACtD,GAAG,WAAW,MAAO,CACnB,KAAM,CAACC,EAAGC,IACD,EAAQA,EAAQ,aAAa,SAAS,wBAAwB,CAEzE,CAAC,EAAE,OAAO,IAAM,CACd,GAAG,WAAW,OAAQ,CAAE,KAAM,aAAc,CAAC,EAAE,MAAM,CACvD,CAAC,CACH,CAAC,EAED,GAAG,WAAW,UAAW,CAAE,KAAM,cAAe,MAAO,CAAE,CAAC,EAAE,OAAO,YAAY,CACjF,CAAC,EAED,GAAG,+BAAgC,IAAM,CACvC,GAAG,MAAMF,CAAI,EAEb,GAAG,gBAAgB,sBAAsB,EAAE,OAAO,IAAM,CACtD,GAAG,WAAW,MAAO,CACnB,KAAM,CAACC,EAAGC,IACD,EAAQA,EAAQ,aAAa,SAAS,iCAAiC,CAElF,CAAC,EAAE,OAAO,IAAM,CACd,GAAG,WAAW,OAAQ,CAAE,KAAM,gBAAiB,CAAC,EAAE,MAAM,CAC1D,CAAC,CACH,CAAC,EAED,GAAG,WAAW,UAAW,CAAE,KAAM,iBAAkB,MAAO,CAAE,CAAC,EAAE,OAAO,YAAY,CACpF,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["import_cypressUtils", "path", "_", "element"]
|
|
7
7
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { executeReportStubs } from '../../../../../../cypress-tests/cypressUtils'
|
|
1
|
+
import { executeReportStubs, executeDashboardStubs } from '../../../../../../cypress-tests/cypressUtils'
|
|
2
2
|
|
|
3
3
|
context('Platform sync tests', () => {
|
|
4
4
|
const path = '/embedded/platform/'
|
|
5
5
|
|
|
6
6
|
describe('Sync tests from the platform', () => {
|
|
7
7
|
before(() => {
|
|
8
|
+
executeDashboardStubs()
|
|
8
9
|
executeReportStubs()
|
|
9
10
|
cy.task('stubDefinitionSyncReport')
|
|
11
|
+
cy.task('stubDefinitionSyncDashboard')
|
|
10
12
|
cy.task('stubRequestSuccessResult20')
|
|
11
13
|
cy.task('stubSyncRequestDataSuccess')
|
|
14
|
+
cy.task('stubSyncDashboardRequestDataSuccess')
|
|
12
15
|
cy.task('stubSyncRequestDataSuccessCount')
|
|
13
16
|
})
|
|
17
|
+
|
|
14
18
|
it('should load a sync report', () => {
|
|
15
19
|
cy.visit(path)
|
|
16
20
|
|
|
@@ -26,5 +30,21 @@ context('Platform sync tests', () => {
|
|
|
26
30
|
|
|
27
31
|
cy.findByRole('heading', { name: /Sync report/, level: 1 }).should('be.visible')
|
|
28
32
|
})
|
|
33
|
+
|
|
34
|
+
it('should load a sync dashboard', () => {
|
|
35
|
+
cy.visit(path)
|
|
36
|
+
|
|
37
|
+
cy.findByLabelText(/Reports catalogue.*/i).within(() => {
|
|
38
|
+
cy.findByRole('row', {
|
|
39
|
+
name: (_, element) => {
|
|
40
|
+
return Boolean(element.textContent?.includes('Sync Dashboard used for testing'))
|
|
41
|
+
},
|
|
42
|
+
}).within(() => {
|
|
43
|
+
cy.findByRole('link', { name: /Load dashboard/ }).click()
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
cy.findByRole('heading', { name: /Sync Dashboard/, level: 1 }).should('be.visible')
|
|
48
|
+
})
|
|
29
49
|
})
|
|
30
50
|
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{% extends layoutPath %}
|
|
2
|
+
|
|
3
|
+
{% block content %}
|
|
4
|
+
<h1 class="govuk-heading-xl">{{ message | default("Sorry, there is a problem with the service.") }}</h1>
|
|
5
|
+
<p>The problem has been reported to the service team.</p>
|
|
6
|
+
<p>Try again later.</p>
|
|
7
|
+
<h2 class="govuk-heading-m">Get help</h2>
|
|
8
|
+
<p>Contact the helpdesk on 0800 917 5148 or #6598 from inside an establishment.</p>
|
|
9
|
+
<p><a class="govuk-link--no-visited-state" href="{{ digitalPrisonServicesUrl }}">Go to digital services home page</a></p>
|
|
10
|
+
{% endblock %}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var D=(i,t)=>{for(var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var D=(i,t)=>{for(var r in t)a(i,r,{get:t[r],enumerable:!0})},b=(i,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of d(t))!h.call(i,s)&&s!==r&&a(i,s,{get:()=>t[s],enumerable:!(n=c(t,s))||n.enumerable});return i};var m=i=>b(a({},"__esModule",{value:!0}),i);var y={};D(y,{DashboardService:()=>o,default:()=>u});module.exports=m(y);class o{constructor(t){this.dashboardClient=t;this.dashboardClient=t}async getDefinition(t,r,n,s,e){return this.dashboardClient.getDefinition(t,n,r,s,e)}async requestAsyncDashboard(t,r,n,s){return this.dashboardClient.requestAsyncDashboard(t,r,n,s)}async cancelAsyncRequest(t,r,n,s,e){return this.dashboardClient.cancelAsyncRequest(t,r,n,s,e)}async getAsyncStatus(t,r,n,s,e,g){return this.dashboardClient.getAsyncStatus(t,r,n,s,e,g)}async getAsyncDashboard(t,r,n,s,e){return this.dashboardClient.getAsyncDashboard(t,n,r,s,e)}async getSyncDashboard(t,r,n,s){return this.dashboardClient.getSyncDashboard(t,n,r,s)}}var u=o;0&&(module.exports={DashboardService});
|
|
2
2
|
//# sourceMappingURL=dashboardService.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/dpr/services/dashboardService.ts"],
|
|
4
|
-
"sourcesContent": ["import Dict = NodeJS.Dict\nimport DashboardClient from '../data/dashboardClient'\nimport { components } from '../types/api'\nimport { DashboardDataResponse } from '../types/Metrics'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nclass DashboardService {\n constructor(private readonly dashboardClient: DashboardClient) {\n this.dashboardClient = dashboardClient\n }\n\n async getDefinition(\n token: string,\n dpdId: string,\n id: string,\n dataProductDefinitionsPath?: string,\n query?: Dict<string | string[]> | undefined,\n ): Promise<components['schemas']['DashboardDefinition']> {\n return this.dashboardClient.getDefinition(token, id, dpdId, dataProductDefinitionsPath, query)\n }\n\n async requestAsyncDashboard(\n token: string,\n reportId: string,\n dashboardId: string,\n query: Record<string, string | boolean | number>,\n ): Promise<Dict<string>> {\n return this.dashboardClient.requestAsyncDashboard(token, reportId, dashboardId, query)\n }\n\n async cancelAsyncRequest(\n token: string,\n reportId: string,\n dashboardId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n ): Promise<Dict<string>> {\n return this.dashboardClient.cancelAsyncRequest(\n token,\n reportId,\n dashboardId,\n executionId,\n dataProductDefinitionsPath,\n )\n }\n\n async getAsyncStatus(\n token: string,\n reportId: string,\n dashboardId: string,\n executionId: string,\n tableId?: string,\n dataProductDefinitionsPath?: string,\n ): Promise<components['schemas']['StatementExecutionStatus']> {\n return this.dashboardClient.getAsyncStatus(\n token,\n reportId,\n dashboardId,\n executionId,\n tableId,\n dataProductDefinitionsPath,\n )\n }\n\n async getAsyncDashboard(\n token: string,\n dashboardId: string,\n reportId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n ): Promise<DashboardDataResponse[][]> {\n return this.dashboardClient.getAsyncDashboard(token, reportId, dashboardId, tableId, query)\n }\n}\n\nexport { DashboardService }\nexport default DashboardService\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAMA,MAAME,CAAiB,CACrB,YAA6BG,EAAkC,CAAlC,qBAAAA,EAC3B,KAAK,gBAAkBA,CACzB,CAEA,MAAM,cACJC,EACAC,EACAC,EACAC,EACAC,EACuD,CACvD,OAAO,KAAK,gBAAgB,cAAcJ,EAAOE,EAAID,EAAOE,EAA4BC,CAAK,CAC/F,CAEA,MAAM,sBACJJ,EACAK,EACAC,EACAF,EACuB,CACvB,OAAO,KAAK,gBAAgB,sBAAsBJ,EAAOK,EAAUC,EAAaF,CAAK,CACvF,CAEA,MAAM,mBACJJ,EACAK,EACAC,EACAC,EACAJ,EACuB,CACvB,OAAO,KAAK,gBAAgB,mBAC1BH,EACAK,EACAC,EACAC,EACAJ,CACF,CACF,CAEA,MAAM,eACJH,EACAK,EACAC,EACAC,EACAC,EACAL,EAC4D,CAC5D,OAAO,KAAK,gBAAgB,eAC1BH,EACAK,EACAC,EACAC,EACAC,EACAL,CACF,CACF,CAEA,MAAM,kBACJH,EACAM,EACAD,EACAG,EACAJ,EACoC,CACpC,OAAO,KAAK,gBAAgB,kBAAkBJ,EAAOK,EAAUC,EAAaE,EAASJ,CAAK,CAC5F,CACF,CAGA,IAAOP,EAAQD",
|
|
4
|
+
"sourcesContent": ["import Dict = NodeJS.Dict\nimport DashboardClient from '../data/dashboardClient'\nimport { components } from '../types/api'\nimport { DashboardDataResponse } from '../types/Metrics'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nclass DashboardService {\n constructor(private readonly dashboardClient: DashboardClient) {\n this.dashboardClient = dashboardClient\n }\n\n async getDefinition(\n token: string,\n dpdId: string,\n id: string,\n dataProductDefinitionsPath?: string,\n query?: Dict<string | string[]> | undefined,\n ): Promise<components['schemas']['DashboardDefinition']> {\n return this.dashboardClient.getDefinition(token, id, dpdId, dataProductDefinitionsPath, query)\n }\n\n async requestAsyncDashboard(\n token: string,\n reportId: string,\n dashboardId: string,\n query: Record<string, string | boolean | number>,\n ): Promise<Dict<string>> {\n return this.dashboardClient.requestAsyncDashboard(token, reportId, dashboardId, query)\n }\n\n async cancelAsyncRequest(\n token: string,\n reportId: string,\n dashboardId: string,\n executionId: string,\n dataProductDefinitionsPath?: string,\n ): Promise<Dict<string>> {\n return this.dashboardClient.cancelAsyncRequest(\n token,\n reportId,\n dashboardId,\n executionId,\n dataProductDefinitionsPath,\n )\n }\n\n async getAsyncStatus(\n token: string,\n reportId: string,\n dashboardId: string,\n executionId: string,\n tableId?: string,\n dataProductDefinitionsPath?: string,\n ): Promise<components['schemas']['StatementExecutionStatus']> {\n return this.dashboardClient.getAsyncStatus(\n token,\n reportId,\n dashboardId,\n executionId,\n tableId,\n dataProductDefinitionsPath,\n )\n }\n\n async getAsyncDashboard(\n token: string,\n dashboardId: string,\n reportId: string,\n tableId: string,\n query: Record<string, string | string[]>,\n ): Promise<DashboardDataResponse[][]> {\n return this.dashboardClient.getAsyncDashboard(token, reportId, dashboardId, tableId, query)\n }\n\n async getSyncDashboard(\n token: string,\n dashboardId: string,\n reportId: string,\n query: Record<string, string | string[]>,\n ) {\n return this.dashboardClient.getSyncDashboard(token, reportId, dashboardId, query)\n }\n}\n\nexport { DashboardService }\nexport default DashboardService\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAMA,MAAME,CAAiB,CACrB,YAA6BG,EAAkC,CAAlC,qBAAAA,EAC3B,KAAK,gBAAkBA,CACzB,CAEA,MAAM,cACJC,EACAC,EACAC,EACAC,EACAC,EACuD,CACvD,OAAO,KAAK,gBAAgB,cAAcJ,EAAOE,EAAID,EAAOE,EAA4BC,CAAK,CAC/F,CAEA,MAAM,sBACJJ,EACAK,EACAC,EACAF,EACuB,CACvB,OAAO,KAAK,gBAAgB,sBAAsBJ,EAAOK,EAAUC,EAAaF,CAAK,CACvF,CAEA,MAAM,mBACJJ,EACAK,EACAC,EACAC,EACAJ,EACuB,CACvB,OAAO,KAAK,gBAAgB,mBAC1BH,EACAK,EACAC,EACAC,EACAJ,CACF,CACF,CAEA,MAAM,eACJH,EACAK,EACAC,EACAC,EACAC,EACAL,EAC4D,CAC5D,OAAO,KAAK,gBAAgB,eAC1BH,EACAK,EACAC,EACAC,EACAC,EACAL,CACF,CACF,CAEA,MAAM,kBACJH,EACAM,EACAD,EACAG,EACAJ,EACoC,CACpC,OAAO,KAAK,gBAAgB,kBAAkBJ,EAAOK,EAAUC,EAAaE,EAASJ,CAAK,CAC5F,CAEA,MAAM,iBACJJ,EACAM,EACAD,EACAD,EACA,CACA,OAAO,KAAK,gBAAgB,iBAAiBJ,EAAOK,EAAUC,EAAaF,CAAK,CAClF,CACF,CAGA,IAAOP,EAAQD",
|
|
6
6
|
"names": ["dashboardService_exports", "__export", "DashboardService", "dashboardService_default", "__toCommonJS", "dashboardClient", "token", "dpdId", "id", "dataProductDefinitionsPath", "query", "reportId", "dashboardId", "executionId", "tableId"]
|
|
7
7
|
}
|
|
@@ -71,6 +71,15 @@ class DashboardService {
|
|
|
71
71
|
): Promise<DashboardDataResponse[][]> {
|
|
72
72
|
return this.dashboardClient.getAsyncDashboard(token, reportId, dashboardId, tableId, query)
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
async getSyncDashboard(
|
|
76
|
+
token: string,
|
|
77
|
+
dashboardId: string,
|
|
78
|
+
reportId: string,
|
|
79
|
+
query: Record<string, string | string[]>,
|
|
80
|
+
) {
|
|
81
|
+
return this.dashboardClient.getSyncDashboard(token, reportId, dashboardId, query)
|
|
82
|
+
}
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
export { DashboardService }
|
package/dpr/types/api.d.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var c=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of i(e))!p.call(n,r)&&r!==o&&s(n,r,{get:()=>e[r],enumerable:!(t=a(e,r))||t.enumerable});return n};var d=n=>c(s({},"__esModule",{value:!0}),n);var m={};module.exports=d(m);
|
|
2
2
|
//# sourceMappingURL=api.d.js.map
|