changes no publications

This commit is contained in:
Eudes Inácio
2022-01-28 19:02:44 +01:00
parent f2d649b9b2
commit dfb1e169d8
7 changed files with 74 additions and 28 deletions
@@ -38,11 +38,13 @@
*ngFor="let publication of getpublication"
(click)="goToPublicationDetail(publication.DocumentId)"
>
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
<ion-img src="{{publication.FileBase64}}" alt="image"></ion-img>
</div>
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image">
<div *ngIf="publication.FileBase64 != null">
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
<img src="{{'data:image/jpeg;base64,' + publication.FileBase64}}" alt="image">
</div>
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image">
</div>
</div>
<div class="post-content px-20">
<div class="post-title-time">
@@ -68,7 +68,7 @@ export class ViewPublicationsPage implements OnInit {
if (typeof (this.folderId) == 'object') {
this.folderId = this.folderId['ProcessId']
}
this.testForkJoin()
//this.testForkJoin()
this.getPublicationDetail();
setTimeout(() => {
this.getPublicationsIds();
@@ -76,7 +76,7 @@ export class ViewPublicationsPage implements OnInit {
this.backgroundservice.registerBackService('Online', () => {
this.getPublicationDetail();
this.testForkJoin()
//this.testForkJoin()
})
@@ -91,16 +91,16 @@ export class ViewPublicationsPage implements OnInit {
// if (typeof (this.id == 'object') {
// this.id = this.id['ProcessId']
// }
this.testForkJoin()
//this.testForkJoin()
this.getPublicationDetail();
// this.getPublicationsIds();
}
doRefresh = (event) => {
setTimeout(() => {
this.testForkJoin()
//this.testForkJoin()
this.getPublicationDetail();
// this.getPublicationsIds();
this.getPublicationsIds();
event.target.complete();
}, 3000);
@@ -116,13 +116,13 @@ export class ViewPublicationsPage implements OnInit {
}
getPublicationDetail() {
this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
this.publications.GetPresidentialAction(this.folderId).subscribe(res => {
console.log(res);
this.item = res;
});
}
// goes to fork
// goes to fork
// getPublicationsIds() {
// this.showLoader = true;
@@ -138,20 +138,20 @@ export class ViewPublicationsPage implements OnInit {
this.showLoader = true;
const folderId = this.folderId
this.getFromDB()
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
console.log('publications ids', res)
this.publicationList = new Array();
/* for(let i of res) {
this.publications.GetPublicationById(i).subscribe(ress => {
console.log('publications by ids', ress)
let item: Publication = this.publicationPipe.itemList(ress)
console.log('publications by ids 2', item)
this.publicationList.push(item);
})
} */
/* for(let i of res) {
this.publications.GetPublicationById(i).subscribe(ress => {
console.log('publications by ids', ress)
let item: Publication = this.publicationPipe.itemList(ress)
console.log('publications by ids 2', item)
this.publicationList.push(item);
})
} */
res.forEach(element => {
console.log('publications elements', element)
@@ -168,7 +168,6 @@ export class ViewPublicationsPage implements OnInit {
this.publicationListStorage.add(folderId, this.publicationList)
this.getpublication = this.publicationList;
this.showLoader = false;
/* this.publicationList = new Array();
@@ -189,7 +188,7 @@ export class ViewPublicationsPage implements OnInit {
this.showLoader = true;
const folderId = this.folderId
this.getFromDB();
this.publications.GetPublications(this.folderId).subscribe(res => {
console.log(this.folderId)
@@ -223,13 +222,13 @@ export class ViewPublicationsPage implements OnInit {
});
}
testForkJoin(){
testForkJoin() {
forkJoin([
this.getPublicationsIds(),
this.getPublications(),
]).subscribe(allResults =>{
]).subscribe(allResults => {
this.publicationList = allResults[2]
})
}