@hmcts/ccd-case-ui-toolkit 6.14.4-eui-4157-b → 6.14.4-hotfix-110
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 +455 -395
- 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/app.config.js +1 -1
- package/esm2015/lib/components/form/date-input/date-input.component.js +8 -8
- package/esm2015/lib/components/header/header-bar/header-bar.component.js +3 -2
- package/esm2015/lib/shared/commons/case-edit-data/case-edit-data.module.js +1 -1
- package/esm2015/lib/shared/commons/case-edit-data/case-edit-validation.model.js +1 -1
- package/esm2015/lib/shared/components/activity/activity.component.js +5 -5
- package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +2 -2
- package/esm2015/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.js +2 -2
- package/esm2015/lib/shared/components/case-editor/case-editor.module.js +1 -1
- package/esm2015/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.js +3 -3
- package/esm2015/lib/shared/components/case-editor/services/cases.service.js +22 -11
- package/esm2015/lib/shared/components/case-editor/services/page-validation.service.js +2 -2
- package/esm2015/lib/shared/components/case-editor/services/wizard-page-field-to-case-field.mapper.js +2 -2
- package/esm2015/lib/shared/components/case-editor/services/work-allocation.service.js +1 -1
- package/esm2015/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.js +5 -5
- package/esm2015/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.js +1 -1
- package/esm2015/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.js +33 -24
- package/esm2015/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.js +4 -4
- package/esm2015/lib/shared/components/case-viewer/case-viewer.component.js +5 -5
- package/esm2015/lib/shared/components/case-viewer/printer/pipes/print-url.pipe.js +3 -3
- package/esm2015/lib/shared/components/case-viewer/services/case.resolver.js +2 -2
- package/esm2015/lib/shared/components/event-start/event-guard/event-start.guard.js +2 -2
- package/esm2015/lib/shared/components/palette/address/address-option.model.js +7 -4
- package/esm2015/lib/shared/components/palette/address/write-address-field.component.js +4 -4
- package/esm2015/lib/shared/components/palette/case-flag/components/case-flag-table/case-flag-table.component.js +1 -1
- package/esm2015/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.js +2 -2
- package/esm2015/lib/shared/components/palette/case-flag/enums/index.js +1 -1
- package/esm2015/lib/shared/components/palette/collection/collection-create-checker.service.js +5 -5
- package/esm2015/lib/shared/components/palette/collection/write-collection-field.component.js +5 -5
- package/esm2015/lib/shared/components/palette/complex/read-complex-field-collection-table.component.js +3 -3
- package/esm2015/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.js +1 -1
- package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.js +2 -2
- package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.js +1 -1
- package/esm2015/lib/shared/components/palette/linked-cases/domain/linked-cases.model.js +1 -1
- package/esm2015/lib/shared/components/palette/linked-cases/read-linked-cases-field.component.js +2 -2
- package/esm2015/lib/shared/components/palette/linked-cases/services/linked-cases.service.js +3 -2
- package/esm2015/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.js +4 -3
- package/esm2015/lib/shared/components/palette/order-summary/fee.model.js +1 -1
- package/esm2015/lib/shared/components/palette/order-summary/order-summary.model.js +1 -1
- package/esm2015/lib/shared/components/palette/text-area/write-text-area-field.component.js +2 -2
- package/esm2015/lib/shared/components/palette/utils/date.pipe.js +4 -4
- package/esm2015/lib/shared/components/search-filters/search-filters.component.js +2 -2
- package/esm2015/lib/shared/components/workbasket-filters/workbasket-filters.component.js +3 -3
- package/esm2015/lib/shared/directives/conditional-show/domain/conditional-show.model.js +3 -3
- package/esm2015/lib/shared/directives/conditional-show/services/condition-parser.service.js +7 -3
- package/esm2015/lib/shared/domain/case-view/case-view.model.js +1 -1
- package/esm2015/lib/shared/domain/case-view/role-assignment-response.model.js +1 -1
- package/esm2015/lib/shared/domain/case-view/role-request.model.js +1 -1
- package/esm2015/lib/shared/domain/organisation/organisation-converter.js +8 -8
- package/esm2015/lib/shared/domain/user/user-info.model.js +1 -1
- package/esm2015/lib/shared/fixture/case-field-builder.js +13 -13
- package/esm2015/lib/shared/fixture/shared.test.fixture.js +27 -27
- package/esm2015/lib/shared/pipes/complex/{ccd-page-fields.pipe.js → cdd-page-fields.pipe.js} +3 -3
- package/esm2015/lib/shared/pipes/complex/index.js +2 -2
- package/esm2015/lib/shared/services/activity/activity.polling.service.js +2 -2
- package/esm2015/lib/shared/services/activity/activity.service.js +18 -9
- package/esm2015/lib/shared/services/addresses/address-parser.js +5 -5
- package/esm2015/lib/shared/services/case-fields/format-translator.service.js +2 -2
- package/esm2015/lib/shared/services/case-flag/case-flag-refdata.service.js +2 -2
- package/esm2015/lib/shared/services/common-data-service/common-data-service.js +2 -2
- package/esm2015/lib/shared/services/definitions/definitions.service.js +8 -3
- package/esm2015/lib/shared/services/fields/fields.purger.js +15 -15
- package/esm2015/lib/shared/services/fields/fields.utils.js +4 -4
- package/esm2015/lib/shared/services/form/form-value.service.js +2 -1
- package/esm2015/lib/shared/services/loading/loading.service.js +7 -2
- package/esm2015/lib/shared/services/search/search.service.js +10 -5
- package/esm2015/lib/shared/services/search-result/sorting/search-result-view-item-comparator-factory.js +5 -5
- package/esm2015/lib/shared/services/window/window.service.js +1 -1
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js +435 -383
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
- package/lib/app.config.d.ts.map +1 -1
- package/lib/components/header/header-bar/header-bar.component.d.ts.map +1 -1
- package/lib/shared/commons/case-edit-data/case-edit-data.module.d.ts.map +1 -1
- package/lib/shared/commons/case-edit-data/case-edit-validation.model.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts +2 -2
- package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/cases.service.d.ts +3 -1
- package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/wizard-page-field-to-case-field.mapper.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/work-allocation.service.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-challenged-access-request/case-challenged-access-request.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +6 -2
- package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-viewer.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/printer/pipes/print-url.pipe.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
- package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +1 -1
- package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
- package/lib/shared/components/palette/address/address-option.model.d.ts.map +1 -1
- package/lib/shared/components/palette/address/write-address-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/enums/index.d.ts.map +1 -1
- package/lib/shared/components/palette/collection/collection-create-checker.service.d.ts.map +1 -1
- package/lib/shared/components/palette/complex/read-complex-field-collection-table.component.d.ts +1 -1
- package/lib/shared/components/palette/complex/read-complex-field-collection-table.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.d.ts +4 -4
- package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/domain/linked-cases.model.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/read-linked-cases-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/order-summary/fee.model.d.ts.map +1 -1
- package/lib/shared/components/palette/order-summary/order-summary.model.d.ts.map +1 -1
- package/lib/shared/components/palette/text-area/write-text-area-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/utils/date.pipe.d.ts.map +1 -1
- package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts.map +1 -1
- package/lib/shared/directives/conditional-show/domain/conditional-show.model.d.ts.map +1 -1
- package/lib/shared/directives/conditional-show/services/condition-parser.service.d.ts.map +1 -1
- package/lib/shared/domain/case-view/case-view.model.d.ts.map +1 -1
- package/lib/shared/domain/case-view/role-assignment-response.model.d.ts +2 -1
- package/lib/shared/domain/case-view/role-assignment-response.model.d.ts.map +1 -1
- package/lib/shared/domain/case-view/role-request.model.d.ts.map +1 -1
- package/lib/shared/domain/organisation/organisation-converter.d.ts.map +1 -1
- package/lib/shared/domain/user/user-info.model.d.ts.map +1 -1
- package/lib/shared/fixture/case-field-builder.d.ts +6 -6
- package/lib/shared/fixture/case-field-builder.d.ts.map +1 -1
- package/lib/shared/fixture/shared.test.fixture.d.ts +6 -6
- package/lib/shared/fixture/shared.test.fixture.d.ts.map +1 -1
- package/lib/shared/pipes/complex/{ccd-page-fields.pipe.d.ts → cdd-page-fields.pipe.d.ts} +1 -1
- package/lib/shared/pipes/complex/cdd-page-fields.pipe.d.ts.map +1 -0
- package/lib/shared/pipes/complex/index.d.ts +1 -1
- package/lib/shared/pipes/pipes.module.d.ts +1 -1
- package/lib/shared/services/activity/activity.polling.service.d.ts.map +1 -1
- package/lib/shared/services/activity/activity.service.d.ts.map +1 -1
- package/lib/shared/services/addresses/address-parser.d.ts.map +1 -1
- package/lib/shared/services/common-data-service/common-data-service.d.ts.map +1 -1
- package/lib/shared/services/definitions/definitions.service.d.ts.map +1 -1
- package/lib/shared/services/fields/fields.purger.d.ts.map +1 -1
- package/lib/shared/services/fields/fields.utils.d.ts +1 -0
- package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
- package/lib/shared/services/loading/loading.service.d.ts +4 -1
- package/lib/shared/services/loading/loading.service.d.ts.map +1 -1
- package/lib/shared/services/search/search.service.d.ts +2 -0
- package/lib/shared/services/search/search.service.d.ts.map +1 -1
- package/lib/shared/services/search-result/sorting/search-result-view-item-comparator-factory.d.ts.map +1 -1
- package/lib/shared/services/window/window.service.d.ts.map +1 -1
- package/package.json +2 -2
- package/lib/shared/pipes/complex/ccd-page-fields.pipe.d.ts.map +0 -1
|
@@ -1036,22 +1036,22 @@
|
|
|
1036
1036
|
}
|
|
1037
1037
|
};
|
|
1038
1038
|
DateInputComponent.prototype.dayId = function () {
|
|
1039
|
-
return this.id +
|
|
1039
|
+
return this.id + '-day';
|
|
1040
1040
|
};
|
|
1041
1041
|
DateInputComponent.prototype.monthId = function () {
|
|
1042
|
-
return this.id +
|
|
1042
|
+
return this.id + '-month';
|
|
1043
1043
|
};
|
|
1044
1044
|
DateInputComponent.prototype.yearId = function () {
|
|
1045
|
-
return this.id +
|
|
1045
|
+
return this.id + '-year';
|
|
1046
1046
|
};
|
|
1047
1047
|
DateInputComponent.prototype.hourId = function () {
|
|
1048
|
-
return this.id +
|
|
1048
|
+
return this.id + '-hour';
|
|
1049
1049
|
};
|
|
1050
1050
|
DateInputComponent.prototype.minuteId = function () {
|
|
1051
|
-
return this.id +
|
|
1051
|
+
return this.id + '-minute';
|
|
1052
1052
|
};
|
|
1053
1053
|
DateInputComponent.prototype.secondId = function () {
|
|
1054
|
-
return this.id +
|
|
1054
|
+
return this.id + '-second';
|
|
1055
1055
|
};
|
|
1056
1056
|
DateInputComponent.prototype.viewValue = function () {
|
|
1057
1057
|
if (this.day || this.month || this.year || this.hour || this.minute || this.second) {
|
|
@@ -1066,7 +1066,7 @@
|
|
|
1066
1066
|
this.minute ? this.pad(this.minute) : '',
|
|
1067
1067
|
this.second ? this.pad(this.second) : ''
|
|
1068
1068
|
].join(':');
|
|
1069
|
-
return date +
|
|
1069
|
+
return date + 'T' + time + '.000';
|
|
1070
1070
|
}
|
|
1071
1071
|
else {
|
|
1072
1072
|
return date;
|
|
@@ -2131,7 +2131,7 @@
|
|
|
2131
2131
|
});
|
|
2132
2132
|
ActivityService.handleHttpError = function (response) {
|
|
2133
2133
|
var error = HttpErrorService.convertToHttpError(response);
|
|
2134
|
-
if (
|
|
2134
|
+
if (response.status && response.status !== error.status) {
|
|
2135
2135
|
error.status = response.status;
|
|
2136
2136
|
}
|
|
2137
2137
|
return error;
|
|
@@ -2139,11 +2139,12 @@
|
|
|
2139
2139
|
ActivityService.prototype.getOptions = function () {
|
|
2140
2140
|
var userDetails = JSON.parse(this.sessionStorageService.getItem('userDetails'));
|
|
2141
2141
|
var headers = new i1$2.HttpHeaders().set('Content-Type', 'application/json').set('Authorization', userDetails.token);
|
|
2142
|
-
|
|
2142
|
+
var options = {
|
|
2143
2143
|
headers: headers,
|
|
2144
2144
|
withCredentials: true,
|
|
2145
2145
|
observe: 'body',
|
|
2146
2146
|
};
|
|
2147
|
+
return options;
|
|
2147
2148
|
};
|
|
2148
2149
|
ActivityService.prototype.getActivities = function () {
|
|
2149
2150
|
var caseId = [];
|
|
@@ -2152,33 +2153,41 @@
|
|
|
2152
2153
|
}
|
|
2153
2154
|
try {
|
|
2154
2155
|
var options = this.getOptions();
|
|
2155
|
-
var url = this.activityUrl() + "/cases/" + caseId.join(',') + "/activity";
|
|
2156
|
+
var url = this.activityUrl() + ("/cases/" + caseId.join(',') + "/activity");
|
|
2156
2157
|
return this.http
|
|
2157
2158
|
.get(url, options, false, ActivityService.handleHttpError)
|
|
2158
2159
|
.pipe(operators.map(function (response) { return response; }));
|
|
2159
2160
|
}
|
|
2160
2161
|
catch (error) {
|
|
2161
|
-
console.log(
|
|
2162
|
+
console.log('user may not be authenticated.' + error);
|
|
2162
2163
|
}
|
|
2163
2164
|
};
|
|
2164
2165
|
ActivityService.prototype.postActivity = function (caseId, activity) {
|
|
2165
2166
|
try {
|
|
2166
2167
|
var options = this.getOptions();
|
|
2167
|
-
var url = this.activityUrl() + "/cases/" + caseId + "/activity";
|
|
2168
|
+
var url = this.activityUrl() + ("/cases/" + caseId + "/activity");
|
|
2168
2169
|
var body = { activity: activity };
|
|
2169
2170
|
return this.http
|
|
2170
2171
|
.post(url, body, options, false)
|
|
2171
2172
|
.pipe(operators.map(function (response) { return response; }));
|
|
2172
2173
|
}
|
|
2173
2174
|
catch (error) {
|
|
2174
|
-
console.log(
|
|
2175
|
+
console.log('user may not be authenticated.' + error);
|
|
2175
2176
|
}
|
|
2176
2177
|
};
|
|
2177
2178
|
ActivityService.prototype.verifyUserIsAuthorized = function () {
|
|
2178
2179
|
var _this = this;
|
|
2179
|
-
if (this.sessionStorageService.getItem('userDetails')
|
|
2180
|
+
if (this.sessionStorageService.getItem('userDetails') === undefined) {
|
|
2181
|
+
return;
|
|
2182
|
+
}
|
|
2183
|
+
if (this.activityUrl() && this.userAuthorised === undefined) {
|
|
2180
2184
|
this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(function () { return _this.userAuthorised = true; }, function (error) {
|
|
2181
|
-
|
|
2185
|
+
if ([401, 403].indexOf(error.status) > -1) {
|
|
2186
|
+
_this.userAuthorised = false;
|
|
2187
|
+
}
|
|
2188
|
+
else {
|
|
2189
|
+
_this.userAuthorised = true;
|
|
2190
|
+
}
|
|
2182
2191
|
});
|
|
2183
2192
|
}
|
|
2184
2193
|
};
|
|
@@ -2291,7 +2300,7 @@
|
|
|
2291
2300
|
requests.get(activity.caseId).next(activity);
|
|
2292
2301
|
});
|
|
2293
2302
|
}, function (err) {
|
|
2294
|
-
console.log(
|
|
2303
|
+
console.log('error: ' + err);
|
|
2295
2304
|
Array.from(requests.values()).forEach(function (subject) { return subject.error(err); });
|
|
2296
2305
|
}); });
|
|
2297
2306
|
});
|
|
@@ -2431,9 +2440,9 @@
|
|
|
2431
2440
|
};
|
|
2432
2441
|
ActivityComponent.prototype.generateDescription = function (prefix, suffix, namesArray, unknownCount) {
|
|
2433
2442
|
var resultText = prefix;
|
|
2434
|
-
resultText += namesArray.map(function (activityInfo) { return activityInfo.forename +
|
|
2443
|
+
resultText += namesArray.map(function (activityInfo) { return activityInfo.forename + ' ' + activityInfo.surname; }).join(', ');
|
|
2435
2444
|
if (unknownCount > 0) {
|
|
2436
|
-
resultText += (namesArray.length > 0 ?
|
|
2445
|
+
resultText += (namesArray.length > 0 ? ' and ' + unknownCount + ' other' : unknownCount + ' user');
|
|
2437
2446
|
resultText += (unknownCount > 1 ? 's' : '');
|
|
2438
2447
|
}
|
|
2439
2448
|
else {
|
|
@@ -2441,10 +2450,10 @@
|
|
|
2441
2450
|
}
|
|
2442
2451
|
if (suffix.length > 0) {
|
|
2443
2452
|
if (namesArray.length + unknownCount > 1) {
|
|
2444
|
-
resultText +=
|
|
2453
|
+
resultText += ' are ' + suffix;
|
|
2445
2454
|
}
|
|
2446
2455
|
else {
|
|
2447
|
-
resultText +=
|
|
2456
|
+
resultText += ' is ' + suffix;
|
|
2448
2457
|
}
|
|
2449
2458
|
}
|
|
2450
2459
|
return resultText;
|
|
@@ -2783,7 +2792,7 @@
|
|
|
2783
2792
|
break;
|
|
2784
2793
|
case 'n':
|
|
2785
2794
|
case 'N':
|
|
2786
|
-
maybePush(result,
|
|
2795
|
+
maybePush(result, '***' + c + '***', inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
|
|
2787
2796
|
break;
|
|
2788
2797
|
case 'V':
|
|
2789
2798
|
case 'O':
|
|
@@ -2917,9 +2926,9 @@
|
|
|
2917
2926
|
resultDate = offsetDate.getDate() + " " + DatePipe.MONTHS[offsetDate.getMonth()] + " " + offsetDate.getFullYear();
|
|
2918
2927
|
if (match[4] && match[5] && match[6] && format !== 'short') {
|
|
2919
2928
|
resultDate += ', ';
|
|
2920
|
-
resultDate += this.getHour(offsetDate.getHours().toString()) +
|
|
2921
|
-
resultDate += this.pad(offsetDate.getMinutes()) +
|
|
2922
|
-
resultDate += this.pad(offsetDate.getSeconds()) +
|
|
2929
|
+
resultDate += this.getHour(offsetDate.getHours().toString()) + ':';
|
|
2930
|
+
resultDate += this.pad(offsetDate.getMinutes()) + ':';
|
|
2931
|
+
resultDate += this.pad(offsetDate.getSeconds()) + ' ';
|
|
2923
2932
|
resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
|
|
2924
2933
|
}
|
|
2925
2934
|
}
|
|
@@ -3735,25 +3744,25 @@
|
|
|
3735
3744
|
OrganisationConverter.toSimpleAddress = function (organisationModel) {
|
|
3736
3745
|
var simpleAddress = '';
|
|
3737
3746
|
if (organisationModel.addressLine1) {
|
|
3738
|
-
simpleAddress += organisationModel.addressLine1 +
|
|
3747
|
+
simpleAddress += organisationModel.addressLine1 + '<br>';
|
|
3739
3748
|
}
|
|
3740
3749
|
if (organisationModel.addressLine2) {
|
|
3741
|
-
simpleAddress += organisationModel.addressLine2 +
|
|
3750
|
+
simpleAddress += organisationModel.addressLine2 + '<br>';
|
|
3742
3751
|
}
|
|
3743
3752
|
if (organisationModel.addressLine3) {
|
|
3744
|
-
simpleAddress += organisationModel.addressLine3 +
|
|
3753
|
+
simpleAddress += organisationModel.addressLine3 + '<br>';
|
|
3745
3754
|
}
|
|
3746
3755
|
if (organisationModel.townCity) {
|
|
3747
|
-
simpleAddress += organisationModel.townCity +
|
|
3756
|
+
simpleAddress += organisationModel.townCity + '<br>';
|
|
3748
3757
|
}
|
|
3749
3758
|
if (organisationModel.county) {
|
|
3750
|
-
simpleAddress += organisationModel.county +
|
|
3759
|
+
simpleAddress += organisationModel.county + '<br>';
|
|
3751
3760
|
}
|
|
3752
3761
|
if (organisationModel.country) {
|
|
3753
|
-
simpleAddress += organisationModel.country +
|
|
3762
|
+
simpleAddress += organisationModel.country + '<br>';
|
|
3754
3763
|
}
|
|
3755
3764
|
if (organisationModel.postCode) {
|
|
3756
|
-
simpleAddress += organisationModel.postCode +
|
|
3765
|
+
simpleAddress += organisationModel.postCode + '<br>';
|
|
3757
3766
|
}
|
|
3758
3767
|
return simpleAddress;
|
|
3759
3768
|
};
|
|
@@ -3932,9 +3941,9 @@
|
|
|
3932
3941
|
});
|
|
3933
3942
|
return valueMap;
|
|
3934
3943
|
};
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3944
|
+
FieldsUtils.getType = function (elem) {
|
|
3945
|
+
return Object.prototype.toString.call(elem).slice(8, -1);
|
|
3946
|
+
};
|
|
3938
3947
|
FieldsUtils.isObject = function (elem) {
|
|
3939
3948
|
return typeof elem === 'object' && elem !== null;
|
|
3940
3949
|
};
|
|
@@ -4492,6 +4501,7 @@
|
|
|
4492
4501
|
if (!condition) {
|
|
4493
4502
|
return null;
|
|
4494
4503
|
}
|
|
4504
|
+
;
|
|
4495
4505
|
condition = condition.replace(/CONTAINS/g, ' CONTAINS');
|
|
4496
4506
|
return peg.parse(condition.trim(), {});
|
|
4497
4507
|
};
|
|
@@ -4505,12 +4515,14 @@
|
|
|
4505
4515
|
if (!conditions || conditions.length === 0) {
|
|
4506
4516
|
return true;
|
|
4507
4517
|
}
|
|
4518
|
+
;
|
|
4508
4519
|
var validJoinComparators = ['AND', 'OR'];
|
|
4509
|
-
|
|
4520
|
+
var result = conditions.reduce(function (accumulator, condition, index) {
|
|
4510
4521
|
var isJoinComparator = function (comparator) { return (typeof comparator === 'string' && validJoinComparators.indexOf(comparator) !== -1); };
|
|
4511
4522
|
if (isJoinComparator(condition)) {
|
|
4512
4523
|
return accumulator;
|
|
4513
4524
|
}
|
|
4525
|
+
;
|
|
4514
4526
|
var currentConditionResult = true;
|
|
4515
4527
|
if (Array.isArray(condition)) {
|
|
4516
4528
|
currentConditionResult = _this.evaluate(fields, condition);
|
|
@@ -4527,6 +4539,7 @@
|
|
|
4527
4539
|
}
|
|
4528
4540
|
return currentConditionResult;
|
|
4529
4541
|
}, true);
|
|
4542
|
+
return result;
|
|
4530
4543
|
};
|
|
4531
4544
|
ConditionParser.evaluateJoin = function (leftResult, comparator, rightResult) {
|
|
4532
4545
|
switch (comparator) {
|
|
@@ -4733,8 +4746,8 @@
|
|
|
4733
4746
|
if (originalCondition.indexOf(condition.fieldReference) > -1) {
|
|
4734
4747
|
if (this.processedList && this.processedList.indexOf(condition.fieldReference) === -1) {
|
|
4735
4748
|
this.processedList.push(condition.fieldReference);
|
|
4736
|
-
var regularExp = new RegExp(
|
|
4737
|
-
return originalCondition.replace(regularExp, pathPrefix +
|
|
4749
|
+
var regularExp = new RegExp('(\\b)' + condition.fieldReference + '(?=[^"]*(?:"[^"]*"[^"]*)*$)(\\b)', 'g');
|
|
4750
|
+
return originalCondition.replace(regularExp, pathPrefix + '.' + condition.fieldReference);
|
|
4738
4751
|
}
|
|
4739
4752
|
else {
|
|
4740
4753
|
return originalCondition;
|
|
@@ -5303,14 +5316,14 @@
|
|
|
5303
5316
|
var formFields = form.getRawValue();
|
|
5304
5317
|
var currentPage = wizard.getPage(currentPageId, this.fieldsUtils.buildCanShowPredicate(eventTrigger, form));
|
|
5305
5318
|
currentPage.wizard_page_fields.forEach(function (wpf) {
|
|
5306
|
-
var
|
|
5307
|
-
if (_this.hasShowConditionField(
|
|
5308
|
-
var condition = new ShowCondition(
|
|
5309
|
-
if (_this.isHidden(condition, formFields.data) && !(_this.isReadonly(
|
|
5310
|
-
_this.resetField(form,
|
|
5319
|
+
var case_field = _this.findCaseFieldByWizardPageFieldId(currentPage, wpf);
|
|
5320
|
+
if (_this.hasShowConditionField(case_field, formFields)) {
|
|
5321
|
+
var condition = new ShowCondition(case_field.show_condition);
|
|
5322
|
+
if (_this.isHidden(condition, formFields.data) && !(_this.isReadonly(case_field))) {
|
|
5323
|
+
_this.resetField(form, case_field);
|
|
5311
5324
|
}
|
|
5312
5325
|
}
|
|
5313
|
-
_this.retainHiddenValueByFieldType(
|
|
5326
|
+
_this.retainHiddenValueByFieldType(case_field, form);
|
|
5314
5327
|
});
|
|
5315
5328
|
};
|
|
5316
5329
|
FieldsPurger.prototype.retainHiddenValueByFieldType = function (field, form) {
|
|
@@ -5341,13 +5354,13 @@
|
|
|
5341
5354
|
FieldsPurger.prototype.hasShowConditionPage = function (wizardPage, formFields) {
|
|
5342
5355
|
return wizardPage.show_condition && formFields[this.getShowConditionKey(wizardPage.show_condition)];
|
|
5343
5356
|
};
|
|
5344
|
-
FieldsPurger.prototype.hasShowConditionField = function (
|
|
5345
|
-
return
|
|
5357
|
+
FieldsPurger.prototype.hasShowConditionField = function (case_field, formFields) {
|
|
5358
|
+
return case_field.show_condition && formFields.data[this.getShowConditionKey(case_field.show_condition)];
|
|
5346
5359
|
};
|
|
5347
|
-
FieldsPurger.prototype.getShowConditionKey = function (
|
|
5360
|
+
FieldsPurger.prototype.getShowConditionKey = function (show_condition) {
|
|
5348
5361
|
// Need to allow for negated conditions, i.e. !=, as well as regular ones (=)
|
|
5349
5362
|
// Also need to allow for conditions specified using the "CONTAINS" keyword
|
|
5350
|
-
return
|
|
5363
|
+
return show_condition.split(/!=|=|CONTAINS/)[0];
|
|
5351
5364
|
};
|
|
5352
5365
|
FieldsPurger.prototype.resetField = function (form, field) {
|
|
5353
5366
|
var e_1, _a;
|
|
@@ -5443,8 +5456,8 @@
|
|
|
5443
5456
|
FieldsPurger.prototype.resetPage = function (form, wizardPage) {
|
|
5444
5457
|
var _this = this;
|
|
5445
5458
|
wizardPage.wizard_page_fields.forEach(function (wpf) {
|
|
5446
|
-
var
|
|
5447
|
-
_this.resetField(form,
|
|
5459
|
+
var case_field = _this.findCaseFieldByWizardPageFieldId(wizardPage, wpf);
|
|
5460
|
+
_this.resetField(form, case_field);
|
|
5448
5461
|
});
|
|
5449
5462
|
};
|
|
5450
5463
|
FieldsPurger.prototype.getType = function (elem) {
|
|
@@ -5454,8 +5467,8 @@
|
|
|
5454
5467
|
return this.getType(elem) === 'Object';
|
|
5455
5468
|
};
|
|
5456
5469
|
// TODO: call isReadOnly on CaseFields once we make it available
|
|
5457
|
-
FieldsPurger.prototype.isReadonly = function (
|
|
5458
|
-
return
|
|
5470
|
+
FieldsPurger.prototype.isReadonly = function (case_field) {
|
|
5471
|
+
return case_field.display_context.toUpperCase() === 'READONLY';
|
|
5459
5472
|
};
|
|
5460
5473
|
/**
|
|
5461
5474
|
* Deletes a field value by setting the value of the corresponding {@link FormControl} to null (or an empty array
|
|
@@ -6350,6 +6363,7 @@
|
|
|
6350
6363
|
});
|
|
6351
6364
|
}
|
|
6352
6365
|
}
|
|
6366
|
+
;
|
|
6353
6367
|
});
|
|
6354
6368
|
}
|
|
6355
6369
|
};
|
|
@@ -6788,7 +6802,7 @@
|
|
|
6788
6802
|
return addressModel;
|
|
6789
6803
|
};
|
|
6790
6804
|
AddressParser.prototype.parseAddressLine1 = function (classification, address) {
|
|
6791
|
-
var addressLine;
|
|
6805
|
+
var addressLine = '';
|
|
6792
6806
|
if (classification === AddressType.RD06) {
|
|
6793
6807
|
addressLine =
|
|
6794
6808
|
address.SUB_BUILDING_NAME + " " + address.ORGANISATION_NAME + " " + address.DEPARTMENT_NAME + " " + address.PO_BOX_NUMBER;
|
|
@@ -6801,7 +6815,7 @@
|
|
|
6801
6815
|
return this.removeNonAddressValues(addressLine);
|
|
6802
6816
|
};
|
|
6803
6817
|
AddressParser.prototype.parseAddressLine2 = function (classification, address) {
|
|
6804
|
-
var addressLine;
|
|
6818
|
+
var addressLine = '';
|
|
6805
6819
|
if (classification === AddressType.RD06) {
|
|
6806
6820
|
addressLine = address.BUILDING_NAME + " ";
|
|
6807
6821
|
}
|
|
@@ -6812,7 +6826,7 @@
|
|
|
6812
6826
|
return this.removeNonAddressValues(addressLine);
|
|
6813
6827
|
};
|
|
6814
6828
|
AddressParser.prototype.parseAddressLine3 = function (classification, address) {
|
|
6815
|
-
var addressLine;
|
|
6829
|
+
var addressLine = '';
|
|
6816
6830
|
if (classification === AddressType.RD06) {
|
|
6817
6831
|
addressLine =
|
|
6818
6832
|
address.BUILDING_NUMBER + " " + address.THOROUGHFARE_NAME;
|
|
@@ -6840,7 +6854,7 @@
|
|
|
6840
6854
|
return value.replace(new RegExp('^,', 'gi'), '');
|
|
6841
6855
|
};
|
|
6842
6856
|
AddressParser.prototype.prefixWithCommaIfPresent = function (value) {
|
|
6843
|
-
return value ?
|
|
6857
|
+
return value ? ', ' + value : value;
|
|
6844
6858
|
};
|
|
6845
6859
|
return AddressParser;
|
|
6846
6860
|
}());
|
|
@@ -7090,7 +7104,7 @@
|
|
|
7090
7104
|
if (flagType) {
|
|
7091
7105
|
url += "?flag-type=" + flagType;
|
|
7092
7106
|
}
|
|
7093
|
-
if (
|
|
7107
|
+
if (welshRequired != null) {
|
|
7094
7108
|
// Check if flag-type has been added to the query string; if so, append welsh-required with '&'
|
|
7095
7109
|
url.indexOf('?') > -1 ? url += '&' : url += '?';
|
|
7096
7110
|
welshRequired ? url += 'welsh-required=Y' : url += 'welsh-required=N';
|
|
@@ -7696,6 +7710,18 @@
|
|
|
7696
7710
|
}], null, null);
|
|
7697
7711
|
})();
|
|
7698
7712
|
|
|
7713
|
+
var HasLoadingState = /** @class */ (function () {
|
|
7714
|
+
function HasLoadingState() {
|
|
7715
|
+
}
|
|
7716
|
+
Object.defineProperty(HasLoadingState.prototype, "isLoading", {
|
|
7717
|
+
get: function () {
|
|
7718
|
+
return;
|
|
7719
|
+
},
|
|
7720
|
+
enumerable: false,
|
|
7721
|
+
configurable: true
|
|
7722
|
+
});
|
|
7723
|
+
return HasLoadingState;
|
|
7724
|
+
}());
|
|
7699
7725
|
var LoadingService = /** @class */ (function () {
|
|
7700
7726
|
function LoadingService() {
|
|
7701
7727
|
this.registered = new Map();
|
|
@@ -7720,7 +7746,7 @@
|
|
|
7720
7746
|
};
|
|
7721
7747
|
LoadingService.prototype.generateToken = function () {
|
|
7722
7748
|
var timestamp = window.performance.now();
|
|
7723
|
-
return
|
|
7749
|
+
return 'toolkit-loading-' + timestamp; // format: [source-library]-[unique incrementing number]
|
|
7724
7750
|
};
|
|
7725
7751
|
return LoadingService;
|
|
7726
7752
|
}());
|
|
@@ -7741,7 +7767,10 @@
|
|
|
7741
7767
|
}
|
|
7742
7768
|
SearchService.prototype.search = function (jurisdictionId, caseTypeId, metaCriteria, caseCriteria, view) {
|
|
7743
7769
|
var _this = this;
|
|
7744
|
-
var url = this.appConfig.getApiUrl() + "/caseworkers/:uid
|
|
7770
|
+
var url = this.appConfig.getApiUrl() + "/caseworkers/:uid"
|
|
7771
|
+
+ ("/jurisdictions/" + jurisdictionId)
|
|
7772
|
+
+ ("/case-types/" + caseTypeId)
|
|
7773
|
+
+ "/cases";
|
|
7745
7774
|
var options = this.requestOptionsBuilder.buildOptions(metaCriteria, caseCriteria, view);
|
|
7746
7775
|
var loadingToken = this.loadingService.register();
|
|
7747
7776
|
return this.httpService
|
|
@@ -7750,14 +7779,15 @@
|
|
|
7750
7779
|
};
|
|
7751
7780
|
SearchService.prototype.searchCasesByIds = function (caseTypeId, filter, view, sort) {
|
|
7752
7781
|
var _this = this;
|
|
7753
|
-
var url = this.appConfig.getCaseDataUrl() +
|
|
7782
|
+
var url = this.appConfig.getCaseDataUrl() +
|
|
7783
|
+
("/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view);
|
|
7754
7784
|
var body = Object.assign(Object.assign({ sort: sort }, filter), { size: this.appConfig.getPaginationPageSize() });
|
|
7755
7785
|
var loadingToken = this.loadingService.register();
|
|
7756
7786
|
return this.httpService.post(url, body).pipe(operators.map(function (response) { return response; }), operators.finalize(function () { return _this.loadingService.unregister(loadingToken); }));
|
|
7757
7787
|
};
|
|
7758
7788
|
SearchService.prototype.searchCases = function (caseTypeId, metaCriteria, caseCriteria, view, sort) {
|
|
7759
7789
|
var _this = this;
|
|
7760
|
-
var url = this.appConfig.getCaseDataUrl() + "/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view;
|
|
7790
|
+
var url = this.appConfig.getCaseDataUrl() + ("/internal/searchCases?ctid=" + caseTypeId + "&use_case=" + view);
|
|
7761
7791
|
var options = this.requestOptionsBuilder.buildOptions(metaCriteria, caseCriteria, view);
|
|
7762
7792
|
var body = {
|
|
7763
7793
|
sort: sort,
|
|
@@ -7802,8 +7832,9 @@
|
|
|
7802
7832
|
return SearchService;
|
|
7803
7833
|
}());
|
|
7804
7834
|
SearchService.V2_MEDIATYPE_SEARCH_INPUTS = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-search-input-details.v2+json;charset=UTF-8';
|
|
7805
|
-
|
|
7835
|
+
SearchService.VIEW_SEARCH = 'SEARCH';
|
|
7806
7836
|
SearchService.VIEW_WORKBASKET = 'WORKBASKET';
|
|
7837
|
+
SearchService.FIELD_PREFIX = 'case.';
|
|
7807
7838
|
SearchService.ɵfac = function SearchService_Factory(t) { return new (t || SearchService)(i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(RequestOptionsBuilder), i0__namespace.ɵɵinject(LoadingService)); };
|
|
7808
7839
|
SearchService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: SearchService, factory: SearchService.ɵfac });
|
|
7809
7840
|
(function () {
|
|
@@ -7933,12 +7964,17 @@
|
|
|
7933
7964
|
this.appConfig = appConfig;
|
|
7934
7965
|
}
|
|
7935
7966
|
DefinitionsService.prototype.getCaseTypes = function (jurisdictionId, access) {
|
|
7936
|
-
var url = this.appConfig.getApiUrl()
|
|
7967
|
+
var url = this.appConfig.getApiUrl()
|
|
7968
|
+
+ "/caseworkers/:uid"
|
|
7969
|
+
+ ("/jurisdictions/" + jurisdictionId)
|
|
7970
|
+
+ ("/case-types?access=" + access);
|
|
7937
7971
|
return this.http
|
|
7938
7972
|
.get(url).pipe(operators.map(function (response) { return response; }));
|
|
7939
7973
|
};
|
|
7940
7974
|
DefinitionsService.prototype.getJurisdictions = function (access) {
|
|
7941
|
-
var url = this.appConfig.getApiUrl()
|
|
7975
|
+
var url = this.appConfig.getApiUrl()
|
|
7976
|
+
+ "/caseworkers/:uid"
|
|
7977
|
+
+ ("/jurisdictions?access=" + access);
|
|
7942
7978
|
return this.http
|
|
7943
7979
|
.get(url)
|
|
7944
7980
|
.pipe(operators.map(function (response) { return response; }));
|
|
@@ -8020,8 +8056,8 @@
|
|
|
8020
8056
|
compare: function (a, b) {
|
|
8021
8057
|
var fieldA = a.case_fields[fieldId];
|
|
8022
8058
|
var fieldB = b.case_fields[fieldId];
|
|
8023
|
-
fieldA = util.isUndefined(fieldA) || fieldA
|
|
8024
|
-
fieldB = util.isUndefined(fieldB) || fieldB
|
|
8059
|
+
fieldA = util.isUndefined(fieldA) || fieldA == null ? '' : fieldA.toLowerCase();
|
|
8060
|
+
fieldB = util.isUndefined(fieldB) || fieldB == null ? '' : fieldB.toLowerCase();
|
|
8025
8061
|
return fieldA === fieldB ? 0 : fieldA > fieldB ? 1 : -1;
|
|
8026
8062
|
}
|
|
8027
8063
|
};
|
|
@@ -8031,8 +8067,8 @@
|
|
|
8031
8067
|
compare: function (a, b) {
|
|
8032
8068
|
var fieldA = a.case_fields[fieldId];
|
|
8033
8069
|
var fieldB = b.case_fields[fieldId];
|
|
8034
|
-
fieldA = util.isUndefined(fieldA) || fieldA
|
|
8035
|
-
fieldB = util.isUndefined(fieldB) || fieldB
|
|
8070
|
+
fieldA = util.isUndefined(fieldA) || fieldA == null ? '' : fieldA.join().toLowerCase();
|
|
8071
|
+
fieldB = util.isUndefined(fieldB) || fieldB == null ? '' : fieldB.join().toLowerCase();
|
|
8036
8072
|
return fieldA === fieldB ? 0 : fieldA > fieldB ? 1 : -1;
|
|
8037
8073
|
}
|
|
8038
8074
|
};
|
|
@@ -8328,7 +8364,7 @@
|
|
|
8328
8364
|
});
|
|
8329
8365
|
};
|
|
8330
8366
|
WizardPageFieldToCaseFieldMapper.prototype.preparePathPrefix = function (pathPrefix, caseField) {
|
|
8331
|
-
return pathPrefix.length === 0 ? caseField : pathPrefix +
|
|
8367
|
+
return pathPrefix.length === 0 ? caseField : pathPrefix + '.' + caseField;
|
|
8332
8368
|
};
|
|
8333
8369
|
WizardPageFieldToCaseFieldMapper.prototype.getCaseFieldLeaf = function (caseFieldId, caseFields) {
|
|
8334
8370
|
var _a = __read(caseFieldId), head = _a[0], tail = _a.slice(1);
|
|
@@ -8385,13 +8421,223 @@
|
|
|
8385
8421
|
}], null, null);
|
|
8386
8422
|
})();
|
|
8387
8423
|
|
|
8424
|
+
var MULTIPLE_TASKS_FOUND = 'More than one task found!';
|
|
8425
|
+
var WorkAllocationService = /** @class */ (function () {
|
|
8426
|
+
function WorkAllocationService(http, appConfig, errorService, alertService, sessionStorageService) {
|
|
8427
|
+
this.http = http;
|
|
8428
|
+
this.appConfig = appConfig;
|
|
8429
|
+
this.errorService = errorService;
|
|
8430
|
+
this.alertService = alertService;
|
|
8431
|
+
this.sessionStorageService = sessionStorageService;
|
|
8432
|
+
// Check to see if work allocation is enabled
|
|
8433
|
+
}
|
|
8434
|
+
/**
|
|
8435
|
+
* Call the API to get tasks matching the search criteria.
|
|
8436
|
+
* @param searchRequest The search parameters that specify which tasks to match.
|
|
8437
|
+
*/
|
|
8438
|
+
WorkAllocationService.prototype.searchTasks = function (searchRequest) {
|
|
8439
|
+
var _this = this;
|
|
8440
|
+
// Do not need to check if WA enabled as parent method will do that
|
|
8441
|
+
var url = this.appConfig.getWorkAllocationApiUrl() + "/searchForCompletable";
|
|
8442
|
+
return this.http
|
|
8443
|
+
.post(url, { searchRequest: searchRequest }, null, false)
|
|
8444
|
+
.pipe(operators.map(function (response) { return response; }), operators.catchError(function (error) {
|
|
8445
|
+
_this.errorService.setError(error);
|
|
8446
|
+
// explicitly eat away 401 error and 400 error
|
|
8447
|
+
if (error && error.status && (error.status === 401 || error.status === 400)) {
|
|
8448
|
+
// do nothing
|
|
8449
|
+
console.log('error status 401 or 400', error);
|
|
8450
|
+
}
|
|
8451
|
+
else {
|
|
8452
|
+
return rxjs.throwError(error);
|
|
8453
|
+
}
|
|
8454
|
+
}));
|
|
8455
|
+
};
|
|
8456
|
+
WorkAllocationService.prototype.isWAEnabled = function (jurisdiction, caseType) {
|
|
8457
|
+
this.features = this.appConfig.getWAServiceConfig();
|
|
8458
|
+
var enabled = false;
|
|
8459
|
+
if (!jurisdiction || !caseType) {
|
|
8460
|
+
var caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
|
|
8461
|
+
jurisdiction = caseInfo.jurisdiction;
|
|
8462
|
+
caseType = caseInfo.caseType;
|
|
8463
|
+
}
|
|
8464
|
+
if (!this.features || !this.features.configurations) {
|
|
8465
|
+
return false;
|
|
8466
|
+
}
|
|
8467
|
+
this.features.configurations.forEach(function (serviceConfig) {
|
|
8468
|
+
if (serviceConfig.serviceName === jurisdiction && (serviceConfig.caseTypes.indexOf(caseType) !== -1)) {
|
|
8469
|
+
enabled = true;
|
|
8470
|
+
}
|
|
8471
|
+
});
|
|
8472
|
+
return enabled;
|
|
8473
|
+
};
|
|
8474
|
+
/**
|
|
8475
|
+
* Call the API to assign a task.
|
|
8476
|
+
* @param taskId specifies which task should be assigned.
|
|
8477
|
+
* @param userId specifies the user the task should be assigned to.
|
|
8478
|
+
*/
|
|
8479
|
+
WorkAllocationService.prototype.assignTask = function (taskId, userId) {
|
|
8480
|
+
var _this = this;
|
|
8481
|
+
if (!this.isWAEnabled()) {
|
|
8482
|
+
return rxjs.of(null);
|
|
8483
|
+
}
|
|
8484
|
+
var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/assign";
|
|
8485
|
+
return this.http
|
|
8486
|
+
.post(url, { userId: userId })
|
|
8487
|
+
.pipe(operators.catchError(function (error) {
|
|
8488
|
+
_this.errorService.setError(error);
|
|
8489
|
+
return rxjs.throwError(error);
|
|
8490
|
+
}));
|
|
8491
|
+
};
|
|
8492
|
+
/**
|
|
8493
|
+
* Call the API to complete a task.
|
|
8494
|
+
* @param taskId specifies which task should be completed.
|
|
8495
|
+
*/
|
|
8496
|
+
WorkAllocationService.prototype.completeTask = function (taskId) {
|
|
8497
|
+
var _this = this;
|
|
8498
|
+
if (!this.isWAEnabled()) {
|
|
8499
|
+
return rxjs.of(null);
|
|
8500
|
+
}
|
|
8501
|
+
var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
|
|
8502
|
+
return this.http
|
|
8503
|
+
.post(url, {})
|
|
8504
|
+
.pipe(operators.catchError(function (error) {
|
|
8505
|
+
_this.errorService.setError(error);
|
|
8506
|
+
// this will subscribe to get the user details and decide whether to display an error message
|
|
8507
|
+
_this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
|
|
8508
|
+
_this.handleTaskCompletionError(response);
|
|
8509
|
+
});
|
|
8510
|
+
return rxjs.throwError(error);
|
|
8511
|
+
}));
|
|
8512
|
+
};
|
|
8513
|
+
/**
|
|
8514
|
+
* Call the API to assign and complete a task.
|
|
8515
|
+
* @param taskId specifies which task should be completed.
|
|
8516
|
+
*/
|
|
8517
|
+
WorkAllocationService.prototype.assignAndCompleteTask = function (taskId) {
|
|
8518
|
+
var _this = this;
|
|
8519
|
+
if (!this.isWAEnabled()) {
|
|
8520
|
+
return rxjs.of(null);
|
|
8521
|
+
}
|
|
8522
|
+
var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
|
|
8523
|
+
return this.http
|
|
8524
|
+
.post(url, {
|
|
8525
|
+
completion_options: {
|
|
8526
|
+
assign_and_complete: true
|
|
8527
|
+
}
|
|
8528
|
+
})
|
|
8529
|
+
.pipe(operators.catchError(function (error) {
|
|
8530
|
+
_this.errorService.setError(error);
|
|
8531
|
+
// this will subscribe to get the user details and decide whether to display an error message
|
|
8532
|
+
_this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
|
|
8533
|
+
_this.handleTaskCompletionError(response);
|
|
8534
|
+
});
|
|
8535
|
+
return rxjs.throwError(error);
|
|
8536
|
+
}));
|
|
8537
|
+
};
|
|
8538
|
+
/**
|
|
8539
|
+
* Handles the response from the observable to get the user details when task is completed.
|
|
8540
|
+
* @param response is the response given from the observable which contains the user detaild.
|
|
8541
|
+
*/
|
|
8542
|
+
WorkAllocationService.prototype.handleTaskCompletionError = function (response) {
|
|
8543
|
+
var userDetails = response;
|
|
8544
|
+
if (this.userIsCaseworker(userDetails.userInfo.roles)) {
|
|
8545
|
+
// when submitting the completion of task if not yet rendered cases/case confirm then preserve the alert for re-rendering
|
|
8546
|
+
this.alertService.setPreserveAlerts(true, ['cases/case', 'submit']);
|
|
8547
|
+
this.alertService.warning('A task could not be completed successfully. Please complete the task associated with the case manually.');
|
|
8548
|
+
}
|
|
8549
|
+
};
|
|
8550
|
+
/**
|
|
8551
|
+
* Returns true if the user's role is equivalent to a caseworker.
|
|
8552
|
+
* @param roles is the list of roles found from the current user.
|
|
8553
|
+
*/
|
|
8554
|
+
WorkAllocationService.prototype.userIsCaseworker = function (roles) {
|
|
8555
|
+
var lowerCaseRoles = roles.map(function (role) { return role.toLowerCase(); });
|
|
8556
|
+
// When/if lib & target permanently change to es2016, replace indexOf with includes
|
|
8557
|
+
return (lowerCaseRoles.indexOf(WorkAllocationService.iACCaseOfficer) !== -1)
|
|
8558
|
+
|| (lowerCaseRoles.indexOf(WorkAllocationService.iACAdmOfficer) !== -1);
|
|
8559
|
+
};
|
|
8560
|
+
/**
|
|
8561
|
+
* Look for open tasks for a case and event combination. There are 5 possible scenarios:
|
|
8562
|
+
* 1. No tasks found => Success.
|
|
8563
|
+
* 2. One task found => Mark as done => Success.
|
|
8564
|
+
* 3. One task found => Mark as done throws error => Failure.
|
|
8565
|
+
* 4. More than one task found => Failure.
|
|
8566
|
+
* 5. Search call throws an error => Failure.
|
|
8567
|
+
* @param ccdId The ID of the case to find tasks for.
|
|
8568
|
+
* @param eventId The ID of the event to find tasks for.
|
|
8569
|
+
*/
|
|
8570
|
+
WorkAllocationService.prototype.completeAppropriateTask = function (ccdId, eventId, jurisdiction, caseTypeId) {
|
|
8571
|
+
var _this = this;
|
|
8572
|
+
if (!this.isWAEnabled(jurisdiction, caseTypeId)) {
|
|
8573
|
+
return rxjs.of(null);
|
|
8574
|
+
}
|
|
8575
|
+
var taskSearchParameter = {
|
|
8576
|
+
ccdId: ccdId,
|
|
8577
|
+
eventId: eventId,
|
|
8578
|
+
jurisdiction: jurisdiction,
|
|
8579
|
+
caseTypeId: caseTypeId
|
|
8580
|
+
};
|
|
8581
|
+
return this.searchTasks(taskSearchParameter)
|
|
8582
|
+
.pipe(operators.map(function (response) {
|
|
8583
|
+
var tasks = response.tasks;
|
|
8584
|
+
if (tasks && tasks.length > 0) {
|
|
8585
|
+
if (tasks.length === 1) {
|
|
8586
|
+
_this.completeTask(tasks[0].id).subscribe();
|
|
8587
|
+
}
|
|
8588
|
+
else {
|
|
8589
|
+
// This is a problem. Throw an appropriate error.
|
|
8590
|
+
throw new Error(MULTIPLE_TASKS_FOUND);
|
|
8591
|
+
}
|
|
8592
|
+
}
|
|
8593
|
+
return true; // All good. Nothing to see here.
|
|
8594
|
+
}), operators.catchError(function (error) {
|
|
8595
|
+
// Simply rethrow it.
|
|
8596
|
+
return rxjs.throwError(error);
|
|
8597
|
+
}));
|
|
8598
|
+
};
|
|
8599
|
+
/**
|
|
8600
|
+
* Return tasks for case and event.
|
|
8601
|
+
*/
|
|
8602
|
+
WorkAllocationService.prototype.getTasksByCaseIdAndEventId = function (eventId, caseId, caseType, jurisdiction) {
|
|
8603
|
+
var defaultPayload = {
|
|
8604
|
+
task_required_for_event: false,
|
|
8605
|
+
tasks: []
|
|
8606
|
+
};
|
|
8607
|
+
if (!this.isWAEnabled()) {
|
|
8608
|
+
return rxjs.of(defaultPayload);
|
|
8609
|
+
}
|
|
8610
|
+
return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/case/tasks/" + caseId + "/event/" + eventId + "/caseType/" + caseType + "/jurisdiction/" + jurisdiction);
|
|
8611
|
+
};
|
|
8612
|
+
/**
|
|
8613
|
+
* Call the API to get a task
|
|
8614
|
+
*/
|
|
8615
|
+
WorkAllocationService.prototype.getTask = function (taskId) {
|
|
8616
|
+
if (!this.isWAEnabled()) {
|
|
8617
|
+
return rxjs.of({ task: null });
|
|
8618
|
+
}
|
|
8619
|
+
return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId);
|
|
8620
|
+
};
|
|
8621
|
+
return WorkAllocationService;
|
|
8622
|
+
}());
|
|
8623
|
+
WorkAllocationService.iACCaseOfficer = 'caseworker-ia-caseofficer';
|
|
8624
|
+
WorkAllocationService.iACAdmOfficer = 'caseworker-ia-admofficer';
|
|
8625
|
+
WorkAllocationService.ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(AlertService), i0__namespace.ɵɵinject(SessionStorageService)); };
|
|
8626
|
+
WorkAllocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: WorkAllocationService, factory: WorkAllocationService.ɵfac });
|
|
8627
|
+
(function () {
|
|
8628
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WorkAllocationService, [{
|
|
8629
|
+
type: i0.Injectable
|
|
8630
|
+
}], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null);
|
|
8631
|
+
})();
|
|
8632
|
+
|
|
8388
8633
|
var CasesService = /** @class */ (function () {
|
|
8389
|
-
function CasesService(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService) {
|
|
8634
|
+
function CasesService(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, workAllocationService, loadingService, sessionStorageService) {
|
|
8390
8635
|
this.http = http;
|
|
8391
8636
|
this.appConfig = appConfig;
|
|
8392
8637
|
this.orderService = orderService;
|
|
8393
8638
|
this.errorService = errorService;
|
|
8394
8639
|
this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
|
|
8640
|
+
this.workAllocationService = workAllocationService;
|
|
8395
8641
|
this.loadingService = loadingService;
|
|
8396
8642
|
this.sessionStorageService = sessionStorageService;
|
|
8397
8643
|
this.get = this.getCaseView;
|
|
@@ -8410,7 +8656,11 @@
|
|
|
8410
8656
|
};
|
|
8411
8657
|
CasesService.prototype.getCaseView = function (jurisdictionId, caseTypeId, caseId) {
|
|
8412
8658
|
var _this = this;
|
|
8413
|
-
var url = this.appConfig.getApiUrl()
|
|
8659
|
+
var url = this.appConfig.getApiUrl()
|
|
8660
|
+
+ "/caseworkers/:uid"
|
|
8661
|
+
+ ("/jurisdictions/" + jurisdictionId)
|
|
8662
|
+
+ ("/case-types/" + caseTypeId)
|
|
8663
|
+
+ ("/cases/" + caseId);
|
|
8414
8664
|
var loadingToken = this.loadingService.register();
|
|
8415
8665
|
return this.http
|
|
8416
8666
|
.get(url)
|
|
@@ -8462,7 +8712,7 @@
|
|
|
8462
8712
|
CasesService.prototype.createEvent = function (caseDetails, eventData) {
|
|
8463
8713
|
var _this = this;
|
|
8464
8714
|
var caseId = caseDetails.case_id;
|
|
8465
|
-
var url = this.appConfig.getCaseDataUrl() + "/cases/" + caseId + "/events";
|
|
8715
|
+
var url = this.appConfig.getCaseDataUrl() + ("/cases/" + caseId + "/events");
|
|
8466
8716
|
var headers = new i1$2.HttpHeaders()
|
|
8467
8717
|
.set('experimental', 'true')
|
|
8468
8718
|
.set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
|
|
@@ -8476,8 +8726,9 @@
|
|
|
8476
8726
|
};
|
|
8477
8727
|
CasesService.prototype.validateCase = function (ctid, eventData, pageId) {
|
|
8478
8728
|
var _this = this;
|
|
8479
|
-
var pageIdString = pageId ?
|
|
8480
|
-
var url = this.appConfig.getCaseDataUrl()
|
|
8729
|
+
var pageIdString = pageId ? '?pageId=' + pageId : '';
|
|
8730
|
+
var url = this.appConfig.getCaseDataUrl()
|
|
8731
|
+
+ ("/case-types/" + ctid + "/validate" + pageIdString);
|
|
8481
8732
|
var headers = new i1$2.HttpHeaders()
|
|
8482
8733
|
.set('experimental', 'true')
|
|
8483
8734
|
.set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
|
|
@@ -8495,7 +8746,8 @@
|
|
|
8495
8746
|
if (eventData.ignore_warning) {
|
|
8496
8747
|
ignoreWarning = 'true';
|
|
8497
8748
|
}
|
|
8498
|
-
var url = this.appConfig.getCaseDataUrl()
|
|
8749
|
+
var url = this.appConfig.getCaseDataUrl()
|
|
8750
|
+
+ ("/case-types/" + ctid + "/cases?ignore-warning=" + ignoreWarning);
|
|
8499
8751
|
var headers = new i1$2.HttpHeaders()
|
|
8500
8752
|
.set('experimental', 'true')
|
|
8501
8753
|
.set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
|
|
@@ -8509,7 +8761,9 @@
|
|
|
8509
8761
|
};
|
|
8510
8762
|
CasesService.prototype.getPrintDocuments = function (caseId) {
|
|
8511
8763
|
var _this = this;
|
|
8512
|
-
var url = this.appConfig.getCaseDataUrl()
|
|
8764
|
+
var url = this.appConfig.getCaseDataUrl()
|
|
8765
|
+
+ ("/cases/" + caseId)
|
|
8766
|
+
+ "/documents";
|
|
8513
8767
|
var headers = new i1$2.HttpHeaders()
|
|
8514
8768
|
.set('experimental', 'true')
|
|
8515
8769
|
.set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
|
|
@@ -8618,12 +8872,12 @@
|
|
|
8618
8872
|
CasesService.V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
|
|
8619
8873
|
CasesService.V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
|
|
8620
8874
|
CasesService.PUI_CASE_MANAGER = 'pui-case-manager';
|
|
8621
|
-
CasesService.ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(OrderService), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0__namespace.ɵɵinject(LoadingService), i0__namespace.ɵɵinject(SessionStorageService)); };
|
|
8875
|
+
CasesService.ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(OrderService), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0__namespace.ɵɵinject(WorkAllocationService), i0__namespace.ɵɵinject(LoadingService), i0__namespace.ɵɵinject(SessionStorageService)); };
|
|
8622
8876
|
CasesService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
|
|
8623
8877
|
(function () {
|
|
8624
8878
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CasesService, [{
|
|
8625
8879
|
type: i0.Injectable
|
|
8626
|
-
}], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
|
|
8880
|
+
}], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: WorkAllocationService }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
|
|
8627
8881
|
})();
|
|
8628
8882
|
|
|
8629
8883
|
var EventTriggerService = /** @class */ (function () {
|
|
@@ -9245,7 +9499,7 @@
|
|
|
9245
9499
|
PageValidationService.prototype.isHidden = function (caseField, editForm, path) {
|
|
9246
9500
|
var formFields = editForm.getRawValue();
|
|
9247
9501
|
var condition = ShowCondition.getInstance(caseField.show_condition);
|
|
9248
|
-
if (path && path.indexOf(
|
|
9502
|
+
if (path && path.indexOf('_' + caseField.id + '_') === -1) {
|
|
9249
9503
|
path = "" + path + caseField.id;
|
|
9250
9504
|
}
|
|
9251
9505
|
return !condition.match(formFields.data, path);
|
|
@@ -9277,215 +9531,6 @@
|
|
|
9277
9531
|
}], function () { return [{ type: CaseFieldService }]; }, null);
|
|
9278
9532
|
})();
|
|
9279
9533
|
|
|
9280
|
-
var MULTIPLE_TASKS_FOUND = 'More than one task found!';
|
|
9281
|
-
var WorkAllocationService = /** @class */ (function () {
|
|
9282
|
-
function WorkAllocationService(http, appConfig, errorService, alertService, sessionStorageService) {
|
|
9283
|
-
this.http = http;
|
|
9284
|
-
this.appConfig = appConfig;
|
|
9285
|
-
this.errorService = errorService;
|
|
9286
|
-
this.alertService = alertService;
|
|
9287
|
-
this.sessionStorageService = sessionStorageService;
|
|
9288
|
-
// Check to see if work allocation is enabled
|
|
9289
|
-
}
|
|
9290
|
-
/**
|
|
9291
|
-
* Call the API to get tasks matching the search criteria.
|
|
9292
|
-
* @param searchRequest The search parameters that specify which tasks to match.
|
|
9293
|
-
*/
|
|
9294
|
-
WorkAllocationService.prototype.searchTasks = function (searchRequest) {
|
|
9295
|
-
var _this = this;
|
|
9296
|
-
// Do not need to check if WA enabled as parent method will do that
|
|
9297
|
-
var url = this.appConfig.getWorkAllocationApiUrl() + "/searchForCompletable";
|
|
9298
|
-
return this.http
|
|
9299
|
-
.post(url, { searchRequest: searchRequest }, null, false)
|
|
9300
|
-
.pipe(operators.map(function (response) { return response; }), operators.catchError(function (error) {
|
|
9301
|
-
_this.errorService.setError(error);
|
|
9302
|
-
// explicitly eat away 401 error and 400 error
|
|
9303
|
-
if (error && error.status && (error.status === 401 || error.status === 400)) {
|
|
9304
|
-
// do nothing
|
|
9305
|
-
console.log('error status 401 or 400', error);
|
|
9306
|
-
}
|
|
9307
|
-
else {
|
|
9308
|
-
return rxjs.throwError(error);
|
|
9309
|
-
}
|
|
9310
|
-
}));
|
|
9311
|
-
};
|
|
9312
|
-
WorkAllocationService.prototype.isWAEnabled = function (jurisdiction, caseType) {
|
|
9313
|
-
this.features = this.appConfig.getWAServiceConfig();
|
|
9314
|
-
var enabled = false;
|
|
9315
|
-
if (!jurisdiction || !caseType) {
|
|
9316
|
-
var caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
|
|
9317
|
-
jurisdiction = caseInfo.jurisdiction;
|
|
9318
|
-
caseType = caseInfo.caseType;
|
|
9319
|
-
}
|
|
9320
|
-
if (!this.features || !this.features.configurations) {
|
|
9321
|
-
return false;
|
|
9322
|
-
}
|
|
9323
|
-
this.features.configurations.forEach(function (serviceConfig) {
|
|
9324
|
-
if (serviceConfig.serviceName === jurisdiction && (serviceConfig.caseTypes.indexOf(caseType) !== -1)) {
|
|
9325
|
-
enabled = true;
|
|
9326
|
-
}
|
|
9327
|
-
});
|
|
9328
|
-
return enabled;
|
|
9329
|
-
};
|
|
9330
|
-
/**
|
|
9331
|
-
* Call the API to assign a task.
|
|
9332
|
-
* @param taskId specifies which task should be assigned.
|
|
9333
|
-
* @param userId specifies the user the task should be assigned to.
|
|
9334
|
-
*/
|
|
9335
|
-
WorkAllocationService.prototype.assignTask = function (taskId, userId) {
|
|
9336
|
-
var _this = this;
|
|
9337
|
-
if (!this.isWAEnabled()) {
|
|
9338
|
-
return rxjs.of(null);
|
|
9339
|
-
}
|
|
9340
|
-
var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/assign";
|
|
9341
|
-
return this.http
|
|
9342
|
-
.post(url, { userId: userId })
|
|
9343
|
-
.pipe(operators.catchError(function (error) {
|
|
9344
|
-
_this.errorService.setError(error);
|
|
9345
|
-
return rxjs.throwError(error);
|
|
9346
|
-
}));
|
|
9347
|
-
};
|
|
9348
|
-
/**
|
|
9349
|
-
* Call the API to complete a task.
|
|
9350
|
-
* @param taskId specifies which task should be completed.
|
|
9351
|
-
*/
|
|
9352
|
-
WorkAllocationService.prototype.completeTask = function (taskId) {
|
|
9353
|
-
var _this = this;
|
|
9354
|
-
if (!this.isWAEnabled()) {
|
|
9355
|
-
return rxjs.of(null);
|
|
9356
|
-
}
|
|
9357
|
-
var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
|
|
9358
|
-
return this.http
|
|
9359
|
-
.post(url, {})
|
|
9360
|
-
.pipe(operators.catchError(function (error) {
|
|
9361
|
-
_this.errorService.setError(error);
|
|
9362
|
-
// this will subscribe to get the user details and decide whether to display an error message
|
|
9363
|
-
_this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
|
|
9364
|
-
_this.handleTaskCompletionError(response);
|
|
9365
|
-
});
|
|
9366
|
-
return rxjs.throwError(error);
|
|
9367
|
-
}));
|
|
9368
|
-
};
|
|
9369
|
-
/**
|
|
9370
|
-
* Call the API to assign and complete a task.
|
|
9371
|
-
* @param taskId specifies which task should be completed.
|
|
9372
|
-
*/
|
|
9373
|
-
WorkAllocationService.prototype.assignAndCompleteTask = function (taskId) {
|
|
9374
|
-
var _this = this;
|
|
9375
|
-
if (!this.isWAEnabled()) {
|
|
9376
|
-
return rxjs.of(null);
|
|
9377
|
-
}
|
|
9378
|
-
var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
|
|
9379
|
-
return this.http
|
|
9380
|
-
.post(url, {
|
|
9381
|
-
completion_options: {
|
|
9382
|
-
assign_and_complete: true
|
|
9383
|
-
}
|
|
9384
|
-
})
|
|
9385
|
-
.pipe(operators.catchError(function (error) {
|
|
9386
|
-
_this.errorService.setError(error);
|
|
9387
|
-
// this will subscribe to get the user details and decide whether to display an error message
|
|
9388
|
-
_this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
|
|
9389
|
-
_this.handleTaskCompletionError(response);
|
|
9390
|
-
});
|
|
9391
|
-
return rxjs.throwError(error);
|
|
9392
|
-
}));
|
|
9393
|
-
};
|
|
9394
|
-
/**
|
|
9395
|
-
* Handles the response from the observable to get the user details when task is completed.
|
|
9396
|
-
* @param response is the response given from the observable which contains the user detaild.
|
|
9397
|
-
*/
|
|
9398
|
-
WorkAllocationService.prototype.handleTaskCompletionError = function (response) {
|
|
9399
|
-
var userDetails = response;
|
|
9400
|
-
if (this.userIsCaseworker(userDetails.userInfo.roles)) {
|
|
9401
|
-
// when submitting the completion of task if not yet rendered cases/case confirm then preserve the alert for re-rendering
|
|
9402
|
-
this.alertService.setPreserveAlerts(true, ['cases/case', 'submit']);
|
|
9403
|
-
this.alertService.warning('A task could not be completed successfully. Please complete the task associated with the case manually.');
|
|
9404
|
-
}
|
|
9405
|
-
};
|
|
9406
|
-
/**
|
|
9407
|
-
* Returns true if the user's role is equivalent to a caseworker.
|
|
9408
|
-
* @param roles is the list of roles found from the current user.
|
|
9409
|
-
*/
|
|
9410
|
-
WorkAllocationService.prototype.userIsCaseworker = function (roles) {
|
|
9411
|
-
var lowerCaseRoles = roles.map(function (role) { return role.toLowerCase(); });
|
|
9412
|
-
// When/if lib & target permanently change to es2016, replace indexOf with includes
|
|
9413
|
-
return (lowerCaseRoles.indexOf(WorkAllocationService.iACCaseOfficer) !== -1)
|
|
9414
|
-
|| (lowerCaseRoles.indexOf(WorkAllocationService.iACAdmOfficer) !== -1);
|
|
9415
|
-
};
|
|
9416
|
-
/**
|
|
9417
|
-
* Look for open tasks for a case and event combination. There are 5 possible scenarios:
|
|
9418
|
-
* 1. No tasks found => Success.
|
|
9419
|
-
* 2. One task found => Mark as done => Success.
|
|
9420
|
-
* 3. One task found => Mark as done throws error => Failure.
|
|
9421
|
-
* 4. More than one task found => Failure.
|
|
9422
|
-
* 5. Search call throws an error => Failure.
|
|
9423
|
-
* @param ccdId The ID of the case to find tasks for.
|
|
9424
|
-
* @param eventId The ID of the event to find tasks for.
|
|
9425
|
-
*/
|
|
9426
|
-
WorkAllocationService.prototype.completeAppropriateTask = function (ccdId, eventId, jurisdiction, caseTypeId) {
|
|
9427
|
-
var _this = this;
|
|
9428
|
-
if (!this.isWAEnabled(jurisdiction, caseTypeId)) {
|
|
9429
|
-
return rxjs.of(null);
|
|
9430
|
-
}
|
|
9431
|
-
var taskSearchParameter = {
|
|
9432
|
-
ccdId: ccdId,
|
|
9433
|
-
eventId: eventId,
|
|
9434
|
-
jurisdiction: jurisdiction,
|
|
9435
|
-
caseTypeId: caseTypeId
|
|
9436
|
-
};
|
|
9437
|
-
return this.searchTasks(taskSearchParameter)
|
|
9438
|
-
.pipe(operators.map(function (response) {
|
|
9439
|
-
var tasks = response.tasks;
|
|
9440
|
-
if (tasks && tasks.length > 0) {
|
|
9441
|
-
if (tasks.length === 1) {
|
|
9442
|
-
_this.completeTask(tasks[0].id).subscribe();
|
|
9443
|
-
}
|
|
9444
|
-
else {
|
|
9445
|
-
// This is a problem. Throw an appropriate error.
|
|
9446
|
-
throw new Error(MULTIPLE_TASKS_FOUND);
|
|
9447
|
-
}
|
|
9448
|
-
}
|
|
9449
|
-
return true; // All good. Nothing to see here.
|
|
9450
|
-
}), operators.catchError(function (error) {
|
|
9451
|
-
// Simply rethrow it.
|
|
9452
|
-
return rxjs.throwError(error);
|
|
9453
|
-
}));
|
|
9454
|
-
};
|
|
9455
|
-
/**
|
|
9456
|
-
* Return tasks for case and event.
|
|
9457
|
-
*/
|
|
9458
|
-
WorkAllocationService.prototype.getTasksByCaseIdAndEventId = function (eventId, caseId, caseType, jurisdiction) {
|
|
9459
|
-
var defaultPayload = {
|
|
9460
|
-
task_required_for_event: false,
|
|
9461
|
-
tasks: []
|
|
9462
|
-
};
|
|
9463
|
-
if (!this.isWAEnabled()) {
|
|
9464
|
-
return rxjs.of(defaultPayload);
|
|
9465
|
-
}
|
|
9466
|
-
return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/case/tasks/" + caseId + "/event/" + eventId + "/caseType/" + caseType + "/jurisdiction/" + jurisdiction);
|
|
9467
|
-
};
|
|
9468
|
-
/**
|
|
9469
|
-
* Call the API to get a task
|
|
9470
|
-
*/
|
|
9471
|
-
WorkAllocationService.prototype.getTask = function (taskId) {
|
|
9472
|
-
if (!this.isWAEnabled()) {
|
|
9473
|
-
return rxjs.of({ task: null });
|
|
9474
|
-
}
|
|
9475
|
-
return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId);
|
|
9476
|
-
};
|
|
9477
|
-
return WorkAllocationService;
|
|
9478
|
-
}());
|
|
9479
|
-
WorkAllocationService.iACCaseOfficer = 'caseworker-ia-caseofficer';
|
|
9480
|
-
WorkAllocationService.iACAdmOfficer = 'caseworker-ia-admofficer';
|
|
9481
|
-
WorkAllocationService.ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(AlertService), i0__namespace.ɵɵinject(SessionStorageService)); };
|
|
9482
|
-
WorkAllocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: WorkAllocationService, factory: WorkAllocationService.ɵfac });
|
|
9483
|
-
(function () {
|
|
9484
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WorkAllocationService, [{
|
|
9485
|
-
type: i0.Injectable
|
|
9486
|
-
}], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null);
|
|
9487
|
-
})();
|
|
9488
|
-
|
|
9489
9534
|
var CaseEditComponent = /** @class */ (function () {
|
|
9490
9535
|
function CaseEditComponent(fb, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService) {
|
|
9491
9536
|
this.fb = fb;
|
|
@@ -10424,7 +10469,7 @@
|
|
|
10424
10469
|
var label = casefield.label || 'Field';
|
|
10425
10470
|
var id_1 = casefield.id;
|
|
10426
10471
|
if (fieldElement['component'] && fieldElement['component'].parent) {
|
|
10427
|
-
if (fieldElement['component'].idPrefix.indexOf(
|
|
10472
|
+
if (fieldElement['component'].idPrefix.indexOf('_' + id_1 + '_') === -1) {
|
|
10428
10473
|
id_1 = "" + fieldElement['component'].idPrefix + id_1;
|
|
10429
10474
|
}
|
|
10430
10475
|
else {
|
|
@@ -10962,7 +11007,7 @@
|
|
|
10962
11007
|
|
|
10963
11008
|
var AddressOption = /** @class */ (function () {
|
|
10964
11009
|
function AddressOption(addressModel, description) {
|
|
10965
|
-
if (description
|
|
11010
|
+
if (description == null) {
|
|
10966
11011
|
this.value = addressModel;
|
|
10967
11012
|
this.description = this.getDescription();
|
|
10968
11013
|
}
|
|
@@ -10971,10 +11016,13 @@
|
|
|
10971
11016
|
}
|
|
10972
11017
|
}
|
|
10973
11018
|
AddressOption.prototype.getDescription = function () {
|
|
10974
|
-
return this.removeInitialCommaIfPresent(
|
|
11019
|
+
return this.removeInitialCommaIfPresent((this.value.AddressLine1 === undefined ? '' : this.value.AddressLine1)
|
|
11020
|
+
+ this.prefixWithCommaIfPresent(this.value.AddressLine2)
|
|
11021
|
+
+ this.prefixWithCommaIfPresent(this.value.AddressLine3)
|
|
11022
|
+
+ ', ' + this.value.PostTown);
|
|
10975
11023
|
};
|
|
10976
11024
|
AddressOption.prototype.prefixWithCommaIfPresent = function (value) {
|
|
10977
|
-
return value ?
|
|
11025
|
+
return value ? ', ' + value : value;
|
|
10978
11026
|
};
|
|
10979
11027
|
AddressOption.prototype.removeInitialCommaIfPresent = function (value) {
|
|
10980
11028
|
return value.replace(new RegExp('^,', 'gi'), '');
|
|
@@ -11118,7 +11166,7 @@
|
|
|
11118
11166
|
this.missingPostcode = false;
|
|
11119
11167
|
var postcode_1 = this.postcode.value;
|
|
11120
11168
|
this.caseField.value = null;
|
|
11121
|
-
this.addressOptions =
|
|
11169
|
+
this.addressOptions = new Array();
|
|
11122
11170
|
this.addressesService.getAddressesForPostcode(postcode_1.replace(' ', '').toUpperCase()).subscribe(function (result) {
|
|
11123
11171
|
result.forEach(function (address) {
|
|
11124
11172
|
_this.addressOptions.push(new AddressOption(address, null));
|
|
@@ -11161,7 +11209,7 @@
|
|
|
11161
11209
|
var hasAddress = false;
|
|
11162
11210
|
if (address) {
|
|
11163
11211
|
Object.keys(address).forEach(function (key) {
|
|
11164
|
-
if (address[key]
|
|
11212
|
+
if (address[key] != null) {
|
|
11165
11213
|
hasAddress = true;
|
|
11166
11214
|
}
|
|
11167
11215
|
});
|
|
@@ -11184,7 +11232,7 @@
|
|
|
11184
11232
|
};
|
|
11185
11233
|
WriteAddressFieldComponent.prototype.defaultLabel = function (numberOfAddresses) {
|
|
11186
11234
|
return numberOfAddresses === 0 ? 'No address found'
|
|
11187
|
-
:
|
|
11235
|
+
: numberOfAddresses + (numberOfAddresses === 1 ? ' address ' : ' addresses ') + 'found';
|
|
11188
11236
|
};
|
|
11189
11237
|
WriteAddressFieldComponent.prototype.setFormValue = function () {
|
|
11190
11238
|
if (this.writeComplexFieldComponent.complexGroup) {
|
|
@@ -12929,16 +12977,16 @@
|
|
|
12929
12977
|
&& this.collItems[i].caseField.id === counter.toString()) {
|
|
12930
12978
|
this.collItems[i].caseField.id = i.toString();
|
|
12931
12979
|
}
|
|
12932
|
-
var idPrefix1 = this.collItems[i].prefix ? this.collItems[i].prefix.replace(
|
|
12933
|
-
var idPrefix1Current = idPrefix1.replace(
|
|
12980
|
+
var idPrefix1 = this.collItems[i].prefix ? this.collItems[i].prefix.replace('_' + counter.toString(), '_' + i.toString()) : '';
|
|
12981
|
+
var idPrefix1Current = idPrefix1.replace('_' + i.toString(), '_' + counter.toString());
|
|
12934
12982
|
if (this.collItems[i].prefix && this.collItems[i].prefix === idPrefix1Current) {
|
|
12935
12983
|
this.collItems[i].prefix = idPrefix1;
|
|
12936
12984
|
}
|
|
12937
12985
|
var idPrefixAvailable = this.collItems[i].container && this.collItems[i].container['component']
|
|
12938
12986
|
&& this.collItems[i].container['component'].idPrefix ? true : false;
|
|
12939
12987
|
var idPrefix2 = idPrefixAvailable ?
|
|
12940
|
-
this.collItems[i].container['component'].idPrefix.replace(
|
|
12941
|
-
var idPrefix2current = idPrefix2.replace(
|
|
12988
|
+
this.collItems[i].container['component'].idPrefix.replace('_' + counter.toString(), '_' + i.toString()) : '';
|
|
12989
|
+
var idPrefix2current = idPrefix2.replace('_' + i.toString(), '_' + counter.toString());
|
|
12942
12990
|
if (idPrefixAvailable && this.collItems[i].container['component'].idPrefix === idPrefix2current) {
|
|
12943
12991
|
this.collItems[i].container['component'].idPrefix = idPrefix2;
|
|
12944
12992
|
}
|
|
@@ -15349,7 +15397,7 @@
|
|
|
15349
15397
|
casesResponse.push(_this.mapResponse(result));
|
|
15350
15398
|
});
|
|
15351
15399
|
});
|
|
15352
|
-
|
|
15400
|
+
var caseLinks = casesResponse.map(function (item) {
|
|
15353
15401
|
return {
|
|
15354
15402
|
caseReference: item.caseReference,
|
|
15355
15403
|
caseName: item.caseName,
|
|
@@ -15363,6 +15411,7 @@
|
|
|
15363
15411
|
}),
|
|
15364
15412
|
};
|
|
15365
15413
|
});
|
|
15414
|
+
_this.linkedCases = caseLinks;
|
|
15366
15415
|
_this.serverLinkedApiError = null;
|
|
15367
15416
|
}, function (err) {
|
|
15368
15417
|
_this.serverLinkedApiError = {
|
|
@@ -17442,7 +17491,7 @@
|
|
|
17442
17491
|
this.caseField = (_a = tab === null || tab === void 0 ? void 0 : tab.fields) === null || _a === void 0 ? void 0 : _a.find(function (field) { return field.id === 'caseLinks'; });
|
|
17443
17492
|
}
|
|
17444
17493
|
this.isServerJurisdictionError = this.linkedCasesService.serverJurisdictionError || false;
|
|
17445
|
-
var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() +
|
|
17494
|
+
var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
|
|
17446
17495
|
this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
|
|
17447
17496
|
next: function (reasons) {
|
|
17448
17497
|
_this.reasonListLoaded = true;
|
|
@@ -17704,7 +17753,7 @@
|
|
|
17704
17753
|
};
|
|
17705
17754
|
WriteLinkedCasesFieldComponent.prototype.getLinkedCaseReasons = function () {
|
|
17706
17755
|
var _this = this;
|
|
17707
|
-
var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() +
|
|
17756
|
+
var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
|
|
17708
17757
|
this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
|
|
17709
17758
|
next: function (reasons) {
|
|
17710
17759
|
// Sort in ascending order
|
|
@@ -17763,10 +17812,11 @@
|
|
|
17763
17812
|
var _this = this;
|
|
17764
17813
|
this.casesService.getCaseViewV2(this.linkedCasesService.caseId).subscribe(function (caseView) {
|
|
17765
17814
|
var caseViewFiltered = caseView.tabs.filter(function (tab) {
|
|
17766
|
-
|
|
17815
|
+
var linkField = tab.fields.some(function (_b) {
|
|
17767
17816
|
var field_type = _b.field_type;
|
|
17768
17817
|
return field_type && field_type.collection_field_type && field_type.collection_field_type.id === 'CaseLink';
|
|
17769
17818
|
});
|
|
17819
|
+
return linkField;
|
|
17770
17820
|
});
|
|
17771
17821
|
if (caseViewFiltered) {
|
|
17772
17822
|
var caseLinkFieldValue = caseViewFiltered.map(function (filtered) { var _a; return ((_a = filtered.fields) === null || _a === void 0 ? void 0 : _a.length) > 0 && filtered.fields.filter(function (field) { return field.id === 'caseLinks'; })[0].value; });
|
|
@@ -19553,7 +19603,7 @@
|
|
|
19553
19603
|
WriteTextAreaFieldComponent.prototype.autoGrow = function (event) {
|
|
19554
19604
|
if (this.browserService.isIEOrEdge()) {
|
|
19555
19605
|
event.target.style.height = 'auto';
|
|
19556
|
-
event.target.style.height = event.target.scrollHeight +
|
|
19606
|
+
event.target.style.height = event.target.scrollHeight + 'px';
|
|
19557
19607
|
event.target.scrollTop = event.target.scrollHeight;
|
|
19558
19608
|
}
|
|
19559
19609
|
};
|
|
@@ -22128,7 +22178,7 @@
|
|
|
22128
22178
|
// is expected not to have a party name)
|
|
22129
22179
|
if (this.flagsData) {
|
|
22130
22180
|
this.filteredFlagsData =
|
|
22131
|
-
this.flagsData.filter(function (f) { return f.flags.partyName
|
|
22181
|
+
this.flagsData.filter(function (f) { return f.flags.partyName != null || f.pathToFlagsFormGroup === _this.caseLevelCaseFlagsFieldId; });
|
|
22132
22182
|
}
|
|
22133
22183
|
// Add a FormControl for the selected flag location if there is at least one flags instance remaining after filtering
|
|
22134
22184
|
if (this.filteredFlagsData && this.filteredFlagsData.length > 0) {
|
|
@@ -23425,13 +23475,13 @@
|
|
|
23425
23475
|
field.value = { CaseReference: value };
|
|
23426
23476
|
return field;
|
|
23427
23477
|
};
|
|
23428
|
-
ReadComplexFieldCollectionTableComponent.prototype.toCaseField = function (id, label,
|
|
23478
|
+
ReadComplexFieldCollectionTableComponent.prototype.toCaseField = function (id, label, field_type, value) {
|
|
23429
23479
|
return classTransformer.plainToClassFromExist(new CaseField(), {
|
|
23430
23480
|
id: id,
|
|
23431
23481
|
label: label,
|
|
23432
23482
|
display_context: 'READONLY',
|
|
23433
23483
|
value: value,
|
|
23434
|
-
field_type:
|
|
23484
|
+
field_type: field_type
|
|
23435
23485
|
});
|
|
23436
23486
|
};
|
|
23437
23487
|
ReadComplexFieldCollectionTableComponent.prototype.sortRowsByColumns = function (column) {
|
|
@@ -25267,7 +25317,7 @@
|
|
|
25267
25317
|
function CcdPageFieldsPipe() {
|
|
25268
25318
|
}
|
|
25269
25319
|
CcdPageFieldsPipe.prototype.transform = function (page, dataFormGroup) {
|
|
25270
|
-
var
|
|
25320
|
+
var complex_fields = Object.keys(dataFormGroup.controls['data'].controls).map(function (key) {
|
|
25271
25321
|
var control = dataFormGroup.controls['data'].get(key);
|
|
25272
25322
|
return control['caseField'];
|
|
25273
25323
|
}).filter(function (field) {
|
|
@@ -25287,7 +25337,7 @@
|
|
|
25287
25337
|
field_type: {
|
|
25288
25338
|
id: page.id,
|
|
25289
25339
|
type: 'Complex',
|
|
25290
|
-
complex_fields:
|
|
25340
|
+
complex_fields: complex_fields
|
|
25291
25341
|
}
|
|
25292
25342
|
});
|
|
25293
25343
|
};
|
|
@@ -25466,11 +25516,11 @@
|
|
|
25466
25516
|
}
|
|
25467
25517
|
return childrenCaseFields;
|
|
25468
25518
|
};
|
|
25469
|
-
CollectionCreateCheckerService.prototype.isComplex = function (
|
|
25470
|
-
return
|
|
25519
|
+
CollectionCreateCheckerService.prototype.isComplex = function (case_field) {
|
|
25520
|
+
return case_field.field_type.type === 'Complex';
|
|
25471
25521
|
};
|
|
25472
|
-
CollectionCreateCheckerService.prototype.isCollection = function (
|
|
25473
|
-
return
|
|
25522
|
+
CollectionCreateCheckerService.prototype.isCollection = function (case_field) {
|
|
25523
|
+
return case_field.field_type.type === 'Collection';
|
|
25474
25524
|
};
|
|
25475
25525
|
CollectionCreateCheckerService.prototype.hasCreateAccess = function (caseField, role) {
|
|
25476
25526
|
return !!caseField.acls.find(function (acl) { return acl.role === role && acl.create === true; });
|
|
@@ -26671,7 +26721,7 @@
|
|
|
26671
26721
|
if (caseField.field_type.type === 'Complex') {
|
|
26672
26722
|
// Note: Deliberate use of equality (==) and non-equality (!=) operators for null checks throughout, to
|
|
26673
26723
|
// handle both null and undefined values
|
|
26674
|
-
if (caseField.value
|
|
26724
|
+
if (caseField.value != null) {
|
|
26675
26725
|
// Call this function recursively to replace the Complex field's sub-fields as necessary, passing the
|
|
26676
26726
|
// CaseField itself (the sub-fields do not contain any values, so these need to be obtained from the
|
|
26677
26727
|
// parent)
|
|
@@ -28700,7 +28750,7 @@
|
|
|
28700
28750
|
var formValue = _this.windowService.getLocalStorage(FORM_GROUP_VAL_LOC_STORAGE);
|
|
28701
28751
|
workbasketInputs.forEach(function (item) {
|
|
28702
28752
|
if (item.field.elementPath) {
|
|
28703
|
-
item.field.id = item.field.id +
|
|
28753
|
+
item.field.id = item.field.id + '.' + item.field.elementPath;
|
|
28704
28754
|
}
|
|
28705
28755
|
item.field.label = item.label;
|
|
28706
28756
|
if (formValue) {
|
|
@@ -28752,7 +28802,7 @@
|
|
|
28752
28802
|
var value = formGroupLS[key];
|
|
28753
28803
|
// Clear the filter form group control values if it has a value in local storage
|
|
28754
28804
|
// The regionList form group control value should be ignored as it always contain the latest value
|
|
28755
|
-
if (key !== REGION_LIST_AND_FRC_FILTER && value
|
|
28805
|
+
if (key !== REGION_LIST_AND_FRC_FILTER && value != null) {
|
|
28756
28806
|
this.formGroup.get(key).setValue(null);
|
|
28757
28807
|
}
|
|
28758
28808
|
}
|
|
@@ -30677,7 +30727,7 @@
|
|
|
30677
30727
|
var _r34_1 = i0__namespace.ɵɵgetCurrentView();
|
|
30678
30728
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
30679
30729
|
i0__namespace.ɵɵelementStart(1, "mat-tab-group", 23, 24);
|
|
30680
|
-
i0__namespace.ɵɵlistener("
|
|
30730
|
+
i0__namespace.ɵɵlistener("selectedIndexChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedIndexChange_1_listener($event) { i0__namespace.ɵɵrestoreView(_r34_1); var ctx_r33 = i0__namespace.ɵɵnextContext(); return ctx_r33.tabChanged($event); });
|
|
30681
30731
|
i0__namespace.ɵɵtemplate(3, CaseFullAccessViewComponent_ng_container_12_mat_tab_3_Template, 1, 2, "mat-tab", 25);
|
|
30682
30732
|
i0__namespace.ɵɵtemplate(4, CaseFullAccessViewComponent_ng_container_12_mat_tab_4_Template, 2, 2, "mat-tab", 25);
|
|
30683
30733
|
i0__namespace.ɵɵtemplate(5, CaseFullAccessViewComponent_ng_container_12_mat_tab_5_Template, 1, 2, "mat-tab", 25);
|
|
@@ -30715,6 +30765,7 @@
|
|
|
30715
30765
|
this.location = location;
|
|
30716
30766
|
this.crf = crf;
|
|
30717
30767
|
this.sessionStorageService = sessionStorageService;
|
|
30768
|
+
this.HEARINGS_TAB_LABEL = 'Hearings';
|
|
30718
30769
|
this.hasPrint = true;
|
|
30719
30770
|
this.hasEventSelector = true;
|
|
30720
30771
|
this.prependedTabs = [];
|
|
@@ -30726,6 +30777,7 @@
|
|
|
30726
30777
|
this.ignoreWarning = false;
|
|
30727
30778
|
this.selectedTabIndex = 0;
|
|
30728
30779
|
this.activeCaseFlags = false;
|
|
30780
|
+
this.subs = [];
|
|
30729
30781
|
this.callbackErrorsSubject = new rxjs.Subject();
|
|
30730
30782
|
}
|
|
30731
30783
|
CaseFullAccessViewComponent.prototype.ngOnInit = function () {
|
|
@@ -30778,6 +30830,7 @@
|
|
|
30778
30830
|
this.unsubscribe(this.callbackErrorsSubject);
|
|
30779
30831
|
this.unsubscribe(this.errorSubscription);
|
|
30780
30832
|
this.unsubscribe(this.subscription);
|
|
30833
|
+
this.subs.forEach(function (s) { return s.unsubscribe(); });
|
|
30781
30834
|
};
|
|
30782
30835
|
CaseFullAccessViewComponent.prototype.unsubscribe = function (subscription) {
|
|
30783
30836
|
if (subscription) {
|
|
@@ -30786,19 +30839,22 @@
|
|
|
30786
30839
|
};
|
|
30787
30840
|
CaseFullAccessViewComponent.prototype.checkRouteAndSetCaseViewTab = function () {
|
|
30788
30841
|
var _this = this;
|
|
30789
|
-
this.router.events
|
|
30842
|
+
this.subs.push(this.router.events
|
|
30790
30843
|
.pipe(operators.filter(function (event) { return event instanceof i1$1.NavigationEnd; }))
|
|
30791
30844
|
.subscribe(function (event) {
|
|
30792
30845
|
var url = event && event.url;
|
|
30793
30846
|
if (url) {
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
|
|
30798
|
-
|
|
30847
|
+
if (url.includes('hearings')) {
|
|
30848
|
+
_this.selectedTabIndex = _this.getTabIndexByTabLabel(_this.tabGroup, 'hearings');
|
|
30849
|
+
}
|
|
30850
|
+
else {
|
|
30851
|
+
var urlFragment = _this.getUrlFragment(url);
|
|
30852
|
+
var tabLabel = decodeURIComponent(urlFragment);
|
|
30853
|
+
var tabIndex = _this.getTabIndexByTabLabel(_this.tabGroup, tabLabel);
|
|
30854
|
+
_this.selectedTabIndex = tabIndex;
|
|
30799
30855
|
}
|
|
30800
30856
|
}
|
|
30801
|
-
});
|
|
30857
|
+
}));
|
|
30802
30858
|
};
|
|
30803
30859
|
CaseFullAccessViewComponent.prototype.postViewActivity = function () {
|
|
30804
30860
|
return this.activityPollingService.postViewActivity(this.caseDetails.case_id);
|
|
@@ -30922,22 +30978,19 @@
|
|
|
30922
30978
|
}
|
|
30923
30979
|
}
|
|
30924
30980
|
};
|
|
30925
|
-
CaseFullAccessViewComponent.prototype.tabChanged = function (
|
|
30926
|
-
//
|
|
30927
|
-
this.
|
|
30928
|
-
var
|
|
30929
|
-
|
|
30930
|
-
|
|
30931
|
-
|
|
30932
|
-
|
|
30933
|
-
|
|
30934
|
-
this.router.navigate([id], { relativeTo: this.route });
|
|
30981
|
+
CaseFullAccessViewComponent.prototype.tabChanged = function (tabIndexChanged) {
|
|
30982
|
+
// Refactored under EXUI-110 to address infinite tab loop
|
|
30983
|
+
var matTab = this.tabGroup._tabs.find(function (tab) { return tab.isActive; });
|
|
30984
|
+
var tabLabel = matTab.textLabel;
|
|
30985
|
+
// if hearings tab don't use fragment for navigation
|
|
30986
|
+
if ((tabIndexChanged <= 1 && this.prependedTabs && this.prependedTabs.length) ||
|
|
30987
|
+
(this.appendedTabs && this.appendedTabs.length && tabLabel === this.HEARINGS_TAB_LABEL)) {
|
|
30988
|
+
// cases/case-details/:caseId/hearings
|
|
30989
|
+
this.router.navigate([tabLabel.toLowerCase()], { relativeTo: this.route });
|
|
30935
30990
|
}
|
|
30936
30991
|
else {
|
|
30937
|
-
|
|
30938
|
-
this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]
|
|
30939
|
-
window.location.hash = label_1;
|
|
30940
|
-
});
|
|
30992
|
+
// cases/case-details/:caseId#tabLabel
|
|
30993
|
+
this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: tabLabel });
|
|
30941
30994
|
}
|
|
30942
30995
|
};
|
|
30943
30996
|
CaseFullAccessViewComponent.prototype.onLinkClicked = function (triggerOutputEventText) {
|
|
@@ -31035,6 +31088,12 @@
|
|
|
31035
31088
|
this.callbackErrorsSubject.next(null);
|
|
31036
31089
|
this.alertService.clear();
|
|
31037
31090
|
};
|
|
31091
|
+
CaseFullAccessViewComponent.prototype.getUrlFragment = function (url) {
|
|
31092
|
+
return url.split('#')[url.split('#').length - 1];
|
|
31093
|
+
};
|
|
31094
|
+
CaseFullAccessViewComponent.prototype.getTabIndexByTabLabel = function (tabGroup, tabLabel) {
|
|
31095
|
+
return tabGroup._tabs.toArray().findIndex(function (t) { return t.textLabel.toLowerCase() === tabLabel.toLowerCase(); });
|
|
31096
|
+
};
|
|
31038
31097
|
return CaseFullAccessViewComponent;
|
|
31039
31098
|
}());
|
|
31040
31099
|
CaseFullAccessViewComponent.ORIGIN_QUERY_PARAM = 'origin';
|
|
@@ -31051,7 +31110,7 @@
|
|
|
31051
31110
|
var _t = void 0;
|
|
31052
31111
|
i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
|
|
31053
31112
|
}
|
|
31054
|
-
}, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "
|
|
31113
|
+
}, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedIndexChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) {
|
|
31055
31114
|
if (rf & 1) {
|
|
31056
31115
|
i0__namespace.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 10, 0, "div", 0);
|
|
31057
31116
|
i0__namespace.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 6, 2, "div", 0);
|
|
@@ -31133,7 +31192,7 @@
|
|
|
31133
31192
|
* or the empty string
|
|
31134
31193
|
*/
|
|
31135
31194
|
PrintUrlPipe.prototype.transform = function (remoteUrl) {
|
|
31136
|
-
if (
|
|
31195
|
+
if (remoteUrl && remoteUrl.length > 0) {
|
|
31137
31196
|
var printServiceUrlPathname = void 0;
|
|
31138
31197
|
/**
|
|
31139
31198
|
* Check navigator.userAgent to see if the browser is IE or not. Check for either the browser name, "MSIE", or
|
|
@@ -31149,7 +31208,7 @@
|
|
|
31149
31208
|
printServiceUrlPathname = urlParser.pathname;
|
|
31150
31209
|
if (printServiceUrlPathname[0] !== '/') {
|
|
31151
31210
|
// Fix for IE11; it returns the pathname without leading slash
|
|
31152
|
-
printServiceUrlPathname =
|
|
31211
|
+
printServiceUrlPathname = '/' + printServiceUrlPathname;
|
|
31153
31212
|
}
|
|
31154
31213
|
}
|
|
31155
31214
|
else {
|
|
@@ -31352,10 +31411,10 @@
|
|
|
31352
31411
|
};
|
|
31353
31412
|
CaseViewerComponent.prototype.setUserAccessType = function (caseDetails) {
|
|
31354
31413
|
if (caseDetails && Array.isArray(caseDetails.metadataFields)) {
|
|
31355
|
-
var
|
|
31356
|
-
var
|
|
31357
|
-
this.accessGranted =
|
|
31358
|
-
this.userAccessType =
|
|
31414
|
+
var access_process = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_PROCEES_ID; });
|
|
31415
|
+
var access_granted = caseDetails.metadataFields.find(function (metadataField) { return metadataField.id === CaseViewerComponent.METADATA_FIELD_ACCESS_GRANTED_ID; });
|
|
31416
|
+
this.accessGranted = access_granted ? access_granted.value !== CaseViewerComponent.BASIC_USER_ACCESS_TYPES : false;
|
|
31417
|
+
this.userAccessType = access_process ? access_process.value : null;
|
|
31359
31418
|
}
|
|
31360
31419
|
};
|
|
31361
31420
|
CaseViewerComponent.prototype.isDataLoaded = function () {
|
|
@@ -32651,11 +32710,11 @@
|
|
|
32651
32710
|
};
|
|
32652
32711
|
this.$roleAssignmentResponseSubscription = this.casesService.createChallengedAccessRequest(caseId_1, challengedAccessRequest)
|
|
32653
32712
|
.pipe(operators.switchMap(function () { return _this.caseNotifier.fetchAndRefresh(caseId_1); }))
|
|
32654
|
-
.subscribe(function () {
|
|
32713
|
+
.subscribe(function (_response) {
|
|
32655
32714
|
// Would have been nice to pass the caseId within state.data, but this isn't part of NavigationExtras until
|
|
32656
32715
|
// Angular 7.2!
|
|
32657
32716
|
_this.router.navigate(['success'], { relativeTo: _this.route });
|
|
32658
|
-
}, function () {
|
|
32717
|
+
}, function (_error) {
|
|
32659
32718
|
// Navigate to error page
|
|
32660
32719
|
});
|
|
32661
32720
|
}
|
|
@@ -32669,7 +32728,7 @@
|
|
|
32669
32728
|
}
|
|
32670
32729
|
};
|
|
32671
32730
|
CaseChallengedAccessRequestComponent.prototype.inputEmpty = function (input) {
|
|
32672
|
-
return input.value
|
|
32731
|
+
return input.value == null || input.value.trim().length === 0;
|
|
32673
32732
|
};
|
|
32674
32733
|
return CaseChallengedAccessRequestComponent;
|
|
32675
32734
|
}());
|
|
@@ -33293,11 +33352,11 @@
|
|
|
33293
33352
|
};
|
|
33294
33353
|
this.$roleAssignmentResponseSubscription = this.casesService.createSpecificAccessRequest(caseId_1, specificAccessRequest)
|
|
33295
33354
|
.pipe(operators.switchMap(function () { return _this.caseNotifier.fetchAndRefresh(caseId_1); }))
|
|
33296
|
-
.subscribe(function () {
|
|
33355
|
+
.subscribe(function (_response) {
|
|
33297
33356
|
// Would have been nice to pass the caseId within state.data, but this isn't part of NavigationExtras until
|
|
33298
33357
|
// Angular 7.2
|
|
33299
33358
|
_this.router.navigate(['success'], { relativeTo: _this.route });
|
|
33300
|
-
}, function () {
|
|
33359
|
+
}, function (_error) {
|
|
33301
33360
|
// Navigate to error page
|
|
33302
33361
|
});
|
|
33303
33362
|
}
|
|
@@ -33312,7 +33371,7 @@
|
|
|
33312
33371
|
}
|
|
33313
33372
|
};
|
|
33314
33373
|
CaseSpecificAccessRequestComponent.prototype.inputEmpty = function (input) {
|
|
33315
|
-
return input.value
|
|
33374
|
+
return input.value == null || input.value.trim().length === 0;
|
|
33316
33375
|
};
|
|
33317
33376
|
return CaseSpecificAccessRequestComponent;
|
|
33318
33377
|
}());
|
|
@@ -34213,7 +34272,7 @@
|
|
|
34213
34272
|
}
|
|
34214
34273
|
searchInputs.forEach(function (item) {
|
|
34215
34274
|
if (item.field.elementPath) {
|
|
34216
|
-
item.field.id = item.field.id +
|
|
34275
|
+
item.field.id = item.field.id + '.' + item.field.elementPath;
|
|
34217
34276
|
}
|
|
34218
34277
|
item.field.label = item.label;
|
|
34219
34278
|
if (formValueObject) {
|
|
@@ -35480,24 +35539,24 @@
|
|
|
35480
35539
|
this.caseField.id = id;
|
|
35481
35540
|
return this;
|
|
35482
35541
|
};
|
|
35483
|
-
CaseFieldBuilder.prototype.withFieldType = function (
|
|
35484
|
-
this.caseField.field_type =
|
|
35542
|
+
CaseFieldBuilder.prototype.withFieldType = function (field_type) {
|
|
35543
|
+
this.caseField.field_type = field_type;
|
|
35485
35544
|
return this;
|
|
35486
35545
|
};
|
|
35487
|
-
CaseFieldBuilder.prototype.withDisplayContext = function (
|
|
35488
|
-
this.caseField.display_context =
|
|
35546
|
+
CaseFieldBuilder.prototype.withDisplayContext = function (display_context) {
|
|
35547
|
+
this.caseField.display_context = display_context;
|
|
35489
35548
|
return this;
|
|
35490
35549
|
};
|
|
35491
|
-
CaseFieldBuilder.prototype.withDisplayContextParameter = function (
|
|
35492
|
-
this.caseField.display_context_parameter =
|
|
35550
|
+
CaseFieldBuilder.prototype.withDisplayContextParameter = function (display_context_parameter) {
|
|
35551
|
+
this.caseField.display_context_parameter = display_context_parameter;
|
|
35493
35552
|
return this;
|
|
35494
35553
|
};
|
|
35495
35554
|
CaseFieldBuilder.prototype.withHidden = function (hidden) {
|
|
35496
35555
|
this.caseField.hidden = hidden;
|
|
35497
35556
|
return this;
|
|
35498
35557
|
};
|
|
35499
|
-
CaseFieldBuilder.prototype.withHintText = function (
|
|
35500
|
-
this.caseField.hint_text =
|
|
35558
|
+
CaseFieldBuilder.prototype.withHintText = function (hint_text) {
|
|
35559
|
+
this.caseField.hint_text = hint_text;
|
|
35501
35560
|
return this;
|
|
35502
35561
|
};
|
|
35503
35562
|
CaseFieldBuilder.prototype.withLabel = function (label) {
|
|
@@ -35508,12 +35567,12 @@
|
|
|
35508
35567
|
this.caseField.order = order;
|
|
35509
35568
|
return this;
|
|
35510
35569
|
};
|
|
35511
|
-
CaseFieldBuilder.prototype.withSecurityLabel = function (
|
|
35512
|
-
this.caseField.security_label =
|
|
35570
|
+
CaseFieldBuilder.prototype.withSecurityLabel = function (security_label) {
|
|
35571
|
+
this.caseField.security_label = security_label;
|
|
35513
35572
|
return this;
|
|
35514
35573
|
};
|
|
35515
|
-
CaseFieldBuilder.prototype.withShowCondition = function (
|
|
35516
|
-
this.caseField.show_condition =
|
|
35574
|
+
CaseFieldBuilder.prototype.withShowCondition = function (show_condition) {
|
|
35575
|
+
this.caseField.show_condition = show_condition;
|
|
35517
35576
|
return this;
|
|
35518
35577
|
};
|
|
35519
35578
|
CaseFieldBuilder.prototype.withShowSummaryContentOption = function (option) {
|
|
@@ -35541,21 +35600,21 @@
|
|
|
35541
35600
|
complex_fields: []
|
|
35542
35601
|
};
|
|
35543
35602
|
};
|
|
35544
|
-
var createCaseEventTrigger = function (id, name,
|
|
35545
|
-
if (
|
|
35546
|
-
if (
|
|
35603
|
+
var createCaseEventTrigger = function (id, name, case_id, show_summary, case_fields, wizard_pages, can_save_draft) {
|
|
35604
|
+
if (wizard_pages === void 0) { wizard_pages = []; }
|
|
35605
|
+
if (can_save_draft === void 0) { can_save_draft = false; }
|
|
35547
35606
|
var eventTrigger = new CaseEventTrigger();
|
|
35548
35607
|
eventTrigger.id = id;
|
|
35549
35608
|
eventTrigger.name = name;
|
|
35550
|
-
eventTrigger.case_id =
|
|
35551
|
-
eventTrigger.show_summary =
|
|
35552
|
-
eventTrigger.wizard_pages =
|
|
35609
|
+
eventTrigger.case_id = case_id;
|
|
35610
|
+
eventTrigger.show_summary = show_summary;
|
|
35611
|
+
eventTrigger.wizard_pages = wizard_pages;
|
|
35553
35612
|
eventTrigger.event_token = 'test-token';
|
|
35554
|
-
eventTrigger.case_fields =
|
|
35555
|
-
eventTrigger.can_save_draft =
|
|
35613
|
+
eventTrigger.case_fields = case_fields;
|
|
35614
|
+
eventTrigger.can_save_draft = can_save_draft;
|
|
35556
35615
|
return eventTrigger;
|
|
35557
35616
|
};
|
|
35558
|
-
var aCaseField = function (id, label, type,
|
|
35617
|
+
var aCaseField = function (id, label, type, display_context, show_summary_content_option, typeComplexFields, retain_hidden_value, hidden) {
|
|
35559
35618
|
if (typeComplexFields === void 0) { typeComplexFields = []; }
|
|
35560
35619
|
return ({
|
|
35561
35620
|
id: id || 'personFirstName',
|
|
@@ -35564,10 +35623,10 @@
|
|
|
35564
35623
|
type: type || 'Text',
|
|
35565
35624
|
complex_fields: typeComplexFields || []
|
|
35566
35625
|
},
|
|
35567
|
-
display_context:
|
|
35626
|
+
display_context: display_context || 'OPTIONAL',
|
|
35568
35627
|
label: label || 'First name',
|
|
35569
|
-
show_summary_content_option:
|
|
35570
|
-
retain_hidden_value:
|
|
35628
|
+
show_summary_content_option: show_summary_content_option,
|
|
35629
|
+
retain_hidden_value: retain_hidden_value || false,
|
|
35571
35630
|
hidden: hidden || false
|
|
35572
35631
|
});
|
|
35573
35632
|
};
|
|
@@ -35609,48 +35668,48 @@
|
|
|
35609
35668
|
complexFieldOverride.display_context = 'HIDDEN';
|
|
35610
35669
|
return complexFieldOverride;
|
|
35611
35670
|
};
|
|
35612
|
-
var createCaseField = function (id, label, hint, fieldType,
|
|
35671
|
+
var createCaseField = function (id, label, hint, fieldType, display_context, order, show_condition, ACLs, hidden) {
|
|
35613
35672
|
if (order === void 0) { order = undefined; }
|
|
35614
|
-
if (
|
|
35615
|
-
if (
|
|
35673
|
+
if (show_condition === void 0) { show_condition = undefined; }
|
|
35674
|
+
if (ACLs === void 0) { ACLs = undefined; }
|
|
35616
35675
|
return CaseFieldBuilder.create()
|
|
35617
35676
|
.withId(id || 'personFirstName')
|
|
35618
35677
|
.withFieldType(fieldType || textFieldType())
|
|
35619
|
-
.withDisplayContext(
|
|
35678
|
+
.withDisplayContext(display_context || 'OPTIONAL')
|
|
35620
35679
|
.withLabel(label || 'First name')
|
|
35621
35680
|
.withHintText(hint || 'First name hint text')
|
|
35622
35681
|
.withShowSummaryContentOption(0)
|
|
35623
35682
|
.withOrder(order)
|
|
35624
|
-
.withShowCondition(
|
|
35625
|
-
.withACLs(
|
|
35683
|
+
.withShowCondition(show_condition || undefined)
|
|
35684
|
+
.withACLs(ACLs)
|
|
35626
35685
|
.withHidden(hidden || false)
|
|
35627
35686
|
.build();
|
|
35628
35687
|
};
|
|
35629
|
-
var newCaseField = function (id, label, hint, fieldType,
|
|
35688
|
+
var newCaseField = function (id, label, hint, fieldType, display_context, order) {
|
|
35630
35689
|
if (order === void 0) { order = undefined; }
|
|
35631
35690
|
return CaseFieldBuilder.create()
|
|
35632
35691
|
.withId(id || 'personFirstName')
|
|
35633
35692
|
.withFieldType(fieldType || textFieldType())
|
|
35634
|
-
.withDisplayContext(
|
|
35693
|
+
.withDisplayContext(display_context || 'OPTIONAL')
|
|
35635
35694
|
.withHintText(hint || 'First name hint text')
|
|
35636
35695
|
.withLabel(label || 'First name')
|
|
35637
35696
|
.withOrder(order)
|
|
35638
35697
|
.withShowSummaryContentOption(0);
|
|
35639
35698
|
};
|
|
35640
|
-
var createFieldType = function (typeId, type,
|
|
35641
|
-
if (
|
|
35642
|
-
if (
|
|
35699
|
+
var createFieldType = function (typeId, type, complex_fields, collection_field_type) {
|
|
35700
|
+
if (complex_fields === void 0) { complex_fields = []; }
|
|
35701
|
+
if (collection_field_type === void 0) { collection_field_type = undefined; }
|
|
35643
35702
|
return {
|
|
35644
35703
|
id: typeId || 'Text',
|
|
35645
35704
|
type: type || 'Text',
|
|
35646
|
-
complex_fields:
|
|
35647
|
-
collection_field_type:
|
|
35705
|
+
complex_fields: complex_fields || [],
|
|
35706
|
+
collection_field_type: collection_field_type || undefined
|
|
35648
35707
|
};
|
|
35649
35708
|
};
|
|
35650
35709
|
var createFixedListFieldType = function (typeId, fixedListItems) {
|
|
35651
35710
|
if (fixedListItems === void 0) { fixedListItems = []; }
|
|
35652
35711
|
return {
|
|
35653
|
-
id:
|
|
35712
|
+
id: 'FixedList-' + typeId,
|
|
35654
35713
|
type: 'FixedList',
|
|
35655
35714
|
fixed_list_items: fixedListItems || []
|
|
35656
35715
|
};
|
|
@@ -35658,18 +35717,18 @@
|
|
|
35658
35717
|
var createMultiSelectListFieldType = function (typeId, fixedListItems) {
|
|
35659
35718
|
if (fixedListItems === void 0) { fixedListItems = []; }
|
|
35660
35719
|
return {
|
|
35661
|
-
id:
|
|
35720
|
+
id: 'MultiSelectList-' + typeId,
|
|
35662
35721
|
type: 'MultiSelectList',
|
|
35663
35722
|
fixed_list_items: fixedListItems || []
|
|
35664
35723
|
};
|
|
35665
35724
|
};
|
|
35666
|
-
var createACL = function (role,
|
|
35725
|
+
var createACL = function (role, create, read, update, _delete) {
|
|
35667
35726
|
return ({
|
|
35668
35727
|
role: role || 'roleX',
|
|
35669
|
-
create:
|
|
35670
|
-
read:
|
|
35671
|
-
update:
|
|
35672
|
-
delete:
|
|
35728
|
+
create: create,
|
|
35729
|
+
read: read,
|
|
35730
|
+
update: update,
|
|
35731
|
+
delete: _delete
|
|
35673
35732
|
});
|
|
35674
35733
|
};
|
|
35675
35734
|
|
|
@@ -35888,6 +35947,7 @@
|
|
|
35888
35947
|
exports.FormatTranslatorService = FormatTranslatorService;
|
|
35889
35948
|
exports.GreyBarService = GreyBarService;
|
|
35890
35949
|
exports.HRef = HRef;
|
|
35950
|
+
exports.HasLoadingState = HasLoadingState;
|
|
35891
35951
|
exports.HeaderBarComponent = HeaderBarComponent;
|
|
35892
35952
|
exports.HeadersModule = HeadersModule;
|
|
35893
35953
|
exports.HttpError = HttpError;
|