@hmcts/ccd-case-ui-toolkit 6.14.4 → 6.14.5-duplicate-tabs

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 +39 -50
  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-viewer/case-event-trigger/case-event-trigger.component.js +2 -4
  6. package/esm2015/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.js +23 -25
  7. package/esm2015/lib/shared/components/case-viewer/case-viewer.component.js +13 -15
  8. package/esm2015/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.js +2 -4
  9. package/esm2015/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.js +2 -4
  10. package/esm2015/lib/shared/components/palette/linked-cases/read-linked-cases-field.component.js +2 -4
  11. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +38 -49
  12. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  13. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
  14. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  15. package/lib/shared/components/case-viewer/case-viewer.component.d.ts +2 -2
  16. package/lib/shared/components/case-viewer/case-viewer.component.d.ts.map +1 -1
  17. package/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.d.ts.map +1 -1
  19. package/lib/shared/components/palette/linked-cases/read-linked-cases-field.component.d.ts.map +1 -1
  20. package/package.json +2 -2
@@ -15566,9 +15566,7 @@
15566
15566
  });
15567
15567
  };
15568
15568
  BeforeYouStartComponent.prototype.onBack = function () {
15569
- this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId]).then(function () {
15570
- window.location.hash = 'Linked cases';
15571
- });
15569
+ this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId], { fragment: 'Linked cases' });
15572
15570
  };
15573
15571
  return BeforeYouStartComponent;
15574
15572
  }());
@@ -17059,9 +17057,7 @@
17059
17057
  this.serverLinkedApiError = this.linkedCasesService.serverLinkedApiError;
17060
17058
  };
17061
17059
  NoLinkedCasesComponent.prototype.onBack = function () {
17062
- this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId]).then(function () {
17063
- window.location.hash = 'Linked cases';
17064
- });
17060
+ this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId], { fragment: 'Linked cases' });
17065
17061
  };
17066
17062
  return NoLinkedCasesComponent;
17067
17063
  }());
@@ -17526,9 +17522,7 @@
17526
17522
  }
17527
17523
  };
17528
17524
  ReadLinkedCasesFieldComponent.prototype.reloadCurrentRoute = function () {
17529
- this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseDetails.case_id]).then(function () {
17530
- window.location.hash = 'Linked cases';
17531
- });
17525
+ this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseDetails.case_id], { fragment: 'Linked cases' });
17532
17526
  };
17533
17527
  ReadLinkedCasesFieldComponent.prototype.getFailureLinkedToNotification = function (evt) {
17534
17528
  this.isServerLinkedToError = true;
@@ -30007,9 +30001,7 @@
30007
30001
  };
30008
30002
  CaseEventTriggerComponent.prototype.cancel = function () {
30009
30003
  if (this.router.url && this.router.url.includes('linkCases')) {
30010
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(function () {
30011
- window.location.hash = 'Linked cases';
30012
- });
30004
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: 'Linked cases' });
30013
30005
  }
30014
30006
  else {
30015
30007
  return this.router.navigate([this.parentUrl]);
@@ -30607,9 +30599,9 @@
30607
30599
  i0__namespace.ɵɵelementEnd();
30608
30600
  }
30609
30601
  if (rf & 2) {
30610
- var field_r24 = i0__namespace.ɵɵnextContext(2).$implicit;
30602
+ var field_r23 = i0__namespace.ɵɵnextContext(2).$implicit;
30611
30603
  i0__namespace.ɵɵadvance(2);
30612
- i0__namespace.ɵɵtextInterpolate(field_r24.label);
30604
+ i0__namespace.ɵɵtextInterpolate(field_r23.label);
30613
30605
  }
30614
30606
  }
30615
30607
  function CaseFullAccessViewComponent_ng_container_12_mat_tab_4_ng_template_1_ng_container_2_tr_4_Template(rf, ctx) {
@@ -30624,14 +30616,14 @@
30624
30616
  i0__namespace.ɵɵelementEnd();
30625
30617
  }
