diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 7996ac0ee..257096e4b 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -44,7 +44,7 @@

{{viagem.Description}}

{{viagem.Detail}}

-
+
@@ -60,7 +60,7 @@

{{evento.Description}}

-
+
diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index 80e4c2259..51eddcc14 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -157,6 +157,7 @@ ion-toolbar{ } .item-options{ + width: 25px; font-size: 20px; } @@ -174,4 +175,7 @@ ion-toolbar{ .aside-left{ width: 35%; } + .item-options{ + display: block !important; + } } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index d678eb14f..877c2aefd 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -277,20 +277,41 @@ export class PublicationsPage implements OnInit { } } - async openOptions(taskAction?: any) { - - const popover = await this.modalController.create({ + async openOptions(id?: string) { + const enterAnimation = (baseEl: any) => { + const backdropAnimation = this.animationController.create() + .addElement(baseEl.querySelector('ion-backdrop')!) + .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); + + const wrapperAnimation = this.animationController.create() + .addElement(baseEl.querySelector('.modal-wrapper')!) + .keyframes([ + { offset: 0, opacity: '1', right: '-100%' }, + { offset: 1, opacity: '1', right: '0px' } + ]); + + return this.animationController.create() + .addElement(baseEl) + .easing('ease-out') + .duration(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ + enterAnimation, + leaveAnimation, component: ActionsOptionsPage, - cssClass: 'model aside-modal', + cssClass: 'model profile-modal search-submodal', componentProps: { - /* task: this.task, - fulltask: this.fulltask, */ - taskAction: taskAction, - showEnviarPendentes: false + id: id, }, //translucent: true }); - return await popover.present(); + return await modal.present(); } } \ No newline at end of file diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index 84f2e7483..989b3e1eb 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -58,15 +58,11 @@ export class PublicationsService { }); } - DeletePublicationFolderById(id:any){ - const geturl = environment.apiURL + 'presidentialActions'; - let params = new HttpParams(); - - params = params.set("id", id); - + DeletePresidentialAction(id:any){ + const geturl = environment.apiURL + 'presidentialActions/'+id; + let options = { headers: this.headers, - params: params }; return this.http.delete(`${geturl}`, options); } diff --git a/src/app/shared/popover/actions-options/actions-options.page.ts b/src/app/shared/popover/actions-options/actions-options.page.ts index 0bef4bc5e..95f8a71b3 100644 --- a/src/app/shared/popover/actions-options/actions-options.page.ts +++ b/src/app/shared/popover/actions-options/actions-options.page.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, PopoverController } from '@ionic/angular'; +import { ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { PublicationsService } from 'src/app/services/publications.service'; @Component({ selector: 'app-actions-options', @@ -8,12 +9,20 @@ import { ModalController, PopoverController } from '@ionic/angular'; }) export class ActionsOptionsPage implements OnInit { + id:string; + constructor( private popoverController: PopoverController, private modalController: ModalController, - ) { } + private navParams: NavParams, + private publicationsService: PublicationsService, + ) { + this.id = this.navParams.get('id'); + } ngOnInit() { + console.log(this.id); + } close () { @@ -23,7 +32,11 @@ export class ActionsOptionsPage implements OnInit { editAction(){} deleteAction(){ + console.log('HEY'); + console.log(this.id); + this.publicationsService.DeletePresidentialAction(this.id).toPromise(); + this.close(); } }