Retified attachments call list at event-details

This commit is contained in:
Tiago Kayaya
2020-09-08 09:40:25 +01:00
parent 4689b71b3a
commit 70833168f7
4 changed files with 35 additions and 45 deletions
@@ -137,9 +137,9 @@
</div>
</div>
<div *ngIf="loadedEventAttachments.length > 1">
<!-- <ion-button class="see-more-button" fill="none" shape="round" [routerLink]="['/home/attachments', loadedEvent.EventId]">
<ion-button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
<ion-label color="secondary">Ver mais...</ion-label>
</ion-button> -->
</ion-button>
</div>
</div>
<!-- Skeleton Attachment -->
@@ -12,6 +12,7 @@ import { Attachment } from 'src/app/models/attachment.model';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { AttachmentsPage } from '../attachments/attachments.page';
@Component({
@@ -208,4 +209,27 @@ export class EventDetailPage implements OnInit {
navigateTo(ev){
this.route.navigate(['/home/events',ev]);
}
async openAttachments(){
const modal = await this.modalCtrl.create({
component: AttachmentsPage,
componentProps: {
eventId: this.pageId,
attachments: this.loadedEventAttachments
},
cssClass: 'attachments',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}
});
}
}