/** Core */ import { Injectable } from '@angular/core' ; import { UIAnalytics } from './uiAnalytics' ; import { ModalController } from '@ionic/angular' ; import { RoastingMachine } from '../classes/roasting-machine/roasting-machine' ; import { RoastingMachineAddComponent } from '../app/roasting-section/roasting-machine/roasting-machine-add/roasting-machine-add.component' ; import { RoastingMachineEditComponent } from '../app/roasting-section/roasting-machine/roasting-machine-edit/roasting-machine-edit.component' ; import { RoastingMachineDetailComponent } from '../app/roasting-section/roasting-machine/roasting-machine-detail/roasting-machine-detail.component' ; /**
 * Handles every helping functionalities
 */ @ Injectable ( { providedIn : 'root' } ) export class UIRoastingMachineHelper { constructor ( private readonly uiAnalytics , private readonly modalController ) { } public async addRoastingMachine ( ) { const modal = await this . modalController . create ( { component : RoastingMachineAddComponent , cssClass : 'popover-actions' , id : RoastingMachineAddComponent . COMPONENT_ID } ) ; await modal . present ( ) ; await modal . onWillDismiss ( ) ; } public async editRoastingMachine ( _roastingMachine ) { const modal = await this . modalController . create ( { component : RoastingMachineEditComponent , id : RoastingMachineEditComponent . COMPONENT_ID , componentProps : { roastingMachine : _roastingMachine } } ) ; await modal . present ( ) ; await modal . onWillDismiss ( ) ; } public async detailRoastingMachine ( _roastingMachine ) { const modal = await this . modalController . create ( { component : RoastingMachineDetailComponent , id : RoastingMachineDetailComponent . COMPONENT_ID , componentProps : { roastingMachine : _roastingMachine } } ) ; await modal . present ( ) ; await modal . onWillDismiss ( ) ; } }