Add TaskProgressEvent
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-08-05 20:05:44 +02:00
parent ebe435027f
commit d7ca1512bd
2 changed files with 14 additions and 2 deletions

View File

@ -31,7 +31,8 @@ export const ITEMDELETEDEVENT = '[AppCommon] ItemDeletedEvent';
export const TASKSTARTEVENT = '[AppCommon] TaskStartEvent';
export const TASKENDEVENT = '[AppCommon] TaskEndEvent';
export const TASKERRORTEVENT = '[AppCommon] TaskErrorEvent';
export const TASKERROREVENT = '[AppCommon] TaskErrorEvent';
export const TASKPROGRESSEVENT = '[AppCommon] TaskProgressEvent';
export const DEVICEUPDATEEVENT = '[AppCommon] DeviceUpdateEvent';
@ -195,7 +196,13 @@ export class TaskEndEvent implements Action {
}
export class TaskErrorEvent implements Action {
readonly type = TASKERRORTEVENT;
readonly type = TASKERROREVENT;
constructor(public itemCode: string, public attributes: any) { }
}
export class TaskProgressEvent implements Action {
readonly type = TASKPROGRESSEVENT;
constructor(public itemCode: string, public attributes: any) { }
}
@ -304,6 +311,7 @@ export type Actions = OpenModal
| TaskStartEvent
| TaskEndEvent
| TaskErrorEvent
| TaskProgressEvent
| DeviceUpdateEvent
| ToggleMenu
| SetMenuVisible

View File

@ -91,6 +91,10 @@ export class AppComponent implements OnInit, OnDestroy {
action = new commonActions.TaskErrorEvent(event.itemCode, event.attributes);
break;
}
case "taskProgress": {
action = new commonActions.TaskProgressEvent(event.itemCode, event.attributes);
break;
}
case "deviceUpdate": {
action = new commonActions.DeviceUpdateEvent(event.itemCode, event.attributes);
break;