import { Component , OnInit } from '@angular/core' ; import { ModalController , NavParams } from '@ionic/angular' ; import { UIHelper } from '../../../services/uiHelper' ; import { IMill } from '../../../interfaces/mill/iMill' ; import { MILL_ACTION } from '../../../enums/mills/millActions' ; import { Mill } from '../../../classes/mill/mill' ; @ Component ( { selector : 'mill-popover-actions' , templateUrl : './mill-popover-actions.component.html' , styleUrls : [ './mill-popover-actions.component.scss' ] , } ) export class MillPopoverActionsComponent implements OnInit { public static COMPONENT_ID = 'mill-popover-actions' ; public data : Mill = new Mill ( ) ; constructor ( private readonly modalController , private readonly navParams , private readonly uiHelper ) { const mill = this . uiHelper . copyData ( this . navParams . get ( 'mill' ) ) ; this . data . initializeByObject ( mill ) ; } public ionViewDidEnter ( ) { } public ngOnInit ( ) { } public hasPhotos ( ) { return this . data . attachments . length > 0 ; } public getStaticActions ( ) { return MILL_ACTION ; } public async choose ( _type ) { this . modalController . dismiss ( undefined , _type , MillPopoverActionsComponent . COMPONENT_ID ) ; } public async dismiss ( ) { this . modalController . dismiss ( undefined , undefined , MillPopoverActionsComponent . COMPONENT_ID ) ; } }