@hmcts/ccd-case-ui-toolkit 6.15.0-d → 6.15.0-e

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.
Files changed (18) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +41 -6
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +2 -1
  6. package/esm2015/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.js +21 -7
  7. package/esm2015/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.js +20 -7
  8. package/esm2015/lib/shared/components/palette/case-flag/write-case-flag-field.component.js +12 -1
  9. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +41 -6
  10. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  11. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  12. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts +7 -2
  13. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts.map +1 -1
  14. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts +4 -1
  15. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts.map +1 -1
  16. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts +4 -2
  17. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
  18. package/package.json +1 -1
@@ -10752,6 +10752,7 @@
10752
10752
  id: id_1,
10753
10753
  message: "Please select Next to complete the " + action + " of the " + (action === 'update' ? 'selected ' : '') + "case flag"
10754
10754
  });
10755
+ _this.caseEditDataService.setFormValidationErrors(_this.validationErrors);
10755
10756
  }
10756
10757
  else {
10757
10758
  _this.validationErrors.push({ id: id_1, message: "Select or fill the required " + casefield.label + " field" });
@@ -12334,6 +12335,13 @@
12334
12335
  });
12335
12336
  }
12336
12337
  }
12338
+ this.caseValidationErrorsSubscription$ = this.caseEditDataService.caseFormValidationErrors$.subscribe({
12339
+ next: function (validationErrors) {
12340
+ if (validationErrors.length) {
12341
+ _this.errorMessages = [];
12342
+ }
12343
+ }
12344
+ });
12337
12345
  };
12338
12346
  WriteCaseFlagFieldComponent.prototype.setDisplayContextParameterUpdate = function (caseFields) {
12339
12347
  var _this = this;
@@ -12565,6 +12573,10 @@
12565
12573
  this.formGroup.updateValueAndValidity();
12566
12574
  this.caseEditDataService.setTriggerSubmitEvent(true);
12567
12575
  };
12576
+ WriteCaseFlagFieldComponent.prototype.ngOnDestroy = function () {
12577
+ var _a;
12578
+ (_a = this.caseValidationErrorsSubscription$) === null || _a === void 0 ? void 0 : _a.unsubscribe();
12579
+ };
12568
12580
  return WriteCaseFlagFieldComponent;
12569
12581
  }(AbstractFieldWriteComponent));
12570
12582
  WriteCaseFlagFieldComponent.ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
@@ -21942,8 +21954,9 @@
21942
21954
  }
21943
21955
  }
21944
21956
  var SelectFlagTypeComponent = /** @class */ (function () {
21945
- function SelectFlagTypeComponent(caseFlagRefdataService) {
21957
+ function SelectFlagTypeComponent(caseFlagRefdataService, caseEditDataService) {
21946
21958
  this.caseFlagRefdataService = caseFlagRefdataService;
21959
+ this.caseEditDataService = caseEditDataService;
21947
21960
  this.caseFlagStateEmitter = new i0.EventEmitter();
21948
21961
  this.flagCommentsOptionalEmitter = new i0.EventEmitter();
21949
21962
  this.flagTypeNotSelectedErrorMessage = '';
@@ -21998,11 +22011,21 @@
21998
22011
  error: function (error) { return _this.onRefdataError(error); }
21999
22012
  });
22000
22013
  }
22014
+ this.caseValidationErrorsSubscription$ = this.caseEditDataService.caseFormValidationErrors$.subscribe({
22015
+ next: function (validationErrors) {
22016
+ if (validationErrors.length) {
22017
+ _this.errorMessages = [];
22018
+ _this.flagTypeNotSelectedErrorMessage = '';
22019
+ _this.flagTypeErrorMessage = '';
22020
+ }
22021
+ }
22022
+ });
22001
22023
  };
22002
22024
  SelectFlagTypeComponent.prototype.ngOnDestroy = function () {
22003
22025
  if (this.flagRefdata$) {
22004
22026
  this.flagRefdata$.unsubscribe();
22005
22027
  }
22028
+ this.caseValidationErrorsSubscription$.unsubscribe();
22006
22029
  };
22007
22030
  SelectFlagTypeComponent.prototype.onFlagTypeChanged = function (flagType) {
22008
22031
  this.selectedFlagType = flagType;
@@ -22068,7 +22091,7 @@
22068
22091
  };
22069
22092
  return SelectFlagTypeComponent;
22070
22093
  }());
