@hmcts/ccd-case-ui-toolkit 6.19.5-secure-doc-case-creation.1 → 6.19.5-view-case-link

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 (24) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +29 -11
  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/services/case.notifier.js +1 -8
  6. package/esm2015/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.js +2 -1
  7. package/esm2015/lib/shared/components/create-case-filters/create-case-filters.component.js +3 -3
  8. package/esm2015/lib/shared/components/palette/document/write-document-field.component.js +1 -4
  9. package/esm2015/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.js +16 -1
  10. package/esm2015/lib/shared/components/workbasket-filters/workbasket-filters.component.js +12 -1
  11. package/esm2015/lib/shared/services/jurisdiction/jurisdiction.service.js +1 -2
  12. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +27 -11
  13. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  14. package/lib/shared/components/case-editor/services/case.notifier.d.ts.map +1 -1
  15. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  16. package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts +1 -1
  17. package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
  19. package/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.d.ts +5 -3
  20. package/lib/shared/components/palette/judicial-user/write-judicial-user-field.component.d.ts.map +1 -1
  21. package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts +1 -1
  22. package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts.map +1 -1
  23. package/lib/shared/services/jurisdiction/jurisdiction.service.d.ts.map +1 -1
  24. package/package.json +1 -1
@@ -6528,7 +6528,6 @@ class JurisdictionService {
6528
6528
  return this.httpService.get('/aggregated/caseworkers/:uid/jurisdictions?access=read');
6529
6529
  }
6530
6530
  announceSelectedJurisdiction(jurisdiction) {
6531
- console.info('Announcing selected jurisdiction = ' + (jurisdiction === null || jurisdiction === void 0 ? void 0 : jurisdiction.id));
6532
6531
  this.selectedJurisdictionSource.next(jurisdiction);
6533
6532
  this.selectedJurisdictionBS.next(jurisdiction);
6534
6533
  }
@@ -8026,22 +8025,15 @@ class CaseNotifier {
8026
8025
  this.cachedCaseView = null;
8027
8026
  }
8028
8027
  announceCase(c) {
8029
- console.info('announceCase started.');
8030
8028
  this.caseViewSource.next(c);
8031
- console.info('announceCase finished.');
8032
8029
  }
8033
8030
  fetchAndRefresh(cid) {
8034
- console.info('fetchAndRefresh started.');
8035
8031
  return this.casesService
8036
8032
  .getCaseViewV2(cid)
8037
8033
  .pipe(map(caseView => {
8038
- console.info('mapping caseView started.');
8039
- // this.casesService.syncWait(10);
8040
- // throw new Error('******************************************************');
8041
8034
  this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
8042
8035
  this.setBasicFields(this.cachedCaseView.tabs);
8043
8036
  this.announceCase(this.cachedCaseView);
8044
- console.info('mapping caseView finished. Returning it.');
8045
8037
  return this.cachedCaseView;
8046
8038
  }));
8047
8039
  }
@@ -12755,7 +12747,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
12755
12747
  }
12756
12748
  ngOnInit() {
12757
12749
  this.secureModeOn = this.appConfig.getDocumentSecureMode();
12758
- console.info('writeDocumentField.ngInit: secure mode = ' + this.secureModeOn);
12759
12750
  if (this.secureModeOn) {
12760
12751
  this.subscribeToCaseDetails();
12761
12752
  }
@@ -12881,7 +12872,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
12881
12872
  var _a, _b;
12882
12873
  this.caseTypeId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_id;
12883
12874
  this.jurisdictionId = (_b = (_a = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_type) === null || _a === void 0 ? void 0 : _a.jurisdiction) === null || _b === void 0 ? void 0 : _b.id;
12884
- console.info(`caseNotifier.next: caseType=${this.caseTypeId} juris=${this.jurisdictionId}`);
12885
12875
  }
12886
12876
  });
12887
12877
  this.jurisdictionSubs = this.jurisdictionService.selectedJurisdictionBS.subscribe({
@@ -12892,7 +12882,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
12892
12882
  this.caseTypeId = jurisdiction.currentCaseType.id;
12893
12883
  }
12894
12884
  }
12895
- console.info(`selectedJurisdiction.next: caseType=${this.caseTypeId} juris=${this.jurisdictionId}`);
12896
12885
  }
12897
12886
  });
12898
12887
  }
@@ -14238,6 +14227,17 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
14238
14227
  this.jurisdiction = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.jurisdiction;
14239
14228
  this.caseType = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.caseType;
