@hmcts/ccd-case-ui-toolkit 7.1.24-case-links-fix → 7.1.25

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.
@@ -16651,8 +16651,8 @@ class LinkCasesComponent {
16651
16651
  })), this.validatorsUtils.formArraySelectedValidator());
16652
16652
  }
16653
16653
  toggleLinkCaseReasonOtherComments(event) {
16654
- this.linkCaseReasons.find((reason) => reason.value_en === event.target.value).selected = event.target.checked;
16655
- this.showComments = this.linkCaseReasons.find((reason) => reason.value_en === 'Other')?.selected;
16654
+ this.linkCaseReasons.find(reason => reason.value_en === event.target.value).selected = event.target.checked;
16655
+ this.showComments = this.linkCaseReasons.find(reason => reason.value_en === 'Other').selected;
16656
16656
  }
16657
16657
  submitCaseInfo() {
16658
16658
  this.errorMessages = [];
@@ -16691,7 +16691,7 @@ class LinkCasesComponent {
16691
16691
  this.errorMessages.push({
16692
16692
  title: 'dummy-case-number',
16693
16693
  description: LinkedCasesErrorMessages.CaseNumberError,
16694
- fieldId: 'caseNumber'
16694
+ fieldId: 'caseNumber',
16695
16695
  });
16696
16696
  }
16697
16697
  if (this.linkCaseForm.controls.reasonType.invalid) {
@@ -16699,17 +16699,17 @@ class LinkCasesComponent {
16699
16699
  this.errorMessages.push({
16700
16700
  title: 'dummy-case-reason',
16701
16701
  description: LinkedCasesErrorMessages.ReasonSelectionError,
16702
- fieldId: 'caseReason'
16702
+ fieldId: 'caseReason',
16703
16703
  });
16704
16704
  }
16705
16705
  if (this.linkCaseForm.controls.reasonType.valid
16706
- && this.linkCaseReasons.find((reason) => reason.value_en === 'Other').selected) {
16706
+ && this.linkCaseReasons.find(reason => reason.value_en === 'Other').selected) {
16707
16707
  if (this.linkCaseForm.controls.otherDescription.value.trim().length === 0) {
16708
16708
  this.caseReasonCommentsError = LinkedCasesErrorMessages.otherDescriptionError;
16709
16709
  this.errorMessages.push({
16710
16710
  title: 'dummy-case-reason-comments',
16711
16711
  description: LinkedCasesErrorMessages.otherDescriptionError,
16712
- fieldId: 'otherDescription'
16712
+ fieldId: 'otherDescription',
16713
16713
  });
16714
16714
  }
16715
16715
  if (this.linkCaseForm.controls.otherDescription.value.trim().length > 100) {
@@ -16717,7 +16717,7 @@ class LinkCasesComponent {
16717
16717
  this.errorMessages.push({
16718
16718
  title: 'dummy-case-reason-comments',
16719
16719
  description: LinkedCasesErrorMessages.otherDescriptionMaxLengthError,
16720
- fieldId: 'otherDescription'
16720
+ fieldId: 'otherDescription',
16721
16721
  });
16722
16722
  }
16723
16723
  }
@@ -16726,7 +16726,7 @@ class LinkCasesComponent {
16726
16726
  this.errorMessages.push({
16727
16727
  title: 'dummy-case-number',
16728
16728
  description: LinkedCasesErrorMessages.CaseProposedError,
16729
- fieldId: 'caseNumber'
16729
+ fieldId: 'caseNumber',
16730
16730
  });
16731
16731
  }
16732
16732
  if (this.isCaseSelected(this.linkedCasesService.linkedCases)) {
@@ -16734,14 +16734,14 @@ class LinkCasesComponent {
16734
16734
  this.errorMessages.push({
16735
16735
  title: 'dummy-case-number',
16736
16736
  description: LinkedCasesErrorMessages.CasesLinkedError,
16737
- fieldId: 'caseNumber'
16737
+ fieldId: 'caseNumber',
16738
16738
  });
16739
16739
  }
16740
16740
  if (this.linkCaseForm.value.caseNumber.split('-').join('') === this.linkedCasesService.caseId.split('-').join('')) {
16741
16741
  this.errorMessages.push({
16742
16742
  title: 'dummy-case-number',
16743
16743
  description: LinkedCasesErrorMessages.ProposedCaseWithIn,
16744
- fieldId: 'caseNumber'
16744
+ fieldId: 'caseNumber',
16745
16745
  });
16746
16746
  }
16747
16747
  window.scrollTo(0, 0);
@@ -16762,7 +16762,7 @@ class LinkCasesComponent {
16762
16762
  caseState: caseView.state.name || '',
16763
16763
  caseStateDescription: caseView.state.description || '',
16764
16764
  caseService: caseView.case_type && caseView.case_type.jurisdiction && caseView.case_type.jurisdiction.description || '',
16765
- caseName: this.linkedCasesService.getCaseName(caseView)
16765
+ caseName: this.linkedCasesService.getCaseName(caseView),
16766
16766
  };
16767
16767
  const ccdApiCaseLinkData = {
16768
16768
  CaseReference: caseView.case_id,
@@ -16775,7 +16775,7 @@ class LinkCasesComponent {
16775
16775
  }
16776
16776
  this.linkedCasesService.caseFieldValue.push({ id: caseView.case_id.toString(), value: ccdApiCaseLinkData });
16777
16777
  this.selectedCases.push(caseLink);
16778
- this.linkCaseReasons.forEach((reason) => reason.selected = false);
16778
+ this.linkCaseReasons.forEach(reason => reason.selected = false);
16779
16779
  this.initForm();
16780
16780
  this.emitLinkedCasesState(false);
16781
16781
  }, (error) => {
@@ -16783,7 +16783,7 @@ class LinkCasesComponent {
16783
16783
  this.errorMessages.push({
16784
16784
  title: 'dummy-case-number',
16785
16785
  description: LinkedCasesErrorMessages.CaseCheckAgainError,
16786
- fieldId: 'caseNumber'
16786
+ fieldId: 'caseNumber',
16787
16787
  });
16788
16788
  this.emitLinkedCasesState(false);
16789
16789
  window.scrollTo(0, 0);
@@ -16795,7 +16795,7 @@ class LinkCasesComponent {
16795
16795
  this.linkedCasesStateEmitter.emit({
16796
16796
  currentLinkedCasesPage: LinkedCasesPages.LINK_CASE,
16797
16797
  errorMessages: this.errorMessages,
16798
- navigateToNextPage: isNavigateToNextPage
16798
+ navigateToNextPage: isNavigateToNextPage,
16799
16799
  });
16800
16800
  }
16801
16801
  getSelectedCaseReasons() {
@@ -16830,7 +16830,7 @@ class LinkCasesComponent {
16830
16830
  }
16831
16831
  onSelectedLinkedCaseRemove(pos, selectedCaseReference) {
16832
16832
  const caseFieldValue = this.linkedCasesService.caseFieldValue || [];
16833
- const updatedItems = caseFieldValue.filter((item) => item.value && item.value.CaseReference !== selectedCaseReference);
16833
+ const updatedItems = caseFieldValue.filter(item => item.value && item.value.CaseReference !== selectedCaseReference);
16834
16834
  if (updatedItems) {
16835
16835
  this.linkedCasesService.caseFieldValue = updatedItems;
16836
16836
  }
@@ -16851,7 +16851,7 @@ class LinkCasesComponent {
16851
16851
  this.errorMessages.push({
16852
16852
  title: 'dummy-case-selection',
16853
16853
  description: LinkedCasesErrorMessages.CaseSelectionError,
16854
- fieldId: 'caseReason'
16854
+ fieldId: 'caseReason',
16855
16855
  });
16856
16856
  navigateToNextPage = false;
16857
16857
  }
@@ -17586,7 +17586,7 @@ class UnLinkCasesComponent {
17586
17586
  }
17587
17587
  else {
17588
17588
  this.casesService.getCaseViewV2(this.caseId).subscribe((caseView) => {
17589
- const linkedCasesTab = caseView.tabs.find((tab) => tab.id === UnLinkCasesComponent.LINKED_CASES_TAB_ID);
17589
+ const linkedCasesTab = caseView.tabs.find(tab => tab.id === UnLinkCasesComponent.LINKED_CASES_TAB_ID);
17590
17590
  if (linkedCasesTab) {
17591
17591
  const linkedCases = linkedCasesTab.fields[0].value;
17592
17592
  this.linkedCases = linkedCases;
@@ -17598,22 +17598,22 @@ class UnLinkCasesComponent {
17598
17598
  }
17599
17599
  getAllLinkedCaseInformation() {
17600
17600
  const searchCasesResponse = [];
17601
- this.linkedCases.forEach((linkedCase) => {
17601
+ this.linkedCases.forEach(linkedCase => {
17602
17602
  searchCasesResponse.push(this.casesService.getCaseViewV2(linkedCase.caseReference));
17603
17603
  });
17604
17604
  if (searchCasesResponse.length) {
17605
17605
  this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
17606
17606
  searchCases.forEach((response) => {
17607
- const linkedCaseFromList = this.linkedCases.find((linkedCase) => linkedCase.caseReference === response.case_id);
17607
+ const linkedCaseFromList = this.linkedCases.find(linkedCase => linkedCase.caseReference === response.case_id);
17608
17608
  if (linkedCaseFromList) {
17609
17609
  const caseName = this.linkedCasesService.getCaseName(response);
17610
- this.linkedCases.find((linkedCase) => linkedCase.caseReference === response.case_id).caseName = caseName;
17610
+ this.linkedCases.find(linkedCase => linkedCase.caseReference === response.case_id).caseName = caseName;
17611
17611
  }
17612
17612
  });
17613
17613
  this.initForm();
17614
17614
  this.linkedCasesService.linkedCases = this.linkedCases;
17615
17615
  this.isServerError = false;
17616
- }, (err) => {
17616
+ }, err => {
17617
17617
  this.isServerError = true;
17618
17618
  this.notifyAPIFailure.emit(true);
17619
17619
  });
@@ -17628,7 +17628,7 @@ class UnLinkCasesComponent {
17628
17628
  });
17629
17629
  }
17630
17630
  get getLinkedCasesFormArray() {
17631
- const formFieldArray = this.linkedCases.map((val) => this.fb.group({
17631
+ const formFieldArray = this.linkedCases.map(val => this.fb.group({
17632
17632
  caseReference: val.caseReference,
17633
17633
  reasons: val.reasons,
17634
17634
  createdDateTime: val.createdDateTime,
@@ -17642,7 +17642,7 @@ class UnLinkCasesComponent {
17642
17642
  }
17643
17643
  onChange(caseSelected) {
17644
17644
  this.resetErrorMessages();
17645
- const selectedCase = this.linkedCases.find((linkedCase) => linkedCase.caseReference === caseSelected.value);
17645
+ const selectedCase = this.linkedCases.find(linkedCase => linkedCase.caseReference === caseSelected.value);
17646
17646
  if (selectedCase) {
17647
17647
  selectedCase.unlink = caseSelected.checked ? true : false;
17648
17648
  }
@@ -17650,7 +17650,7 @@ class UnLinkCasesComponent {
17650
17650
  onNext() {
17651
17651
  this.resetErrorMessages();
17652
17652
  let navigateToNextPage = true;
17653
- const casesMarkedToUnlink = this.linkedCases.find((linkedCase) => linkedCase.unlink && linkedCase.unlink === true);
17653
+ const casesMarkedToUnlink = this.linkedCases.find(linkedCase => linkedCase.unlink && linkedCase.unlink === true);
17654
17654
  if (!casesMarkedToUnlink) {
17655
17655
  this.errorMessages.push({
17656
17656
  title: 'case-selection',
@@ -17668,7 +17668,7 @@ class UnLinkCasesComponent {
17668
17668
  this.linkedCasesStateEmitter.emit({
17669
17669
  currentLinkedCasesPage: LinkedCasesPages.UNLINK_CASE,
17670
17670
  errorMessages: this.errorMessages,
17671
- navigateToNextPage: isNavigateToNextPage
17671
+ navigateToNextPage: isNavigateToNextPage,
17672
17672
  });
17673
17673
  }
17674
17674
  resetErrorMessages() {
@@ -18011,16 +18011,14 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18011
18011
  // Get linked case reasons from ref data
18012
18012
  this.linkedCasesService.editMode = false;
18013
18013
  this.subscriptions.add(this.caseEditDataService.caseDetails$.subscribe({
18014
- next: (caseDetails) => {
18015
- this.initialiseCaseDetails(caseDetails);
18016
- }
18014
+ next: caseDetails => { this.initialiseCaseDetails(caseDetails); }
18017
18015
  }));
18018
18016
  this.getOrgService();
18019
18017
  this.subscriptions.add(this.caseEditDataService.caseEventTriggerName$.subscribe({
18020
- next: (name) => this.linkedCasesService.isLinkedCasesEventTrigger = (name === LinkedCasesEventTriggers.LINK_CASES)
18018
+ next: name => this.linkedCasesService.isLinkedCasesEventTrigger = (name === LinkedCasesEventTriggers.LINK_CASES)
18021
18019
  }));
18022
18020
  this.subscriptions.add(this.caseEditDataService.caseEditForm$.subscribe({
18023
- next: (editForm) => this.caseEditForm = editForm
18021
+ next: editForm => this.caseEditForm = editForm
18024
18022
  }));
18025
18023
  }
18026
18024
  initialiseCaseDetails(caseDetails) {
@@ -18096,28 +18094,13 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18096
18094
  }
18097
18095
  }
18098
18096
  submitLinkedCases() {
18099
- let caseFieldValue = [...(this.linkedCasesService.caseFieldValue || [])];
18100
18097
  if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
18101
- const unlinkedCaseReferenceIds = this.linkedCasesService.linkedCases
18102
- .filter((item) => item.unlink)
18103
- .map((item) => item.caseReference);
18104
- caseFieldValue = caseFieldValue.filter((item) => !unlinkedCaseReferenceIds.includes(item.id));
18105
- }
18106
- // Replace the caseLinks value in this.formGroup
18107
- this.formGroup.patchValue({
18108
- caseLinks: caseFieldValue
18109
- });
18110
- // Replace the caseLinks control in caseEditForm.controls.data
18111
- const dataFormGroup = this.caseEditForm.controls.data;
18112
- if (dataFormGroup) {
18113
- // Remove the existing caseLinks control (if it exists)
18114
- if (dataFormGroup.contains('caseLinks')) {
18115
- dataFormGroup.removeControl('caseLinks');
18116
- }
18117
- // Add the new control with the replacement value
18118
- dataFormGroup.addControl('caseLinks', new FormControl(caseFieldValue || []));
18098
+ const unlinkedCaseRefereneIds = this.linkedCasesService.linkedCases.filter(item => item.unlink).map(item => item.caseReference);
18099
+ const caseFieldValue = this.linkedCasesService.caseFieldValue;
18100
+ this.linkedCasesService.caseFieldValue = caseFieldValue.filter(item => unlinkedCaseRefereneIds.indexOf(item.id) === -1);
18119
18101
  }
18120
- // Set the updated form in the caseEditDataService
18102
+ this.formGroup.value.caseLinks = this.linkedCasesService.caseFieldValue;
18103
+ this.caseEditForm.controls['data'] = new FormGroup({ caseLinks: new FormControl(this.linkedCasesService.caseFieldValue || []) });
18121
18104
  this.caseEditDataService.setCaseEditForm(this.caseEditForm);
18122
18105
  }
18123
18106
  isAtFinalPage() {
@@ -18134,11 +18117,11 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18134
18117
  }
18135
18118
  getLinkedCases() {
18136
18119
  this.casesService.getCaseViewV2(this.linkedCasesService.caseId).subscribe((caseView) => {
18137
- const caseViewFiltered = caseView.tabs.filter((tab) => {
18120
+ const caseViewFiltered = caseView.tabs.filter(tab => {
18138
18121
  return tab.fields.some(({ field_type }) => field_type && field_type.collection_field_type && field_type.collection_field_type.id === 'CaseLink');
18139
18122
  });
18140
18123
  if (caseViewFiltered) {
18141
- const caseLinkFieldValue = caseViewFiltered.map((filtered) => filtered.fields?.length > 0 && filtered.fields.filter((field) => field.id === 'caseLinks')[0].value);
18124
+ const caseLinkFieldValue = caseViewFiltered.map(filtered => filtered.fields?.length > 0 && filtered.fields.filter(field => field.id === 'caseLinks')[0].value);
18142
18125
  this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
18143
18126
  this.linkedCasesService.getAllLinkedCaseInformation();
18144
18127
  }
@@ -18178,7 +18161,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18178
18161
  type: Component,
18179
18162
  args: [{ selector: 'ccd-write-linked-cases-field', template: "<div class=\"form-group govuk-!-margin-bottom-2\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"linkedCasesPage\">\n <ng-container *ngSwitchCase=\"linkedCasesPages.BEFORE_YOU_START\">\n <ccd-linked-cases-before-you-start\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-before-you-start>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.NO_LINKED_CASES\">\n <ccd-no-linked-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-no-linked-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.LINK_CASE\">\n <ccd-link-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-link-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.UNLINK_CASE\">\n <ccd-unlink-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-unlink-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.CHECK_YOUR_ANSWERS\">\n <ccd-linked-cases-check-your-answers\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-check-your-answers>\n </ng-container>\n </div>\n</div>\n" }]
18180
18163
  }], () => [{ type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }, { type: CaseEditDataService }], null); })();
18181
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteLinkedCasesFieldComponent, { className: "WriteLinkedCasesFieldComponent", filePath: "lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts", lineNumber: 18 }); })();
18164
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteLinkedCasesFieldComponent, { className: "WriteLinkedCasesFieldComponent", filePath: "lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts", lineNumber: 19 }); })();
18182
18165
 
18183
18166
  function ReadMoneyGbpFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
18184
18167
  i0.ɵɵelementContainerStart(0);
@@ -29785,7 +29768,7 @@ class CaseEditSubmitComponent {
29785
29768
  return 'Cancel';
29786
29769
  }
29787
29770
  static ɵfac = function CaseEditSubmitComponent_Factory(t) { return new (t || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(FormValidatorsService)); };
29788
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 23, vars: 21, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 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"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29771
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 23, vars: 21, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 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"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content", "text-16"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29789
29772
  const _r1 = i0.ɵɵgetCurrentView();
29790
29773
  i0.ɵɵelementStart(0, "div")(1, "h1", 2);
29791
29774
  i0.ɵɵtext(2);
@@ -29841,7 +29824,7 @@ class CaseEditSubmitComponent {
29841
29824
  }
29842
29825
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
29843
29826
  type: Component,
29844
- args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button *ngIf=\"!caseEdit.isCaseFlagSubmission\" class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
29827
+ args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content text-16\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button *ngIf=\"!caseEdit.isCaseFlagSubmission\" class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
29845
29828
  }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: FormValidatorsService }], null); })();
29846
29829
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 27 }); })();
29847
29830