@hmcts/ccd-case-ui-toolkit 7.3.48-xui-3740 → 7.3.49-3582-rc-1

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, EventEmitter, Output, NgModule, ViewEncapsulation, forwardRef, Pipe, ContentChildren, ViewChildren, DOCUMENT, Injectable, Inject, ChangeDetectorRef, Directive, InjectionToken, ViewChild, ChangeDetectionStrategy, Injector, ViewContainerRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Component, Input, EventEmitter, Output, NgModule, ViewEncapsulation, forwardRef, Pipe, ContentChildren, ViewChildren, DOCUMENT, Injectable, Inject, ChangeDetectorRef, Directive, InjectionToken, ViewChild, ChangeDetectionStrategy, Injector, ViewContainerRef, SecurityContext, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
3
  import * as i5 from '@angular/common';
4
4
  import { CommonModule, AsyncPipe, CurrencyPipe, formatDate } from '@angular/common';
5
5
  import * as i1 from 'rpx-xui-translation';
@@ -39,6 +39,7 @@ import * as i2$1 from '@angular/cdk/overlay';
39
39
  import { OverlayModule } from '@angular/cdk/overlay';
40
40
  import * as i6$1 from '@angular/cdk/tree';
41
41
  import { NestedTreeControl, CdkTreeModule } from '@angular/cdk/tree';
42
+ import * as i2$2 from '@angular/platform-browser';
42
43
  import { cloneDeep } from 'lodash';
43
44
  import * as i4$1 from '@angular-material-components/datetime-picker';
44
45
  import { NGX_MAT_DATE_FORMATS, NgxMatDateAdapter, NgxMatDatetimePickerModule, NgxMatTimepickerModule, NgxMatNativeDateModule } from '@angular-material-components/datetime-picker';
@@ -52,7 +53,7 @@ import { MatLegacyInputModule } from '@angular/material/legacy-input';
52
53
  import * as i14 from '@hmcts/media-viewer';
53
54
  import { MediaViewerModule } from '@hmcts/media-viewer';
54
55
  import { PortalModule } from '@angular/cdk/portal';
55
- import * as i2$2 from 'ngx-pagination';
56
+ import * as i2$3 from 'ngx-pagination';
56
57
  import { NgxPaginationModule, PaginatePipe } from 'ngx-pagination';
57
58
  import * as i10 from '@angular/material/legacy-tabs';
58
59
  import { MatLegacyTabsModule } from '@angular/material/legacy-tabs';
