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