30626
30618
  if (rf & 2) {
30627
- var field_r24 = i0__namespace.ɵɵnextContext().$implicit;
30628
- var ctx_r25 = i0__namespace.ɵɵnextContext(4);
30619
+ var field_r23 = i0__namespace.ɵɵnextContext().$implicit;
30620
+ var ctx_r24 = i0__namespace.ɵɵnextContext(4);
30629
30621
  i0__namespace.ɵɵadvance(1);
30630
- i0__namespace.ɵɵproperty("ngIf", !ctx_r25.isFieldToHaveNoLabel(field_r24));
30622
+ i0__namespace.ɵɵproperty("ngIf", !ctx_r24.isFieldToHaveNoLabel(field_r23));
30631
30623
  i0__namespace.ɵɵadvance(1);
30632
- i0__namespace.ɵɵproperty("id", "case-viewer-field-read--" + field_r24.id);
30624
+ i0__namespace.ɵɵproperty("id", "case-viewer-field-read--" + field_r23.id);
30633
30625
  i0__namespace.ɵɵadvance(2);
30634
- i0__namespace.ɵɵproperty("topLevelFormGroup", ctx_r25.formGroup.controls["data"])("caseField", field_r24)("caseReference", ctx_r25.caseDetails.case_id)("markdownUseHrefAsRouterLink", ctx_r25.markdownUseHrefAsRouterLink);
30626
+ i0__namespace.ɵɵproperty("topLevelFormGroup", ctx_r24.formGroup.controls["data"])("caseField", field_r23)("caseReference", ctx_r24.caseDetails.case_id)("markdownUseHrefAsRouterLink", ctx_r24.markdownUseHrefAsRouterLink);
30635
30627
  }
30636
30628
  }
30637
30629
  function CaseFullAccessViewComponent_ng_container_12_mat_tab_4_ng_template_1_ng_container_2_tr_5_Template(rf, ctx) {
@@ -30645,12 +30637,12 @@
30645
30637
  i0__namespace.ɵɵelementEnd();
30646
30638
  }
30647
30639
  if (rf & 2) {
30648
- var field_r24 = i0__namespace.ɵɵnextContext().$implicit;
30649
- var ctx_r26 = i0__namespace.ɵɵnextContext(4);
30640
+ var field_r23 = i0__namespace.ɵɵnextContext().$implicit;
30641
+ var ctx_r25 = i0__namespace.ɵɵnextContext(4);
30650
30642
  i0__namespace.ɵɵadvance(1);
30651
- i0__namespace.ɵɵproperty("id", "case-viewer-field-read--" + field_r24.id);
30643
+ i0__namespace.ɵɵproperty("id", "case-viewer-field-read--" + field_r23.id);
30652
30644
  i0__namespace.ɵɵadvance(2);
30653
- i0__namespace.ɵɵproperty("topLevelFormGroup", ctx_r26.formGroup.controls["data"])("caseField", field_r24)("caseReference", ctx_r26.caseDetails.case_id)("markdownUseHrefAsRouterLink", ctx_r26.markdownUseHrefAsRouterLink);
30645
+ i0__namespace.ɵɵproperty("topLevelFormGroup", ctx_r25.formGroup.controls["data"])("caseField", field_r23)("caseReference", ctx_r25.caseDetails.case_id)("markdownUseHrefAsRouterLink", ctx_r25.markdownUseHrefAsRouterLink);
30654
30646
  }
30655
30647
  }
30656
30648
  function CaseFullAccessViewComponent_ng_container_12_mat_tab_4_ng_template_1_ng_container_2_Template(rf, ctx) {
@@ -30666,12 +30658,12 @@
30666
30658
  i0__namespace.ɵɵelementContainerEnd();
30667
30659
  }
30668
30660
  if (rf & 2) {
30669
- var field_r24 = ctx.$implicit;
30670
- var ctx_r23 = i0__namespace.ɵɵnextContext(4);
30661
+ var field_r23 = ctx.$implicit;
30662
+ var ctx_r22 = i0__namespace.ɵɵnextContext(4);
30671
30663
  i0__namespace.ɵɵadvance(1);
30672
- i0__namespace.ɵɵproperty("caseField", field_r24)("contextFields", ctx_r23.caseFields)("hidden", field_r24.hidden);
30664
+ i0__namespace.ɵɵproperty("caseField", field_r23)("contextFields", ctx_r22.caseFields)("hidden", field_r23.hidden);
30673
30665
  i0__namespace.ɵɵadvance(1);
30674
- i0__namespace.ɵɵproperty("ngSwitch", !i0__namespace.ɵɵpipeBind1(3, 6, field_r24));
30666
+ i0__namespace.ɵɵproperty("ngSwitch", !i0__namespace.ɵɵpipeBind1(3, 6, field_r23));
30675
30667
  i0__namespace.ɵɵadvance(2);
30676
30668
  i0__namespace.ɵɵproperty("ngSwitchCase", true);
30677
30669
  i0__namespace.ɵɵadvance(1);
@@ -30691,10 +30683,10 @@
30691
30683
  }
