@hmcts/ccd-case-ui-toolkit 7.0.6 → 7.0.7-task-completion-error-message
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/esm2020/lib/shared/commons/constants.mjs +2 -1
- package/esm2020/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +16 -6
- package/esm2020/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.mjs +22 -9
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +33 -11
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +33 -11
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/commons/constants.d.ts +1 -0
- package/lib/shared/commons/constants.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +3 -2
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts +5 -2
- package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4320,6 +4320,7 @@ class Constants {
|
|
|
4320
4320
|
}
|
|
4321
4321
|
Constants.MANDATORY = 'MANDATORY';
|
|
4322
4322
|
Constants.REGEX_WHITESPACES = '^[^ ]+(?:\\s+[^ ]+)*$';
|
|
4323
|
+
Constants.TASK_COMPLETION_ERROR = 'The associated task for this event failed to complete automatically. Please complete the task manually in the Tasks tab on the case';
|
|
4323
4324
|
Constants.ɵfac = function Constants_Factory(t) { return new (t || Constants)(); };
|
|
4324
4325
|
Constants.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: Constants, factory: Constants.ɵfac });
|
|
4325
4326
|
(function () {
|
|
@@ -8727,7 +8728,7 @@ ValidPageListCaseFieldsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({
|
|
|
8727
8728
|
})();
|
|
8728
8729
|
|
|
8729
8730
|
class CaseEditComponent {
|
|
8730
|
-
constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService) {
|
|
8731
|
+
constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService) {
|
|
8731
8732
|
this.fb = fb;
|
|
8732
8733
|
this.caseNotifier = caseNotifier;
|
|
8733
8734
|
this.router = router;
|
|
@@ -8743,6 +8744,7 @@ class CaseEditComponent {
|
|
|
8743
8744
|
this.loadingService = loadingService;
|
|
8744
8745
|
this.validPageListCaseFieldsService = validPageListCaseFieldsService;
|
|
8745
8746
|
this.workAllocationService = workAllocationService;
|
|
8747
|
+
this.alertService = alertService;
|
|
8746
8748
|
this.cancelled = new EventEmitter();
|
|
8747
8749
|
this.submitted = new EventEmitter();
|
|
8748
8750
|
this.isEventCompletionChecksRequired = false;
|
|
@@ -9031,6 +9033,7 @@ class CaseEditComponent {
|
|
|
9031
9033
|
const loadingSpinnerToken = this.loadingService.register();
|
|
9032
9034
|
// keep the initial event response to finalise process after task completion
|
|
9033
9035
|
let eventResponse;
|
|
9036
|
+
this.sessionStorageService.setItem('taskCompletionError', 'false');
|
|
9034
9037
|
submit(caseEventData).pipe(switchMap((response) => {
|
|
9035
9038
|
eventResponse = response;
|
|
9036
9039
|
return this.postCompleteTaskIfRequired();
|
|
@@ -9039,6 +9042,10 @@ class CaseEditComponent {
|
|
|
9039
9042
|
}))
|
|
9040
9043
|
.subscribe(() => {
|
|
9041
9044
|
this.finishEventCompletionLogic(eventResponse);
|
|
9045
|
+
/* NOTE: Uncomment this to test event confirmation page display of error
|
|
9046
|
+
Replicates lines 458-459
|
|
9047
|
+
this.alertService.setPreserveAlerts(true);
|
|
9048
|
+
this.alertService.error({phrase: 'The associated task for this event failed to complete automatically. Please complete the task manually in the Tasks tab on the case'}); */
|
|
9042
9049
|
}, error => {
|
|
9043
9050
|
if (!eventResponse) {
|
|
9044
9051
|
// event submission error
|
|
@@ -9052,10 +9059,13 @@ class CaseEditComponent {
|
|
|
9052
9059
|
this.isSubmitting = false;
|
|
9053
9060
|
}
|
|
9054
9061
|
else {
|
|
9062
|
+
this.sessionStorageService.setItem('taskCompletionError', 'true');
|
|
9055
9063
|
// task assignment/completion error - handled within workallocation service
|
|
9056
9064
|
// could set task to be deleted (or completed later)?
|
|
9057
|
-
// note: think error messages only shown if user is caseworker - might reqauire changing
|
|
9058
9065
|
this.finishEventCompletionLogic(eventResponse);
|
|
9066
|
+
// below allows error to be shown on navigation to confirmation page
|
|
9067
|
+
this.alertService.setPreserveAlerts(true);
|
|
9068
|
+
this.alertService.error({ phrase: Constants.TASK_COMPLETION_ERROR });
|
|
9059
9069
|
}
|
|
9060
9070
|
});
|
|
9061
9071
|
}
|
|
@@ -9111,7 +9121,7 @@ class CaseEditComponent {
|
|
|
9111
9121
|
}
|
|
9112
9122
|
CaseEditComponent.ORIGIN_QUERY_PARAM = 'origin';
|
|
9113
9123
|
CaseEditComponent.ALERT_MESSAGE = 'Page is being refreshed so you will be redirected to the first page of this event.';
|
|
9114
|
-
CaseEditComponent.ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i3.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$2.Router), i0.ɵɵdirectiveInject(i1$2.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService)); };
|
|
9124
|
+
CaseEditComponent.ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i3.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$2.Router), i0.ɵɵdirectiveInject(i1$2.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService)); };
|
|
9115
9125
|
CaseEditComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) {
|
|
9116
9126
|
if (rf & 1) {
|
|
9117
9127
|
i0.ɵɵelement(0, "router-outlet");
|
|
@@ -9121,7 +9131,7 @@ CaseEditComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditC
|
|
|
9121
9131
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
|
|
9122
9132
|
type: Component,
|
|
9123
9133
|
args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.case-field-change{width:5%}\n"] }]
|
|
9124
|
-
}], function () { return [{ type: i3.FormBuilder }, { type: CaseNotifier }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }]; }, { eventTrigger: [{
|
|
9134
|
+
}], function () { return [{ type: i3.FormBuilder }, { type: CaseNotifier }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }]; }, { eventTrigger: [{
|
|
9125
9135
|
type: Input
|
|
9126
9136
|
}], submit: [{
|
|
9127
9137
|
type: Input
|
|
@@ -28157,7 +28167,7 @@ function CaseEventTriggerComponent_div_0_Template(rf, ctx) {
|
|
|
28157
28167
|
}
|
|
28158
28168
|
}
|
|
28159
28169
|
class CaseEventTriggerComponent {
|
|
28160
|
-
constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService) {
|
|
28170
|
+
constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService) {
|
|
28161
28171
|
this.ngZone = ngZone;
|
|
28162
28172
|
this.casesService = casesService;
|
|
28163
28173
|
this.caseNotifier = caseNotifier;
|
|
@@ -28166,6 +28176,7 @@ class CaseEventTriggerComponent {
|
|
|
28166
28176
|
this.route = route;
|
|
28167
28177
|
this.caseReferencePipe = caseReferencePipe;
|
|
28168
28178
|
this.activityPollingService = activityPollingService;
|
|
28179
|
+
this.sessionStorageService = sessionStorageService;
|
|
28169
28180
|
this.BANNER = DisplayMode.BANNER;
|
|
28170
28181
|
}
|
|
28171
28182
|
ngOnInit() {
|
|
@@ -28227,21 +28238,30 @@ class CaseEventTriggerComponent {
|
|
|
28227
28238
|
}
|
|
28228
28239
|
submitted(event) {
|
|
28229
28240
|
const eventStatus = event['status'];
|
|
28241
|
+
const taskCompletionFailed = this.sessionStorageService.getItem('taskCompletionError') === 'true';
|
|
28230
28242
|
this.router
|
|
28231
28243
|
.navigate([this.parentUrl])
|
|
28232
28244
|
.then(() => {
|
|
28233
28245
|
const caseReference = this.caseReferencePipe.transform(this.caseDetails.case_id.toString());
|
|
28234
28246
|
const replacements = { CASEREFERENCE: caseReference, NAME: this.eventTrigger.name };
|
|
28235
|
-
|
|
28247
|
+
this.alertService.setPreserveAlerts(true);
|
|
28248
|
+
if (taskCompletionFailed) {
|
|
28249
|
+
// if task still present in session storage, we know that the task has not been correctly completed
|
|
28250
|
+
this.alertService.warning({
|
|
28251
|
+
phrase: CaseEventTriggerComponent.EVENT_COMPLETION_MESSAGE + '. ' + Constants.TASK_COMPLETION_ERROR,
|
|
28252
|
+
replacements
|
|
28253
|
+
});
|
|
28254
|
+
this.sessionStorageService.removeItem('taskCompletionError');
|
|
28255
|
+
}
|
|
28256
|
+
else if (EventStatusService.isIncomplete(eventStatus)) {
|
|
28236
28257
|
this.alertService.warning({
|
|
28237
|
-
phrase:
|
|
28238
|
-
but the callback service cannot be completed`,
|
|
28258
|
+
phrase: CaseEventTriggerComponent.EVENT_COMPLETION_MESSAGE + CaseEventTriggerComponent.CALLBACK_FAILED_MESSAGE,
|
|
28239
28259
|
replacements
|
|
28240
28260
|
});
|
|
28241
28261
|
}
|
|
28242
28262
|
else {
|
|
28243
28263
|
this.alertService.success({
|
|
28244
|
-
phrase:
|
|
28264
|
+
phrase: CaseEventTriggerComponent.EVENT_COMPLETION_MESSAGE,
|
|
28245
28265
|
replacements,
|
|
28246
28266
|
preserve: true
|
|
28247
28267
|
});
|
|
@@ -28260,7 +28280,9 @@ class CaseEventTriggerComponent {
|
|
|
28260
28280
|
return !!(this.eventTrigger && this.caseDetails);
|
|
28261
28281
|
}
|
|
28262
28282
|
}
|
|
28263
|
-
CaseEventTriggerComponent
|
|
28283
|
+
CaseEventTriggerComponent.EVENT_COMPLETION_MESSAGE = `Case #%CASEREFERENCE% has been updated with event: %NAME%`;
|
|
28284
|
+
CaseEventTriggerComponent.CALLBACK_FAILED_MESSAGE = ' but the callback service cannot be completed';
|
|
28285
|
+
CaseEventTriggerComponent.ɵfac = function CaseEventTriggerComponent_Factory(t) { return new (t || CaseEventTriggerComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$2.Router), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(i1$2.ActivatedRoute), i0.ɵɵdirectiveInject(CaseReferencePipe), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(SessionStorageService)); };
|
|
28264
28286
|
CaseEventTriggerComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventTriggerComponent, selectors: [["ccd-case-event-trigger"]], decls: 1, vars: 1, consts: [["class", "screen-990", 4, "ngIf"], [1, "screen-990"], [3, "caseId", "displayMode"], [3, "caseDetails", "submit", "validate", "eventTrigger", "cancelled", "submitted"]], template: function CaseEventTriggerComponent_Template(rf, ctx) {
|
|
28265
28287
|
if (rf & 1) {
|
|
28266
28288
|
i0.ɵɵtemplate(0, CaseEventTriggerComponent_div_0_Template, 3, 6, "div", 0);
|
|
@@ -28273,7 +28295,7 @@ CaseEventTriggerComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: C
|
|
|
28273
28295
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventTriggerComponent, [{
|
|
28274
28296
|
type: Component,
|
|
28275
28297
|
args: [{ selector: 'ccd-case-event-trigger', template: "<div *ngIf=\"isDataLoaded()\" class=\"screen-990\">\n <ccd-activity [caseId]=\"caseDetails.case_id\" [displayMode]=\"BANNER\"></ccd-activity>\n <ccd-case-edit [caseDetails]=\"caseDetails\"\n [submit]=\"submit()\"\n [validate]=\"validate()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"cancel()\"\n (submitted)=\"submitted($event)\"></ccd-case-edit>\n</div>\n" }]
|
|
28276
|
-
}], function () { return [{ type: i0.NgZone }, { type: CasesService }, { type: CaseNotifier }, { type: i1$2.Router }, { type: AlertService }, { type: i1$2.ActivatedRoute }, { type: CaseReferencePipe }, { type: ActivityPollingService }]; }, null);
|
|
28298
|
+
}], function () { return [{ type: i0.NgZone }, { type: CasesService }, { type: CaseNotifier }, { type: i1$2.Router }, { type: AlertService }, { type: i1$2.ActivatedRoute }, { type: CaseReferencePipe }, { type: ActivityPollingService }, { type: SessionStorageService }]; }, null);
|
|
28277
28299
|
})();
|
|
28278
28300
|
|
|
28279
28301
|
function CaseViewComponent_div_0_Template(rf, ctx) {
|