@hmcts/ccd-case-ui-toolkit 6.19.3-RetryCaseRetrievals.1 → 6.19.5-secure-doc-case-creation.1

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 (23) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +56 -29
  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-editor.module.js +6 -6
  6. package/esm2015/lib/shared/components/create-case-filters/create-case-filters.component.js +13 -8
  7. package/esm2015/lib/shared/components/palette/document/write-document-field.component.js +43 -20
  8. package/esm2015/lib/shared/components/palette/palette.module.js +4 -5
  9. package/esm2015/lib/shared/domain/definition/jurisdiction.model.js +1 -1
  10. package/esm2015/lib/shared/services/jurisdiction/jurisdiction.service.js +6 -2
  11. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +56 -29
  12. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  13. package/lib/shared/components/case-editor/case-editor.module.d.ts +8 -8
  14. package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts +3 -1
  15. package/lib/shared/components/create-case-filters/create-case-filters.component.d.ts.map +1 -1
  16. package/lib/shared/components/palette/document/write-document-field.component.d.ts +8 -4
  17. package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  19. package/lib/shared/domain/definition/jurisdiction.model.d.ts +1 -0
  20. package/lib/shared/domain/definition/jurisdiction.model.d.ts.map +1 -1
  21. package/lib/shared/services/jurisdiction/jurisdiction.service.d.ts +3 -2
  22. package/lib/shared/services/jurisdiction/jurisdiction.service.d.ts.map +1 -1
  23. package/package.json +1 -1
