@hmcts/ccd-case-ui-toolkit 7.3.3-angular-20 → 7.3.4-angular-20

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.
@@ -13773,15 +13773,15 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteJourneyComponent {
13773
13773
  }
13774
13774
  }
13775
13775
  // CSFD-16.
13776
- // Setup the page number to initially be the same value as
13777
- // the start page number. Provided that some state exists within
13776
+ // Setup the page number to initially be the same value as
13777
+ // the start page number. Provided that some state exists within
13778
13778
  // the page state service, use that instaead.
13779
13779
  //
13780
- // If isDisplayContextParameterUpdate is true, then the starting page must be
13780
+ // If isDisplayContextParameterUpdate is true, then the starting page must be
13781
13781
  // the value of 4. Otherwise, it's 0. However, we're using an enum to simplify
13782
13782
  // this process.
13783
13783
  //
13784
- // It might help to take a look at the template file.
13784
+ // It might help to take a look at the template file.
13785
13785
  if (this.isDisplayContextParameterUpdate) {
13786
13786
  this.journeyStartPageNumber = CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS;
13787
13787
  this.journeyEndPageNumber = CaseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION;
@@ -13790,17 +13790,17 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteJourneyComponent {
13790
13790
  this.journeyStartPageNumber = CaseFlagFieldState.FLAG_LOCATION;
13791
13791
  this.journeyEndPageNumber = CaseFlagFieldState.FLAG_STATUS;
13792
13792
  }
13793
- // Now that we've set the start page number, let's set the current page number.
13793
+ // Now that we've set the start page number, let's set the current page number.
13794
13794
  this.journeyPageNumber = this.journeyStartPageNumber;
13795
- // If we've navigated to this page, then we know by default, we want to set the
13796
- // journey page number to the field state.
13795
+ // If we've navigated to this page, then we know by default, we want to set the
13796
+ // journey page number to the field state.
13797
13797
  if (this.navigatedTo) {
13798
13798
  const pageNo = this.fieldState === CaseFlagFieldState.FLAG_STATUS ? this.fieldState - 1 : this.fieldState;
13799
13799
  this.journeyPageNumber = pageNo;
13800
13800
  this.journeyPreviousPageNumber = pageNo + 1;
13801
13801
  }
13802
- // Provided we have some stored state, i.e. when going backwards, we want
13803
- // to get the last visited page, etc.
13802
+ // Provided we have some stored state, i.e. when going backwards, we want
13803
+ // to get the last visited page, etc.
13804
13804
  const state = this.multipageComponentStateService.getJourneyState(this);
13805
13805
  if (state) {
13806
13806
  const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
@@ -16365,7 +16365,7 @@ class ReadEmailFieldComponent extends AbstractFieldReadComponent {
16365
16365
  args: [{
16366
16366
  selector: 'ccd-read-email-field',
16367
16367
  template: `
16368
- <a *ngIf="!isFieldValueEmpty()" href=\"mailto:{{caseField.value}}\">{{caseField.value}}</a>
16368
+ <a *ngIf="!isFieldValueEmpty()" href=\"mailto:{{caseField.value}}\">{{caseField.value}}</a>
16369
16369
  `,
16370
16370
  standalone: false
16371
16371
  }]
@@ -19224,7 +19224,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteJourneyComponent
19224
19224
  }
19225
19225
  proceedToNextPage() {
19226
19226
  if (this.isAtFinalPage()) {
19227
- // Set the journey page to the end page.
19227
+ // Set the journey page to the end page.
19228
19228
  this.journeyPageNumber = this.journeyEndPageNumber;
19229
19229
  // Continue button event must be allowed in final page
19230
19230
  this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
@@ -19480,12 +19480,12 @@ class MoneyGbpInputComponent {
19480
19480
  {
19481
19481
  provide: NG_VALUE_ACCESSOR,
19482
19482
  useExisting: forwardRef(() => MoneyGbpInputComponent),
19483
- multi: true,
19483
+ multi: true
19484
19484
  },
19485
19485
  {
19486
19486
  provide: NG_VALIDATORS,
19487
19487
  useExisting: forwardRef(() => MoneyGbpInputComponent),
19488
- multi: true,
19488
+ multi: true
19489
19489
  }
19490
19490
  ])], decls: 1, vars: 4, consts: [["type", "text", 1, "form-control", "form-control-1-8", 3, "change", "keyup", "id", "name", "value", "disabled"]], template: function MoneyGbpInputComponent_Template(rf, ctx) { if (rf & 1) {
19491
19491
  i0.ɵɵelementStart(0, "input", 0);
@@ -19511,12 +19511,12 @@ class MoneyGbpInputComponent {
19511
19511
  {
19512
19512
  provide: NG_VALUE_ACCESSOR,
19513
19513
  useExisting: forwardRef(() => MoneyGbpInputComponent),
19514
- multi: true,
19514
+ multi: true
19515
19515
  },
19516
19516
  {
19517
19517
  provide: NG_VALIDATORS,
19518
19518
  useExisting: forwardRef(() => MoneyGbpInputComponent),
19519
- multi: true,
19519
+ multi: true
19520
19520
  }
19521
19521
  ],
19522
19522
  standalone: false
@@ -31880,7 +31880,6 @@ class CaseEditSubmitComponent {
31880
31880
  formValidatorsService;
31881
31881
  caseFlagStateService;
31882
31882
  linkedCasesService;
31883
- router;
31884
31883
  eventTrigger;
31885
31884
  editForm;
31886
31885
  triggerText;
@@ -31916,7 +31915,7 @@ class CaseEditSubmitComponent {
31916
31915
  // not been disabled.
31917
31916
  return this.caseEdit.isSubmitting || this.hasErrors;
31918
31917
  }
31919
- constructor(caseEdit, fieldsUtils, caseFieldService, route, orderService, profileNotifier, multipageComponentStateService, formValidatorsService, caseFlagStateService, linkedCasesService, router) {
31918
+ constructor(caseEdit, fieldsUtils, caseFieldService, route, orderService, profileNotifier, multipageComponentStateService, formValidatorsService, caseFlagStateService, linkedCasesService) {
31920
31919
  this.caseEdit = caseEdit;
31921
31920
  this.fieldsUtils = fieldsUtils;
31922
31921
  this.caseFieldService = caseFieldService;
@@ -31927,14 +31926,12 @@ class CaseEditSubmitComponent {
31927
31926
  this.formValidatorsService = formValidatorsService;
31928
31927
  this.caseFlagStateService = caseFlagStateService;
31929
31928
  this.linkedCasesService = linkedCasesService;
31930
- this.router = router;
31931
31929
  }
31932
31930
  ngOnInit() {
31933
31931
  this.profileSubscription = this.profileNotifier.profile.subscribe((_) => this.profile = _);
31934
31932
  this.eventTrigger = this.caseEdit.eventTrigger;
31935
31933
  this.triggerText = this.eventTrigger.end_button_label || CallbackErrorsComponent.TRIGGER_TEXT_SUBMIT;
31936
31934
  this.editForm = this.caseEdit.form;
31937
- this.redirectIfFormEmpty();
31938
31935
  this.wizard = this.caseEdit.wizard;
31939
31936
  this.showSummaryFields = this.sortFieldsByShowSummaryContent(this.eventTrigger.case_fields);
31940
31937
  this.caseEdit.isSubmitting = false;
@@ -32171,14 +32168,7 @@ class CaseEditSubmitComponent {
32171
32168
  }
32172
32169
  return 'Cancel';
32173
32170
  }
32174
- redirectIfFormEmpty() {
32175
- const data = this.editForm?.getRawValue()?.data;
32176
- const isEmpty = !data || (typeof data === 'object' && Object.keys(data).length === 0);
32177
- if (isEmpty) {
32178
- this.router.navigate(['/cases/case-filter']);
32179
- }
32180
- }
32181
- static ɵfac = function CaseEditSubmitComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(FormValidatorsService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(i1$1.Router)); };
32171
+ static ɵfac = function CaseEditSubmitComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(FormValidatorsService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
32182
32172
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], standalone: false, decls: 25, vars: 24, 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"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], ["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"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
32183
32173
  const _r1 = i0.ɵɵgetCurrentView();
32184
32174
  i0.ɵɵelementStart(0, "div")(1, "h1", 2);
@@ -32241,8 +32231,8 @@ class CaseEditSubmitComponent {
32241
32231
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
32242
32232
  type: Component,
32243
32233
  args: [{ selector: 'ccd-case-edit-submit', standalone: false, 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'] | 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 <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 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"] }]
32244
- }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: MultipageComponentStateService }, { type: FormValidatorsService }, { type: CaseFlagStateService }, { type: LinkedCasesService }, { type: i1$1.Router }], null); })();
32245
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 33 }); })();
32234
+ }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: MultipageComponentStateService }, { type: FormValidatorsService }, { type: CaseFlagStateService }, { type: LinkedCasesService }], null); })();
32235
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 31 }); })();
32246
32236
 
32247
32237
  function CaseProgressComponent_div_0_Template(rf, ctx) { if (rf & 1) {
32248
32238
  const _r1 = i0.ɵɵgetCurrentView();