@hmcts/ccd-case-ui-toolkit 6.14.5-testing → 6.14.6-exui-229

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.
@@ -28,7 +28,9 @@ import * as i6 from '@angular/material/core';
28
28
  import { MAT_DATE_LOCALE } from '@angular/material/core';
29
29
  import * as i3 from '@hmcts/ccpay-web-component';
30
30
  import { PaymentLibModule } from '@hmcts/ccpay-web-component';
31
- import * as i1$4 from '@angular/cdk/overlay';
31
+ import * as i1$4 from 'ngx-md';
32
+ import { NgxMdModule } from 'ngx-md';
33
+ import * as i1$5 from '@angular/cdk/overlay';
32
34
  import { OverlayModule } from '@angular/cdk/overlay';
33
35
  import * as i7 from '@angular/cdk/tree';
34
36
  import { NestedTreeControl, CdkTreeModule } from '@angular/cdk/tree';
@@ -41,8 +43,6 @@ import * as i5$1 from '@angular/material/datepicker';
41
43
  import { MatDatepickerModule } from '@angular/material/datepicker';
42
44
  import * as i6$1 from '@angular/material/form-field';
43
45
  import { MatFormFieldModule } from '@angular/material/form-field';
44
- import * as i1$5 from 'ngx-md';
45
- import { NgxMdModule } from 'ngx-md';
46
46
  import * as i11 from '@hmcts/media-viewer';
47
47
  import { MediaViewerModule } from '@hmcts/media-viewer';
48
48
  import * as i6$2 from '@angular/cdk/portal';
@@ -16646,16 +16646,52 @@ CasePaymentHistoryViewerFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: Ca
16646
16646
  }]
16647
16647
  }], function () { return [{ type: AbstractAppConfig }, { type: SessionStorageService }]; }, null); })();
16648
16648
 
16649
+ class MarkdownComponent {
16650
+ constructor() { }
16651
+ ngOnInit() {
16652
+ this.content = this.content.replace(/ \n/g, '<br>');
16653
+ }
16654
+ onMarkdownClick(event) {
16655
+ // If we don't have an anchor tag, we don't need to do anything.
16656
+ if (event.target instanceof HTMLAnchorElement === false) {
16657
+ return;
16658
+ }
16659
+ return true;
16660
+ }
16661
+ }
16662
+ MarkdownComponent.ɵfac = function MarkdownComponent_Factory(t) { return new (t || MarkdownComponent)(); };
16663
+ MarkdownComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MarkdownComponent, selectors: [["ccd-markdown"]], hostBindings: function MarkdownComponent_HostBindings(rf, ctx) { if (rf & 1) {
16664
+ i0.ɵɵlistener("click", function MarkdownComponent_click_HostBindingHandler($event) { return ctx.onMarkdownClick($event); });
16665
+ } }, inputs: { content: "content", markdownUseHrefAsRouterLink: "markdownUseHrefAsRouterLink" }, decls: 3, vars: 3, consts: [[1, "markdown", 3, "innerHTML"]], template: function MarkdownComponent_Template(rf, ctx) { if (rf & 1) {
16666
+ i0.ɵɵelementStart(0, "div");
16667
+ i0.ɵɵelement(1, "markdown", 0);
16668
+ i0.ɵɵpipe(2, "ccdCaseReference");
16669
+ i0.ɵɵelementEnd();
16670
+ } if (rf & 2) {
16671
+ i0.ɵɵadvance(1);
16672
+ i0.ɵɵproperty("innerHTML", i0.ɵɵpipeBind1(2, 1, ctx.content), i0.ɵɵsanitizeHtml);
16673
+ } }, directives: [i1$4.NgxMdComponent], pipes: [CaseReferencePipe], encapsulation: 2 });
16674
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MarkdownComponent, [{
16675
+ type: Component,
16676
+ args: [{
16677
+ selector: 'ccd-markdown',
16678
+ templateUrl: './markdown.html'
16679
+ }]
16680
+ }], function () { return []; }, { content: [{
16681
+ type: Input
16682
+ }], markdownUseHrefAsRouterLink: [{
16683
+ type: Input
16684
+ }], onMarkdownClick: [{
16685
+ type: HostListener,
16686
+ args: ['click', ['$event']]
16687
+ }] }); })();
16688
+
16649
16689
  function ReadDynamicMultiSelectListFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