@@ -7699,14 +7699,18 @@
7699
7699
  var JurisdictionService = /** @class */ (function () {
7700
7700
  function JurisdictionService(httpService) {
7701
7701
  this.httpService = httpService;
7702
+ // We retain the Subject observable because subscribing code couldn't happen a null value
7702
7703
  this.selectedJurisdictionSource = new rxjs.Subject();
7704
+ this.selectedJurisdictionBS = new rxjs.BehaviorSubject(null);
7703
7705
  this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
7704
7706
  }
7705
7707
  JurisdictionService.prototype.getJurisdictions = function () {
7706
7708
  return this.httpService.get('/aggregated/caseworkers/:uid/jurisdictions?access=read');
7707
7709
  };
7708
7710
  JurisdictionService.prototype.announceSelectedJurisdiction = function (jurisdiction) {
7711
+ console.info('Announcing selected jurisdiction = ' + (jurisdiction === null || jurisdiction === void 0 ? void 0 : jurisdiction.id));
7709
7712
  this.selectedJurisdictionSource.next(jurisdiction);
7713
+ this.selectedJurisdictionBS.next(jurisdiction);
7710
7714
  };
7711
7715
  JurisdictionService.prototype.searchJudicialUsers = function (searchTerm, serviceId) {
7712
7716
  return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
@@ -14631,18 +14635,19 @@
14631
14635
  var _c1$k = function (a0) { return { "form-group-error bottom-30": a0 }; };
14632
14636
  var WriteDocumentFieldComponent = /** @class */ (function (_super) {
14633
14637
  __extends(WriteDocumentFieldComponent, _super);
14634
- function WriteDocumentFieldComponent(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService) {
14638
+ function WriteDocumentFieldComponent(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
14635
14639
  var _this = _super.call(this) || this;
14636
14640
  _this.appConfig = appConfig;
14637
14641
  _this.caseNotifier = caseNotifier;
14638
14642
  _this.documentManagement = documentManagement;
14639
14643
  _this.dialog = dialog;
14640
14644
  _this.fileUploadStateService = fileUploadStateService;
14645
+ _this.jurisdictionService = jurisdictionService;
14641
14646
  _this.valid = true;
14642
14647
  return _this;
14643
14648
  }
14644
14649
  WriteDocumentFieldComponent.prototype.clickout = function (event) {
14645
- // Capturing the event of of the associated ElementRef <input type="file" #fileInpu
14650
+ // Capturing the event of the associated ElementRef <input type="file" #fileInpu
14646
14651
  if (this.fileInput.nativeElement.contains(event.target)) {
14647
14652
  this.clickInsideTheDocument = true;
14648
14653
  }
@@ -14652,6 +14657,10 @@
14652
14657
  };
14653
14658
  WriteDocumentFieldComponent.prototype.ngOnInit = function () {
14654
14659
  this.secureModeOn = this.appConfig.getDocumentSecureMode();
14660
+ console.info('writeDocumentField.ngInit: secure mode = ' + this.secureModeOn);
14661
+ if (this.secureModeOn) {
14662
+ this.subscribeToCaseDetails();
14663
+ }
14655
14664
  this.dialogConfig = initDialog();
14656
14665
  // EUI-3403. The field was not being registered when there was no value and the field
14657
14666
  // itself was not mandatory, which meant that show_conditions would not be evaluated.
@@ -14664,9 +14673,6 @@
14664
14673
  else {
14665
14674
  this.createDocumentForm(document);
14666
14675
  }
14667
- if (this.appConfig.getDocumentSecureMode()) {
14668
- this.subscribeToCaseDetails();
14669
- }
14670
14676
  };
14671
14677
  WriteDocumentFieldComponent.prototype.ngOnDestroy = function () {
14672
14678
  if (this.fileUploadSubscription) {
@@ -14675,8 +14681,11 @@
14675
14681
  if (this.dialogSubscription) {
14676
14682
  this.dialogSubscription.unsubscribe();
14677
14683
  }
14678
- if (this.caseEventSubscription) {
14679
- this.caseEventSubscription.unsubscribe();
14684
+ if (this.caseNotifierSubscription) {
14685
+ this.caseNotifierSubscription.unsubscribe();
14686
+ }
14687
+ if (this.jurisdictionSubs) {
14688
+ this.jurisdictionSubs.unsubscribe();
14680
14689
  }
14681
14690
  };
14682
14691
  WriteDocumentFieldComponent.prototype.isUploadInProgress = function () {
@@ -14728,7 +14737,9 @@
14728
14737
  WriteDocumentFieldComponent.prototype.triggerReplace = function () {
14729
14738
  if (this.confirmReplaceResult === 'Replace') {
14730
14739
  this.openFileDialog();
14740
+ return true;
14731
14741
  }
14742
+ return false;
14732
14743
  };
14733
14744
  WriteDocumentFieldComponent.prototype.getUploadedFileName = function () {
14734
14745
  if (this.uploadedDocument) {
@@ -14763,11 +14774,30 @@
14763
14774
  _this.triggerReplace();
14764
14775
  });
14765
14776
  };
14777
+ // Depending on the context, we can get the case type and jurisdiction from different sources
14778
+ // If we are running an event, the caseNotifier will have the current case
14779
+ // If we are creating a case, the case doesn't exist yet, so the caseNotifier can't help
14780
+ // Instead we can use the eventTrigger to get the case type, and the jurisdiction service to
14781
+ // get the currently selected jurisdiction
14766
14782
  WriteDocumentFieldComponent.prototype.subscribeToCaseDetails = function () {
14767
14783
  var _this = this;
14768
- this.caseEventSubscription = this.caseNotifier.caseView.subscribe({
14784
+ this.caseNotifierSubscription = this.caseNotifier.caseView.subscribe({
14769
14785
  next: function (caseDetails) {
14770
- _this.caseDetails = caseDetails;
14786
+ var _a, _b;
14787
+ _this.caseTypeId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.case_id;
14788
+ _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;
14789
+ console.info("caseNotifier.next: caseType=" + _this.caseTypeId + " juris=" + _this.jurisdictionId);
14790
+ }
14791
+ });
14792
+ this.jurisdictionSubs = this.jurisdictionService.selectedJurisdictionBS.subscribe({
14793
+ next: function (jurisdiction) {
14794
+ if (jurisdiction) {
14795
+ _this.jurisdictionId = jurisdiction.id;
14796
+ if (jurisdiction.currentCaseType) {
14797
+ _this.caseTypeId = jurisdiction.currentCaseType.id;
14798
+ }
14799
+ }
14800
+ console.info("selectedJurisdiction.next: caseType=" + _this.caseTypeId + " juris=" + _this.jurisdictionId);
14771
14801
  }
14772
14802
  });
14773
14803
  };
@@ -14831,13 +14861,8 @@
14831
14861
  documentUpload.append('files', selectedFile, selectedFile.name);
14832
14862
  documentUpload.append('classification', 'PUBLIC');
14833
14863
  if (this.appConfig.getDocumentSecureMode()) {
14834
- var caseTypeId = this.caseDetails &&
14835
- this.caseDetails.case_type &&
14836
- this.caseDetails.case_type.id ? this.caseDetails.case_type.id : null;
14837
- var caseTypeJurisdictionId = this.caseDetails &&
14838
- this.caseDetails.case_type &&
14839
- this.caseDetails.case_type.jurisdiction &&
14840
- this.caseDetails.case_type.jurisdiction.id ? this.caseDetails.case_type.jurisdiction.id : null;
14864
+ var caseTypeId = this.caseTypeId ? this.caseTypeId : null;
14865
+ var caseTypeJurisdictionId = this.jurisdictionId ? this.jurisdictionId : null;
14841
14866
  documentUpload.append('caseTypeId', caseTypeId);
14842
14867
  documentUpload.append('jurisdictionId', caseTypeJurisdictionId);
14843
14868
  }
@@ -14885,7 +14910,7 @@
14885
14910
  WriteDocumentFieldComponent.UPLOAD_ERROR_FILE_REQUIRED = 'File required';
14886
14911
  WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE = 'Document upload facility is not available at the moment';
14887
14912
  WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
14888
- WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CaseNotifier), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog), i0__namespace.ɵɵdirectiveInject(FileUploadStateService)); };
14913
+ WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CaseNotifier), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog), i0__namespace.ɵɵdirectiveInject(FileUploadStateService), i0__namespace.ɵɵdirectiveInject(JurisdictionService)); };
14889
14914
  WriteDocumentFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) {
14890
14915
  if (rf & 1) {
14891
14916
  i0__namespace.ɵɵviewQuery(_c0$N, 1);
@@ -14963,7 +14988,7 @@
14963
14988
  selector: 'ccd-write-document-field',
14964
14989
  templateUrl: './write-document-field.html'
14965
14990
  }]
14966
- }], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1__namespace$3.MatDialog }, { type: FileUploadStateService }]; }, { fileInput: [{
14991
+ }], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1__namespace$3.MatDialog }, { type: FileUploadStateService }, { type: JurisdictionService }]; }, { fileInput: [{
14967
14992
  type: i0.ViewChild,
14968
14993
  args: ['fileInput', { static: false }]
14969
14994
  }], clickout: [{
@@ -26880,13 +26905,13 @@
26880
26905
  CaseFlagRefdataService,
26881
26906
  YesNoService,
26882
26907
  CollectionCreateCheckerService,
26908
+ JurisdictionService,
26883
26909
  PaletteService,
26884
26910
  FormValidatorsService,
26885
26911
  FileUploadStateService,
26886
26912
  FileUploadProgressGuard,
26887
26913
  WindowService,
26888
26914
  CommonDataService,
26889
- JurisdictionService,
26890
26915
  LinkedCasesService,
26891
26916
  { provide: i6.MAT_DATE_LOCALE, useValue: 'en-GB' }
26892
26917
  ], imports: [[
@@ -27236,17 +27261,16 @@
27236
27261
  CaseFlagRefdataService,
27237
27262
  YesNoService,
27238
27263
  CollectionCreateCheckerService,
27264
+ JurisdictionService,
27239
27265
  PaletteService,
27240
27266
  FormValidatorsService,
27241
27267
  FileUploadStateService,
27242
27268
  FileUploadProgressGuard,
27243
27269
  WindowService,
27244
27270
  CommonDataService,
27245
- JurisdictionService,
27246
27271
  LinkedCasesService,
27247
27272
  { provide: i6.MAT_DATE_LOCALE, useValue: 'en-GB' }
27248
- ],
27249
- entryComponents: [CaseFileViewFolderSelectorComponent]
27273
+ ]
27250
27274
  }]