14240
14229
  }
14230
+ else {
14231
+ // If there is no case info, attempt to get the current jurisdiction and case type via the JurisdictionService
14232
+ this.jurisdictionSubscription = this.jurisdictionService.selectedJurisdictionBS.subscribe((jurisdiction) => {
14233
+ if (jurisdiction) {
14234
+ this.jurisdiction = jurisdiction.id;
14235
+ if (jurisdiction.currentCaseType) {
14236
+ this.caseType = jurisdiction.currentCaseType.id;
14237
+ }
14238
+ }
14239
+ });
14240
+ }
14241
14241
  }
14242
14242
  displayJudicialUser(judicialUser) {
14243
14243
  return judicialUser
@@ -14283,6 +14283,10 @@ class WriteJudicialUserFieldComponent extends WriteComplexFieldComponent {
14283
14283
  this.judicialUserControl.setValidators(Validators.required);
14284
14284
  }
14285
14285
  }
14286
+ ngOnDestroy() {
14287
+ var _a;
14288
+ (_a = this.jurisdictionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
14289
+ }
14286
14290
  }
14287
14291
  WriteJudicialUserFieldComponent.ɵfac = function WriteJudicialUserFieldComponent_Factory(t) { return new (t || WriteJudicialUserFieldComponent)(i0.ɵɵdirectiveInject(JurisdictionService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseFlagRefdataService), i0.ɵɵdirectiveInject(IsCompoundPipe), i0.ɵɵdirectiveInject(FormValidatorsService)); };
14288
14292
  WriteJudicialUserFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteJudicialUserFieldComponent, selectors: [["ccd-write-judicial-user-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 12, vars: 17, consts: [[1, "form-group", 3, "formGroup", "ngClass"], [3, "for"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [1, "form-control", "bottom-30", 3, "id", "formControl", "matAutocomplete", "blur"], ["autoActiveFirstOption", "", 3, "displayWith"], ["autoComplete", "matAutocomplete"], ["class", "select-option", 3, "ngClass", "value", "onSelectionChange", 4, "ngFor", "ngForOf"], ["class", "select-option", "disabled", "", 4, "ngIf"], [1, "form-label"], [1, "form-hint"], [1, "error-message"], [1, "select-option", 3, "ngClass", "value", "onSelectionChange"], ["disabled", "", 1, "select-option"]], template: function WriteJudicialUserFieldComponent_Template(rf, ctx) { if (rf & 1) {
@@ -26004,9 +26008,20 @@ class WorkbasketFiltersComponent {
26004
26008
  if (init) {
26005
26009
  this.windowService.setLocalStorage(SAVED_QUERY_PARAM_LOC_STORAGE, JSON.stringify(queryParams));
26006
26010
  if (Object.keys(this.formGroup.controls).length > 0) {
26011
+ // Find all "special case" JudicialUser FormControl keys and remove the corresponding values from the
26012
+ // FormGroup value because these values are not intended to be stored and subsequently passed as query string
26013
+ // parameters when calling searchCases API endpoint
26014
+ const judicialUserControlValuesToRemove = Object.keys(this.formGroup.controls).filter((key) => key.endsWith('_judicialUserControl'));
26015
+ judicialUserControlValuesToRemove.forEach((controlKey) => delete this.formGroup.value[controlKey]);
26007
26016
  this.windowService.setLocalStorage(FORM_GROUP_VAL_LOC_STORAGE, JSON.stringify(this.formGroup.value));
26008
26017
  }
26009
26018
  }
26019
+ // Announce selected jurisdiction via JurisdictionService
26020
+ if (this.selected.jurisdiction) {
26021
+ // Set the selected case type as the current case type of the selected jurisdiction
26022
+ this.selected.jurisdiction.currentCaseType = this.selected.caseType;
26023
+ this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
26024
+ }
26010
26025
  // Apply filters
26011
26026
  this.onApply.emit({ selected: this.selected, queryParams });
26012
26027
  this.setFocusToTop();
@@ -28244,6 +28259,7 @@ class CaseFullAccessViewComponent {
28244
28259
  const targetTabIndex = this.tabGroup._tabs.toArray().findIndex(tab => tab.textLabel === triggerOutputEventText);
28245
28260
  if (targetTabIndex > -1) {
28246
28261
  this.selectedTabIndex = targetTabIndex;
28262
+ this.tabGroup.selectedIndex = targetTabIndex;
28247
28263
  }
28248
28264
  }
28249
28265
  hasActiveCaseFlags() {