@hmcts/ccd-case-ui-toolkit 7.4.19-alignment-issue → 7.4.19-exui-5450-rc1
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.
|
@@ -10818,6 +10818,62 @@ class ValidPageListCaseFieldsService {
|
|
|
10818
10818
|
type: Injectable
|
|
10819
10819
|
}], () => [{ type: FieldsUtils }], null); })();
|
|
10820
10820
|
|
|
10821
|
+
/** Uses current form-control visibility and the configured retention policy. */
|
|
10822
|
+
class HiddenFieldValues {
|
|
10823
|
+
static clearHiddenValues(data, control, parentHidden = false, collectionItem = false) {
|
|
10824
|
+
if (!control || data === null || data === undefined) {
|
|
10825
|
+
return data;
|
|
10826
|
+
}
|
|
10827
|
+
const field = control.caseField;
|
|
10828
|
+
const displayContext = field?.display_context?.toUpperCase();
|
|
10829
|
+
if (displayContext === 'READONLY' || displayContext === 'HIDDEN' ||
|
|
10830
|
+
displayContext === 'HIDDEN_TEMP' || field?.id === 'caseLinks') {
|
|
10831
|
+
return data;
|
|
10832
|
+
}
|
|
10833
|
+
const hidden = parentHidden || field?.hidden === true;
|
|
10834
|
+
if (hidden && field && !collectionItem) {
|
|
10835
|
+
if (!field.retain_hidden_value) {
|
|
10836
|
+
return control instanceof FormArray ? [] : null;
|
|
10837
|
+
}
|
|
10838
|
+
const hasComplexChildren = field.field_type?.type === 'Complex' ||
|
|
10839
|
+
(field.field_type?.type === 'Collection' && field.field_type.collection_field_type?.type === 'Complex');
|
|
10840
|
+
if (!hasComplexChildren) {
|
|
10841
|
+
// Documents, lists and other composite controls retain their whole value.
|
|
10842
|
+
return data;
|
|
10843
|
+
}
|
|
10844
|
+
// Complex children have their own retention settings; they do not inherit Yes.
|
|
10845
|
+
}
|
|
10846
|
+
if (control instanceof FormArray) {
|
|
10847
|
+
return this.clearCollectionValues(data, control, hidden);
|
|
10848
|
+
}
|
|
10849
|
+
if (control instanceof FormGroup) {
|
|
10850
|
+
const result = { ...data };
|
|
10851
|
+
Object.keys(result).forEach((key) => {
|
|
10852
|
+
result[key] = this.clearHiddenValues(result[key], control.controls[key], hidden);
|
|
10853
|
+
});
|
|
10854
|
+
return result;
|
|
10855
|
+
}
|
|
10856
|
+
return data;
|
|
10857
|
+
}
|
|
10858
|
+
static clearCollectionValues(data, control, hidden) {
|
|
10859
|
+
if (!Array.isArray(data)) {
|
|
10860
|
+
return data;
|
|
10861
|
+
}
|
|
10862
|
+
return data.map((item, index) => {
|
|
10863
|
+
const row = control.at(index);
|
|
10864
|
+
const valueControl = row instanceof FormGroup ? row.controls.value : undefined;
|
|
10865
|
+
if (valueControl && item && typeof item === 'object' && Object.hasOwn(item, 'value')) {
|
|
10866
|
+
return {
|
|
10867
|
+
...item,
|
|
10868
|
+
// The value group is a collection-item container, not another configurable case field.
|
|
10869
|
+
value: this.clearHiddenValues(item.value, valueControl, hidden, valueControl instanceof FormGroup)
|
|
10870
|
+
};
|
|
10871
|
+
}
|
|
10872
|
+
return this.clearHiddenValues(item, row, hidden);
|
|
10873
|
+
});
|
|
10874
|
+
}
|
|
10875
|
+
}
|
|
10876
|
+
|
|
10821
10877
|
function CaseEditComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
10822
10878
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
10823
10879
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
|
|
@@ -11079,8 +11135,11 @@ class CaseEditComponent {
|
|
|
11079
11135
|
return form.value.event.id;
|
|
11080
11136
|
}
|
|
11081
11137
|
generateCaseEventData({ eventTrigger, form }) {
|
|
11082
|
-
|
|
11138
|
+
let formData = this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields);
|
|
11083
11139
|
this.formValueService.sanitiseDynamicLists(eventTrigger.case_fields, { data: formData });
|
|
11140
|
+
if (!this.isCaseFlagSubmission) {
|
|
11141
|
+
formData = HiddenFieldValues.clearHiddenValues(formData, form.get('data'));
|
|
11142
|
+
}
|
|
11084
11143
|
const caseEventData = {
|
|
11085
11144
|
data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(formData, this.isCaseFlagSubmission)),
|
|
11086
11145
|
event: form.value.event
|
|
@@ -11406,7 +11465,7 @@ class CaseEditComponent {
|
|
|
11406
11465
|
}], submitted: [{
|
|
11407
11466
|
type: Output
|
|
11408
11467
|
}] }); })();
|
|
11409
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber:
|
|
11468
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 40 }); })();
|
|
11410
11469
|
|
|
11411
11470
|
const EVENT_START_FIRST_PAGE_REDIRECT = 'eventStartFirstPageRedirect';
|
|
11412
11471
|
function convertNonASCIICharacter(character) {
|
|
@@ -13300,6 +13359,9 @@ class CaseEditPageComponent {
|
|
|
13300
13359
|
const formFields = this.formValueService.filterCurrentPageFields(caseFields, formValue);
|
|
13301
13360
|
// Sort out the dynamic lists.
|
|
13302
13361
|
this.formValueService.sanitiseDynamicLists(caseFields, formFields);
|
|
13362
|
+
if (!this.caseEdit.isCaseFlagSubmission) {
|
|
13363
|
+
formFields.data = HiddenFieldValues.clearHiddenValues(formFields.data, this.editForm.get('data'));
|
|
13364
|
+
}
|
|
13303
13365
|
// Get hold of the CaseEventData.
|
|
13304
13366
|
const caseEventData = this.formValueService.sanitise(formFields);
|
|
13305
13367
|
// delete fields which are not part of the case event journey wizard pages case fields
|
|
@@ -13367,7 +13429,7 @@ class CaseEditPageComponent {
|
|
|
13367
13429
|
} if (rf & 2) {
|
|
13368
13430
|
let _t;
|
|
13369
13431
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.caseEditFormComponents = _t);
|
|
13370
|
-
} }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"
|
|
13432
|
+
} }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
13371
13433
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
13372
13434
|
i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 3, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
|
|
13373
13435
|
i0.ɵɵelement(7, "ccd-case-edit-generic-errors", 5);
|
|
@@ -13398,12 +13460,12 @@ class CaseEditPageComponent {
|
|
|
13398
13460
|
}
|
|
13399
13461
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
|
|
13400
13462
|
type: Component,
|
|
13401
|
-
args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"eventTrigger\">\n <h1 *ngIf=\"!currentPage?.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage?.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"demoteCaseTitleHeadingLevel(getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate)\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <div id=\"fieldset-case-data\">\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </div>\n\n <div class=\"form-group form-group-related
|
|
13463
|
+
args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"eventTrigger\">\n <h1 *ngIf=\"!currentPage?.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage?.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"demoteCaseTitleHeadingLevel(getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate)\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <div id=\"fieldset-case-data\">\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </div>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".govuk-js-link{appearance:none;background:none;border:none;color:#005ea5;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-decoration:underline}.govuk-js-link:hover{color:#2b8cc4;text-decoration-thickness:max(3px,.1875rem,.12em)}.govuk-js-link:focus{background-color:#ffbf47;color:#000;outline:3px solid transparent;text-decoration:none;box-shadow:0 -2px #ffbf47,0 4px #000}.govuk-js-link:visited{color:#4c2c92}.rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
|
|
13402
13464
|
}], () => [{ type: CaseEditComponent }, { type: i1$2.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }, { type: FocusService }], { caseEditFormComponents: [{
|
|
13403
13465
|
type: ViewChildren,
|
|
13404
13466
|
args: [CaseEditFormComponent]
|
|
13405
13467
|
}] }); })();
|
|
13406
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber:
|
|
13468
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 39 }); })();
|
|
13407
13469
|
|
|
13408
13470
|
class CallbackErrorsContext {
|
|
13409
13471
|
triggerText;
|