@hmcts/ccd-case-ui-toolkit 6.13.0-rc5 → 6.13.0-rc7

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.
@@ -12412,7 +12412,7 @@
12412
12412
  if (rf & 2) {
12413
12413
  var ctx_r8 = i0__namespace.ɵɵnextContext(2);
12414
12414
  i0__namespace.ɵɵadvance(1);
12415
- i0__namespace.ɵɵproperty("formGroup", ctx_r8.caseFlagParentFormGroup)("jurisdiction", ctx_r8.jurisdiction)("caseTypeId", ctx_r8.caseTypeId);
12415
+ i0__namespace.ɵɵproperty("formGroup", ctx_r8.caseFlagParentFormGroup)("jurisdiction", ctx_r8.jurisdiction)("caseTypeId", ctx_r8.caseTypeId)("hmctsServiceId", ctx_r8.hmctsServiceId);
12416
12416
  }
12417
12417
  }
12418
12418
  function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template(rf, ctx) {
@@ -12454,7 +12454,7 @@
12454
12454
  i0__namespace.ɵɵtext(3);
12455
12455
  i0__namespace.ɵɵelementEnd();
12456
12456
  i0__namespace.ɵɵtemplate(4, WriteCaseFlagFieldComponent_div_1_ng_container_4_Template, 2, 2, "ng-container", 11);
12457
- i0__namespace.ɵɵtemplate(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 2, 3, "ng-container", 11);
12457
+ i0__namespace.ɵɵtemplate(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 2, 4, "ng-container", 11);
12458
12458
  i0__namespace.ɵɵtemplate(6, WriteCaseFlagFieldComponent_div_1_ng_container_6_Template, 2, 3, "ng-container", 11);
12459
12459
  i0__namespace.ɵɵtemplate(7, WriteCaseFlagFieldComponent_div_1_ng_container_7_Template, 2, 2, "ng-container", 11);
12460
12460
  i0__namespace.ɵɵelementEnd();
@@ -12577,22 +12577,30 @@
12577
12577
  }
12578
12578
  }
12579
12579
  // Extract all flags-related data from the CaseEventTrigger object in the snapshot data
12580
- if (this.route.snapshot.data.eventTrigger && this.route.snapshot.data.eventTrigger.case_fields) {
12581
- this.flagsData = (this.route.snapshot.data.eventTrigger.case_fields)
12582
- .reduce(function (flags, caseField) {
12583
- return FieldsUtils.extractFlagsDataFromCaseField(flags, caseField, caseField.id, caseField);
12584
- }, []);
12585
- // Set boolean indicating the display_context_parameter is "update"
12586
- this.isDisplayContextParameterUpdate =
12587
- this.setDisplayContextParameterUpdate((this.route.snapshot.data.eventTrigger.case_fields));
12588
- // Set starting field state
12589
- this.fieldState = this.isDisplayContextParameterUpdate ? exports.CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS : exports.CaseFlagFieldState.FLAG_LOCATION;
12590
- // Get case title, to be used by child components
12591
- this.caseEditDataService.caseTitle$.subscribe({
12592
- next: function (title) {
12593
- _this.caseTitle = title.length > 0 ? title : _this.caseNameMissing;
12594
- }
12595
- });
12580
+ if (this.route.snapshot.data.eventTrigger) {
12581
+ // Get the HMCTSServiceId from supplementary data, if it exists (required for retrieving the available flag types in
12582
+ // the first instance, only falling back on case type ID or jurisidiction if it's not present)
12583
+ if (this.route.snapshot.data.eventTrigger.supplementary_data
12584
+ && this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId) {
12585
+ this.hmctsServiceId = this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId;
12586
+ }
12587
+ if (this.route.snapshot.data.eventTrigger.case_fields) {
12588
+ this.flagsData = (this.route.snapshot.data.eventTrigger.case_fields)
12589
+ .reduce(function (flags, caseField) {
12590
+ return FieldsUtils.extractFlagsDataFromCaseField(flags, caseField, caseField.id, caseField);
12591
+ }, []);
12592
+ // Set boolean indicating the display_context_parameter is "update"
12593
+ this.isDisplayContextParameterUpdate =
12594
+ this.setDisplayContextParameterUpdate((this.route.snapshot.data.eventTrigger.case_fields));
12595
+ // Set starting field state
12596
+ this.fieldState = this.isDisplayContextParameterUpdate ? exports.CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS : exports.CaseFlagFieldState.FLAG_LOCATION;
12597
+ // Get case title, to be used by child components
12598
+ this.caseEditDataService.caseTitle$.subscribe({
12599
+ next: function (title) {
12600
+ _this.caseTitle = title.length > 0 ? title : _this.caseNameMissing;
12601
+ }
12602
+ });
12603
+ }
12596
12604
  }
12597
12605
  };
