@hmcts/ccd-case-ui-toolkit 7.3.38 → 7.3.39-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: [{
|
|
@@ -13268,7 +13268,7 @@ class CaseFileViewFieldComponent {
|
|
|
13268
13268
|
// As there can be more than one intersecting role, if any acls are update: true
|
|
13269
13269
|
this.allowMoving = acls.some(acl => acl.update);
|
|
13270
13270
|
this.icp_jurisdictions = this.abstractConfig.getIcpJurisdictions();
|
|
13271
|
-
this.icpEnabled =
|
|
13271
|
+
this.icpEnabled = true;
|
|
13272
13272
|
}
|
|
13273
13273
|
ngAfterViewInit() {
|
|
13274
13274
|
const slider = this.elementRef.nativeElement.querySelector('.slider');
|
|
@@ -35829,6 +35829,99 @@ class DialogsModule {
|
|
|
35829
35829
|
SaveOrDiscardDialogComponent,
|
|
35830
35830
|
RemoveDialogComponent] }); })();
|
|
35831
35831
|
|
|
35832
|
+
const PVP_FLAG_CODE = 'PF0021';
|
|
35833
|
+
const PVP_DISPLAY_TEXT = 'POTENTIALLY VIOLENT PERSON';
|
|
35834
|
+
function isPvpFlag(flagDetail) {
|
|
35835
|
+
return flagDetail?.flagCode === PVP_FLAG_CODE;
|
|
35836
|
+
}
|
|
35837
|
+
function hasPvpFlag(flagsWithFormGroupPath) {
|
|
35838
|
+
return !!flagsWithFormGroupPath?.flags?.details?.some(isPvpFlag);
|
|
35839
|
+
}
|
|
35840
|
+
function isActivePvpFlag(flagDetail) {
|
|
35841
|
+
return isPvpFlag(flagDetail) && flagDetail?.status === CaseFlagStatus.ACTIVE;
|
|
35842
|
+
}
|
|
35843
|
+
function hasActivePvpFlag(flagsWithFormGroupPath) {
|
|
35844
|
+
return !!flagsWithFormGroupPath?.flags?.details?.some(isActivePvpFlag);
|
|
35845
|
+
}
|
|
35846
|
+
function prioritisePvpFlags(flagDetails = []) {
|
|
35847
|
+
const activePvpFlags = [];
|
|
35848
|
+
const remainingFlags = [];
|
|
35849
|
+
flagDetails.forEach((flagDetail) => {
|
|
35850
|
+
if (isActivePvpFlag(flagDetail)) {
|
|
35851
|
+
activePvpFlags.push(flagDetail);
|
|
35852
|
+
}
|
|
35853
|
+
else {
|
|
35854
|
+
remainingFlags.push(flagDetail);
|
|
35855
|
+
}
|
|
35856
|
+
});
|
|
35857
|
+
return [...activePvpFlags, ...remainingFlags];
|
|
35858
|
+
}
|
|
35859
|
+
function prioritisePvpParties(partyFlagsData = []) {
|
|
35860
|
+
const pvpParties = [];
|
|
35861
|
+
const nonPvpParties = [];
|
|
35862
|
+
partyFlagsData.forEach((partyFlags) => {
|
|
35863
|
+
const prioritisedPartyFlags = {
|
|
35864
|
+
...partyFlags,
|
|
35865
|
+
flags: {
|
|
35866
|
+
...partyFlags.flags,
|
|
35867
|
+
details: partyFlags?.flags?.details ? prioritisePvpFlags(partyFlags.flags.details) : partyFlags?.flags?.details
|
|
35868
|
+
}
|
|
35869
|
+
};
|
|
35870
|
+
if (hasActivePvpFlag(prioritisedPartyFlags)) {
|
|
35871
|
+
pvpParties.push(prioritisedPartyFlags);
|
|
35872
|
+
}
|
|
35873
|
+
else {
|
|
35874
|
+
nonPvpParties.push(prioritisedPartyFlags);
|
|
35875
|
+
}
|
|
35876
|
+
});
|
|
35877
|
+
return [...pvpParties, ...nonPvpParties];
|
|
35878
|
+
}
|
|
35879
|
+
function hasActivePvpFlagInCaseFields(caseFields = []) {
|
|
35880
|
+
return caseFields
|
|
35881
|
+
.filter((caseField) => !FieldsUtils.isFlagLauncherCaseField(caseField) && caseField.value)
|
|
35882
|
+
.some((caseField) => hasActivePvpFlagInCaseField(caseField));
|
|
35883
|
+
}
|
|
35884
|
+
function hasActivePvpFlagInCaseField(caseField, currentValue) {
|
|
35885
|
+
const fieldType = caseField?.field_type;
|
|
35886
|
+
const value = caseField?.value ? caseField.value : currentValue;
|
|
35887
|
+
if (fieldType?.type === 'Complex') {
|
|
35888
|
+
return hasActivePvpFlagInComplexField(caseField, value);
|
|
35889
|
+
}
|
|
35890
|
+
if (fieldType?.type === 'Collection') {
|
|
35891
|
+
return hasActivePvpFlagInCollectionField(caseField, value);
|
|
35892
|
+
}
|
|
35893
|
+
return false;
|
|
35894
|
+
}
|
|
35895
|
+
function hasActivePvpFlagInComplexField(caseField, value) {
|
|
35896
|
+
if (FieldsUtils.isFlagsCaseField(caseField)) {
|
|
35897
|
+
return hasActivePvpFlagInFlagsValue(value);
|
|
35898
|
+
}
|
|
35899
|
+
const complexFields = caseField?.field_type?.complex_fields;
|
|
35900
|
+
if (!complexFields || !value || !FieldsUtils.isNonEmptyObject(value)) {
|
|
35901
|
+
return false;
|
|
35902
|
+
}
|
|
35903
|
+
return complexFields.some((subField) => hasActivePvpFlagInCaseField(subField, value[subField.id]));
|
|
35904
|
+
}
|
|
35905
|
+
function hasActivePvpFlagInCollectionField(caseField, value) {
|
|
35906
|
+
if (!value || !Array.isArray(value)) {
|
|
35907
|
+
return false;
|
|
35908
|
+
}
|
|
35909
|
+
const collectionFieldType = caseField?.field_type?.collection_field_type;
|
|
35910
|
+
if (FieldsUtils.isFlagsFieldType(collectionFieldType)) {
|
|
35911
|
+
return value.some((item) => hasActivePvpFlagInFlagsValue(item?.value));
|
|
35912
|
+
}
|
|
35913
|
+
if (collectionFieldType?.type !== 'Complex' || !collectionFieldType.complex_fields) {
|
|
35914
|
+
return false;
|
|
35915
|
+
}
|
|
35916
|
+
return value.some((item) => collectionFieldType.complex_fields.some((subField) => hasActivePvpFlagInCaseField(subField, item?.value?.[subField.id])));
|
|
35917
|
+
}
|
|
35918
|
+
function hasActivePvpFlagInFlagsValue(value) {
|
|
35919
|
+
if (!value || !FieldsUtils.isNonEmptyObject(value) || !value.details || !Array.isArray(value.details)) {
|
|
35920
|
+
return false;
|
|
35921
|
+
}
|
|
35922
|
+
return value.details.some((detail) => isActivePvpFlag(detail?.value ?? detail));
|
|
35923
|
+
}
|
|
35924
|
+
|
|
35832
35925
|
const _c0$c = ["tabGroup"];
|
|
35833
35926
|
const _c1$3 = (a0, a1) => [a0, false, undefined, true, a1];
|
|
35834
35927
|
function CaseFullAccessViewComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -36132,6 +36225,7 @@ class CaseFullAccessViewComponent {
|
|
|
36132
36225
|
activeCaseFlags = false;
|
|
36133
36226
|
caseFlagsExternalUser = false;
|
|
36134
36227
|
caseFlagsReadExternalMode = '#ARGUMENT(READ,EXTERNAL)';
|
|
36228
|
+
potentiallyViolentPersonFlagPrefix = `${PVP_DISPLAY_TEXT}.`;
|
|
36135
36229
|
subs = [];
|
|
36136
36230
|
eventId;
|
|
36137
36231
|
isEventButtonClicked = false;
|
|
@@ -36436,9 +36530,8 @@ class CaseFullAccessViewComponent {
|
|
|
36436
36530
|
}
|
|
36437
36531
|
hasActiveCaseFlags() {
|
|
36438
36532
|
// Determine which tab contains the FlagLauncher CaseField type, from the CaseView object in the snapshot data
|
|
36439
|
-
const caseFlagsTab = this.caseDetails?.tabs
|
|
36440
|
-
|
|
36441
|
-
: null;
|
|
36533
|
+
const caseFlagsTab = this.caseDetails?.tabs?.filter((tab) => tab.fields && tab.fields.some((caseField) => FieldsUtils.isFlagLauncherCaseField(caseField)))[0]
|
|
36534
|
+
?? null;
|
|
36442
36535
|
if (caseFlagsTab) {
|
|
36443
36536
|
// Check whether the FlagLauncher CaseField is in external mode or not; the notification banner should not be
|
|
36444
36537
|
// displayed for external users
|
|
@@ -36453,8 +36546,12 @@ class CaseFullAccessViewComponent {
|
|
|
36453
36546
|
return FieldsUtils.countActiveFlagsInCaseField(active, caseFlag);
|
|
36454
36547
|
}, 0);
|
|
36455
36548
|
if (activeCaseFlags > 0) {
|
|
36456
|
-
const
|
|
36549
|
+
const hasActivePotentiallyViolentPersonFlag = this.hasActivePotentiallyViolentPersonFlag(caseFlagsTab.fields);
|
|
36550
|
+
const baseDescription = activeCaseFlags > 1
|
|
36457
36551
|
? `There are ${activeCaseFlags} active flags on this case.` : 'There is 1 active flag on this case.';
|
|
36552
|
+
const description = hasActivePotentiallyViolentPersonFlag
|
|
36553
|
+
? `${this.potentiallyViolentPersonFlagPrefix} ${baseDescription}`
|
|
36554
|
+
: baseDescription;
|
|
36458
36555
|
// Initialise and display notification banner
|
|
36459
36556
|
this.notificationBannerConfig = {
|
|
36460
36557
|
bannerType: NotificationBannerType.INFORMATION,
|
|
@@ -36471,6 +36568,9 @@ class CaseFullAccessViewComponent {
|
|
|
36471
36568
|
}
|
|
36472
36569
|
return false;
|
|
36473
36570
|
}
|
|
36571
|
+
hasActivePotentiallyViolentPersonFlag(caseFields) {
|
|
36572
|
+
return hasActivePvpFlagInCaseFields(caseFields);
|
|
36573
|
+
}
|
|
36474
36574
|
/**
|
|
36475
36575
|
* Indicates that a CaseField is to be displayed without a label, as is expected for all ComponentLauncher-type
|
|
36476
36576
|
* fields.
|
|
@@ -36582,7 +36682,7 @@ class CaseFullAccessViewComponent {
|
|
|
36582
36682
|
type: ViewChild,
|
|
36583
36683
|
args: ['tabGroup', { static: false }]
|
|
36584
36684
|
}] }); })();
|
|
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:
|
|
36685
|
+
(() => { (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
36686
|
|
|
36587
36687
|
class PrintUrlPipe {
|
|
36588
36688
|
appConfig;
|