@hmcts/ccd-case-ui-toolkit 7.3.36 → 7.3.37-exui-4089

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.
@@ -993,11 +993,11 @@ class NotificationBannerComponent {
993
993
  i0.ɵɵtemplate(0, NotificationBannerComponent_div_0_Template, 14, 10, "div", 0);
994
994
  } if (rf & 2) {
995
995
  i0.ɵɵproperty("ngIf", ctx.notificationBannerConfig);
996
- } }, dependencies: [i5.NgClass, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase], styles: [".govuk-notification-banner[_ngcontent-%COMP%] .govuk-notification-banner__content[_ngcontent-%COMP%] .govuk-notification-banner__heading[_ngcontent-%COMP%]{margin-left:0;max-width:900px}.govuk-notification-banner[_ngcontent-%COMP%] .govuk-notification-banner__content[_ngcontent-%COMP%] .govuk-notification-banner__heading[_ngcontent-%COMP%] .govuk-notification-banner__link[_ngcontent-%COMP%]{margin-left:10px}.notification-banner-information[_ngcontent-%COMP%], .notification-banner-error[_ngcontent-%COMP%]{background-color:#d4351c;border:5px solid #d4351c}.notification-banner-warning[_ngcontent-%COMP%]{background-color:#912b88;border:5px solid #912b88}.notification-banner-success[_ngcontent-%COMP%]{background-color:#006435;border:5px solid #006435}"] });
996
+ } }, dependencies: [i5.NgClass, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase], styles: [".govuk-notification-banner[_ngcontent-%COMP%] .govuk-notification-banner__content[_ngcontent-%COMP%] .govuk-notification-banner__heading[_ngcontent-%COMP%]{margin-left:0;max-width:fit-content}.govuk-notification-banner[_ngcontent-%COMP%] .govuk-notification-banner__content[_ngcontent-%COMP%] .govuk-notification-banner__heading[_ngcontent-%COMP%] .govuk-notification-banner__link[_ngcontent-%COMP%]{margin-left:10px}.notification-banner-information[_ngcontent-%COMP%], .notification-banner-error[_ngcontent-%COMP%]{background-color:#d4351c;border:5px solid #d4351c}.notification-banner-warning[_ngcontent-%COMP%]{background-color:#912b88;border:5px solid #912b88}.notification-banner-success[_ngcontent-%COMP%]{background-color:#006435;border:5px solid #006435}"] });
997
997
  }
