Working on attachments

This commit is contained in:
Tiago Kayaya
2020-09-07 15:50:36 +01:00
parent 74ce37adf3
commit cc88726c03
3 changed files with 18 additions and 9 deletions
@@ -43,6 +43,7 @@ export class AttachmentsPage implements OnInit {
}
navigateBack(){
console.log(this.pageId);
this.route.navigate(['/home/events',this.pageId]);
}
@@ -126,7 +126,7 @@
<div *ngIf="j<2">
<ion-list *ngIf="loadedEvent.HasAttachments">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-item lines="none">
<ion-item lines="none" (click)="viewDocument(att.Link)">
<ion-icon name="attach" slot="start"></ion-icon>
<ion-label>
<p>{{ att.Description }}</p>
@@ -137,7 +137,7 @@
</div>
</div>
<div *ngIf="loadedEventAttachments.length > 1">
<ion-button class="see-more-button" fill="none" shape="round" (click)="showAlert()">
<ion-button class="see-more-button" fill="none" shape="round" [routerLink]="['/home/attachments', loadedEvent.EventId]">
<ion-label color="secondary">Ver mais...</ion-label>
</ion-button>
</div>
@@ -11,6 +11,7 @@ import { AlertService } from 'src/app/services/alert.service';
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';
@Component({
@@ -31,11 +32,15 @@ export class EventDetailPage implements OnInit {
minDate: Date;
constructor(public formBuilder: FormBuilder, public alertController: AlertController,
private router: Router, private activatedRoute: ActivatedRoute,
private eventsService: EventsService, private modalCtrl: ModalController,
constructor(public formBuilder: FormBuilder,
public alertController: AlertController,
private router: Router,
private activatedRoute: ActivatedRoute,
private eventsService: EventsService,
private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService) {
private attachamentsService: AttachmentsService,
private iab: InAppBrowser) {
this.loadedEvent = new Event();
this.loadedEvent.Body = new EventBody();
}
@@ -180,9 +185,12 @@ export class EventDetailPage implements OnInit {
this.loadedEventAttachments = attachments;
});
}
async viewDocument(documenturl:string)
{
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
}
back()
{