30692
30684
  if (rf & 2) {
30693
30685
  var tab_r20 = i0__namespace.ɵɵnextContext().$implicit;
30694
- var ctx_r22 = i0__namespace.ɵɵnextContext(2);
30686
+ var ctx_r21 = i0__namespace.ɵɵnextContext(2);
30695
30687
  i0__namespace.ɵɵclassMap(tab_r20.id);
30696
30688
  i0__namespace.ɵɵadvance(2);
30697
- i0__namespace.ɵɵproperty("ngForOf", i0__namespace.ɵɵpipeBindV(3, 3, i0__namespace.ɵɵpureFunction2(11, _c1$3, i0__namespace.ɵɵpipeBind1(4, 9, tab_r20), ctx_r22.formGroup.controls["data"])));
30689
+ i0__namespace.ɵɵproperty("ngForOf", i0__namespace.ɵɵpipeBindV(3, 3, i0__namespace.ɵɵpureFunction2(11, _c1$3, i0__namespace.ɵɵpipeBind1(4, 9, tab_r20), ctx_r21.formGroup.controls["data"])));
30698
30690
  }
30699
30691
  }
30700
30692
  function CaseFullAccessViewComponent_ng_container_12_mat_tab_4_Template(rf, ctx) {
@@ -30713,8 +30705,8 @@
30713
30705
  i0__namespace.ɵɵelement(0, "mat-tab", 26);
30714
30706
  }
30715
30707
  if (rf & 2) {
30716
- var tab_r32 = ctx.$implicit;
30717
- i0__namespace.ɵɵproperty("id", tab_r32.id)("label", tab_r32.label);
30708
+ var tab_r31 = ctx.$implicit;
30709
+ i0__namespace.ɵɵproperty("id", tab_r31.id)("label", tab_r31.label);
30718
30710
  }
30719
30711
  }
30720
30712
  function CaseFullAccessViewComponent_ng_container_12_router_outlet_6_Template(rf, ctx) {
@@ -30724,10 +30716,10 @@
30724
30716
  }
30725
30717
  function CaseFullAccessViewComponent_ng_container_12_Template(rf, ctx) {
30726
30718
  if (rf & 1) {
30727
- var _r34_1 = i0__namespace.ɵɵgetCurrentView();
30719
+ var _r33_1 = i0__namespace.ɵɵgetCurrentView();
30728
30720
  i0__namespace.ɵɵelementContainerStart(0);
30729
30721
  i0__namespace.ɵɵelementStart(1, "mat-tab-group", 23, 24);
30730
- i0__namespace.ɵɵlistener("selectedTabChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedTabChange_1_listener($event) { i0__namespace.ɵɵrestoreView(_r34_1); var ctx_r33 = i0__namespace.ɵɵnextContext(); return ctx_r33.tabChanged($event); });
30722
+ i0__namespace.ɵɵlistener("selectedTabChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedTabChange_1_listener($event) { i0__namespace.ɵɵrestoreView(_r33_1); var ctx_r32 = i0__namespace.ɵɵnextContext(); return ctx_r32.tabChanged($event); });
30731
30723
  i0__namespace.ɵɵtemplate(3, CaseFullAccessViewComponent_ng_container_12_mat_tab_3_Template, 1, 2, "mat-tab", 25);
30732
30724
  i0__namespace.ɵɵtemplate(4, CaseFullAccessViewComponent_ng_container_12_mat_tab_4_Template, 2, 2, "mat-tab", 25);
30733
30725
  i0__namespace.ɵɵtemplate(5, CaseFullAccessViewComponent_ng_container_12_mat_tab_5_Template, 1, 2, "mat-tab", 25);
@@ -30984,10 +30976,8 @@
30984
30976
  this.router.navigate([id], { relativeTo: this.route });
30985
30977
  }
30986
30978
  else {
30987
- var label_1 = tabChangeEvent.tab.textLabel;
30988
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(function () {
30989
- window.location.hash = label_1;
30990
- });
30979
+ var label = tabChangeEvent.tab.textLabel;
30980
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: label });
30991
30981
  }
30992
30982
  };
30993
30983
  CaseFullAccessViewComponent.prototype.onLinkClicked = function (triggerOutputEventText) {
@@ -31389,23 +31379,24 @@
31389
31379
  };
