Skip to content

Commit

Permalink
exui-1717-add WA related logs (#1843)
Browse files Browse the repository at this point in the history
* add WA related logs

* version updated

* version updated
  • Loading branch information
RiteshHMCTS authored Jan 22, 2025
1 parent ead614d commit 2174080
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## RELEASE NOTES

### Version 7.1.29
**EXUI-1717** Add logs for auto task completion failure

### Version 7.1.28
**EXUI-2698** User is able to upload restricted file type to Civil case

### Version 7.1.27
**EXUI-2672** Incorrect Timestamp in CaseFileView

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.1.28",
"version": "7.1.29",
"engines": {
"node": ">=18.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.1.28",
"version": "7.1.29",
"engines": {
"node": ">=18.19.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ export class CaseEditComponent implements OnInit, OnDestroy {
const caseField: CaseField = caseFieldsLookup[key];
// If caseField.hidden is NOT truthy and also NOT equal to false, then it must be null/undefined (remember that
// both null and undefined are equal to *neither false nor true*)
if (caseField && caseField.retain_hidden_value &&
(caseField.hidden || (caseField.hidden !== false && parentField && parentField.hidden))) {
if (caseField?.retain_hidden_value &&
(caseField?.hidden || (caseField?.hidden !== false && parentField?.hidden))) {
if (caseField.field_type.type === 'Complex') {
this.handleComplexField(caseField, formGroup, key, rawFormValueData);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class EventCompletionStateMachineService {
const assignNeeded = context.sessionStorageService.getItem('assignNeeded');
context.workAllocationService.getTask(context.task.id).subscribe(
taskResponse => {
if (taskResponse && taskResponse.task && taskResponse.task.task_state) {
if (taskResponse?.task?.task_state) {
switch (taskResponse.task.task_state.toUpperCase()) {
case TaskState.Unassigned:
// Task unassigned
Expand Down Expand Up @@ -115,6 +115,12 @@ export class EventCompletionStateMachineService {
state.trigger(EventCompletionStates.CompleteEventAndTask);
break;
}
} else if (!taskResponse?.task) {
context.alertService.setPreserveAlerts(true);
context.alertService.warning({ phrase: 'Task statecheck : no task available for completion', replacements: {} });
} else {
context.alertService.setPreserveAlerts(true);
context.alertService.warning({ phrase: 'Task statecheck : no task state available for completion', replacements: {} });
}
},
error => {
Expand All @@ -140,6 +146,8 @@ export class EventCompletionStateMachineService {
// just set event can be completed
context.component.eventCanBeCompleted.emit(true);
} else {
context.alertService.setPreserveAlerts(true);
context.alertService.warning({phrase: 'CompleteEventAndTask : no task available for completion', replacements: {}});
// Emit event cannot be completed event
context.component.eventCanBeCompleted.emit(false);
}
Expand All @@ -161,6 +169,8 @@ export class EventCompletionStateMachineService {
context.sessionStorageService.setItem('assignNeeded', 'true');
context.component.eventCanBeCompleted.emit(true);
} else {
context.alertService.setPreserveAlerts(true);
context.alertService.warning({phrase: 'Unassigned task : no task available for completion', replacements: {}});
// Emit event cannot be completed event
context.component.eventCanBeCompleted.emit(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export class WorkAllocationService {
*/
public completeTask(taskId: string, eventName?: string): Observable<any> {
if (!this.isWAEnabled()) {
this.alertService.setPreserveAlerts(true);
this.alertService.warning({ phrase:'completeTask: Work Allocation is not enabled, so the task could not be completed. Please complete the task associated with the case manually.'});
return of(null);
}
this.appConfig.logMessage(`completeTask: completing ${taskId}`);
Expand All @@ -129,6 +131,8 @@ export class WorkAllocationService {
*/
public assignAndCompleteTask(taskId: string, eventName?: string): Observable<any> {
if (!this.isWAEnabled()) {
this.alertService.setPreserveAlerts(true);
this.alertService.warning({ phrase:'assignAndCompleteTask: Work Allocation is not enabled, so the task could not be completed. Please complete the task associated with the case manually.'});
return of(null);
}
this.appConfig.logMessage(`assignAndCompleteTask: completing ${taskId}`);
Expand Down

0 comments on commit 2174080

Please sign in to comment.