998
998
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NotificationBannerComponent, [{
999
999
  type: Component,
1000
- args: [{ selector: 'ccd-notification-banner', standalone: false, template: "<div *ngIf=\"notificationBannerConfig\"\n class=\"govuk-notification-banner\"\n [ngClass]=\"notificationBannerConfig.headerClass\"\n role=\"region\"\n aria-labelledby=\"govuk-notification-banner-title\"\n data-module=\"govuk-notification-banner\">\n\n <div class=\"govuk-notification-banner__header\">\n <h2 class=\"govuk-notification-banner__title\" id=\"govuk-notification-banner-title\">\n {{notificationBannerConfig.headingText}}\n </h2>\n </div>\n <div class=\"govuk-notification-banner__content\">\n <p class=\"govuk-notification-banner__heading\">\n <ng-container [ngSwitch]=\"notificationBannerConfig.bannerType\">\n <ng-container *ngSwitchCase=\"notificationBannerType.WARNING\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"></path>\n </svg>\n </ng-container>\n <ng-container *ngSwitchCase=\"notificationBannerType.ERROR\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"></path>\n </svg>\n </ng-container>\n <ng-container *ngSwitchCase=\"notificationBannerType.SUCCESS\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z\"></path>\n </svg>\n </ng-container>\n <ng-container *ngSwitchCase=\"notificationBannerType.INFORMATION\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z\"></path>\n </svg>\n </ng-container>\n </ng-container>\n {{notificationBannerConfig.description}}\n <a *ngIf=\"notificationBannerConfig.showLink && !notificationBannerConfig.triggerOutputEvent\"\n class=\"govuk-notification-banner__link\"\n href=\"{{notificationBannerConfig.linkUrl}}\">{{notificationBannerConfig.linkText}}</a>\n <a *ngIf=\"notificationBannerConfig.showLink && notificationBannerConfig.triggerOutputEvent\"\n class=\"govuk-notification-banner__link\"\n href=\"#\"\n (click)=\"onLinkClick(notificationBannerConfig.triggerOutputEventText); $event.preventDefault()\">{{notificationBannerConfig.linkText}}</a>\n </p>\n </div>\n</div>\n", styles: [".govuk-notification-banner .govuk-notification-banner__content .govuk-notification-banner__heading{margin-left:0;max-width:900px}.govuk-notification-banner .govuk-notification-banner__content .govuk-notification-banner__heading .govuk-notification-banner__link{margin-left:10px}.notification-banner-information,.notification-banner-error{background-color:#d4351c;border:5px solid #d4351c}.notification-banner-warning{background-color:#912b88;border:5px solid #912b88}.notification-banner-success{background-color:#006435;border:5px solid #006435}\n"] }]
1000
+ args: [{ selector: 'ccd-notification-banner', standalone: false, template: "<div *ngIf=\"notificationBannerConfig\"\n class=\"govuk-notification-banner\"\n [ngClass]=\"notificationBannerConfig.headerClass\"\n role=\"region\"\n aria-labelledby=\"govuk-notification-banner-title\"\n data-module=\"govuk-notification-banner\">\n\n <div class=\"govuk-notification-banner__header\">\n <h2 class=\"govuk-notification-banner__title\" id=\"govuk-notification-banner-title\">\n {{notificationBannerConfig.headingText}}\n </h2>\n </div>\n <div class=\"govuk-notification-banner__content\">\n <p class=\"govuk-notification-banner__heading\">\n <ng-container [ngSwitch]=\"notificationBannerConfig.bannerType\">\n <ng-container *ngSwitchCase=\"notificationBannerType.WARNING\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"></path>\n </svg>\n </ng-container>\n <ng-container *ngSwitchCase=\"notificationBannerType.ERROR\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"></path>\n </svg>\n </ng-container>\n <ng-container *ngSwitchCase=\"notificationBannerType.SUCCESS\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z\"></path>\n </svg>\n </ng-container>\n <ng-container *ngSwitchCase=\"notificationBannerType.INFORMATION\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n <path d=\"M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z\"></path>\n </svg>\n </ng-container>\n </ng-container>\n {{notificationBannerConfig.description}}\n <a *ngIf=\"notificationBannerConfig.showLink && !notificationBannerConfig.triggerOutputEvent\"\n class=\"govuk-notification-banner__link\"\n href=\"{{notificationBannerConfig.linkUrl}}\">{{notificationBannerConfig.linkText}}</a>\n <a *ngIf=\"notificationBannerConfig.showLink && notificationBannerConfig.triggerOutputEvent\"\n class=\"govuk-notification-banner__link\"\n href=\"#\"\n (click)=\"onLinkClick(notificationBannerConfig.triggerOutputEventText); $event.preventDefault()\">{{notificationBannerConfig.linkText}}</a>\n </p>\n </div>\n</div>\n", styles: [".govuk-notification-banner .govuk-notification-banner__content .govuk-notification-banner__heading{margin-left:0;max-width:fit-content}.govuk-notification-banner .govuk-notification-banner__content .govuk-notification-banner__heading .govuk-notification-banner__link{margin-left:10px}.notification-banner-information,.notification-banner-error{background-color:#d4351c;border:5px solid #d4351c}.notification-banner-warning{background-color:#912b88;border:5px solid #912b88}.notification-banner-success{background-color:#006435;border:5px solid #006435}\n"] }]
1001
1001
  }], null, { notificationBannerConfig: [{
1002
1002
  type: Input
1003
1003
  }], linkClicked: [{
@@ -36132,6 +36132,8 @@ class CaseFullAccessViewComponent {
36132
36132
  activeCaseFlags = false;
36133
36133
  caseFlagsExternalUser = false;
36134
36134
  caseFlagsReadExternalMode = '#ARGUMENT(READ,EXTERNAL)';
36135
+ potentiallyViolentPersonFlagCode = 'PF0021';
36136
+ potentiallyViolentPersonFlagPrefix = 'POTENTIALLY VIOLENT PERSON.';
36135
36137
  subs = [];
36136
36138
  eventId;
36137
36139
  isEventButtonClicked = false;
@@ -36453,8 +36455,12 @@ class CaseFullAccessViewComponent {
36453
36455
  return FieldsUtils.countActiveFlagsInCaseField(active, caseFlag);
36454
36456
  }, 0);
36455
36457
  if (activeCaseFlags > 0) {
36456
- const description = activeCaseFlags > 1
36458
+ const hasActivePotentiallyViolentPersonFlag = this.hasActivePotentiallyViolentPersonFlag(caseFlagsTab.fields);
36459
+ const baseDescription = activeCaseFlags > 1
36457
36460
  ? `There are ${activeCaseFlags} active flags on this case.` : 'There is 1 active flag on this case.';
36461
+ const description = hasActivePotentiallyViolentPersonFlag
36462
+ ? `${this.potentiallyViolentPersonFlagPrefix} ${baseDescription}`
36463
+ : baseDescription;
36458
36464
  // Initialise and display notification banner
36459
36465
  this.notificationBannerConfig = {
36460
36466
  bannerType: NotificationBannerType.INFORMATION,
@@ -36471,6 +36477,56 @@ class CaseFullAccessViewComponent {
36471
36477
  }
36472
36478
  return false;
36473
36479
  }
36480
+ hasActivePotentiallyViolentPersonFlag(caseFields) {
36481
+ return caseFields
36482
+ .filter((caseField) => !FieldsUtils.isFlagLauncherCaseField(caseField) && caseField.value)
36483
+ .some((caseField) => this.hasActivePotentiallyViolentPersonFlagInCaseField(caseField));
36484
+ }
36485
+ hasActivePotentiallyViolentPersonFlagInCaseField(caseField, currentValue) {
36486
+ console.log('hasActivePotentiallyViolentPersonFlagInCaseField', caseField);
36487
+ const fieldType = caseField.field_type;
36488
+ switch (fieldType.type) {
36489
+ case 'Complex':
36490
+ if (FieldsUtils.isFlagsCaseField(caseField)) {
36491
+ const value = caseField.value ? caseField.value : currentValue;
36492
+ return this.hasActivePotentiallyViolentPersonFlagInFlagsValue(value);
36493
+ }
36494
+ else if (fieldType.complex_fields) {
36495
+ const value = caseField.value ? caseField.value : currentValue;
36496
+ if (value && FieldsUtils.isNonEmptyObject(value)) {
36497
+ return fieldType.complex_fields.some((subField) => this.hasActivePotentiallyViolentPersonFlagInCaseField(subField, value[subField.id]));
36498
+ }
36499
+ }
36500
+ break;
36501
+ case 'Collection':
36502
+ if (FieldsUtils.isFlagsFieldType(fieldType.collection_field_type)) {
36503
+ const value = caseField.value ? caseField.value : currentValue;
36504
+ if (value && Array.isArray(value)) {
36505
+ return value.some((item) => this.hasActivePotentiallyViolentPersonFlagInFlagsValue(item.value));
36506
+ }
36507
+ }
36508
+ else if (fieldType.collection_field_type.type === 'Complex' && fieldType.collection_field_type.complex_fields) {
36509
+ const value = caseField.value ? caseField.value : currentValue;
36510
+ if (value && Array.isArray(value)) {
36511
+ return value.some((item) => fieldType.collection_field_type.complex_fields.some((subField) => this.hasActivePotentiallyViolentPersonFlagInCaseField(subField, item.value?.[subField.id])));
36512
+ }
36513
+ }
36514
+ break;
36515
+ default:
36516
+ }
36517
+ return false;
36518
+ }
36519
+ hasActivePotentiallyViolentPersonFlagInFlagsValue(value) {
36520
+ if (!value || !FieldsUtils.isNonEmptyObject(value) || !value.details || !Array.isArray(value.details)) {
36521
+ return false;
36522
+ }
36523
+ return value.details.some((detail) => {
36524
+ const detailValue = detail && detail.value ? detail.value : detail;
36525
+ return detailValue
36526
+ && detailValue.flagCode === this.potentiallyViolentPersonFlagCode
36527
+ && detailValue.status === CaseFlagStatus.ACTIVE;
36528
+ });
36529
+ }
36474
36530
  /**
36475
36531
  * Indicates that a CaseField is to be displayed without a label, as is expected for all ComponentLauncher-type
36476
36532
  * fields.
@@ -36582,7 +36638,7 @@ class CaseFullAccessViewComponent {
36582
36638
  type: ViewChild,
36583
36639
  args: ['tabGroup', { static: false }]
36584
36640
  }] }); })();
36585
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFullAccessViewComponent, { className: "CaseFullAccessViewComponent", filePath: "lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.ts", lineNumber: 47 }); })();
36641
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFullAccessViewComponent, { className: "CaseFullAccessViewComponent", filePath: "lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.ts", lineNumber: 48 }); })();
36586
36642
 
36587
36643
  class PrintUrlPipe {
36588
36644
  appConfig;