@hmcts/ccd-case-ui-toolkit 6.15.0-b → 6.15.0-d

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.
@@ -16963,6 +16963,9 @@ class PaymentField extends AbstractFieldReadComponent {
16963
16963
  getRefundsUrl() {
16964
16964
  return this.appConfig.getRefundsUrl();
16965
16965
  }
16966
+ getNotificationUrl() {
16967
+ return this.appConfig.getNotificationUrl();
16968
+ }
16966
16969
  getUserRoles() {
16967
16970
  const userDetails = JSON.parse(this.sessionStorage.getItem('userDetails') || null);
16968
16971
  if (!userDetails || !userDetails.hasOwnProperty('roles')) {
@@ -16985,10 +16988,10 @@ class CasePaymentHistoryViewerFieldComponent extends PaymentField {
16985
16988
  }
16986
16989
  }
16987
16990
  CasePaymentHistoryViewerFieldComponent.ɵfac = function CasePaymentHistoryViewerFieldComponent_Factory(t) { return new (t || CasePaymentHistoryViewerFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(SessionStorageService)); };
16988
- CasePaymentHistoryViewerFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CasePaymentHistoryViewerFieldComponent, selectors: [["ccd-case-payment-history-viewer-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 15, consts: [[3, "API_ROOT", "CCD_CASE_NUMBER", "BULKSCAN_API_ROOT", "SELECTED_OPTION", "ISBSENABLE", "LOGGEDINUSEREMAIL", "LOGGEDINUSERROLES", "REFUNDS_API_ROOT", "VIEW", "TAKEPAYMENT", "SERVICEREQUEST", "PAYMENT_GROUP_REF", "EXC_REFERENCE", "DCN_NUMBER", "ISPAYMENTSTATUSENABLED"]], template: function CasePaymentHistoryViewerFieldComponent_Template(rf, ctx) { if (rf & 1) {
16991
+ CasePaymentHistoryViewerFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CasePaymentHistoryViewerFieldComponent, selectors: [["ccd-case-payment-history-viewer-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 16, consts: [[3, "API_ROOT", "CCD_CASE_NUMBER", "BULKSCAN_API_ROOT", "SELECTED_OPTION", "ISBSENABLE", "LOGGEDINUSEREMAIL", "LOGGEDINUSERROLES", "REFUNDS_API_ROOT", "NOTIFICATION_API_ROOT", "VIEW", "TAKEPAYMENT", "SERVICEREQUEST", "PAYMENT_GROUP_REF", "EXC_REFERENCE", "DCN_NUMBER", "ISPAYMENTSTATUSENABLED"]], template: function CasePaymentHistoryViewerFieldComponent_Template(rf, ctx) { if (rf & 1) {
16989
16992
  i0.ɵɵelement(0, "ccpay-payment-lib", 0);
16990
16993
  } if (rf & 2) {
16991
- i0.ɵɵproperty("API_ROOT", ctx.getBaseURL())("CCD_CASE_NUMBER", ctx.caseReference)("BULKSCAN_API_ROOT", ctx.getPayBulkScanBaseURL())("SELECTED_OPTION", "CCDorException")("ISBSENABLE", "true")("LOGGEDINUSEREMAIL", ctx.getUserEmail())("LOGGEDINUSERROLES", ctx.getUserRoles())("REFUNDS_API_ROOT", ctx.getRefundsUrl())("VIEW", "case-transactions")("TAKEPAYMENT", false)("SERVICEREQUEST", false)("PAYMENT_GROUP_REF", null)("EXC_REFERENCE", ctx.caseReference)("DCN_NUMBER", null)("ISPAYMENTSTATUSENABLED", "Enable");
16994
+ i0.ɵɵproperty("API_ROOT", ctx.getBaseURL())("CCD_CASE_NUMBER", ctx.caseReference)("BULKSCAN_API_ROOT", ctx.getPayBulkScanBaseURL())("SELECTED_OPTION", "CCDorException")("ISBSENABLE", "true")("LOGGEDINUSEREMAIL", ctx.getUserEmail())("LOGGEDINUSERROLES", ctx.getUserRoles())("REFUNDS_API_ROOT", ctx.getRefundsUrl())("NOTIFICATION_API_ROOT", ctx.getNotificationUrl())("VIEW", "case-transactions")("TAKEPAYMENT", false)("SERVICEREQUEST", false)("PAYMENT_GROUP_REF", null)("EXC_REFERENCE", ctx.caseReference)("DCN_NUMBER", null)("ISPAYMENTSTATUSENABLED", "Enable");
16992
16995
  } }, directives: [i3.PaymentLibComponent], encapsulation: 2 });
16993
16996
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CasePaymentHistoryViewerFieldComponent, [{
16994
16997
  type: Component,
@@ -17487,7 +17490,7 @@ function WaysToPayFieldComponent_ccpay_payment_lib_0_Template(rf, ctx) { if (rf
17487
17490
  i0.ɵɵelement(0, "ccpay-payment-lib", 1);
17488
17491
  } if (rf & 2) {
17489
17492
  const ctx_r0 = i0.ɵɵnextContext();
17490
- i0.ɵɵproperty("API_ROOT", ctx_r0.getBaseURL())("BULKSCAN_API_ROOT", ctx_r0.getPayBulkScanBaseURL())("REFUNDS_API_ROOT", ctx_r0.getRefundsUrl())("CCD_CASE_NUMBER", ctx_r0.caseReference)("VIEW", "case-transactions")("TAKEPAYMENT", false)("SERVICEREQUEST", true)("PAYMENT_GROUP_REF", null)("EXC_REFERENCE", ctx_r0.caseReference)("DCN_NUMBER", null)("SELECTED_OPTION", "CCDorException")("LOGGEDINUSERROLES", ctx_r0.getUserRoles())("CARDPAYMENTRETURNURL", ctx_r0.getCardPaymentReturnUrl())("ISPAYMENTSTATUSENABLED", "Enable");
17493
+ i0.ɵɵproperty("API_ROOT", ctx_r0.getBaseURL())("BULKSCAN_API_ROOT", ctx_r0.getPayBulkScanBaseURL())("REFUNDS_API_ROOT", ctx_r0.getRefundsUrl())("NOTIFICATION_API_ROOT", ctx_r0.getNotificationUrl())("CCD_CASE_NUMBER", ctx_r0.caseReference)("VIEW", "case-transactions")("TAKEPAYMENT", false)("SERVICEREQUEST", true)("PAYMENT_GROUP_REF", null)("EXC_REFERENCE", ctx_r0.caseReference)("DCN_NUMBER", null)("SELECTED_OPTION", "CCDorException")("LOGGEDINUSERROLES", ctx_r0.getUserRoles())("CARDPAYMENTRETURNURL", ctx_r0.getCardPaymentReturnUrl())("ISPAYMENTSTATUSENABLED", "Enable");
17491
17494
  } }
17492
17495
  class WaysToPayFieldComponent extends PaymentField {
17493
17496
  constructor(appConfig, sessionStorage) {
@@ -17498,8 +17501,8 @@ class WaysToPayFieldComponent extends PaymentField {
17498
17501
  }
17499
17502
  }
17500
17503
  WaysToPayFieldComponent.ɵfac = function WaysToPayFieldComponent_Factory(t) { return new (t || WaysToPayFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(SessionStorageService)); };
17501
- WaysToPayFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WaysToPayFieldComponent, selectors: [["ccd-ways-to-pay-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "API_ROOT", "BULKSCAN_API_ROOT", "REFUNDS_API_ROOT", "CCD_CASE_NUMBER", "VIEW", "TAKEPAYMENT", "SERVICEREQUEST", "PAYMENT_GROUP_REF", "EXC_REFERENCE", "DCN_NUMBER", "SELECTED_OPTION", "LOGGEDINUSERROLES", "CARDPAYMENTRETURNURL", "ISPAYMENTSTATUSENABLED", 4, "ngIf"], [3, "API_ROOT", "BULKSCAN_API_ROOT", "REFUNDS_API_ROOT", "CCD_CASE_NUMBER", "VIEW", "TAKEPAYMENT", "SERVICEREQUEST", "PAYMENT_GROUP_REF", "EXC_REFERENCE", "DCN_NUMBER", "SELECTED_OPTION", "LOGGEDINUSERROLES", "CARDPAYMENTRETURNURL", "ISPAYMENTSTATUSENABLED"]], template: function WaysToPayFieldComponent_Template(rf, ctx) { if (rf & 1) {
17502
- i0.ɵɵtemplate(0, WaysToPayFieldComponent_ccpay_payment_lib_0_Template, 1, 14, "ccpay-payment-lib", 0);
17504
+ WaysToPayFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WaysToPayFieldComponent, selectors: [["ccd-ways-to-pay-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "API_ROOT", "BULKSCAN_API_ROOT", "REFUNDS_API_ROOT", "NOTIFICATION_API_ROOT", "CCD_CASE_NUMBER", "VIEW", "TAKEPAYMENT", "SERVICEREQUEST", "PAYMENT_GROUP_REF", "EXC_REFERENCE", "DCN_NUMBER", "SELECTED_OPTION", "LOGGEDINUSERROLES", "CARDPAYMENTRETURNURL", "ISPAYMENTSTATUSENABLED", 4, "ngIf"], [3, "API_ROOT", "BULKSCAN_API_ROOT", "REFUNDS_API_ROOT", "NOTIFICATION_API_ROOT", "CCD_CASE_NUMBER", "VIEW", "TAKEPAYMENT", "SERVICEREQUEST", "PAYMENT_GROUP_REF", "EXC_REFERENCE", "DCN_NUMBER", "SELECTED_OPTION", "LOGGEDINUSERROLES", "CARDPAYMENTRETURNURL", "ISPAYMENTSTATUSENABLED"]], template: function WaysToPayFieldComponent_Template(rf, ctx) { if (rf & 1) {
17505
+ i0.ɵɵtemplate(0, WaysToPayFieldComponent_ccpay_payment_lib_0_Template, 1, 15, "ccpay-payment-lib", 0);
17503
17506
  } if (rf & 2) {
17504
17507
  i0.ɵɵproperty("ngIf", ctx.getUserRoles().length > 0);
17505
17508
  } }, directives: [i1.NgIf, i3.PaymentLibComponent], encapsulation: 2 });
@@ -26943,7 +26946,7 @@ function CaseFullAccessViewComponent_ng_container_12_Template(rf, ctx) { if (rf
26943
26946
  const _r34 = i0.ɵɵgetCurrentView();
26944
26947
  i0.ɵɵelementContainerStart(0);
26945
26948
  i0.ɵɵelementStart(1, "mat-tab-group", 23, 24);
26946
- 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); });
26949
+ 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); });
26947
26950
  i0.ɵɵtemplate(3, CaseFullAccessViewComponent_ng_container_12_mat_tab_3_Template, 1, 2, "mat-tab", 25);
26948
26951
  i0.ɵɵtemplate(4, CaseFullAccessViewComponent_ng_container_12_mat_tab_4_Template, 2, 2, "mat-tab", 25);
26949
26952
  i0.ɵɵtemplate(5, CaseFullAccessViewComponent_ng_container_12_mat_tab_5_Template, 1, 2, "mat-tab", 25);
@@ -26979,6 +26982,7 @@ class CaseFullAccessViewComponent {
26979
26982
  this.location = location;
26980
26983
  this.crf = crf;
26981
26984
  this.sessionStorageService = sessionStorageService;
26985
+ this.HEARINGS_TAB_LABEL = 'Hearings';
26982
26986
  this.hasPrint = true;
26983
26987
  this.hasEventSelector = true;
26984
26988
  this.prependedTabs = [];
@@ -26990,6 +26994,7 @@ class CaseFullAccessViewComponent {
26990
26994
  this.ignoreWarning = false;
26991
26995
  this.selectedTabIndex = 0;
26992
26996
  this.activeCaseFlags = false;
26997
+ this.subs = [];
26993
26998
  this.callbackErrorsSubject = new Subject();
26994
26999
  }
26995
27000
  ngOnInit() {
@@ -27041,6 +27046,7 @@ class CaseFullAccessViewComponent {
27041
27046
  this.unsubscribe(this.callbackErrorsSubject);
27042
27047
  this.unsubscribe(this.errorSubscription);
27043
27048
  this.unsubscribe(this.subscription);
27049
+ this.subs.forEach(s => s.unsubscribe());
27044
27050
  }
27045
27051
  unsubscribe(subscription) {
27046
27052
  if (subscription) {
@@ -27048,7 +27054,7 @@ class CaseFullAccessViewComponent {
27048
27054
  }
27049
27055
  }
27050
27056
  checkRouteAndSetCaseViewTab() {
27051
- this.router.events
27057
+ this.subs.push(this.router.events
27052
27058
  .pipe(filter((event) => event instanceof NavigationEnd))
27053
27059
  .subscribe((event) => {
27054
27060
  const url = event && event.url;
@@ -27060,8 +27066,9 @@ class CaseFullAccessViewComponent {
27060
27066
  this.tabGroup.selectedIndex = matTab.position;
27061
27067
  }
27062
27068
  }
27063
- });
27069
+ }));
27064
27070
  }
27071
+ ;
27065
27072
  postViewActivity() {
27066
27073
  return this.activityPollingService.postViewActivity(this.caseDetails.case_id);
27067
27074
  }
@@ -27182,22 +27189,25 @@ class CaseFullAccessViewComponent {
27182
27189
  }
27183
27190
  }