31390
31380
  CaseViewerComponent.prototype.loadCaseDetails = function () {
31391
31381
  var _this = this;
31392
- if (!this.route.snapshot.data.case) {
31382
+ if (this.route.snapshot.data.case) {
31383
+ this.caseDetails = this.route.snapshot.data.case;
31384
+ this.caseDetails.tabs = __spread(new Map(this.caseDetails.tabs.map(function (item) { return [item['label'], item]; })).values());
31385
+ this.setUserAccessType(this.caseDetails);
31386
+ }
31387
+ else {
31393
31388
  this.caseSubscription = this.caseNotifier.caseView.subscribe(function (caseDetails) {
31394
31389
  _this.caseDetails = caseDetails;
31395
31390
  _this.setUserAccessType(_this.caseDetails);
31396
31391
  });
31397
31392
  }
31398
- else {
31399
- this.caseDetails = this.route.snapshot.data.case;
31400
- this.setUserAccessType(this.caseDetails);
31401
- }
31402
31393
  };
31403
31394
  CaseViewerComponent.prototype.setUserAccessType = function (caseDetails) {
31404
31395
  if (caseDetails && Array.isArray(caseDetails.metadataFields)) {
31405
- var access_process = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_PROCEES_ID; });
31406
- var access_granted = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_GRANTED_ID; });
31407
- this.accessGranted = access_granted ? access_granted.value !== CaseViewerComponent.BASIC_USER_ACCESS_TYPES : false;
31408
- this.userAccessType = access_process ? access_process.value : null;
31396
+ var accessProcess = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_PROCESS_ID; });
31397
+ var accessGranted = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_GRANTED_ID; });
31398
+ this.accessGranted = accessGranted ? accessGranted.value !== CaseViewerComponent.BASIC_USER_ACCESS_TYPES : false;
31399
+ this.userAccessType = accessProcess ? accessProcess.value : null;
31409
31400
  }
31410
31401
  };
31411
31402
  CaseViewerComponent.prototype.isDataLoaded = function () {
@@ -31419,12 +31410,12 @@
31419
31410
  };
31420
31411
  return CaseViewerComponent;
31421
31412
  }());
31422
- CaseViewerComponent.METADATA_FIELD_ACCESS_PROCEES_ID = '[ACCESS_PROCESS]';
31413
+ CaseViewerComponent.METADATA_FIELD_ACCESS_PROCESS_ID = '[ACCESS_PROCESS]';
31423
31414
  CaseViewerComponent.METADATA_FIELD_ACCESS_GRANTED_ID = '[ACCESS_GRANTED]';
31424
31415
  CaseViewerComponent.NON_STANDARD_USER_ACCESS_TYPES = ['CHALLENGED', 'SPECIFIC'];
31425
31416
  CaseViewerComponent.BASIC_USER_ACCESS_TYPES = 'BASIC';
31426
31417
  CaseViewerComponent.ɵfac = function CaseViewerComponent_Factory(t) { return new (t || CaseViewerComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseNotifier), i0__namespace.ɵɵdirectiveInject(AbstractAppConfig)); };
31427
- CaseViewerComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseViewerComponent, selectors: [["ccd-case-viewer"]], inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs", caseDetails: "caseDetails" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [3, "accessType", "caseDetails", 4, "ngIf"], [3, "caseDetails", "hasPrint", "hasEventSelector", "prependedTabs", "appendedTabs", 4, "ngIf"], [3, "accessType", "caseDetails"], [3, "caseDetails", "hasPrint", "hasEventSelector", "prependedTabs", "appendedTabs"]], template: function CaseViewerComponent_Template(rf, ctx) {
31418
+ CaseViewerComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseViewerComponent, selectors: [["ccd-case-viewer"]], inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [3, "accessType", "caseDetails", 4, "ngIf"], [3, "caseDetails", "hasPrint", "hasEventSelector", "prependedTabs", "appendedTabs", 4, "ngIf"], [3, "accessType", "caseDetails"], [3, "caseDetails", "hasPrint", "hasEventSelector", "prependedTabs", "appendedTabs"]], template: function CaseViewerComponent_Template(rf, ctx) {
31428
31419
  if (rf & 1) {
31429
31420
  i0__namespace.ɵɵtemplate(0, CaseViewerComponent_div_0_Template, 3, 2, "div", 0);
31430
31421
  }
@@ -31447,8 +31438,6 @@
31447
31438
  type: i0.Input
31448
31439
  }], appendedTabs: [{
31449
31440
  type: i0.Input
31450
- }], caseDetails: [{
31451
- type: i0.Input
31452
31441
  }] });
31453
31442
  })();
31454
31443