@ministryofjustice/hmpps-digital-prison-reporting-frontend 6.2.1 → 6.2.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/all.bundle.js +9 -10
- package/all.bundle.js.map +1 -1
- package/all.js +9 -10
- package/all.js.map +1 -1
- package/dpr/all.scss +1 -1
- package/dpr/components/_async/async-filters-form/actions/reset-form-button/view.njk +1 -0
- package/dpr/components/_async/async-polling/view.njk +1 -1
- package/dpr/components/_filters/filters-reset/view.njk +2 -1
- package/package.json +1 -1
package/all.bundle.js
CHANGED
|
@@ -1297,9 +1297,7 @@ class DprReportStatus extends PollingClientClass {
|
|
|
1297
1297
|
if (!fragment)
|
|
1298
1298
|
return;
|
|
1299
1299
|
// Get the redirect to the report, if present it means the status is finished
|
|
1300
|
-
|
|
1301
|
-
return;
|
|
1302
|
-
}
|
|
1300
|
+
const redirectUrl = this.redirectToReport(fragment);
|
|
1303
1301
|
// Set the new container
|
|
1304
1302
|
const newContainer = fragment.querySelector('#dpr-current-status__content');
|
|
1305
1303
|
if (!newContainer)
|
|
@@ -1307,6 +1305,11 @@ class DprReportStatus extends PollingClientClass {
|
|
|
1307
1305
|
// Replace the old container
|
|
1308
1306
|
this.container.replaceWith(newContainer);
|
|
1309
1307
|
this.container = newContainer;
|
|
1308
|
+
if (!!redirectUrl) {
|
|
1309
|
+
setTimeout(() => {
|
|
1310
|
+
window.location.replace(redirectUrl);
|
|
1311
|
+
}, 1000);
|
|
1312
|
+
}
|
|
1310
1313
|
}
|
|
1311
1314
|
catch (error) {
|
|
1312
1315
|
console.error('Polling error', error);
|
|
@@ -1323,13 +1326,7 @@ class DprReportStatus extends PollingClientClass {
|
|
|
1323
1326
|
}
|
|
1324
1327
|
redirectToReport(fragment) {
|
|
1325
1328
|
const redirectEl = fragment.querySelector('[data-redirect]');
|
|
1326
|
-
|
|
1327
|
-
return false;
|
|
1328
|
-
const url = redirectEl.getAttribute('data-redirect');
|
|
1329
|
-
if (!url)
|
|
1330
|
-
return false;
|
|
1331
|
-
window.location.replace(url);
|
|
1332
|
-
return true;
|
|
1329
|
+
return redirectEl?.getAttribute('data-redirect') ?? null;
|
|
1333
1330
|
}
|
|
1334
1331
|
}
|
|
1335
1332
|
|
|
@@ -2176,8 +2173,10 @@ class DprMyReports extends PollingClientClass {
|
|
|
2176
2173
|
headers: {
|
|
2177
2174
|
'X-Requested-With': 'XMLHttpRequest',
|
|
2178
2175
|
'Content-Type': 'application/json',
|
|
2176
|
+
'CSRF-Token': this.csrfToken,
|
|
2179
2177
|
},
|
|
2180
2178
|
body: JSON.stringify(body),
|
|
2179
|
+
credentials: 'same-origin',
|
|
2181
2180
|
});
|
|
2182
2181
|
if (!res.ok) {
|
|
2183
2182
|
console.error('Remove failed');
|