27251
27275
  }], null, null);
27252
27276
  })();
@@ -28592,13 +28616,13 @@
28592
28616
  i2$1.FormsModule,
28593
28617
  i2$1.ReactiveFormsModule,
28594
28618
  CaseEditDataModule,
28595
- PaletteModule,
28596
28619
  LabelSubstitutorModule,
28597
28620
  ConditionalShowModule,
28598
28621
  ErrorsModule,
28599
28622
  i6$2.PortalModule,
28600
28623
  LoadingSpinnerModule,
28601
28624
  BannersModule,
28625
+ PaletteModule,
28602
28626
  i1.RpxTranslationModule.forChild()
28603
28627
  ]] });
28604
28628
  (function () {
@@ -28617,13 +28641,13 @@
28617
28641
  i2$1.FormsModule,
28618
28642
  i2$1.ReactiveFormsModule,
28619
28643
  CaseEditDataModule,
28620
- PaletteModule,
28621
28644
  LabelSubstitutorModule,
28622
28645
  ConditionalShowModule,
28623
28646
  ErrorsModule,
28624
28647
  i6$2.PortalModule,
28625
28648
  LoadingSpinnerModule,
28626
- BannersModule, i1__namespace.RpxTranslationModule], exports: [CaseEditConfirmComponent,
28649
+ BannersModule,
28650
+ PaletteModule, i1__namespace.RpxTranslationModule], exports: [CaseEditConfirmComponent,
28627
28651
  CaseEditComponent,
28628
28652
  CaseEditPageComponent,
28629
28653
  CaseEditFormComponent,
@@ -28642,13 +28666,13 @@
28642
28666
  i2$1.FormsModule,
28643
28667
  i2$1.ReactiveFormsModule,
28644
28668
  CaseEditDataModule,
28645
- PaletteModule,
28646
28669
  LabelSubstitutorModule,
28647
28670
  ConditionalShowModule,
28648
28671
  ErrorsModule,
28649
28672
  i6$2.PortalModule,
28650
28673
  LoadingSpinnerModule,
28651
28674
  BannersModule,
28675
+ PaletteModule,
28652
28676
  i1.RpxTranslationModule.forChild()
28653
28677
  ],
28654
28678
  declarations: [
@@ -35412,10 +35436,11 @@
35412
35436
  }
35413
35437
  }
