@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.0.1 → 4.0.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/assets/js/all.mjs
CHANGED
|
@@ -327,8 +327,8 @@ class DprQueryParamClass extends DprClientClass {
|
|
|
327
327
|
if (type === 'radio' || type === 'checkbox') {
|
|
328
328
|
this.setMultiSelectValue(inputs, value);
|
|
329
329
|
} else if (input.classList.contains('moj-js-datepicker-input')) {
|
|
330
|
-
const formatted = dayjs(value, 'YYYY-MM-DD');
|
|
331
|
-
input.value = formatted
|
|
330
|
+
const formatted = dayjs(value, 'YYYY-MM-DD').format('DD/MM/YYYY');
|
|
331
|
+
input.value = formatted !== 'Invalid Date' ? formatted : '';
|
|
332
332
|
} else {
|
|
333
333
|
input.value = value;
|
|
334
334
|
}
|
|
@@ -1021,7 +1021,7 @@ class Filters extends DprClientClass {
|
|
|
1021
1021
|
|
|
1022
1022
|
if (v.match(dateRegEx)) {
|
|
1023
1023
|
// eslint-disable-next-line no-param-reassign
|
|
1024
|
-
v = dayjs(v, '
|
|
1024
|
+
v = dayjs(v, 'D/M/YYYY').format('YYYY-MM-DD');
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
1027
|
serializedFormData += `&${n}=${v}`;
|
|
@@ -6,12 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const enum_1 = require("../_filters/filter-input/enum");
|
|
7
7
|
const urlHelper_1 = require("../../utils/urlHelper");
|
|
8
8
|
const utils_1 = __importDefault(require("../_inputs/start-end-date/utils"));
|
|
9
|
-
const logger_1 = __importDefault(require("../../utils/logger"));
|
|
10
9
|
const LOCALE = 'en-GB';
|
|
11
10
|
const toLocaleDate = (isoDate) => {
|
|
12
11
|
const date = new Date(isoDate);
|
|
13
|
-
const dateString = isoDate ? date.toLocaleDateString(LOCALE) : null;
|
|
14
|
-
logger_1.default.info('toLocaleDate:', isoDate, date, dateString);
|
|
15
12
|
return isoDate ? date.toLocaleDateString(LOCALE) : null;
|
|
16
13
|
};
|
|
17
14
|
const filterHasValue = (value) => {
|
|
@@ -33,12 +30,6 @@ const getSelectedFilters = (format, reportQuery, createUrlForParameters) => form
|
|
|
33
30
|
const { start, end } = utils_1.default.setDateRangeValuesWithinMinMax(f.filter, startValue, endValue);
|
|
34
31
|
const localeStart = toLocaleDate(start);
|
|
35
32
|
const localeEnd = toLocaleDate(end);
|
|
36
|
-
logger_1.default.info('Selected daterange filters:', {
|
|
37
|
-
start,
|
|
38
|
-
end,
|
|
39
|
-
localeStart,
|
|
40
|
-
localeEnd,
|
|
41
|
-
});
|
|
42
33
|
if (localeStart && localeEnd) {
|
|
43
34
|
filterValueText = `${localeStart} - ${localeEnd}`;
|
|
44
35
|
}
|
|
@@ -12,8 +12,6 @@ const LOCALE = 'en-GB'
|
|
|
12
12
|
|
|
13
13
|
const toLocaleDate = (isoDate?: string) => {
|
|
14
14
|
const date = new Date(isoDate)
|
|
15
|
-
const dateString = isoDate ? date.toLocaleDateString(LOCALE) : null
|
|
16
|
-
logger.info('toLocaleDate:', isoDate, date, dateString)
|
|
17
15
|
return isoDate ? date.toLocaleDateString(LOCALE) : null
|
|
18
16
|
}
|
|
19
17
|
|
|
@@ -45,12 +43,6 @@ const getSelectedFilters = (
|
|
|
45
43
|
const { start, end } = StartEndDateUtils.setDateRangeValuesWithinMinMax(f.filter, startValue, endValue)
|
|
46
44
|
const localeStart = toLocaleDate(start)
|
|
47
45
|
const localeEnd = toLocaleDate(end)
|
|
48
|
-
logger.info('Selected daterange filters:', {
|
|
49
|
-
start,
|
|
50
|
-
end,
|
|
51
|
-
localeStart,
|
|
52
|
-
localeEnd,
|
|
53
|
-
})
|
|
54
46
|
|
|
55
47
|
if (localeStart && localeEnd) {
|
|
56
48
|
filterValueText = `${localeStart} - ${localeEnd}`
|
|
@@ -36,7 +36,6 @@ const reportingClient_1 = __importDefault(require("../../data/reportingClient"))
|
|
|
36
36
|
const utils_4 = __importDefault(require("../_reports/report-actions/utils"));
|
|
37
37
|
const DataTableBuilder_1 = __importDefault(require("../../utils/DataTableBuilder/DataTableBuilder"));
|
|
38
38
|
const utils_5 = __importDefault(require("../_reports/report-pagination/utils"));
|
|
39
|
-
const logger_1 = __importDefault(require("../../utils/logger"));
|
|
40
39
|
function isListWithWarnings(data) {
|
|
41
40
|
return data.data !== undefined;
|
|
42
41
|
}
|
|
@@ -100,7 +99,6 @@ function renderList(listData, variantDefinition, reportQuery, request, response,
|
|
|
100
99
|
totals: utils_1.default.getTotals(pagination.pageSize, pagination.currentPage, pagination.totalRows, dataTable.rowCount),
|
|
101
100
|
};
|
|
102
101
|
const filterOptions = utils_2.default.getFilterOptions(variantDefinition, reportQuery, urlHelper_1.default, dynamicAutocompleteEndpoint);
|
|
103
|
-
logger_1.default.info(JSON.stringify({ filterOptions }, null, 2));
|
|
104
102
|
const reportUrl = `${request.protocol}://${request.get('host')}${request.originalUrl}`;
|
|
105
103
|
const actions = utils_4.default.getActions({
|
|
106
104
|
print: {
|
|
@@ -20,7 +20,6 @@ import { DataTable } from '../../utils/DataTableBuilder/types'
|
|
|
20
20
|
import PaginationUtils from '../_reports/report-pagination/utils'
|
|
21
21
|
import { FilterOptions } from '../_filters/types'
|
|
22
22
|
import { Template } from '../../types/Templates'
|
|
23
|
-
import logger from '../../utils/logger'
|
|
24
23
|
|
|
25
24
|
function isListWithWarnings(data: Dict<string>[] | ListWithWarnings): data is ListWithWarnings {
|
|
26
25
|
return (data as ListWithWarnings).data !== undefined
|
|
@@ -127,7 +126,6 @@ function renderList(
|
|
|
127
126
|
createUrlForParameters,
|
|
128
127
|
dynamicAutocompleteEndpoint,
|
|
129
128
|
)
|
|
130
|
-
logger.info(JSON.stringify({ filterOptions }, null, 2))
|
|
131
129
|
|
|
132
130
|
const reportUrl = `${request.protocol}://${request.get('host')}${request.originalUrl}`
|
|
133
131
|
const actions = ReportActionsUtils.getActions({
|
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": "4.0.
|
|
4
|
+
"version": "4.0.2",
|
|
5
5
|
"main": "dpr/assets/js/all.mjs",
|
|
6
6
|
"sass": "dpr/all.scss",
|
|
7
7
|
"engines": {
|
package/package.zip
CHANGED
|
Binary file
|