12598
12606
  WriteCaseFlagFieldComponent.prototype.setDisplayContextParameterUpdate = function (caseFields) {
@@ -12828,7 +12836,7 @@
12828
12836
  return WriteCaseFlagFieldComponent;
12829
12837
  }(AbstractFieldWriteComponent));
12830
12838
  WriteCaseFlagFieldComponent.ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
12831
- WriteCaseFlagFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], ["id", "create-flag-caption", 1, "govuk-caption-l", 3, "ngClass"], [4, "ngSwitchCase"], [3, "formGroup", "flagsData", "caseFlagStateEmitter"], [3, "formGroup", "jurisdiction", "caseTypeId", "caseFlagStateEmitter", "flagCommentsOptionalEmitter"], [3, "formGroup", "languages", "flagCode", "caseFlagStateEmitter"], [3, "formGroup", "optional", "caseFlagStateEmitter"], [3, "formGroup", "flagsData", "caseTitle", "caseFlagStateEmitter"], [3, "formGroup", "selectedFlag", "caseFlagStateEmitter"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) {
12839
+ WriteCaseFlagFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], ["id", "create-flag-caption", 1, "govuk-caption-l", 3, "ngClass"], [4, "ngSwitchCase"], [3, "formGroup", "flagsData", "caseFlagStateEmitter"], [3, "formGroup", "jurisdiction", "caseTypeId", "hmctsServiceId", "caseFlagStateEmitter", "flagCommentsOptionalEmitter"], [3, "formGroup", "languages", "flagCode", "caseFlagStateEmitter"], [3, "formGroup", "optional", "caseFlagStateEmitter"], [3, "formGroup", "flagsData", "caseTitle", "caseFlagStateEmitter"], [3, "formGroup", "selectedFlag", "caseFlagStateEmitter"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) {
12832
12840
  if (rf & 1) {
12833
12841
  i0__namespace.ɵɵtemplate(0, WriteCaseFlagFieldComponent_div_0_Template, 4, 1, "div", 0);
12834
12842
  i0__namespace.ɵɵtemplate(1, WriteCaseFlagFieldComponent_div_1_Template, 8, 10, "div", 1);
@@ -19216,19 +19224,30 @@
19216
19224
  && this.formGroup['caseField'].id === this.caseLevelCaseFlagsFieldId
19217
19225
  ? exports.RefdataCaseFlagType.CASE
19218
19226
  : exports.RefdataCaseFlagType.PARTY;
19219
- // HMCTS service code is required to retrieve the relevant list of flag types; attempt to obtain it by case type ID first
19220
- this.flagRefdata$ = this.caseFlagRefdataService.getHmctsServiceDetailsByCaseType(this.caseTypeId)
19221
- .pipe(
19222
- // If an error occurs retrieving HMCTS service details by case type ID, try by service name instead
19223
- operators.catchError(function (_) { return _this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(_this.jurisdiction); }),
19224
- // Use switchMap to return an inner Observable of the flag types data, having received the service details
19225
- // including service_code. This avoids having nested `subscribe`s, which is an anti-pattern!
19226
- operators.switchMap(function (serviceDetails) { return _this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType); }))
19227
- .subscribe({
19228
- // First (and only) object in the returned array should be the top-level "Party" flag type
19229
- next: function (flagTypes) { return _this.flagTypes = flagTypes[0].childFlags; },
19230
- error: function (error) { return _this.onRefdataError(error); }
19231
- });
19227
+ // If hmctsServiceId is present, use this to retrieve the relevant list of flag types
19228
+ if (this.hmctsServiceId) {
19229
+ this.flagRefdata$ = this.caseFlagRefdataService.getCaseFlagsRefdata(this.hmctsServiceId, flagType)
19230
+ .subscribe({
19231
+ // First (and only) object in the returned array should be the top-level "Party" flag type
19232
+ next: function (flagTypes) { return _this.flagTypes = flagTypes[0].childFlags; },
19233
+ error: function (error) { return _this.onRefdataError(error); }
19234
+ });
19235
+ }
19236
+ else {
19237
+ // Else, HMCTS service code is required to retrieve the relevant list of flag types; attempt to obtain it by case type ID first
19238
+ this.flagRefdata$ = this.caseFlagRefdataService.getHmctsServiceDetailsByCaseType(this.caseTypeId)
19239
+ .pipe(
19240
+ // If an error occurs retrieving HMCTS service details by case type ID, try by service name instead
19241
+ operators.catchError(function (_) { return _this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(_this.jurisdiction); }),
19242
+ // Use switchMap to return an inner Observable of the flag types data, having received the service details
19243
+ // including service_code. This avoids having nested `subscribe`s, which is an anti-pattern!
19244
+ operators.switchMap(function (serviceDetails) { return _this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType); }))
19245
+ .subscribe({
19246
+ // First (and only) object in the returned array should be the top-level "Party" flag type
19247
+ next: function (flagTypes) { return _this.flagTypes = flagTypes[0].childFlags; },
19248
+ error: function (error) { return _this.onRefdataError(error); }
19249
+ });
19250
+ }
19232
19251
  };
