@hmcts/ccd-case-ui-toolkit 6.19.6-restricted-case-access → 6.19.6-restricted-case-access-v4
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/bundles/hmcts-ccd-case-ui-toolkit.umd.js +20 -13
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
- package/esm2015/lib/app.config.js +1 -1
- package/esm2015/lib/shared/components/case-editor/case-edit/case-edit.component.js +2 -2
- package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +2 -2
- package/esm2015/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.js +15 -7
- package/esm2015/lib/shared/components/case-viewer/services/case.resolver.js +9 -6
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js +20 -12
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
- package/lib/app.config.d.ts +2 -0
- package/lib/app.config.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.d.ts +6 -1
- package/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts +3 -1
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8511,10 +8511,18 @@ WorkAllocationService.ɵprov = i0.ɵɵdefineInjectable({ token: WorkAllocationSe
|
|
|
8511
8511
|
}], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null); })();
|
|
8512
8512
|
|
|
8513
8513
|
class ValidPageListCaseFieldsService {
|
|
8514
|
-
|
|
8514
|
+
constructor(fieldsUtils) {
|
|
8515
|
+
this.fieldsUtils = fieldsUtils;
|
|
8516
|
+
}
|
|
8517
|
+
isShown(page, eventTriggerFields, data) {
|
|
8518
|
+
const fields = this.fieldsUtils
|
|
8519
|
+
.mergeCaseFieldsAndFormFields(eventTriggerFields, data);
|
|
8520
|
+
return page.parsedShowCondition.match(fields);
|
|
8521
|
+
}
|
|
8522
|
+
deleteNonValidatedFields(validPageList, data, eventTriggerFields, fromPreviousPage = false) {
|
|
8515
8523
|
const validPageListCaseFields = [];
|
|
8516
8524
|
validPageList.forEach(page => {
|
|
8517
|
-
if (
|
|
8525
|
+
if (this.isShown(page, eventTriggerFields, data)) {
|
|
8518
8526
|
page.case_fields.forEach(field => validPageListCaseFields.push(field));
|
|
8519
8527
|
}
|
|
8520
8528
|
});
|
|
@@ -8522,17 +8530,16 @@ class ValidPageListCaseFieldsService {
|
|
|
8522
8530
|
Object.keys(data).forEach(key => {
|
|
8523
8531
|
if (validPageListCaseFields.findIndex((element) => element.id === key) < 0) {
|
|
8524
8532
|
delete data[key];
|
|
8525
|
-
;
|
|
8526
8533
|
}
|
|
8527
8534
|
});
|
|
8528
8535
|
}
|
|
8529
8536
|
}
|
|
8530
8537
|
}
|
|
8531
|
-
ValidPageListCaseFieldsService.ɵfac = function ValidPageListCaseFieldsService_Factory(t) { return new (t || ValidPageListCaseFieldsService)(); };
|
|
8538
|
+
ValidPageListCaseFieldsService.ɵfac = function ValidPageListCaseFieldsService_Factory(t) { return new (t || ValidPageListCaseFieldsService)(i0.ɵɵinject(FieldsUtils)); };
|
|
8532
8539
|
ValidPageListCaseFieldsService.ɵprov = i0.ɵɵdefineInjectable({ token: ValidPageListCaseFieldsService, factory: ValidPageListCaseFieldsService.ɵfac });
|
|
8533
8540
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ValidPageListCaseFieldsService, [{
|
|
8534
8541
|
type: Injectable
|
|
8535
|
-
}],
|
|
8542
|
+
}], function () { return [{ type: FieldsUtils }]; }, null); })();
|
|
8536
8543
|
|
|
8537
8544
|
class CaseEditComponent {
|
|
8538
8545
|
constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService) {
|
|
@@ -8719,7 +8726,7 @@ class CaseEditComponent {
|
|
|
8719
8726
|
// Remove "Launcher"-type fields (these have no values and are not intended to be persisted)
|
|
8720
8727
|
this.formValueService.removeCaseFieldsOfType(caseEventData.data, eventTrigger.case_fields, ['FlagLauncher', 'ComponentLauncher']);
|
|
8721
8728
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
8722
|
-
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, false);
|
|
8729
|
+
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, eventTrigger.case_fields, false);
|
|
8723
8730
|
caseEventData.event_token = eventTrigger.event_token;
|
|
8724
8731
|
caseEventData.ignore_warning = this.ignoreWarning;
|
|
8725
8732
|
if (this.confirmation) {
|
|
@@ -9966,7 +9973,7 @@ class CaseEditPageComponent {
|
|
|
9966
9973
|
// Get hold of the CaseEventData.
|
|
9967
9974
|
const caseEventData = this.formValueService.sanitise(formFields);
|
|
9968
9975
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
9969
|
-
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data,
|
|
9976
|
+
this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage);
|
|
9970
9977
|
// Tidy it up before we return it.
|
|
9971
9978
|
this.formValueService.removeUnnecessaryFields(caseEventData.data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, this.currentPage.case_fields);
|
|
9972
9979
|
return caseEventData;
|
|
@@ -27059,12 +27066,13 @@ CaseTimelineModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
|
|
|
27059
27066
|
i0.ɵɵsetComponentScope(CaseTimelineComponent, [i2.NgIf, i2.NgSwitch, i2.NgSwitchCase, EventLogComponent, CaseHistoryComponent], [i1.RpxTranslatePipe]);
|
|
27060
27067
|
|
|
27061
27068
|
class CaseResolver {
|
|
27062
|
-
constructor(caseNotifier, draftService, navigationNotifierService, router, sessionStorage) {
|
|
27069
|
+
constructor(caseNotifier, draftService, navigationNotifierService, router, sessionStorage, appConfig) {
|
|
27063
27070
|
this.caseNotifier = caseNotifier;
|
|
27064
27071
|
this.draftService = draftService;
|
|
27065
27072
|
this.navigationNotifierService = navigationNotifierService;
|
|
27066
27073
|
this.router = router;
|
|
27067
27074
|
this.sessionStorage = sessionStorage;
|
|
27075
|
+
this.appConfig = appConfig;
|
|
27068
27076
|
router.events.pipe(filter(event => event instanceof NavigationEnd))
|
|
27069
27077
|
.subscribe((event) => {
|
|
27070
27078
|
this.previousUrl = event.url;
|
|
@@ -27135,8 +27143,8 @@ class CaseResolver {
|
|
|
27135
27143
|
this.router.navigate(['/list/case']);
|
|
27136
27144
|
return of(null);
|
|
27137
27145
|
}
|
|
27138
|
-
// Error 403, navigate to restricted case access page
|
|
27139
|
-
if (error.status === 403) {
|
|
27146
|
+
// Error 403 and enable-restricted-case-access Launch Darkly flag is enabled, navigate to restricted case access page
|
|
27147
|
+
if (error.status === 403 && this.appConfig.getEnableRestrictedCaseAccessConfig()) {
|
|
27140
27148
|
this.router.navigate([`/cases/restricted-case-access/${caseReference}`]);
|
|
27141
27149
|
return of(null);
|
|
27142
27150
|
}
|
|
@@ -27166,11 +27174,11 @@ CaseResolver.PARAM_CASE_ID = 'cid';
|
|
|
27166
27174
|
CaseResolver.CASE_CREATED_MSG = 'The case has been created successfully';
|
|
27167
27175
|
CaseResolver.defaultWAPage = '/work/my-work/list';
|
|
27168
27176
|
CaseResolver.defaultPage = '/cases';
|
|
27169
|
-
CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService)); };
|
|
27177
|
+
CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(AbstractAppConfig)); };
|
|
27170
27178
|
CaseResolver.ɵprov = i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
|
|
27171
27179
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseResolver, [{
|
|
27172
27180
|
type: Injectable
|
|
27173
|
-
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$1.Router }, { type: SessionStorageService }]; }, null); })();
|
|
27181
|
+
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$1.Router }, { type: SessionStorageService }, { type: AbstractAppConfig }]; }, null); })();
|
|
27174
27182
|
|
|
27175
27183
|
class EventTriggerResolver {
|
|
27176
27184
|
constructor(casesService, alertService, profileService, profileNotifier) {
|