16650
16690
  i0.ɵɵelementStart(0, "div");
16651
- i0.ɵɵtext(1);
16652
- i0.ɵɵpipe(2, "ccdFixedList");
16691
+ i0.ɵɵelementStart(1, "ccd-markdown");
16692
+ i0.ɵɵtext(2, "[content]=\"value.code | ccdFixedList:caseField.list_items\"");
16693
+ i0.ɵɵelementEnd();
16653
16694
  i0.ɵɵelementEnd();
16654
- } if (rf & 2) {
16655
- const value_r1 = ctx.$implicit;
16656
- const ctx_r0 = i0.ɵɵnextContext();
16657
- i0.ɵɵadvance(1);
16658
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(2, 1, value_r1.code, ctx_r0.caseField.list_items), "\n");
16659
16695
  } }
16660
16696
  class ReadDynamicMultiSelectListFieldComponent extends AbstractFieldReadComponent {
16661
16697
  ngOnInit() {
@@ -16674,10 +16710,10 @@ class ReadDynamicMultiSelectListFieldComponent extends AbstractFieldReadComponen
16674
16710
  }
16675
16711
  ReadDynamicMultiSelectListFieldComponent.ɵfac = function ReadDynamicMultiSelectListFieldComponent_Factory(t) { return ɵReadDynamicMultiSelectListFieldComponent_BaseFactory(t || ReadDynamicMultiSelectListFieldComponent); };
16676
16712
  ReadDynamicMultiSelectListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadDynamicMultiSelectListFieldComponent, selectors: [["ccd-read-dynamic-multi-select-list-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[4, "ngFor", "ngForOf"]], template: function ReadDynamicMultiSelectListFieldComponent_Template(rf, ctx) { if (rf & 1) {
16677
- i0.ɵɵtemplate(0, ReadDynamicMultiSelectListFieldComponent_div_0_Template, 3, 4, "div", 0);
16713
+ i0.ɵɵtemplate(0, ReadDynamicMultiSelectListFieldComponent_div_0_Template, 3, 0, "div", 0);
16678
16714
  } if (rf & 2) {
16679
16715
  i0.ɵɵproperty("ngForOf", ctx.caseField.value);
16680
- } }, directives: [i1.NgForOf], pipes: [FixedListPipe], styles: [".multi-select-list-field-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{padding:5px 0}.multi-select-list-field-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child > td[_ngcontent-%COMP%]{border-bottom:none}.multi-select-list-field-table[_ngcontent-%COMP%] td.collection-actions[_ngcontent-%COMP%]{width:1px;white-space:nowrap}"] });
16716
+ } }, directives: [i1.NgForOf, MarkdownComponent], styles: [".multi-select-list-field-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{padding:5px 0}.multi-select-list-field-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child > td[_ngcontent-%COMP%]{border-bottom:none}.multi-select-list-field-table[_ngcontent-%COMP%] td.collection-actions[_ngcontent-%COMP%]{width:1px;white-space:nowrap}"] });
16681
16717
  const ɵReadDynamicMultiSelectListFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(ReadDynamicMultiSelectListFieldComponent);
