@hmcts/ccd-case-ui-toolkit 6.19.6-rc3 → 6.19.6-restricted-case-access-v2

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.
Files changed (20) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +18 -58
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/components/case-editor/case-edit/case-edit.component.js +5 -13
  6. package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +4 -12
  7. package/esm2015/lib/shared/components/case-editor/case-editor.module.js +3 -6
  8. package/esm2015/lib/shared/components/case-viewer/services/case.resolver.js +10 -6
  9. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +18 -52
  10. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  11. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +1 -4
  12. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  13. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +2 -4
  14. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  15. package/lib/shared/components/case-editor/case-editor.module.d.ts.map +1 -1
  16. package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
  17. package/package.json +1 -1
  18. package/esm2015/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.js +0 -27
  19. package/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.d.ts +0 -8
  20. package/lib/shared/components/case-editor/services/valid-page-list-caseFields.service.d.ts.map +0 -1
@@ -8510,32 +8510,8 @@ WorkAllocationService.ɵprov = i0.ɵɵdefineInjectable({ token: WorkAllocationSe
8510
8510
  type: Injectable
8511
8511
  }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null); })();
8512
8512
 
8513
- class ValidPageListCaseFieldsService {
8514
- deleteNonValidatedFields(validPageList, data, notFromEventSubmit, fromPreviousPage = false) {
8515
- const validPageListCaseFields = [];
8516
- validPageList.forEach(page => {
8517
- if (notFromEventSubmit || ShowCondition.getInstance(page.show_condition).match(data)) {
8518
- page.case_fields.forEach(field => validPageListCaseFields.push(field));
8519
- }
8520
- });
8521
- if (!fromPreviousPage && validPageListCaseFields.length > 0) {
8522
- Object.keys(data).forEach(key => {
8523
- if (validPageListCaseFields.findIndex((element) => element.id === key) < 0) {
8524
- delete data[key];
8525
- ;
8526
- }
8527
- });
8528
- }
8529
- }
8530
- }
8531
- ValidPageListCaseFieldsService.ɵfac = function ValidPageListCaseFieldsService_Factory(t) { return new (t || ValidPageListCaseFieldsService)(); };
8532
- ValidPageListCaseFieldsService.ɵprov = i0.ɵɵdefineInjectable({ token: ValidPageListCaseFieldsService, factory: ValidPageListCaseFieldsService.ɵfac });
8533
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ValidPageListCaseFieldsService, [{
8534
- type: Injectable
8535
- }], null, null); })();
8536
-
8537
8513
  class CaseEditComponent {
8538
- constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService) {
8514
+ constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService) {
8539
8515
  this.fb = fb;
8540
8516
  this.caseNotifier = caseNotifier;
8541
8517
  this.router = router;
@@ -8549,7 +8525,6 @@ class CaseEditComponent {
8549
8525
  this.formValueService = formValueService;
8550
8526
  this.formErrorService = formErrorService;
8551
8527
  this.loadingService = loadingService;
8552
- this.validPageListCaseFieldsService = validPageListCaseFieldsService;
8553
8528
  this.cancelled = new EventEmitter();
8554
8529
  this.submitted = new EventEmitter();
8555
8530
  this.isEventCompletionChecksRequired = false;
@@ -8557,7 +8532,6 @@ class CaseEditComponent {
8557
8532
  this.ignoreWarning = false;
8558
8533
  this.isLinkedCasesSubmission = false;
8559
8534
  this.callbackErrorsSubject = new Subject();
8560
- this.validPageList = [];
8561
8535
  }
8562
8536
  ngOnInit() {
8563
8537
  this.wizard = this.wizardFactory.create(this.eventTrigger);
@@ -8718,8 +8692,6 @@ class CaseEditComponent {
8718
8692
  this.formValueService.populateLinkedCasesDetailsFromCaseFields(caseEventData.data, eventTrigger.case_fields);
8719
8693
  // Remove "Launcher"-type fields (these have no values and are not intended to be persisted)
8720
8694
  this.formValueService.removeCaseFieldsOfType(caseEventData.data, eventTrigger.case_fields, ['FlagLauncher', 'ComponentLauncher']);
8721
- // delete fields which are not part of the case event journey wizard pages case fields
8722
- this.validPageListCaseFieldsService.deleteNonValidatedFields(this.validPageList, caseEventData.data, false);
8723
8695
  caseEventData.event_token = eventTrigger.event_token;
8724
8696
  caseEventData.ignore_warning = this.ignoreWarning;
8725
8697
  if (this.confirmation) {
@@ -8820,9 +8792,7 @@ class CaseEditComponent {
8820
8792
  rawFormValueData[key] = parentField.formatted_value[caseField.id];
8821
8793
  }
8822
8794
  else {
8823
- if (!(caseField.hidden && caseField.retain_hidden_value)) {
8824
- rawFormValueData[key] = caseField.formatted_value;
8825
- }
8795
+ rawFormValueData[key] = caseField.formatted_value;
8826
8796
  }
8827
8797
  }
8828
8798
  }
@@ -8884,7 +8854,7 @@ class CaseEditComponent {
8884
8854
  }
8885
8855
  CaseEditComponent.ORIGIN_QUERY_PARAM = 'origin';
8886
8856
  CaseEditComponent.ALERT_MESSAGE = 'Page is being refreshed so you will be redirected to the first page of this event.';
8887
- CaseEditComponent.ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i2$1.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService)); };
8857
+ CaseEditComponent.ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i2$1.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService)); };
8888
8858
  CaseEditComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