27184
27191
  }
27185
- tabChanged(tabChangeEvent) {
27186
- // Update selected tab index
27187
- this.selectedTabIndex = tabChangeEvent.index;
27188
- const tab = tabChangeEvent.tab['_viewContainerRef'];
27189
- const id = tab.element.nativeElement.id;
27190
- // due to some edge case like hidden tab we can't calculate the last index of existing tabs,
27191
- // so have to hard code the hearings id here
27192
- if ((tabChangeEvent.index <= 1 && this.prependedTabs && this.prependedTabs.length) ||
27193
- (this.appendedTabs && this.appendedTabs.length && id === 'hearings')) {
27192
+ // Refactored under EXUI-110 to address infinite tab loop to use tabIndexChanged instead
27193
+ tabChanged(tabIndexChanged) {
27194
+ const matTab = this.tabGroup._tabs.find(tab => tab.isActive);
27195
+ const tabLabel = matTab.textLabel;
27196
+ // sortedTabs are fragments
27197
+ // appended/prepepended tabs use router navigation
27198
+ if ((tabIndexChanged <= 1 && this.prependedTabs && this.prependedTabs.length) ||
27199
+ (this.appendedTabs && this.appendedTabs.length && tabLabel === this.HEARINGS_TAB_LABEL)) {
27200
+ // Hack to get ID from tab as it's not easily achieved through Angular Material Tabs
27201
+ const tab = matTab['_viewContainerRef'];
27202
+ const id = tab.element.nativeElement.id;
27203
+ // cases/case-details/:caseId/hearings
27204
+ // cases/case-details/:caseId/roles-and-access
27194
27205
  this.router.navigate([id], { relativeTo: this.route });
27195
27206
  }
27196
27207
  else {
27197
- const label = tabChangeEvent.tab.textLabel;
27198
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(() => {
27199
- window.location.hash = label;
27200
- });
27208
+ // Routing here is based on tab label, not ideal
27209
+ // cases/case-details/:caseId#tabLabel
27210
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: tabLabel });
27201
27211
  }
27202
27212
  }