22071
- SelectFlagTypeComponent.ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0__namespace.ɵɵdirectiveInject(CaseFlagRefdataService)); };
22094
+ SelectFlagTypeComponent.ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0__namespace.ɵɵdirectiveInject(CaseFlagRefdataService), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
22072
22095
  SelectFlagTypeComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId", hmctsServiceId: "hmctsServiceId" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, decls: 11, vars: 9, consts: [[1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--l"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading"], ["id", "flag-type-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"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName", "change"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagTypeComponent_Template(rf, ctx) {
22073
22096
  if (rf & 1) {
22074
22097
  i0__namespace.ɵɵelementStart(0, "div", 0);
@@ -22113,7 +22136,7 @@
22113
22136
  templateUrl: './select-flag-type.component.html',
22114
22137
  styleUrls: ['./select-flag-type.component.scss']
22115
22138
  }]
22116
- }], function () { return [{ type: CaseFlagRefdataService }]; }, { formGroup: [{
22139
+ }], function () { return [{ type: CaseFlagRefdataService }, { type: CaseEditDataService }]; }, { formGroup: [{
22117
22140
  type: i0.Input
22118
22141
  }], jurisdiction: [{
22119
22142
  type: i0.Input
@@ -22536,7 +22559,8 @@
22536
22559
  }
22537
22560
  var _c0$o = function (a0) { return { "form-group-error": a0 }; };
22538
22561
  var SelectFlagLocationComponent = /** @class */ (function () {
22539
- function SelectFlagLocationComponent() {
22562
+ function SelectFlagLocationComponent(caseEditDataService) {
22563
+ this.caseEditDataService = caseEditDataService;
22540
22564
  this.caseFlagStateEmitter = new i0.EventEmitter();
22541
22565
  this.errorMessages = [];
22542
22566
  this.flagLocationNotSelectedErrorMessage = null;
@@ -22564,6 +22588,14 @@
22564
22588
  // flags in future)
22565
22589
  this.onCaseFlagsConfigError();
22566
22590
  }
22591
+ this.caseValidationErrorsSubscription$ = this.caseEditDataService.caseFormValidationErrors$.subscribe({
22592
+ next: function (validationErrors) {
22593
+ if (validationErrors.length) {
22594
+ _this.errorMessages = [];
22595
+ _this.flagLocationNotSelectedErrorMessage = null;
22596
+ }
22597
+ }
22598
+ });
22567
22599
  };
22568
22600
  SelectFlagLocationComponent.prototype.onNext = function () {
22569
22601
  // Validate flag location selection
@@ -22598,9 +22630,12 @@
22598
22630
  // Return case flag field state and error messages to the parent
22599
22631
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: exports.CaseFlagFieldState.FLAG_TYPE, errorMessages: this.errorMessages });
22600
22632
  };
22633
+ SelectFlagLocationComponent.prototype.ngOnDestroy = function () {
22634
+ this.caseValidationErrorsSubscription$.unsubscribe();
22635
+ };
22601
22636
  return SelectFlagLocationComponent;
22602
22637
  }());
22603
- SelectFlagLocationComponent.ɵfac = function SelectFlagLocationComponent_Factory(t) { return new (t || SelectFlagLocationComponent)(); };
22638
+ SelectFlagLocationComponent.ɵfac = function SelectFlagLocationComponent_Factory(t) { return new (t || SelectFlagLocationComponent)(i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
22604
22639
  SelectFlagLocationComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: SelectFlagLocationComponent, selectors: [["ccd-select-flag-location"]], inputs: { formGroup: "formGroup", flagsData: "flagsData" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 10, vars: 8, consts: [[1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-location-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--l"], ["id", "flag-location-heading", 1, "govuk-fieldset__heading"], ["id", "flag-location-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"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "flag-location-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], [4, "ngIf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagLocationComponent_Template(rf, ctx) {
22605
22640
  if (rf & 1) {
22606
22641
  i0__namespace.ɵɵelementStart(0, "div", 0);
@@ -22641,7 +22676,7 @@
22641
22676
  selector: 'ccd-select-flag-location',
22642
22677
  templateUrl: './select-flag-location.component.html'
22643
22678
  }]
22644
- }], null, { formGroup: [{
22679
+ }], function () { return [{ type: CaseEditDataService }]; }, { formGroup: [{
22645
22680
  type: i0.Input
22646
22681
  }], flagsData: [{
22647
22682
  type: i0.Input