16682
16718
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadDynamicMultiSelectListFieldComponent, [{
16683
16719
  type: Component,
@@ -16725,7 +16761,7 @@ function WriteDynamicMultiSelectListFieldComponent_ng_container_6_Template(rf, c
16725
16761
  i0.ɵɵlistener("change", function WriteDynamicMultiSelectListFieldComponent_ng_container_6_Template_input_change_2_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.onCheckChange($event); });
16726
16762
  i0.ɵɵelementEnd();
16727
16763
  i0.ɵɵelementStart(3, "label", 10);
16728
- i0.ɵɵtext(4);
16764
+ i0.ɵɵelement(4, "ccd-markdown", 11);
16729
16765
  i0.ɵɵelementEnd();
16730
16766
  i0.ɵɵelementEnd();
16731
16767
  i0.ɵɵelementContainerEnd();
@@ -16739,7 +16775,7 @@ function WriteDynamicMultiSelectListFieldComponent_ng_container_6_Template(rf, c
16739
16775
  i0.ɵɵadvance(1);
16740
16776
  i0.ɵɵpropertyInterpolate("for", ctx_r3.createElementId(checkbox_r4.code));
16741
16777
  i0.ɵɵadvance(1);
16742
- i0.ɵɵtextInterpolate(checkbox_r4.label);
16778
+ i0.ɵɵproperty("content", checkbox_r4.label);
16743
16779
  } }
16744
16780
  const _c0$A = function (a0) { return { "error": a0 }; };
16745
16781
  class WriteDynamicMultiSelectListFieldComponent extends AbstractFieldWriteComponent {
@@ -16803,7 +16839,7 @@ class WriteDynamicMultiSelectListFieldComponent extends AbstractFieldWriteCompon
16803
16839
  }
16804
16840
  }
16805
16841
  WriteDynamicMultiSelectListFieldComponent.ɵfac = function WriteDynamicMultiSelectListFieldComponent_Factory(t) { return ɵWriteDynamicMultiSelectListFieldComponent_BaseFactory(t || WriteDynamicMultiSelectListFieldComponent); };
16806
- WriteDynamicMultiSelectListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteDynamicMultiSelectListFieldComponent, selectors: [["ccd-write-dynamic-multi-select-list-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 8, consts: [[1, "form-group", "bottom-30", 3, "ngClass", "id"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [4, "ngFor", "ngForOf"], [1, "form-label"], [1, "form-hint"], [1, "error-message"], [1, "multiple-choice"], ["type", "checkbox", 1, "form-control", 3, "id", "name", "value", "checked", "change"], [1, "form-label", 3, "for"]], template: function WriteDynamicMultiSelectListFieldComponent_Template(rf, ctx) { if (rf & 1) {
16842
+ WriteDynamicMultiSelectListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteDynamicMultiSelectListFieldComponent, selectors: [["ccd-write-dynamic-multi-select-list-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 8, consts: [[1, "form-group", "bottom-30", 3, "ngClass", "id"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [4, "ngFor", "ngForOf"], [1, "form-label"], [1, "form-hint"], [1, "error-message"], [1, "multiple-choice"], ["type", "checkbox", 1, "form-control", 3, "id", "name", "value", "checked", "change"], [1, "form-label", 3, "for"], [3, "content"]], template: function WriteDynamicMultiSelectListFieldComponent_Template(rf, ctx) { if (rf & 1) {
16807
16843
  i0.ɵɵelementStart(0, "div", 0);
16808
16844
  i0.ɵɵelementStart(1, "fieldset");
16809
16845
  i0.ɵɵelementStart(2, "legend");
@@ -16824,13 +16860,14 @@ WriteDynamicMultiSelectListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type:
16824
16860
  i0.ɵɵproperty("ngIf", ctx.checkboxes.errors && ctx.checkboxes.touched);
16825
16861
  i0.ɵɵadvance(1);
16826
16862
  i0.ɵɵproperty("ngForOf", ctx.caseField.list_items);
16827
- } }, directives: [i1.NgClass, i1.NgIf, i1.NgForOf], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
16863
+ } }, directives: [i1.NgClass, i1.NgIf, i1.NgForOf, MarkdownComponent], pipes: [FieldLabelPipe, FirstErrorPipe], styles: ["ccd-markdown[_ngcontent-%COMP%]{display:inline-block}"] });
16828
16864
  const ɵWriteDynamicMultiSelectListFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(WriteDynamicMultiSelectListFieldComponent);
16829
16865
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteDynamicMultiSelectListFieldComponent, [{
16830
16866
  type: Component,
16831
16867
  args: [{
16832
16868
  selector: 'ccd-write-dynamic-multi-select-list-field',
16833
- templateUrl: './write-dynamic-multi-select-list-field.html'
16869
+ templateUrl: './write-dynamic-multi-select-list-field.html',
16870
+ styleUrls: ['./write-dynamic-multi-select-list-field.component.scss']
16834
16871
  }]
16835
16872
  }], null, null); })();