8889
8859
  i0.ɵɵelement(0, "router-outlet");
8890
8860
  } }, directives: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:1px solid #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:0}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
@@ -8896,7 +8866,7 @@ CaseEditComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseEditComponent, sele
8896
8866
  styleUrls: ['../case-edit.scss'],
8897
8867
  providers: [GreyBarService]
8898
8868
  }]
8899
- }], function () { return [{ type: i2$1.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }]; }, { eventTrigger: [{
8869
+ }], function () { return [{ type: i2$1.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }]; }, { eventTrigger: [{
8900
8870
  type: Input
8901
8871
  }], submit: [{
8902
8872
  type: Input
@@ -9495,7 +9465,7 @@ function CaseEditPageComponent_ccd_case_event_completion_11_Template(rf, ctx) {
9495
9465
  i0.ɵɵproperty("eventCompletionParams", ctx_r8.caseEdit.eventCompletionParams);
9496
9466
  } }
9497
9467
  class CaseEditPageComponent {
9498
- constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService) {
9468
+ constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService) {
9499
9469
  this.caseEdit = caseEdit;
9500
9470
  this.route = route;
9501
9471
  this.formValueService = formValueService;
@@ -9506,7 +9476,6 @@ class CaseEditPageComponent {
9506
9476
  this.caseFieldService = caseFieldService;
9507
9477
  this.caseEditDataService = caseEditDataService;
9508
9478
  this.loadingService = loadingService;
9509
- this.validPageListCaseFieldsService = validPageListCaseFieldsService;
9510
9479
  this.triggerTextStart = CaseEditPageComponent.TRIGGER_TEXT_START;
9511
9480
  this.triggerTextIgnoreWarnings = CaseEditPageComponent.TRIGGER_TEXT_CONTINUE;
9512
9481
  this.formValuesChanged = false;
@@ -9714,9 +9683,6 @@ class CaseEditPageComponent {
9714
9683
  }
9715
9684
  }
9716
9685
  if (!this.caseEdit.isSubmitting && !this.currentPageIsNotValid()) {
9717
- if (this.caseEdit.validPageList.findIndex(page => page.id === this.currentPage.id) === -1) {
9718
- this.caseEdit.validPageList.push(this.currentPage);
9719
- }
9720
9686
  this.caseEdit.isSubmitting = true;
9721
9687
  this.caseEdit.error = null;
9722
9688
  const caseEventData = this.buildCaseEventData();
@@ -9965,8 +9931,6 @@ class CaseEditPageComponent {
9965
9931
  this.formValueService.sanitiseDynamicLists(caseFields, formFields);
9966
9932
  // Get hold of the CaseEventData.
9967
9933
  const caseEventData = this.formValueService.sanitise(formFields);
9968
- // delete fields which are not part of the case event journey wizard pages case fields
9969
- this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, true, fromPreviousPage);
9970
9934
  // Tidy it up before we return it.
9971
9935
  this.formValueService.removeUnnecessaryFields(caseEventData.data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, this.currentPage.case_fields);
9972
9936
  return caseEventData;
@@ -10007,7 +9971,7 @@ CaseEditPageComponent.RESUMED_FORM_SAVE = 'RESUMED_FORM_SAVE';
10007
9971
  CaseEditPageComponent.TRIGGER_TEXT_START = 'Continue';
10008
9972
  CaseEditPageComponent.TRIGGER_TEXT_SAVE = 'Save and continue';
10009
9973
  CaseEditPageComponent.TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Continue';
10010
- CaseEditPageComponent.ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService)); };
9974
+ CaseEditPageComponent.ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService)); };
10011
9975
  CaseEditPageComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], decls: 12, vars: 11, consts: [[4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["titleBlock", ""], ["idBlock", ""], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form", 3, "formGroup", "submit"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["type", "button", 1, "button", "button-secondary", 3, "disabled", "click"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], [3, "eventCompletionParams", "eventCanBeCompleted"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
10012
9976
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 0);
10013
9977
  i0.ɵɵtemplate(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 1);
@@ -10046,7 +10010,7 @@ CaseEditPageComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseEditPageCompone
10046
10010
  templateUrl: 'case-edit-page.html',
10047
10011
  styleUrls: ['./case-edit-page.scss']
10048
10012
  }]