@@ -3933,7 +3934,6 @@ class FieldsUtils {
3933
3934
  static SERVER_RESPONSE_FIELD_TYPE_COLLECTION = 'Collection';
3934
3935
  static SERVER_RESPONSE_FIELD_TYPE_COMPLEX = 'Complex';
3935
3936
  static SERVER_RESPONSE_FIELD_TYPE_DYNAMIC_LIST_TYPE = ['DynamicList', 'DynamicRadioList'];
3936
- static SERVER_RESPONSE_FIELD_TYPE_DYNAMIC_MULTISELECT_LIST_TYPE = 'DynamicMultiSelectList';
3937
3937
  static defaultTabList = {
3938
3938
  "PRLAPPS": "Summary"
3939
3939
  };
@@ -4184,53 +4184,31 @@ class FieldsUtils {
4184
4184
  static textForInvalidField(type, invalidValue) {
4185
4185
  return `{ Invalid ${type}: ${invalidValue} }`;
4186
4186
  }
4187
- static setDynamicListDefinition(caseField, caseFieldType, rootCaseField, isWithinCollection = false) {
4187
+ static setDynamicListDefinition(caseField, caseFieldType, rootCaseField) {
4188
4188
  if (caseFieldType.type === FieldsUtils.SERVER_RESPONSE_FIELD_TYPE_COMPLEX) {
4189
4189
  caseFieldType.complex_fields.forEach(field => {
4190
4190
  try {
4191
4191
  const isDynamicField = FieldsUtils.SERVER_RESPONSE_FIELD_TYPE_DYNAMIC_LIST_TYPE.indexOf(field.field_type.type) !== -1;
4192
- const isDynamicMultiSelectField = field.field_type.type === FieldsUtils.SERVER_RESPONSE_FIELD_TYPE_DYNAMIC_MULTISELECT_LIST_TYPE;
4193
- if (isDynamicField || isDynamicMultiSelectField) {
4192
+ if (isDynamicField) {
4194
4193
  const dynamicListValue = this.getDynamicListValue(rootCaseField.value, field.id);
4195
4194
  if (dynamicListValue) {
4196
- const list_items = dynamicListValue.find(data => data?.list_items !== undefined)?.list_items;
4197
- if (list_items !== undefined) {
4198
- field.list_items = list_items;
4199
- field.formatted_value = {
4200
- ...field.formatted_value,
4201
- list_items
4202
- };
4203
- }
4204
- if (isDynamicMultiSelectField) {
4205
- if (!isWithinCollection) {
4206
- const value = dynamicListValue[0]?.value;
4207
- if (value !== undefined) {
4208
- field.value = value;
4209
- field.formatted_value = {
4210
- ...field.formatted_value,
4211
- value
4212
- };
4213
- }
4214
- }
4215
- }
4216
- else {
4217
- const complexValue = dynamicListValue.map(data => data.value);
4218
- const value = {
4219
- list_items,
4220
- value: complexValue.length > 0 ? complexValue : undefined
4221
- };
4222
- field.value = {
4223
- ...value
4224
- };
4225
- field.formatted_value = {
4226
- ...field.formatted_value,
4227
- ...value
4228
- };
4229
- }
4195
+ const list_items = dynamicListValue[0].list_items;
4196
+ const complexValue = dynamicListValue.map(data => data.value);
4197
+ const value = {
4198
+ list_items,
4199
+ value: complexValue.length > 0 ? complexValue : undefined
4200
+ };
4201
+ field.value = {
4202
+ ...value
4203
+ };
4204
+ field.formatted_value = {
4205
+ ...field.formatted_value,
4206
+ ...value
4207
+ };
4230
4208
  }
4231
4209
  }
4232
4210
  else {
4233
- this.setDynamicListDefinition(field, field.field_type, rootCaseField, isWithinCollection);
4211
+ this.setDynamicListDefinition(field, field.field_type, rootCaseField);
4234
4212
  }
4235
4213
  }
4236
4214
  catch (error) {
@@ -4240,7 +4218,7 @@ class FieldsUtils {
4240
4218
  }
4241
4219
  else if (caseFieldType.type === FieldsUtils.SERVER_RESPONSE_FIELD_TYPE_COLLECTION) {
4242
4220
  if (caseFieldType.collection_field_type) {
4243
- this.setDynamicListDefinition(caseField, caseFieldType.collection_field_type, rootCaseField, true);
4221
+ this.setDynamicListDefinition(caseField, caseFieldType.collection_field_type, rootCaseField);
4244
4222
  }
4245
4223
  }
4246
4224
  }
@@ -5903,55 +5881,37 @@ class FieldTypeSanitiser {
5903
5881
  }
5904
5882
  ensureDynamicMultiSelectListPopulated(caseFields) {
5905
5883
  return caseFields.map((field) => {
5906
- const fieldData = field._value || field.value;
5907
- if (field.field_type.type === FieldTypeSanitiser.FIELD_TYPE_COMPLEX) {
5908
- this.checkNestedDynamicList(field, fieldData);
5909
- }
5910
- else if (field.field_type.type === FieldTypeSanitiser.FIELD_TYPE_COLLECTION &&
5911
- field.field_type.collection_field_type?.type === FieldTypeSanitiser.FIELD_TYPE_COMPLEX) {
5912
- this.checkNestedDynamicList(field, fieldData, true);
5913
- }
5914
- else {
5884
+ if (field.field_type.type !== 'Complex') {
5915
5885
  return field;
5916
5886
  }
5887
+ const caseFieldData = field._value;
5888
+ // Process each complex field
5889
+ field.field_type.complex_fields.forEach((complexField) => {
5890
+ if (complexField.field_type.type === FieldTypeSanitiser.FIELD_TYPE_COMPLEX) {
5891
+ this.checkNestedDynamicList(complexField, caseFieldData?.[complexField.id]);
5892
+ }
5893
+ else if (this.isDynamicList(complexField.field_type.type) &&
5894
+ complexField.display_context !== 'HIDDEN' &&
5895
+ field._value?.[complexField.id]) {
5896
+ complexField.list_items = field._value[complexField.id]?.list_items;
5897
+ }
5898
+ });
5917
5899
  // Final transformation: construct updated field object
5918
5900
  return { ...field, field_type: { ...field?.field_type } };
5919
5901
  });
5920
5902
  }
5921
- checkNestedDynamicList(caseField, fieldData = null, isCollection = false) {
5922
- const complexFields = isCollection
5923
- ? caseField.field_type.collection_field_type?.complex_fields || []
5924
- : caseField.field_type.complex_fields;
5925
- complexFields.forEach((complexField) => {
5926
- const childData = isCollection
5927
- ? this.getFirstCollectionFieldData(fieldData, complexField.id)
5928
- : fieldData?.[complexField.id];
5903
+ checkNestedDynamicList(caseField, fieldData = null) {
5904
+ caseField.field_type.complex_fields.forEach((complexField) => {
5929
5905
  if (complexField.field_type.type === FieldTypeSanitiser.FIELD_TYPE_COMPLEX) {
5930
- this.checkNestedDynamicList(complexField, childData);
5931
- }
5932
- else if (complexField.field_type.type === FieldTypeSanitiser.FIELD_TYPE_COLLECTION &&
5933
- complexField.field_type.collection_field_type?.type === FieldTypeSanitiser.FIELD_TYPE_COMPLEX) {
5934
- this.checkNestedDynamicList(complexField, childData, true);
5906
+ this.checkNestedDynamicList(complexField, fieldData?.[complexField.id]);
5935
5907
  }
5936
5908
  else if (this.isDynamicList(complexField.field_type.type) &&
5937
5909
  complexField.display_context !== 'HIDDEN' &&
5938
- childData) {
5939
- complexField.list_items = childData.list_items;
5910
+ fieldData?.[complexField.id]) {
5911
+ complexField.list_items = fieldData?.[complexField.id]?.list_items;
5940
5912
  }
5941
5913
  });
5942
5914
  }
5943
- getFirstCollectionFieldData(collectionData, fieldId) {
5944
- if (!Array.isArray(collectionData)) {
5945
- return null;
5946
- }
5947
- for (const item of collectionData) {
5948
- const value = item?.value || item;
5949
- if (value?.[fieldId] !== undefined) {
5950
- return value[fieldId];
5951
- }
5952
- }
5953
- return null;
5954
- }
5955
5915
  isDynamicList(fieldType) {
5956
5916
  return FieldTypeSanitiser.DYNAMIC_LIST_TYPE.indexOf(fieldType) !== -1;
5957
5917
  }
@@ -6275,7 +6235,7 @@ class FormValueService {
6275
6235
  * @param clearEmpty Whether or not we should clear out empty, optional, complex objects.
6276
6236
  * @param clearNonCase Whether or not we should clear out non-case fields at the top level.
6277
6237
  */
6278
- removeUnnecessaryFields(data, caseFields, clearEmpty = false, clearNonCase = false, fromPreviousPage = false, currentPageCaseFields = [], isNested = false) {
6238
+ removeUnnecessaryFields(data, caseFields, clearEmpty = false, clearNonCase = false, fromPreviousPage = false, currentPageCaseFields = []) {
6279
6239
  if (data && caseFields && caseFields.length > 0) {
6280
6240
  // check if there is any data at the top level of the form that's not in the caseFields
6281
6241
  if (clearNonCase) {
@@ -6286,9 +6246,9 @@ class FormValueService {
6286
6246
  // Retain anything that is readonly and not a label.
6287
6247
  continue;
6288
6248
  }
6289
- if (this.shouldRemoveHiddenField(field, isNested)) {
6249
+ if (field.hidden === true && field.display_context !== 'HIDDEN' && field.display_context !== 'HIDDEN_TEMP' && field.id !== 'caseLinks' && !field.retain_hidden_value) {
6290
6250
  // Delete anything that is hidden (that is NOT readonly), and that
6291
- // is not explicitly retained. Nested hidden fields should be dropped by default.
6251
+ // hasn't had its display_context overridden to make it hidden.
6292
6252
  delete data[field.id];
6293
6253
  }
6294
6254
  else if (field.field_type) {
@@ -6303,7 +6263,7 @@ class FormValueService {
6303
6263
  }
6304
6264
  break;
6305
6265
  case 'Complex':
6306
- this.removeUnnecessaryFields(data[field.id], field.field_type.complex_fields, clearEmpty, false, false, [], true);
6266
+ this.removeUnnecessaryFields(data[field.id], field.field_type.complex_fields, clearEmpty);
6307
6267
  // Also remove any optional complex objects that are completely empty.
6308
6268
  // EUI-4244: Ritesh's fix, passing true instead of clearEmpty.
6309
6269
  if (FormValueService.clearOptionalEmpty(true, data[field.id], field)) {
@@ -6326,8 +6286,8 @@ class FormValueService {
6326
6286
  if (field.field_type.collection_field_type.type === 'Complex') {
6327
6287
  // Iterate through the elements and remove any unnecessary fields within.
6328
6288
  for (const item of collection) {
6329
- this.removeUnnecessaryFields(item, field.field_type.collection_field_type.complex_fields, clearEmpty, false, false, [], true);
6330
- this.removeUnnecessaryFields(item.value, field.field_type.collection_field_type.complex_fields, false, false, false, [], true);
6289
+ this.removeUnnecessaryFields(item, field.field_type.collection_field_type.complex_fields, clearEmpty);
6290
+ this.removeUnnecessaryFields(item.value, field.field_type.collection_field_type.complex_fields, false);
6331
6291
  }
6332
6292
  }
6333
6293
  }
@@ -6341,12 +6301,6 @@ class FormValueService {
6341
6301
  // Clear out any MultiSelect labels.
6342
6302
  FormValueService.removeMultiSelectLabels(data);
6343
6303
  }
6344
- shouldRemoveHiddenField(field, isNested) {
6345
- return field.hidden === true
6346
- && field.id !== 'caseLinks'
6347
- && !field.retain_hidden_value
6348
- && (isNested || (field.display_context !== 'HIDDEN' && field.display_context !== 'HIDDEN_TEMP'));
6349
- }
6350
6304
  removeInvalidCollectionData(data, field) {
6351
6305
  if (data[field.id] && data[field.id].length > 0) {
6352
6306
  for (const objCollection of data[field.id]) {
@@ -6356,6 +6310,60 @@ class FormValueService {
6356
6310
  }
6357
6311
  }
6358
6312
  }
6313
+ // exui-3582 When a form field becomes hidden based on user’s input in the event journey,
6314
+ // its stored value must be cleared and it must not be submitted or persisted.
6315
+ removeHiddenField(data, caseFields, clearNonCase, formControls) {
6316
+ if (clearNonCase && data && caseFields && caseFields.length > 0) {
6317
+ for (const field of caseFields) {
6318
+ if (!FormValueService.isLabel(field) && FormValueService.isReadOnly(field)) {
6319
+ // Retain anything that is readonly and not a label.
6320
+ continue;
6321
+ }
6322
+ // Check if formControls[field.id] exists before accessing its properties
6323
+ const caseField = formControls[field.id] ? formControls[field.id]['caseField'] : undefined;
6324
+ if (caseField === undefined || field.hidden === true) {
6325
+ continue;
6326
+ }
6327
+ const hasValue = data.hasOwnProperty(field.id) && data[field.id] != null &&
6328
+ (typeof data[field.id] !== 'object' || Object.keys(data[field.id]).length > 0);
6329
+ if (caseField?.hidden === true &&
6330
+ field.display_context !== 'HIDDEN' &&
6331
+ field.display_context !== 'HIDDEN_TEMP' &&
6332
+ !field.retain_hidden_value &&
6333
+ field.id !== 'caseLinks' &&
6334
+ hasValue) {
6335
+ data[field.id] = null;
6336
+ continue; // If field is now hidden, skip checking its children
6337
+ }
6338
+ if (field.field_type) {
6339
+ switch (field.field_type.type) {
6340
+ case 'Complex':
6341
+ const complexData = data[field.id] ?? data['value'];
6342
+ if (complexData && formControls[field.id] && formControls[field.id]['controls']) {
6343
+ this.removeHiddenField(complexData, field.field_type.complex_fields, clearNonCase, formControls[field.id]['controls']);
6344
+ }
6345
+ break;
6346
+ case 'Collection':
6347
+ const collection = data[field.id];
6348
+ if (collection && Array.isArray(collection) && field.field_type.collection_field_type.type === 'Complex') {
6349
+ collection.forEach((item, index) => {
6350
+ if (formControls[field.id] && formControls[field.id]['controls'] && formControls[field.id]['controls'][index]) {
6351
+ const itemControls = formControls[field.id]?.['controls']?.[index]?.['controls']?.['value'];
6352
+ const collectionData = item['value'] ?? item;
6353
+ if (collectionData && itemControls?.['controls']) {
6354
+ this.removeHiddenField(collectionData, field.field_type.collection_field_type.complex_fields, clearNonCase, itemControls['controls']);
6355
+ }
6356
+ }
6357
+ });
6358
+ }
6359
+ break;
6360
+ default:
6361
+ break;
6362
+ }
6363
+ }
6364
+ }
6365
+ }
6366
+ }
6359
6367
  /**
6360
6368
  * Remove any empty collection fields where a value of greater than zero is specified in the field's {@link FieldType}
6361
6369
  * `min` attribute.
@@ -9755,10 +9763,8 @@ class CaseEditComponent {
9755
9763
  return form.value.event.id;
9756
9764
  }
9757
9765
  generateCaseEventData({ eventTrigger, form }) {
9758
- const formData = this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields);
9759
- this.formValueService.sanitiseDynamicLists(eventTrigger.case_fields, { data: formData });
9760
9766
  const caseEventData = {
9761
- data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(formData, this.isCaseFlagSubmission)),
9767
+ data: this.replaceEmptyComplexFieldValues(this.formValueService.sanitise(this.replaceHiddenFormValuesWithOriginalCaseData(form.get('data'), eventTrigger.case_fields), this.isCaseFlagSubmission)),
9762
9768
  event: form.value.event
9763
9769
  };
9764
9770
  this.formValueService.clearNonCaseFields(caseEventData.data, eventTrigger.case_fields);
@@ -9781,6 +9787,11 @@ class CaseEditComponent {
9781
9787
  if (!this.isCaseFlagSubmission) {
9782
9788
  this.formValueService.removeUnnecessaryFields(caseEventData.data, pageListCaseFields, true, true);
9783
9789
  }
9790
+ // removeHiddenFields while are hidden in the UI
9791
+ // Only remove hidden fields if editForm and its controls are available
9792
+ if (form?.controls?.['data']?.['controls']) {
9793
+ this.formValueService.removeHiddenField(caseEventData.data, pageListCaseFields, true, form.controls['data']['controls']);
9794
+ }
9784
9795
  caseEventData.event_token = eventTrigger.event_token;
9785
9796
  caseEventData.ignore_warning = this.ignoreWarning;
9786
9797
  if (this.confirmation) {
@@ -11925,6 +11936,11 @@ class CaseEditPageComponent {
11925
11936
  this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage, this.editForm.controls['data'].value);
11926
11937
  // Tidy it up before we return it.
11927
11938
  this.formValueService.removeUnnecessaryFields(caseEventData.data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, this.currentPage.case_fields);
11939
+ // removeHiddenFields while are hidden in the UI
11940
+ // Only remove hidden fields if editForm and its controls are available
11941
+ if (this.editForm?.controls?.['data']?.['controls']) {
11942
+ this.formValueService.removeHiddenField(caseEventData.data, caseFields, clearNonCase, this.editForm.controls['data']['controls']);
11943
+ }
11928
11944
  return caseEventData;
11929
11945
  }
11930
11946
  syncCaseEditDataService() {
@@ -26833,9 +26849,10 @@ function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
26833
26849
  i0.ɵɵadvance();
26834
26850
  i0.ɵɵproperty("id", i0.ɵɵinterpolate1("flag-selection-", i_r4))("checked", ctx_r0.isSelected(flagDisplay_r3));
26835
26851
  i0.ɵɵadvance();
26836
- i0.ɵɵproperty("for", i0.ɵɵinterpolate1("flag-selection-", i_r4))("innerHtml", i0.ɵɵpipeBind1(3, 6, flagDisplay_r3), i0.ɵɵsanitizeHtml);
26852
+ i0.ɵɵproperty("for", i0.ɵɵinterpolate1("flag-selection-", i_r4))("innerHTML", ctx_r0.sanitizeHtml(i0.ɵɵpipeBind1(3, 6, flagDisplay_r3)), i0.ɵɵsanitizeHtml);
26837
26853
  } }
26838
26854
  class ManageCaseFlagsComponent extends AbstractJourneyComponent {
26855
+ sanitizer;
26839
26856
  formGroup;
26840
26857
  flagsData;
26841
26858
  caseTitle;
@@ -26850,6 +26867,10 @@ class ManageCaseFlagsComponent extends AbstractJourneyComponent {
26850
26867
  selectedControlName = 'selectedManageCaseLocation';
26851
26868
  excludedFlagStatuses = [CaseFlagStatus.INACTIVE, CaseFlagStatus.NOT_APPROVED];
26852
26869
  cachedControls;
26870
+ constructor(multipageComponentStateService, sanitizer) {
26871
+ super(multipageComponentStateService);
26872
+ this.sanitizer = sanitizer;
26873
+ }
26853
26874
  ngOnInit() {
26854
26875
  this.manageCaseFlagTitle = this.setManageCaseFlagTitle(this.displayContextParameter);
26855
26876
  let originalStatus;
@@ -27096,8 +27117,12 @@ class ManageCaseFlagsComponent extends AbstractJourneyComponent {
27096
27117
  });
27097
27118
  }
27098
27119
  }
27099
- static ɵfac = /*@__PURE__*/ (() => { let ɵManageCaseFlagsComponent_BaseFactory; return function ManageCaseFlagsComponent_Factory(__ngFactoryType__) { return (ɵManageCaseFlagsComponent_BaseFactory || (ɵManageCaseFlagsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ManageCaseFlagsComponent)))(__ngFactoryType__ || ManageCaseFlagsComponent); }; })();
27100
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 9, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "manage-case-flag-heading", 1, "govuk-fieldset__heading"], ["id", "manage-case-flag-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "manage-case-flag-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "change", "id", "checked"], [1, "govuk-label", "govuk-radios__label", 3, "for", "innerHtml"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
27120
+ // Ensure there is no dangerous HTML in the flag name or description that could lead to XSS vulnerabilities
27121
+ sanitizeHtml(content) {
27122
+ return this.sanitizer.sanitize(SecurityContext.HTML, content ?? '') ?? '';
27123
+ }
27124
+ static ɵfac = function ManageCaseFlagsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ManageCaseFlagsComponent)(i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(i2$2.DomSanitizer)); };
27125
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 9, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "manage-case-flag-heading", 1, "govuk-fieldset__heading"], ["id", "manage-case-flag-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "manage-case-flag-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "change", "id", "checked"], [1, "govuk-label", "govuk-radios__label", 3, "for", "innerHTML"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
27101
27126
  i0.ɵɵelementContainerStart(0, 0);
27102
27127
  i0.ɵɵelementStart(1, "div", 1)(2, "fieldset", 2)(3, "legend", 3)(4, "h1", 4);
27103
27128
  i0.ɵɵtext(5);
@@ -27122,8 +27147,8 @@ class ManageCaseFlagsComponent extends AbstractJourneyComponent {
27122
27147
  }
27123
27148
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManageCaseFlagsComponent, [{
27124
27149
  type: Component,
27125
- args: [{ selector: 'ccd-manage-case-flags', encapsulation: ViewEncapsulation.None, standalone: false, template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"manage-case-flag-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"manage-case-flag-heading\" class=\"govuk-fieldset__heading\">\n {{manageCaseFlagTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"manage-case-flag-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"manageCaseFlagSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{manageCaseFlagSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagDisplay of flagsDisplayData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-selection-{{i}}\"\n type=\"radio\"\n [checked]=\"isSelected(flagDisplay)\"\n (change)=\"onFlagSelectionChange(flagDisplay)\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-selection-{{i}}\" [innerHtml]=\"flagDisplay | manageCaseFlagsLabelDisplay\"></label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>", styles: [".flag-name-and-description{font-weight:700}\n"] }]
27126
- }], null, { formGroup: [{
27150
+ args: [{ selector: 'ccd-manage-case-flags', encapsulation: ViewEncapsulation.None, standalone: false, template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"manage-case-flag-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"manage-case-flag-heading\" class=\"govuk-fieldset__heading\">\n {{manageCaseFlagTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"manage-case-flag-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"manageCaseFlagSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{manageCaseFlagSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagDisplay of flagsDisplayData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-selection-{{i}}\"\n type=\"radio\"\n [checked]=\"isSelected(flagDisplay)\"\n (change)=\"onFlagSelectionChange(flagDisplay)\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-selection-{{i}}\" [innerHTML]=\"sanitizeHtml(flagDisplay | manageCaseFlagsLabelDisplay)\"></label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>", styles: [".flag-name-and-description{font-weight:700}\n"] }]
27151
+ }], () => [{ type: MultipageComponentStateService }, { type: i2$2.DomSanitizer }], { formGroup: [{
27127
27152
  type: Input
27128
27153
  }], flagsData: [{
27129
27154
  type: Input
@@ -27134,7 +27159,7 @@ class ManageCaseFlagsComponent extends AbstractJourneyComponent {
27134
27159
  }], caseFlagStateEmitter: [{
27135
27160
  type: Output
27136
27161
  }] }); })();
27137
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ManageCaseFlagsComponent, { className: "ManageCaseFlagsComponent", filePath: "lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.ts", lineNumber: 17 }); })();
27162
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ManageCaseFlagsComponent, { className: "ManageCaseFlagsComponent", filePath: "lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.ts", lineNumber: 19 }); })();
27138
27163
 
27139
27164
  // tslint:disable:variable-name
27140
27165
  /**
@@ -33628,7 +33653,7 @@ class PaginationComponent {
33628
33653
  i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(3, 4, "Pagination"));
33629
33654
  i0.ɵɵadvance(2);
33630
33655
  i0.ɵɵproperty("ngIf", !(ctx.autoHide && p_r3.pages.length <= 1));
33631
- } }, dependencies: [i5.NgForOf, i5.NgIf, i2$2.PaginationControlsDirective, i5.DecimalPipe, i1.RpxTranslatePipe], styles: [".ngx-pagination[_ngcontent-%COMP%]{margin-left:0;margin-bottom:1rem;padding-top:25px;text-decoration:none;text-align:left;font-size:16px}.ngx-pagination[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%]:after{content:\" \";display:table}.ngx-pagination[_ngcontent-%COMP%]:after{clear:both}.ngx-pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;margin-right:.0625rem;border-radius:0}.ngx-pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-block}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:block;padding:.1875rem .625rem;border-radius:0;color:#005da6}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:#e6e6e6}.ngx-pagination[_ngcontent-%COMP%] .current[_ngcontent-%COMP%]{padding:.1875rem .625rem;background:#fff;color:#4c2c92;cursor:default;font-weight:900;text-decoration:none}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]:hover{background:transparent}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{cursor:pointer}.ngx-pagination[_ngcontent-%COMP%] .pagination-previous[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous.disabled[_ngcontent-%COMP%]:before{margin-right:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:transparent;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);content:\"\";border-width:3px 0 0 3px}.ngx-pagination[_ngcontent-%COMP%] .pagination-next[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-next.disabled[_ngcontent-%COMP%]:after{margin-left:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:transparent;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);content:\"\";border-width:0 3px 3px 0}.ngx-pagination[_ngcontent-%COMP%] .show-for-sr[_ngcontent-%COMP%]{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.ngx-pagination[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:none}@media screen and (max-width:601px){.ngx-pagination.responsive[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:inline-block}.ngx-pagination.responsive[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(.small-screen):not(.pagination-previous):not(.pagination-next){display:none}}"] });
33656
+ } }, dependencies: [i5.NgForOf, i5.NgIf, i2$3.PaginationControlsDirective, i5.DecimalPipe, i1.RpxTranslatePipe], styles: [".ngx-pagination[_ngcontent-%COMP%]{margin-left:0;margin-bottom:1rem;padding-top:25px;text-decoration:none;text-align:left;font-size:16px}.ngx-pagination[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%]:after{content:\" \";display:table}.ngx-pagination[_ngcontent-%COMP%]:after{clear:both}.ngx-pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;margin-right:.0625rem;border-radius:0}.ngx-pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-block}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:block;padding:.1875rem .625rem;border-radius:0;color:#005da6}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:#e6e6e6}.ngx-pagination[_ngcontent-%COMP%] .current[_ngcontent-%COMP%]{padding:.1875rem .625rem;background:#fff;color:#4c2c92;cursor:default;font-weight:900;text-decoration:none}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]:hover{background:transparent}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{cursor:pointer}.ngx-pagination[_ngcontent-%COMP%] .pagination-previous[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous.disabled[_ngcontent-%COMP%]:before{margin-right:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:transparent;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);content:\"\";border-width:3px 0 0 3px}.ngx-pagination[_ngcontent-%COMP%] .pagination-next[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-next.disabled[_ngcontent-%COMP%]:after{margin-left:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:transparent;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);content:\"\";border-width:0 3px 3px 0}.ngx-pagination[_ngcontent-%COMP%] .show-for-sr[_ngcontent-%COMP%]{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.ngx-pagination[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:none}@media screen and (max-width:601px){.ngx-pagination.responsive[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:inline-block}.ngx-pagination.responsive[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(.small-screen):not(.pagination-previous):not(.pagination-next){display:none}}"] });
33632
33657
  }
33633
33658
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationComponent, [{
33634
33659
  type: Component,
@@ -33972,7 +33997,7 @@ class CaseListComponent {
33972
33997
  i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind2(10, 9, ctx.cases, i0.ɵɵpureFunction3(12, _c0$d, ctx.pageSize, ctx.currentPageNo, ctx.totalResultsCount)));
33973
33998
  i0.ɵɵadvance(2);
33974
33999
  i0.ɵɵproperty("ngIf", ctx.totalResultsCount > ctx.pageSize);
33975
- } }, dependencies: [i5.NgForOf, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase, i5.NgSwitchDefault, i1$1.RouterLink, PaginationComponent, i5.CurrencyPipe, i2$2.PaginatePipe, i1.RpxTranslatePipe], encapsulation: 2 });
34000
+ } }, dependencies: [i5.NgForOf, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase, i5.NgSwitchDefault, i1$1.RouterLink, PaginationComponent, i5.CurrencyPipe, i2$3.PaginatePipe, i1.RpxTranslatePipe], encapsulation: 2 });
33976
34001
  }
33977
34002
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseListComponent, [{
33978
34003
  type: Component,
@@ -41227,7 +41252,7 @@ class SearchResultModule {
41227
41252
  PipesModule,
41228
41253
  ActivityModule,
41229
41254
  PaginationModule, i1.RpxTranslationModule, PaletteModule], exports: [SearchResultComponent] }); })();
41230
- i0.ɵɵsetComponentScope(SearchResultComponent, function () { return [i5.NgForOf, i5.NgIf, i1$1.RouterLink, LabelSubstitutorDirective, ActivityComponent, PaginationComponent, FieldReadComponent]; }, function () { return [i5.DecimalPipe, i2$2.PaginatePipe, CaseReferencePipe, SortSearchResultPipe, i1.RpxTranslatePipe]; });
41255
+ i0.ɵɵsetComponentScope(SearchResultComponent, function () { return [i5.NgForOf, i5.NgIf, i1$1.RouterLink, LabelSubstitutorDirective, ActivityComponent, PaginationComponent, FieldReadComponent]; }, function () { return [i5.DecimalPipe, i2$3.PaginatePipe, CaseReferencePipe, SortSearchResultPipe, i1.RpxTranslatePipe]; });
41231
41256
 
41232
41257
  // tslint:disable:variable-name
41233
41258
  class ComplexFieldOverride {