19233
19252
  SelectFlagTypeComponent.prototype.ngOnDestroy = function () {
19234
19253
  if (this.flagRefdata$) {
@@ -19300,7 +19319,7 @@
19300
19319
  return SelectFlagTypeComponent;
19301
19320
  }());
19302
19321
  SelectFlagTypeComponent.ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0__namespace.ɵɵdirectiveInject(CaseFlagRefdataService)); };
19303
- SelectFlagTypeComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId" }, 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) {
19322
+ 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) {
19304
19323
  if (rf & 1) {
19305
19324
  i0__namespace.ɵɵelementStart(0, "div", 0);
19306
19325
  i0__namespace.ɵɵelementStart(1, "div", 1);
@@ -19350,6 +19369,8 @@
19350
19369
  type: i0.Input
19351
19370
  }], caseTypeId: [{
19352
19371
  type: i0.Input
19372
+ }], hmctsServiceId: [{
19373
+ type: i0.Input
19353
19374
  }], caseFlagStateEmitter: [{
19354
19375
  type: i0.Output
19355
19376
  }], flagCommentsOptionalEmitter: [{
@@ -27759,7 +27780,7 @@
27759
27780
  this.activeCaseFlags = this.hasActiveCaseFlags();
27760
27781
  };
27761
27782
  CaseFullAccessViewComponent.prototype.ngOnChanges = function (changes) {
27762
- if (!changes.prependedTabs.firstChange) {
27783
+ if (changes && changes.prependedTabs && !changes.prependedTabs.firstChange) {
27763
27784
  this.init();
27764
27785
  this.crf.detectChanges();
27765
27786
  this.organiseTabPosition();
@@ -27786,8 +27807,10 @@
27786
27807
  };
27787
27808
  CaseFullAccessViewComponent.prototype.checkRouteAndSetCaseViewTab = function () {
27788
27809
  var _this = this;
27789
- this.router.events.subscribe(function (val) {
27790
- var url = val && val.url;
27810
+ this.router.events
27811
+ .pipe(operators.filter(function (event) { return event instanceof i1$1.NavigationEnd; }))
27812
+ .subscribe(function (event) {
27813
+ var url = event && event.url;
27791
27814
  if (url) {
27792
27815
  var tabUrl = url ? url.split('#') : null;
27793
27816
  var tab_1 = tabUrl && tabUrl.length > 1 ? tabUrl[tabUrl.length - 1].replaceAll('%20', ' ') : '';