16836
16873
 
@@ -17895,7 +17932,7 @@ CaseFileViewOverlayMenuComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFile
17895
17932
  const _r0 = i0.ɵɵreference(2);
17896
17933
  i0.ɵɵadvance(4);
17897
17934
  i0.ɵɵproperty("cdkConnectedOverlayOrigin", _r0)("cdkConnectedOverlayOpen", ctx.isOpen)("cdkConnectedOverlayHasBackdrop", true)("cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop");
17898
- } }, directives: [i1$4.CdkOverlayOrigin, i1$4.CdkConnectedOverlay, i1.NgIf, i1.NgForOf], styles: [".overlay-toggle[_ngcontent-%COMP%]{display:block;background:none;border:0;padding:0 6px;margin-right:-6px;cursor:pointer}.overlay-menu[_ngcontent-%COMP%]{background-color:#fafafa;border:1px solid grey;margin-top:8px;font-size:1rem}.overlay-menu__item[_ngcontent-%COMP%], .overlay-menu__title[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid grey}.overlay-menu__item[_ngcontent-%COMP%]:last-child, .overlay-menu__title[_ngcontent-%COMP%]:last-child{border:none}.overlay-menu__title[_ngcontent-%COMP%]{padding-left:6px;padding-right:6px}.overlay-menu__item[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875em}.overlay-menu__item[_ngcontent-%COMP%]:hover{background-color:#fff2cc}.overlay-menu__itemIcon[_ngcontent-%COMP%]{height:1.25em;width:1.25em;margin-right:6px}"] });
17935
+ } }, directives: [i1$5.CdkOverlayOrigin, i1$5.CdkConnectedOverlay, i1.NgIf, i1.NgForOf], styles: [".overlay-toggle[_ngcontent-%COMP%]{display:block;background:none;border:0;padding:0 6px;margin-right:-6px;cursor:pointer}.overlay-menu[_ngcontent-%COMP%]{background-color:#fafafa;border:1px solid grey;margin-top:8px;font-size:1rem}.overlay-menu__item[_ngcontent-%COMP%], .overlay-menu__title[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid grey}.overlay-menu__item[_ngcontent-%COMP%]:last-child, .overlay-menu__title[_ngcontent-%COMP%]:last-child{border:none}.overlay-menu__title[_ngcontent-%COMP%]{padding-left:6px;padding-right:6px}.overlay-menu__item[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875em}.overlay-menu__item[_ngcontent-%COMP%]:hover{background-color:#fff2cc}.overlay-menu__itemIcon[_ngcontent-%COMP%]{height:1.25em;width:1.25em;margin-right:6px}"] });
17899
17936
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFileViewOverlayMenuComponent, [{
17900
17937
  type: Component,
17901
17938
  args: [{
@@ -21323,46 +21360,6 @@ EventLogComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EventLogComponent, sele
21323
21360
  type: Output
21324
21361
  }] }); })();
21325
21362
 
21326
- class MarkdownComponent {
21327
- constructor() { }
21328
- ngOnInit() {
21329
- this.content = this.content.replace(/ \n/g, '<br>');
21330
- }
21331
- onMarkdownClick(event) {
21332
- // If we don't have an anchor tag, we don't need to do anything.
21333
- if (event.target instanceof HTMLAnchorElement === false) {
21334
- return;
21335
- }
21336
- return true;
21337
- }
21338
- }
21339
- MarkdownComponent.ɵfac = function MarkdownComponent_Factory(t) { return new (t || MarkdownComponent)(); };
21340
- MarkdownComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MarkdownComponent, selectors: [["ccd-markdown"]], hostBindings: function MarkdownComponent_HostBindings(rf, ctx) { if (rf & 1) {
21341
- i0.ɵɵlistener("click", function MarkdownComponent_click_HostBindingHandler($event) { return ctx.onMarkdownClick($event); });
21342
- } }, inputs: { content: "content", markdownUseHrefAsRouterLink: "markdownUseHrefAsRouterLink" }, decls: 3, vars: 3, consts: [[1, "markdown", 3, "innerHTML"]], template: function MarkdownComponent_Template(rf, ctx) { if (rf & 1) {
21343
- i0.ɵɵelementStart(0, "div");
21344
- i0.ɵɵelement(1, "markdown", 0);
21345
- i0.ɵɵpipe(2, "ccdCaseReference");
21346
- i0.ɵɵelementEnd();
21347
- } if (rf & 2) {
21348
- i0.ɵɵadvance(1);
21349
- i0.ɵɵproperty("innerHTML", i0.ɵɵpipeBind1(2, 1, ctx.content), i0.ɵɵsanitizeHtml);
21350
- } }, directives: [i1$5.NgxMdComponent], pipes: [CaseReferencePipe], encapsulation: 2 });
21351
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MarkdownComponent, [{
21352
- type: Component,
21353
- args: [{
21354
- selector: 'ccd-markdown',
21355
- templateUrl: './markdown.html'
21356
- }]
21357
- }], function () { return []; }, { content: [{
21358
- type: Input
21359
- }], markdownUseHrefAsRouterLink: [{
21360
- type: Input
21361
- }], onMarkdownClick: [{
21362
- type: HostListener,
21363
- args: ['click', ['$event']]
21364
- }] }); })();
21365
-
21366
21363
  class FeeValue {
21367
21364
  }
