import { Component , OnInit } from '@angular/core' ; import { ModalController , NavParams } from '@ionic/angular' ; import { UIHelper } from '../../../../services/uiHelper' ; import { RoastingMachine } from '../../../../classes/roasting-machine/roasting-machine' ; import { IRoastingMachine } from '../../../../interfaces/roasting-machine/iRoastingMachine' ; import { ROASTING_MACHINE_ACTION } from '../../../../enums/roasting-machine/roastingMachineAction' ; @ Component ( { selector : 'app-roasting-machine-popover-actions' , templateUrl : './roasting-machine-popover-actions.component.html' , styleUrls : [ './roasting-machine-popover-actions.component.scss' ] , } ) export class RoastingMachinePopoverActionsComponent implements OnInit { public static COMPONENT_ID : string = 'roasting-machine-popover-actions' ; public data : RoastingMachine = new RoastingMachine ( ) ; constructor ( private readonly modalController , private readonly navParams , private readonly uiHelper ) { const roastingMachine = this . uiHelper . copyData ( this . navParams . get ( 'roastingMachine' ) ) ; this . data . initializeByObject ( roastingMachine ) ; } public ionViewDidEnter ( ) { } public ngOnInit ( ) { } public hasPhotos ( ) { return this . data . attachments . length > 0 ; } public getStaticActions ( ) { return ROASTING_MACHINE_ACTION ; } public async choose ( _type ) { this . modalController . dismiss ( undefined , _type , RoastingMachinePopoverActionsComponent . COMPONENT_ID ) ; } public async dismiss ( ) { this . modalController . dismiss ( undefined , undefined , RoastingMachinePopoverActionsComponent . COMPONENT_ID ) ; } }