10049
- }], function () { return [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }]; }, null); })();
10013
+ }], function () { return [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }]; }, null); })();
10050
10014
 
10051
10015
  class CallbackErrorsContext {
10052
10016
  }
@@ -24970,8 +24934,7 @@ CaseEditorModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
24970
24934
  JudicialworkerService,
24971
24935
  CaseworkerService,
24972
24936
  SessionStorageService,
24973
- EventCompletionStateMachineService,
24974
- ValidPageListCaseFieldsService
24937
+ EventCompletionStateMachineService
24975
24938
  ], imports: [[
24976
24939
  CommonModule,
24977
24940
  RouterModule,
@@ -25084,8 +25047,7 @@ CaseEditorModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
25084
25047
  JudicialworkerService,
25085
25048
  CaseworkerService,
25086
25049
  SessionStorageService,
25087
- EventCompletionStateMachineService,
25088
- ValidPageListCaseFieldsService
25050
+ EventCompletionStateMachineService
25089
25051
  ]
25090
25052
  }]
25091
25053
  }], null, null); })();
@@ -27109,7 +27071,7 @@ class CaseResolver {
27109
27071
  else {
27110
27072
  console.info('getAndCacheCaseView - Path B.');
27111
27073
  return this.caseNotifier.fetchAndRefresh(cid)
27112
- .pipe(catchError(error => this.processErrorInCaseFetch(error)))
27074
+ .pipe(catchError(error => this.processErrorInCaseFetch(error, cid)))
27113
27075
  .toPromise();
27114
27076
  }
27115
27077
  }
@@ -27121,9 +27083,9 @@ class CaseResolver {
27121
27083
  this.caseNotifier.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
27122
27084
  this.caseNotifier.announceCase(this.caseNotifier.cachedCaseView);
27123
27085
  return this.caseNotifier.cachedCaseView;
27124
- }), catchError(error => this.processErrorInCaseFetch(error))).toPromise();
27086
+ }), catchError(error => this.processErrorInCaseFetch(error, cid))).toPromise();
27125
27087
  }
27126
- processErrorInCaseFetch(error) {
27088
+ processErrorInCaseFetch(error, caseReference) {
27127
27089
  console.error('!!! processErrorInCaseFetch !!!');
27128
27090
  console.error(error);
27129
27091
  // TODO Should be logged to remote logging infrastructure
@@ -27131,12 +27093,16 @@ class CaseResolver {
27131
27093
  this.router.navigate(['/search/noresults']);
27132
27094
  return of(null);
27133
27095
  }
27134
- console.error(error);
27135
27096
  if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
27136
27097
  this.router.navigate(['/list/case']);
27137
27098
  return of(null);
27138
27099
  }
27139
- if (error.status !== 401 && error.status !== 403) {
27100
+ // Error 403, navigate to restricted case access page
27101
+ if (error.status === 403) {
27102
+ this.router.navigate([`/cases/restricted-case-access/${caseReference}`]);
27103
+ return of(null);
27104
+ }
27105
+ if (error.status !== 401) {
27140
27106
  this.router.navigate(['/error']);
27141
27107
  }
27142
27108
  this.goToDefaultPage();