@hmcts/ccd-case-ui-toolkit 7.3.37 → 7.3.38-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:
|
|
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:
|
|
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
|
|
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,55 @@ 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
|
+
const fieldType = caseField.field_type;
|
|
36487
|
+
const value = caseField.value ? caseField.value : currentValue;
|
|
36488
|
+
if (fieldType.type === 'Complex') {
|
|
36489
|
+
return this.hasActivePotentiallyViolentPersonFlagInComplexField(caseField, value);
|
|
36490
|
+
}
|
|
36491
|
+
if (fieldType.type === 'Collection') {
|
|
36492
|
+
return this.hasActivePotentiallyViolentPersonFlagInCollectionField(caseField, value);
|
|
36493
|
+
}
|
|
36494
|
+
return false;
|
|
36495
|
+
}
|
|
36496
|
+
hasActivePotentiallyViolentPersonFlagInComplexField(caseField, value) {
|
|
36497
|
+
if (FieldsUtils.isFlagsCaseField(caseField)) {
|
|
36498
|
+
return this.hasActivePotentiallyViolentPersonFlagInFlagsValue(value);
|
|
36499
|
+
}
|
|
36500
|
+
const complexFields = caseField.field_type.complex_fields;
|
|
36501
|
+
if (!complexFields || !value || !FieldsUtils.isNonEmptyObject(value)) {
|
|
36502
|
+
return false;
|
|
36503
|
+
}
|
|
36504
|
+
return complexFields.some((subField) => this.hasActivePotentiallyViolentPersonFlagInCaseField(subField, value[subField.id]));
|
|
36505
|
+
}
|
|
36506
|
+
hasActivePotentiallyViolentPersonFlagInCollectionField(caseField, value) {
|
|
36507
|
+
if (!value || !Array.isArray(value)) {
|
|
36508
|
+
return false;
|
|
36509
|
+
}
|
|
36510
|
+
const collectionFieldType = caseField.field_type.collection_field_type;
|
|
36511
|
+
if (FieldsUtils.isFlagsFieldType(collectionFieldType)) {
|
|
36512
|
+
return value.some((item) => this.hasActivePotentiallyViolentPersonFlagInFlagsValue(item.value));
|
|
36513
|
+
}
|
|
36514
|
+
if (collectionFieldType.type !== 'Complex' || !collectionFieldType.complex_fields) {
|
|
36515
|
+
return false;
|
|
36516
|
+
}
|
|
36517
|
+
return value.some((item) => collectionFieldType.complex_fields.some((subField) => this.hasActivePotentiallyViolentPersonFlagInCaseField(subField, item.value?.[subField.id])));
|
|
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?.value ?? detail;
|
|
36525
|
+
return detailValue?.flagCode === this.potentiallyViolentPersonFlagCode
|
|
36526
|
+
&& detailValue?.status === CaseFlagStatus.ACTIVE;
|
|
36527
|
+
});
|
|
36528
|
+
}
|
|
36474
36529
|
/**
|
|
36475
36530
|
* Indicates that a CaseField is to be displayed without a label, as is expected for all ComponentLauncher-type
|
|
36476
36531
|
* fields.
|
|
@@ -36582,7 +36637,7 @@ class CaseFullAccessViewComponent {
|
|
|
36582
36637
|
type: ViewChild,
|
|
36583
36638
|
args: ['tabGroup', { static: false }]
|
|
36584
36639
|
}] }); })();
|
|
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:
|
|
36640
|
+
(() => { (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
36641
|
|
|
36587
36642
|
class PrintUrlPipe {
|
|
36588
36643
|
appConfig;
|