21368
21365
 
@@ -26779,7 +26776,7 @@ function CaseFullAccessViewComponent_ng_container_12_Template(rf, ctx) { if (rf
26779
26776
  const _r34 = i0.ɵɵgetCurrentView();
26780
26777
  i0.ɵɵelementContainerStart(0);
26781
26778
  i0.ɵɵelementStart(1, "mat-tab-group", 23, 24);
26782
- i0.ɵɵlistener("selectedTabChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedTabChange_1_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r33 = i0.ɵɵnextContext(); return ctx_r33.tabChanged($event); });
26779
+ i0.ɵɵlistener("selectedIndexChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedIndexChange_1_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r33 = i0.ɵɵnextContext(); return ctx_r33.tabChanged($event); });
26783
26780
  i0.ɵɵtemplate(3, CaseFullAccessViewComponent_ng_container_12_mat_tab_3_Template, 1, 2, "mat-tab", 25);
26784
26781
  i0.ɵɵtemplate(4, CaseFullAccessViewComponent_ng_container_12_mat_tab_4_Template, 2, 2, "mat-tab", 25);
26785
26782
  i0.ɵɵtemplate(5, CaseFullAccessViewComponent_ng_container_12_mat_tab_5_Template, 1, 2, "mat-tab", 25);
@@ -26815,6 +26812,7 @@ class CaseFullAccessViewComponent {
26815
26812
  this.location = location;
26816
26813
  this.crf = crf;
26817
26814
  this.sessionStorageService = sessionStorageService;
26815
+ this.HEARINGS_TAB_LABEL = 'Hearings';
26818
26816
  this.hasPrint = true;
26819
26817
  this.hasEventSelector = true;
26820
26818
  this.prependedTabs = [];
@@ -26826,6 +26824,7 @@ class CaseFullAccessViewComponent {
26826
26824
  this.ignoreWarning = false;
26827
26825
  this.selectedTabIndex = 0;
26828
26826
  this.activeCaseFlags = false;
26827
+ this.subs = [];
26829
26828
  this.callbackErrorsSubject = new Subject();
26830
26829
  }
26831
26830
  ngOnInit() {
@@ -26877,6 +26876,7 @@ class CaseFullAccessViewComponent {
26877
26876
  this.unsubscribe(this.callbackErrorsSubject);
26878
26877
  this.unsubscribe(this.errorSubscription);
26879
26878
  this.unsubscribe(this.subscription);
26879
+ this.subs.forEach(s => s.unsubscribe());
26880
26880
  }
26881
26881
  unsubscribe(subscription) {
26882
26882
  if (subscription) {
@@ -26884,7 +26884,7 @@ class CaseFullAccessViewComponent {
26884
26884
  }
26885
26885
  }
26886
26886
  checkRouteAndSetCaseViewTab() {
26887
- this.router.events
26887
+ this.subs.push(this.router.events
26888
26888
  .pipe(filter((event) => event instanceof NavigationEnd))
26889
26889
  .subscribe((event) => {
26890
26890
  const url = event && event.url;
@@ -26896,8 +26896,9 @@ class CaseFullAccessViewComponent {
26896
26896
  this.tabGroup.selectedIndex = matTab.position;
26897
26897
  }
26898
26898
  }
26899
- });
26899
+ }));
26900
26900
  }
26901
+ ;
26901
26902
  postViewActivity() {
26902
26903
  return this.activityPollingService.postViewActivity(this.caseDetails.case_id);
26903
26904
  }
@@ -27018,22 +27019,25 @@ class CaseFullAccessViewComponent {
27018
27019
  }
27019
27020
  }
27020
27021
  }
27021
- tabChanged(tabChangeEvent) {
27022
- // Update selected tab index
27023
- this.selectedTabIndex = tabChangeEvent.index;
27024
- const tab = tabChangeEvent.tab['_viewContainerRef'];
27025
- const id = tab.element.nativeElement.id;
27026
- // due to some edge case like hidden tab we can't calculate the last index of existing tabs,
27027
- // so have to hard code the hearings id here
27028
- if ((tabChangeEvent.index <= 1 && this.prependedTabs && this.prependedTabs.length) ||
27029
- (this.appendedTabs && this.appendedTabs.length && id === 'hearings')) {
27022
+ // Refactored under EXUI-110 to address infinite tab loop to use tabIndexChanged instead
27023
+ tabChanged(tabIndexChanged) {
27024
+ const matTab = this.tabGroup._tabs.find(tab => tab.isActive);
27025
+ const tabLabel = matTab.textLabel;
27026
+ // sortedTabs are fragments
27027
+ // appended/prepepended tabs use router navigation
27028
+ if ((tabIndexChanged <= 1 && this.prependedTabs && this.prependedTabs.length) ||
27029
+ (this.appendedTabs && this.appendedTabs.length && tabLabel === this.HEARINGS_TAB_LABEL)) {
27030
+ // Hack to get ID from tab as it's not easily achieved through Angular Material Tabs
27031
+ const tab = matTab['_viewContainerRef'];
27032
+ const id = tab.element.nativeElement.id;
27033
+ // cases/case-details/:caseId/hearings
27034
+ // cases/case-details/:caseId/roles-and-access
27030
27035
  this.router.navigate([id], { relativeTo: this.route });
27031
27036
  }
27032
27037
  else {
27033
- const label = tabChangeEvent.tab.textLabel;
27034
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(() => {
27035
- window.location.hash = label;
27036
- });
27038
+ // Routing here is based on tab label, not ideal
27039
+ // cases/case-details/:caseId#tabLabel
27040
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: tabLabel });
27037
27041
  }
27038
27042
  }
27039
27043
  onLinkClicked(triggerOutputEventText) {
@@ -27129,6 +27133,12 @@ class CaseFullAccessViewComponent {
27129
27133
  this.callbackErrorsSubject.next(null);
27130
27134
  this.alertService.clear();
27131
27135
  }
27136
+ getUrlFragment(url) {
27137
+ return url.split('#')[url.split('#').length - 1];
27138
+ }
27139
+ getTabIndexByTabLabel(tabGroup, tabLabel) {
27140
+ return tabGroup._tabs.toArray().findIndex((t) => t.textLabel.toLowerCase() === tabLabel.toLowerCase());
27141
+ }
27132
27142
  }
27133
27143
  CaseFullAccessViewComponent.ORIGIN_QUERY_PARAM = 'origin';
27134
27144
  CaseFullAccessViewComponent.TRIGGER_TEXT_START = 'Go';
@@ -27141,7 +27151,7 @@ CaseFullAccessViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFullAcces
27141
27151
  } if (rf & 2) {
27142
27152
  let _t;
27143
27153
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
27144
- } }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedTabChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) { if (rf & 1) {
27154
+ } }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedIndexChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) { if (rf & 1) {
27145
27155
  i0.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 10, 0, "div", 0);
27146
27156
  i0.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 6, 2, "div", 0);
27147
27157
  i0.ɵɵelementStart(2, "ccd-callback-errors", 1);