@hmcts/ccd-case-ui-toolkit 5.0.16-angular11-upgrade → 5.0.19-angular11-upgrade

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.
@@ -19548,7 +19548,7 @@ function CaseFullAccessViewComponent_ng_container_11_Template(rf, ctx) { if (rf
19548
19548
  i0.ɵɵproperty("ngIf", ctx_r4.prependedTabs && ctx_r4.prependedTabs.length || ctx_r4.appendedTabs && ctx_r4.appendedTabs.length);
19549
19549
  } }
19550
19550
  class CaseFullAccessViewComponent {
19551
- constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location) {
19551
+ constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf) {
19552
19552
  this.ngZone = ngZone;
19553
19553
  this.route = route;
19554
19554
  this.router = router;
@@ -19561,6 +19561,7 @@ class CaseFullAccessViewComponent {
19561
19561
  this.errorNotifierService = errorNotifierService;
19562
19562
  this.convertHrefToRouterService = convertHrefToRouterService;
19563
19563
  this.location = location;
19564
+ this.crf = crf;
19564
19565
  this.hasPrint = true;
19565
19566
  this.hasEventSelector = true;
19566
19567
  this.prependedTabs = [];
@@ -19572,8 +19573,15 @@ class CaseFullAccessViewComponent {
19572
19573
  this.ignoreWarning = false;
19573
19574
  this.callbackErrorsSubject = new Subject();
19574
19575
  }
19576
+ ngOnChanges(changes) {
19577
+ if (!changes.prependedTabs.firstChange) {
19578
+ this.init();
19579
+ this.crf.detectChanges();
19580
+ this.organiseTabPosition();
19581
+ }
19582
+ }
19575
19583
  ngOnInit() {
19576
- this.dialogConfig = initDialog();
19584
+ initDialog();
19577
19585
  this.init();
19578
19586
  this.callbackErrorsSubject.subscribe(errorEvent => {
19579
19587
  this.error = errorEvent;
@@ -19596,20 +19604,19 @@ class CaseFullAccessViewComponent {
19596
19604
  return this.caseDetails.case_type.printEnabled;
19597
19605
  }
19598
19606
  ngOnDestroy() {
19599
- if (this.activitySubscription && this.activityPollingService.isEnabled) {
19600
- this.activitySubscription.unsubscribe();
19601
- }
19602
- if (this.callbackErrorsSubject) {
19603
- this.callbackErrorsSubject.unsubscribe();
19604
- }
19605
- if (!this.route.snapshot.data.case && this.caseSubscription) {
19606
- this.caseSubscription.unsubscribe();
19607
+ if (this.activityPollingService.isEnabled) {
19608
+ this.unsubscribe(this.activitySubscription);
19607
19609
  }
19608
- if (this.errorSubscription) {
19609
- this.errorSubscription.unsubscribe();
19610
+ if (!this.route.snapshot.data.case) {
19611
+ this.unsubscribe(this.caseSubscription);
19610
19612
  }
19611
- if (this.subscription) {
19612
- this.subscription.unsubscribe();
19613
+ this.unsubscribe(this.callbackErrorsSubject);
19614
+ this.unsubscribe(this.errorSubscription);
19615
+ this.unsubscribe(this.subscription);
19616
+ }
19617
+ unsubscribe(subscription) {
19618
+ if (subscription) {
19619
+ subscription.unsubscribe();
19613
19620
  }
19614
19621
  }
19615
19622
  postViewActivity() {
@@ -19679,15 +19686,18 @@ class CaseFullAccessViewComponent {
19679
19686
  && this.error.details.field_errors
19680
19687
  && this.error.details.field_errors.length);
19681
19688
  }
19682
- ngAfterViewInit() {
19689
+ organiseTabPosition() {
19683
19690
  let matTab;
19684
19691
  const url = this.location.path(true);
19685
19692
  let hashValue = url.substring(url.indexOf('#') + 1);
19686
- if (!url.includes('#')) {
19693
+ if (!url.includes('#') && !url.includes('roles-and-access') && !url.includes('tasks')) {
19687
19694
  const paths = url.split('/');
19688
19695
  // lastPath can be /caseId, or the tabs /tasks, /hearings etc.
19689
19696
  const lastPath = decodeURIComponent(paths[paths.length - 1]);
19690
19697
  let foundTab = null;
19698
+ if (!this.prependedTabs) {
19699
+ this.prependedTabs = [];
19700
+ }
19691
19701
  const additionalTabs = [...this.prependedTabs, ...this.appendedTabs];
19692
19702
  if (additionalTabs && additionalTabs.length) {
19693
19703
  foundTab = additionalTabs.find((caseTab) => caseTab.id.toLowerCase() === lastPath.toLowerCase());
@@ -19705,7 +19715,7 @@ class CaseFullAccessViewComponent {
19705
19715
  this.caseDetails.tabs.sort((aTab, bTab) => aTab.order > bTab.order ? 1 : (bTab.order > aTab.order ? -1 : 0));
19706
19716
  // preselect the 1st order of CCD predefined tabs
19707
19717
  const preSelectTab = this.caseDetails.tabs[0];
19708
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(() => {
19718
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: preSelectTab.label }).then(() => {
19709
19719
  matTab = this.tabGroup._tabs.find((x) => x.textLabel === preSelectTab.label);
19710
19720
  this.tabGroup.selectedIndex = matTab.position;
19711
19721
  });
@@ -19714,6 +19724,9 @@ class CaseFullAccessViewComponent {
19714
19724
  else {
19715
19725
  const regExp = new RegExp(CaseFullAccessViewComponent.UNICODE_SPACE, 'g');
19716
19726
  hashValue = hashValue.replace(regExp, CaseFullAccessViewComponent.EMPTY_SPACE);
19727
+ if (hashValue.includes('roles-and-access') || hashValue.includes('tasks')) {
19728
+ hashValue = hashValue.includes('roles-and-access') ? 'roles and access' : 'tasks';
19729
+ }
19717
19730
  matTab = this.tabGroup._tabs.find((x) => x.textLabel.replace(CaseFullAccessViewComponent.EMPTY_SPACE, '').toLowerCase() ===
19718
19731
  hashValue.replace(CaseFullAccessViewComponent.EMPTY_SPACE, '').toLowerCase());
19719
19732
  if (matTab && matTab.position) {
@@ -19790,13 +19803,13 @@ CaseFullAccessViewComponent.TRIGGER_TEXT_START = 'Go';
19790
19803
  CaseFullAccessViewComponent.TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Go';
19791
19804
  CaseFullAccessViewComponent.UNICODE_SPACE = '%20';
19792
19805
  CaseFullAccessViewComponent.EMPTY_SPACE = ' ';
19793
- CaseFullAccessViewComponent.ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$5.MatDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i1.Location)); };
19806
+ CaseFullAccessViewComponent.ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$5.MatDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i1.Location), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
19794
19807
  CaseFullAccessViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFullAccessViewComponent, selectors: [["ccd-case-full-access-view"]], viewQuery: function CaseFullAccessViewComponent_Query(rf, ctx) { if (rf & 1) {
19795
19808
  i0.ɵɵviewQuery(_c0$a, 1);
19796
19809
  } if (rf & 2) {
19797
19810
  let _t;
19798
19811
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
19799
- } }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, decls: 12, vars: 11, 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"], [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"], ["animationDuration", "0ms", 3, "disableRipple", "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"], [1, "case-viewer-label", "text-16"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) { if (rf & 1) {
19812
+ } }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0.ɵɵNgOnChangesFeature], decls: 12, vars: 11, 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"], [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"], ["animationDuration", "0ms", 3, "disableRipple", "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"], [1, "case-viewer-label", "text-16"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) { if (rf & 1) {
19800
19813
  i0.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 10, 0, "div", 0);
19801
19814
  i0.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 6, 2, "div", 0);
19802
19815
  i0.ɵɵelementStart(2, "ccd-callback-errors", 1);
@@ -19839,7 +19852,7 @@ CaseFullAccessViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFullAcces
19839
19852
  templateUrl: './case-full-access-view.component.html',
19840
19853
  styleUrls: ['./case-full-access-view.component.scss']
19841
19854
  }]
19842
- }], function () { return [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$5.MatDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i1.Location }]; }, { hasPrint: [{
19855
+ }], function () { return [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$5.MatDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i1.Location }, { type: i0.ChangeDetectorRef }]; }, { hasPrint: [{
19843
19856
  type: Input
19844
19857
  }], hasEventSelector: [{
19845
19858
  type: Input