@ministryofjustice/hmpps-digital-prison-reporting-frontend 3.9.2 → 3.9.4
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.
|
@@ -107,7 +107,7 @@ const renderListWithDefinition = ({ title, definitionName, variantName, request,
|
|
|
107
107
|
.then((reportDefinition) => {
|
|
108
108
|
const reportName = reportDefinition.name;
|
|
109
109
|
const variantDefinition = reportDefinition.variant;
|
|
110
|
-
const reportQuery = new ReportQuery_1.default(variantDefinition.specification.fields, request.query, getDefaultSortColumn(variantDefinition.specification.fields), filtersQueryParameterPrefix);
|
|
110
|
+
const reportQuery = new ReportQuery_1.default(variantDefinition.specification.fields, request.query, getDefaultSortColumn(variantDefinition.specification.fields), filtersQueryParameterPrefix, definitionsPath);
|
|
111
111
|
const getListData = {
|
|
112
112
|
data: reportingClient.getListWithWarnings(variantDefinition.resourceName, token, reportQuery),
|
|
113
113
|
count: reportingClient.getCount(variantDefinition.resourceName, token, reportQuery),
|
package/dpr/types/ReportQuery.js
CHANGED
|
@@ -6,14 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const urlHelper_1 = require("../utils/urlHelper");
|
|
7
7
|
const utils_1 = __importDefault(require("../components/columns/utils"));
|
|
8
8
|
class ReportQuery {
|
|
9
|
-
constructor(fields, queryParams, defaultSortColumn, filtersPrefix) {
|
|
9
|
+
constructor(fields, queryParams, defaultSortColumn, filtersPrefix, definitionsPath) {
|
|
10
10
|
this.selectedPage = queryParams.selectedPage ? Number(queryParams.selectedPage) : 1;
|
|
11
11
|
this.pageSize = queryParams.pageSize ? Number(queryParams.pageSize) : 20;
|
|
12
12
|
this.sortColumn = queryParams.sortColumn ? queryParams.sortColumn.toString() : defaultSortColumn;
|
|
13
13
|
this.sortedAsc = queryParams.sortedAsc !== 'false';
|
|
14
|
-
this.dataProductDefinitionsPath =
|
|
15
|
-
? queryParams.dataProductDefinitionsPath.toString()
|
|
16
|
-
: null;
|
|
14
|
+
this.dataProductDefinitionsPath =
|
|
15
|
+
definitionsPath !== null && definitionsPath !== void 0 ? definitionsPath : (queryParams.dataProductDefinitionsPath ? queryParams.dataProductDefinitionsPath.toString() : null);
|
|
17
16
|
this.filtersPrefix = filtersPrefix;
|
|
18
17
|
if (queryParams.columns) {
|
|
19
18
|
const columns = typeof queryParams.columns === 'string' ? queryParams.columns.split(',') : queryParams.columns;
|
package/dpr/types/ReportQuery.ts
CHANGED
|
@@ -27,14 +27,15 @@ export default class ReportQuery implements FilteredListRequest {
|
|
|
27
27
|
queryParams: ParsedQs,
|
|
28
28
|
defaultSortColumn: string,
|
|
29
29
|
filtersPrefix: string,
|
|
30
|
+
definitionsPath?: string,
|
|
30
31
|
) {
|
|
31
32
|
this.selectedPage = queryParams.selectedPage ? Number(queryParams.selectedPage) : 1
|
|
32
33
|
this.pageSize = queryParams.pageSize ? Number(queryParams.pageSize) : 20
|
|
33
34
|
this.sortColumn = queryParams.sortColumn ? queryParams.sortColumn.toString() : defaultSortColumn
|
|
34
35
|
this.sortedAsc = queryParams.sortedAsc !== 'false'
|
|
35
|
-
this.dataProductDefinitionsPath =
|
|
36
|
-
|
|
37
|
-
: null
|
|
36
|
+
this.dataProductDefinitionsPath =
|
|
37
|
+
definitionsPath ??
|
|
38
|
+
(queryParams.dataProductDefinitionsPath ? queryParams.dataProductDefinitionsPath.toString() : null)
|
|
38
39
|
this.filtersPrefix = filtersPrefix
|
|
39
40
|
|
|
40
41
|
if (queryParams.columns) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
|
|
3
3
|
"description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
|
|
4
|
-
"version": "3.9.
|
|
4
|
+
"version": "3.9.4",
|
|
5
5
|
"main": "dpr/assets/js/all.mjs",
|
|
6
6
|
"sass": "dpr/all.scss",
|
|
7
7
|
"engines": {
|
package/package.zip
CHANGED
|
Binary file
|