35414
35438
  var CreateCaseFiltersComponent = /** @class */ (function () {
35415
- function CreateCaseFiltersComponent(orderService, definitionsService, sessionStorageService) {
35439
+ function CreateCaseFiltersComponent(orderService, definitionsService, sessionStorageService, jurisdictionService) {
35416
35440
  this.orderService = orderService;
35417
35441
  this.definitionsService = definitionsService;
35418
35442
  this.sessionStorageService = sessionStorageService;
35443
+ this.jurisdictionService = jurisdictionService;
35419
35444
  this.selectionSubmitted = new i0.EventEmitter();
35420
35445
  this.selectionChanged = new i0.EventEmitter();
35421
35446
  this.formGroup = new i2$1.FormGroup({});
@@ -35469,6 +35494,8 @@
35469
35494
  !this.isDisabled;
35470
35495
  };
35471
35496
  CreateCaseFiltersComponent.prototype.apply = function () {
35497
+ this.selected.jurisdiction.currentCaseType = this.selected.caseType;
35498
+ this.jurisdictionService.announceSelectedJurisdiction(this.selected.jurisdiction);
35472
35499
  this.selectionSubmitted.emit({
35473
35500
  jurisdictionId: this.selected.jurisdiction.id,
35474
35501
  caseTypeId: this.selected.caseType.id,
@@ -35552,7 +35579,7 @@
35552
35579
  };
35553
35580
  return CreateCaseFiltersComponent;
35554
35581
  }());
35555
- CreateCaseFiltersComponent.ɵfac = function CreateCaseFiltersComponent_Factory(t) { return new (t || CreateCaseFiltersComponent)(i0__namespace.ɵɵdirectiveInject(OrderService), i0__namespace.ɵɵdirectiveInject(DefinitionsService), i0__namespace.ɵɵdirectiveInject(SessionStorageService)); };
35582
+ CreateCaseFiltersComponent.ɵfac = function CreateCaseFiltersComponent_Factory(t) { return new (t || CreateCaseFiltersComponent)(i0__namespace.ɵɵdirectiveInject(OrderService), i0__namespace.ɵɵdirectiveInject(DefinitionsService), i0__namespace.ɵɵdirectiveInject(SessionStorageService), i0__namespace.ɵɵdirectiveInject(JurisdictionService)); };
35556
35583
  CreateCaseFiltersComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CreateCaseFiltersComponent, selectors: [["ccd-create-case-filters"]], inputs: { isDisabled: "isDisabled", startButtonText: "startButtonText" }, outputs: { selectionSubmitted: "selectionSubmitted", selectionChanged: "selectionChanged" }, decls: 31, vars: 28, consts: [[3, "ngSubmit"], [1, "form-group"], ["for", "cc-jurisdiction", 1, "form-label"], ["id", "cc-jurisdiction", "name", "jurisdiction", 1, "form-control", "ccd-dropdown", 3, "formControl", "change"], ["value", ""], [3, "value", 4, "ngFor", "ngForOf"], ["for", "cc-case-type", 1, "form-label"], ["id", "cc-case-type", "name", "case-type", 1, "form-control", "ccd-dropdown", 3, "formControl", "change"], ["for", "cc-event", 1, "form-label"], ["id", "cc-event", "name", "event", 1, "form-control", "ccd-dropdown", 3, "formControl", "change"], ["type", "submit", 1, "button", 3, "disabled"], [3, "value"]], template: function CreateCaseFiltersComponent_Template(rf, ctx) {
35557
35584
  if (rf & 1) {
35558
35585
  i0__namespace.ɵɵelementStart(0, "form", 0);
@@ -35643,7 +35670,7 @@
35643
35670
  selector: 'ccd-create-case-filters',
35644
35671
  templateUrl: './create-case-filters.component.html'
35645
35672
  }]
35646
- }], function () { return [{ type: OrderService }, { type: DefinitionsService }, { type: SessionStorageService }]; }, { isDisabled: [{
35673
+ }], function () { return [{ type: OrderService }, { type: DefinitionsService }, { type: SessionStorageService }, { type: JurisdictionService }]; }, { isDisabled: [{
35647
35674
  type: i0.Input
35648
35675
  }], startButtonText: [{
35649
35676
  type: i0.Input