@hmcts/ccd-case-ui-toolkit 7.3.36-remove-flag-icp-enabled → 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:
|
|
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: [{
|
|
@@ -6050,8 +6050,8 @@ class FormValueService {
|
|
|
6050
6050
|
constructor(fieldTypeSanitiser) {
|
|
6051
6051
|
this.fieldTypeSanitiser = fieldTypeSanitiser;
|
|
6052
6052
|
}
|
|
6053
|
-
sanitise(rawValue) {
|
|
6054
|
-
return this.sanitiseObject(rawValue);
|
|
6053
|
+
sanitise(rawValue, isCaseFlagJourney = false) {
|
|
6054
|
+
return this.sanitiseObject(rawValue, isCaseFlagJourney);
|
|
6055
6055
|
}
|
|
6056
6056
|
sanitiseCaseReference(reference) {
|
|
6057
6057
|
// strip non digits
|
|
@@ -6073,7 +6073,7 @@ class FormValueService {
|
|
|
6073
6073
|
sanitiseDynamicLists(caseFields, editForm) {
|
|
6074
6074
|
return this.fieldTypeSanitiser.sanitiseLists(caseFields, editForm.data);
|
|
6075
6075
|
}
|
|
6076
|
-
sanitiseObject(rawObject) {
|
|
6076
|
+
sanitiseObject(rawObject, isCaseFlagJourney = false) {
|
|
6077
6077
|
if (!rawObject) {
|
|
6078
6078
|
return rawObject;
|
|
6079
6079
|
}
|
|
@@ -6087,14 +6087,17 @@ class FormValueService {
|
|
|
6087
6087
|
break;
|
|
6088
6088
|
}
|
|
6089
6089
|
else if ('CaseReference' === key) {
|
|
6090
|
-
sanitisedObject[key] = this.sanitiseValue(this.sanitiseCaseReference(String(rawObject[key])));
|
|
6090
|
+
sanitisedObject[key] = this.sanitiseValue(this.sanitiseCaseReference(String(rawObject[key])), isCaseFlagJourney);
|
|
6091
6091
|
}
|
|
6092
6092
|
else {
|
|
6093
|
-
sanitisedObject[key] = this.sanitiseValue(rawObject[key]);
|
|
6093
|
+
sanitisedObject[key] = this.sanitiseValue(rawObject[key], isCaseFlagJourney);
|
|
6094
6094
|
if (Array.isArray(sanitisedObject[key])) {
|
|
6095
6095
|
// If the 'sanitised' array is empty, whereas the original array had 1 or more items
|
|
6096
6096
|
// delete the property from the sanatised object
|
|
6097
|
-
|
|
6097
|
+
const shouldDeleteField = sanitisedObject[key].length === 0
|
|
6098
|
+
&& rawObject[key].length > 0
|
|
6099
|
+
&& !isCaseFlagJourney;
|
|
6100
|
+
if (shouldDeleteField) {
|
|
6098
6101
|
delete sanitisedObject[key];
|
|
6099
6102
|
}
|
|
6100
6103
|
}
|
|
@@ -6102,13 +6105,13 @@ class FormValueService {
|
|
|
6102
6105
|
}
|
|
6103
6106
|
return sanitisedObject;
|
|
6104
6107
|
}
|
|
6105
|
-
sanitiseArray(rawArray) {
|
|
6108
|
+
sanitiseArray(rawArray, isCaseFlagJourney = false) {
|
|
6106
6109
|
if (!rawArray) {
|
|
6107
6110
|
return rawArray;
|
|
6108
6111
|
}
|
|
6109
6112
|
rawArray.forEach(item => {
|
|
6110
6113
|
if (item && item.hasOwnProperty('value')) {
|
|
6111
|
-
item.value = this.sanitiseValue(item.value);
|
|
6114
|
+
item.value = this.sanitiseValue(item.value, isCaseFlagJourney);
|
|
6112
6115
|
}
|
|
6113
6116
|
});
|
|
6114
6117
|
// Filter the array to ensure only truthy values are returned; double-bang operator returns the boolean true/false
|
|
@@ -6118,13 +6121,13 @@ class FormValueService {
|
|
|
6118
6121
|
.filter(item => !!item)
|
|
6119
6122
|
.filter(item => item.hasOwnProperty('value') ? FieldsUtils.containsNonEmptyValues(item.value) : true);
|
|
6120
6123
|
}
|
|
6121
|
-
sanitiseValue(rawValue) {
|
|
6124
|
+
sanitiseValue(rawValue, isCaseFlagJourney = false) {
|
|
6122
6125
|
if (Array.isArray(rawValue)) {
|
|
6123
|
-
return this.sanitiseArray(rawValue);
|
|
6126
|
+
return this.sanitiseArray(rawValue, isCaseFlagJourney);
|
|
6124
6127
|
}
|
|
6125
6128
|
switch (typeof rawValue) {
|
|
6126
6129
|
case 'object':
|
|
6127
|
-
return this.sanitiseObject(rawValue);
|
|
6130
|
+
return this.sanitiseObject(rawValue, isCaseFlagJourney);
|
|
6128
6131
|
case 'string':
|
|
6129
6132
|
return rawValue.trim();
|
|
6130
6133
|
case 'number':
|
|
@@ -9630,7 +9633,7 @@ class CaseEditComponent {
|
|
|
9630
9633
|
}
|
|
9631
9634
|
generateCaseEventData({ eventTrigger, form }) {
|
|
9632
9635
|
const caseEventData = {
|
|
9633
|
-
data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields))),
|
|
9636
|
+
data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields), this.isCaseFlagSubmission)),
|
|
9634
9637
|
event: form.value.event
|
|
9635
9638
|
};
|
|
9636
9639
|
this.formValueService.clearNonCaseFields(caseEventData.data, eventTrigger.case_fields);
|
|
@@ -13265,7 +13268,7 @@ class CaseFileViewFieldComponent {
|
|
|
13265
13268
|
// As there can be more than one intersecting role, if any acls are update: true
|
|
13266
13269
|
this.allowMoving = acls.some(acl => acl.update);
|
|
13267
13270
|
this.icp_jurisdictions = this.abstractConfig.getIcpJurisdictions();
|
|
13268
|
-
this.icpEnabled =
|
|
13271
|
+
this.icpEnabled = this.abstractConfig.getIcpEnable();
|
|
13269
13272
|
}
|
|
13270
13273
|
ngAfterViewInit() {
|
|
13271
13274
|
const slider = this.elementRef.nativeElement.querySelector('.slider');
|
|
@@ -36129,6 +36132,8 @@ class CaseFullAccessViewComponent {
|
|
|
36129
36132
|
activeCaseFlags = false;
|
|
36130
36133
|
caseFlagsExternalUser = false;
|
|
36131
36134
|
caseFlagsReadExternalMode = '#ARGUMENT(READ,EXTERNAL)';
|
|
36135
|
+
potentiallyViolentPersonFlagCode = 'PF0021';
|
|
36136
|
+
potentiallyViolentPersonFlagPrefix = 'POTENTIALLY VIOLENT PERSON.';
|
|
36132
36137
|
subs = [];
|
|
36133
36138
|
eventId;
|
|
36134
36139
|
isEventButtonClicked = false;
|
|
@@ -36450,8 +36455,12 @@ class CaseFullAccessViewComponent {
|
|
|
36450
36455
|
return FieldsUtils.countActiveFlagsInCaseField(active, caseFlag);
|
|
36451
36456
|
}, 0);
|
|
36452
36457
|
if (activeCaseFlags > 0) {
|
|
36453
|
-
const
|
|
36458
|
+
const hasActivePotentiallyViolentPersonFlag = this.hasActivePotentiallyViolentPersonFlag(caseFlagsTab.fields);
|
|
36459
|
+
const baseDescription = activeCaseFlags > 1
|
|
36454
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;
|
|
36455
36464
|
// Initialise and display notification banner
|
|
36456
36465
|
this.notificationBannerConfig = {
|
|
36457
36466
|
bannerType: NotificationBannerType.INFORMATION,
|
|
@@ -36468,6 +36477,56 @@ class CaseFullAccessViewComponent {
|
|
|
36468
36477
|
}
|
|
36469
36478
|
return false;
|
|
36470
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
|
+
}
|
|
36471
36530
|
/**
|
|
36472
36531
|
* Indicates that a CaseField is to be displayed without a label, as is expected for all ComponentLauncher-type
|
|
36473
36532
|
* fields.
|
|
@@ -36579,7 +36638,7 @@ class CaseFullAccessViewComponent {
|
|
|
36579
36638
|
type: ViewChild,
|
|
36580
36639
|
args: ['tabGroup', { static: false }]
|
|
36581
36640
|
}] }); })();
|
|
36582
|
-
(() => { (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:
|
|
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 }); })();
|
|
36583
36642
|
|
|
36584
36643
|
class PrintUrlPipe {
|
|
36585
36644
|
appConfig;
|