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