Skip to content

Commit

Permalink
show task failure logs as warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RiteshHMCTS committed Nov 22, 2024
1 parent 3913532 commit c092edf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## RELEASE NOTES

### Version 7.0.75-exui-1717-rc1
**EXUI-1717** add-task-failure-logs

### Version 7.0.75-exui-2462-rc1
**EXUI-2462** DynamicRadioList incorrectly selects the wrong radio button

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.0.75-exui-2462-rc",
"version": "7.0.75-exui-1717-rc1",
"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.0.75-exui-2462-rc",
"version": "7.0.75-exui-1717-rc1",
"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') {
// Note: Deliberate use of equality (==) and non-equality (!=) operators for null checks throughout, to
// handle both null and undefined values
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 c092edf

Please sign in to comment.