@hmcts/ccd-case-ui-toolkit 6.19.11 → 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.
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +43 -17
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
- package/esm2015/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.js +26 -12
- package/esm2015/lib/shared/domain/case-view/service-org-response.model.js +2 -0
- package/esm2015/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.js +11 -5
- package/esm2015/lib/shared/services/common-data-service/common-data-service.js +7 -1
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js +41 -16
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
- package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts +6 -3
- package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
- package/lib/shared/domain/case-view/service-org-response.model.d.ts +14 -0
- package/lib/shared/domain/case-view/service-org-response.model.d.ts.map +1 -0
- package/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.d.ts.map +1 -1
- package/lib/shared/services/common-data-service/common-data-service.d.ts +2 -0
- package/lib/shared/services/common-data-service/common-data-service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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) {
|
|
19062
|
-
});
|
|
19063
|
-
this.
|
|
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 (
|
|
19159
|
-
var 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)); };
|
|
@@ -26523,10 +26543,16 @@
|
|
|
26523
26543
|
if (formGroup) {
|
|
26524
26544
|
checkConditionalShowAgainst = formGroup.parent.getRawValue().data;
|
|
26525
26545
|
formGroupAvailable = true;
|
|
26526
|
-
if (idPrefix) {
|
|
26527
|
-
|
|
26528
|
-
|
|
26529
|
-
checkConditionalShowAgainst
|
|
26546
|
+
if (idPrefix !== undefined) {
|
|
26547
|
+
if (idPrefix !== '') {
|
|
26548
|
+
var fieldId = idPrefix.substring(0, idPrefix.indexOf('_'));
|
|
26549
|
+
if (checkConditionalShowAgainst[fieldId]) {
|
|
26550
|
+
checkConditionalShowAgainst = values;
|
|
26551
|
+
formGroupAvailable = false;
|
|
26552
|
+
}
|
|
26553
|
+
}
|
|
26554
|
+
else {
|
|
26555
|
+
checkConditionalShowAgainst = Object.assign(checkConditionalShowAgainst, values);
|
|
26530
26556
|
formGroupAvailable = false;
|
|
26531
26557
|
}
|
|
26532
26558
|
}
|