This commit is contained in:
tiago.kayaya
2021-04-05 15:02:57 +01:00
parent e0c5fe2e57
commit ade02d2d79
3 changed files with 12 additions and 6 deletions
@@ -56,7 +56,7 @@
<h3>Documentos Anexados</h3>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<ion-label *ngFor="let attach of loadedAttachments"
(click)="viewDocument()">
(click)="viewDocument(attach.SourceId)">
<p class="attach-title-item">{{attach.SourceName}}</p>
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yy' }}</span></p>
</ion-label>
@@ -7,6 +7,7 @@ import { EventsService } from 'src/app/services/events.service';
import { Event } from 'src/app/models/event.model';
import { EditEventPage } from 'src/app/pages/agenda/edit-event/edit-event.page';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ProcessesService } from 'src/app/services/processes.service';
@Component({
selector: 'app-view-event',
@@ -42,6 +43,7 @@ export class ViewEventPage implements OnInit {
private attachmentsService: AttachmentsService,
public alertController: AlertController,
private iab: InAppBrowser,
private processes: ProcessesService,
)
{
this.isEventEdited = false;
@@ -109,10 +111,15 @@ export class ViewEventPage implements OnInit {
event: this.loadedEvent
})
}
viewDocument(){
const url: string = this.loadedAttachments.DocumentURL.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
viewDocument(sourceId){
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
}