@hmcts/ccd-case-ui-toolkit 6.19.12-rc1 → 6.19.13-prerelease-service-id-params

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.
@@ -18781,6 +18781,12 @@
18781
18781
  }
18782
18782
  return rxjs.of(null);
18783
18783
  };
18784
+ CommonDataService.prototype.getServiceOrgData = function (url) {
18785
+ if (url) {
18786
+ return this.http.get(url, { observe: 'body' });
18787
+ }
18788
+ return rxjs.of(null);
18789
+ };
18784
18790
  return CommonDataService;
18785
18791
  }());
18786
18792
  CommonDataService.ɵfac = function CommonDataService_Factory(t) { return new (t || CommonDataService)(i0__namespace.ɵɵinject(i1__namespace$2.HttpClient)); };
@@ -19045,6 +19051,7 @@
19045
19051
  _this.linkedCasesPages = exports.LinkedCasesPages;
19046
19052
  _this.linkedCasesEventTriggers = exports.LinkedCasesEventTriggers;
19047
19053
  _this.linkedCases = [];
19054
+ _this.subscriptions = new rxjs.Subscription();
19048
19055
  return _this;
19049
19056
  }
19050
19057
  WriteLinkedCasesFieldComponent.prototype.ngOnInit = function () {
@@ -19055,17 +19062,17 @@
19055
19062
  // Clear validation errors
19056
19063
  this.caseEditDataService.clearFormValidationErrors();
19057
19064
  // Get linked case reasons from ref data
19058
- this.getLinkedCaseReasons();
19059
19065
  this.linkedCasesService.editMode = false;
19060
- this.caseEditDataService.caseDetails$.subscribe({
19061
- next: function (caseDetails) { return _this.initialiseCaseDetails(caseDetails); }
19062
- });
19063
- this.caseEditDataService.caseEventTriggerName$.subscribe({
19066
+ this.subscriptions.add(this.caseEditDataService.caseDetails$.subscribe({
19067
+ next: function (caseDetails) { _this.initialiseCaseDetails(caseDetails); }
19068
+ }));
19069
+ this.getOrgService();
19070
+ this.subscriptions.add(this.caseEditDataService.caseEventTriggerName$.subscribe({
19064
19071
  next: function (name) { return _this.linkedCasesService.isLinkedCasesEventTrigger = (name === exports.LinkedCasesEventTriggers.LINK_CASES); }
19065
- });
19066
- this.caseEditDataService.caseEditForm$.subscribe({
19072
+ }));
19073
+ this.subscriptions.add(this.caseEditDataService.caseEditForm$.subscribe({
19067
19074
  next: function (editForm) { return _this.caseEditForm = editForm; }
19068
- });
19075
+ }));
19069
19076
  };
19070
19077
  WriteLinkedCasesFieldComponent.prototype.initialiseCaseDetails = function (caseDetails) {
19071
19078
  if (caseDetails) {
@@ -19102,19 +19109,29 @@
19102
19109
  }
19103
19110
  }
19104
19111
  };
19105
- WriteLinkedCasesFieldComponent.prototype.getLinkedCaseReasons = function () {
19112
+ WriteLinkedCasesFieldComponent.prototype.getLinkedCaseReasons = function (serviceId) {
19106
19113
  var _this = this;
19107
- var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + "/lov/categories/CaseLinkingReasonCode";
19114
+ var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + "/lov/categories/CaseLinkingReasonCode?serviceId=" + serviceId;
19108
19115
  this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
19109
19116
  next: function (reasons) {
19110
19117
  // Sort in ascending order
19111
19118
  var linkCaseReasons = reasons.list_of_values.sort(function (a, b) { return (a.value_en > b.value_en) ? 1 : -1; });
19112
- // Move Other option to the end of the list
19113
19119
  _this.linkedCasesService.linkCaseReasons = linkCaseReasons === null || linkCaseReasons === void 0 ? void 0 : linkCaseReasons.filter(function (reason) { return reason.value_en !== 'Other'; });
19120
+ // Move Other option to the end of the list
19114
19121
  _this.linkedCasesService.linkCaseReasons.push(linkCaseReasons === null || linkCaseReasons === void 0 ? void 0 : linkCaseReasons.find(function (reason) { return reason.value_en === 'Other'; }));
19115
19122
  }
19116
19123
  });
19117
19124
  };
19125
+ WriteLinkedCasesFieldComponent.prototype.getOrgService = function () {
19126
+ var _this = this;
19127
+ var _a, _b;
19128
+ var servicesApiUrl = "refdata/location/orgServices?ccdCaseType=" + ((_b = (_a = this.caseDetails) === null || _a === void 0 ? void 0 : _a.case_type) === null || _b === void 0 ? void 0 : _b.id);
19129
+ this.commonDataService.getServiceOrgData(servicesApiUrl).subscribe(function (result) {
19130
+ result.forEach(function (ids) {
19131
+ _this.getLinkedCaseReasons(ids.service_id);
19132
+ });
19133
+ });
19134
+ };
19118
19135
  WriteLinkedCasesFieldComponent.prototype.proceedToNextPage = function () {
19119
19136
  if (this.isAtFinalPage()) {
19120
19137
  // Continue button event must be allowed in final page
@@ -19155,8 +19172,8 @@
19155
19172
  var _this = this;
19156
19173
  this.casesService.getCaseViewV2(this.linkedCasesService.caseId).subscribe(function (caseView) {
19157
19174
  var caseViewFiltered = caseView.tabs.filter(function (tab) {
19158
- return tab.fields.some(function (_b) {
19159
- var field_type = _b.field_type;
19175
+ return tab.fields.some(function (_c) {
19176
+ var field_type = _c.field_type;
19160
19177
  return field_type && field_type.collection_field_type && field_type.collection_field_type.id === 'CaseLink';
19161
19178
  });
19162
19179
  });
@@ -19173,6 +19190,9 @@
19173
19190
  : exports.LinkedCasesPages.NO_LINKED_CASES;
19174
19191
  });
19175
19192
  };
19193
+ WriteLinkedCasesFieldComponent.prototype.ngOnDestroy = function () {
19194
+ this.subscriptions.unsubscribe();
19195
+ };
19176
19196
  return WriteLinkedCasesFieldComponent;
19177
19197
  }(AbstractFieldWriteComponent));
19178
19198
  WriteLinkedCasesFieldComponent.ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CommonDataService), i0__namespace.ɵɵdirectiveInject(CasesService), i0__namespace.ɵɵdirectiveInject(LinkedCasesService), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
@@ -32426,7 +32446,6 @@
32426
32446
  var targetTabIndex = this.tabGroup._tabs.toArray().findIndex(function (tab) { return tab.textLabel === triggerOutputEventText; });
32427
32447
  if (targetTabIndex > -1) {
32428
32448
  this.selectedTabIndex = targetTabIndex;
32429
- this.tabGroup.selectedIndex = targetTabIndex;
32430
32449
  }
32431
32450
  };
32432
32451
  CaseFullAccessViewComponent.prototype.hasActiveCaseFlags = function () {