27203
27213
  onLinkClicked(triggerOutputEventText) {
@@ -27293,6 +27303,12 @@ class CaseFullAccessViewComponent {
27293
27303
  this.callbackErrorsSubject.next(null);
27294
27304
  this.alertService.clear();
27295
27305
  }
27306
+ getUrlFragment(url) {
27307
+ return url.split('#')[url.split('#').length - 1];
27308
+ }
27309
+ getTabIndexByTabLabel(tabGroup, tabLabel) {
27310
+ return tabGroup._tabs.toArray().findIndex((t) => t.textLabel.toLowerCase() === tabLabel.toLowerCase());
27311
+ }
27296
27312
  }
27297
27313
  CaseFullAccessViewComponent.ORIGIN_QUERY_PARAM = 'origin';
27298
27314
  CaseFullAccessViewComponent.TRIGGER_TEXT_START = 'Go';
@@ -27305,7 +27321,7 @@ CaseFullAccessViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFullAcces
27305
27321
  } if (rf & 2) {
27306
27322
  let _t;
27307
27323
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
27308
- } }, 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) {
27324
+ } }, 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) {
27309
27325
  i0.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 10, 0, "div", 0);
27310
27326
  i0.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 6, 2, "div", 0);
27311
27327
  i0.ɵɵelementStart(2, "ccd-callback-errors", 1);