mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
modalReviewd
This commit is contained in:
@@ -292,6 +292,11 @@ td.monthview-primary-with-event {
|
||||
|
||||
.segment {
|
||||
|
||||
}
|
||||
|
||||
div ion-raw > ul > li{
|
||||
font-size: 11pt;
|
||||
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* Timeline */
|
||||
|
||||
@@ -652,6 +652,9 @@ touchStart(card) {
|
||||
modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
imageSize(img){
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
@@ -106,6 +106,8 @@ export class NewPublicationPage implements OnInit {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 50,
|
||||
allowEditing: false,
|
||||
width:50,
|
||||
height: 50,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
|
||||
@@ -393,6 +395,8 @@ export class NewPublicationPage implements OnInit {
|
||||
async selectImage() {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 50,
|
||||
width:50,
|
||||
height:50,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
|
||||
@@ -15,6 +15,7 @@ import { PublicationDetailPageModule } from 'src/app/shared/publication/view-pub
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -29,6 +30,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
PublicationDetailPageModule,
|
||||
NewActionPageModule,
|
||||
EditActionPageModule,
|
||||
LazyLoadImageModule
|
||||
],
|
||||
declarations: [
|
||||
PublicationsPage,
|
||||
|
||||
@@ -10,6 +10,9 @@ import { ViewPublicationsPage } from './view-publications.page';
|
||||
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
@@ -18,6 +21,7 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
ViewPublicationsPageRoutingModule,
|
||||
HeaderPageModule,
|
||||
LazyLoadImageModule
|
||||
],
|
||||
exports: [ViewPublicationsPage],
|
||||
declarations: [ViewPublicationsPage]
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||
>
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image">
|
||||
<img [debug]= "true" [defaultImage] = "defaultImage" [lazyLoad]="publication.FileBase64" src="{{publication.FileBase64}}" alt="image">
|
||||
</div>
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
|
||||
@@ -13,6 +13,7 @@ import { PublicationDetailPage } from './publication-detail/publication-detail.p
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { forkJoin } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -25,7 +26,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: Publication[] = new Array();
|
||||
item: PublicationFolder;
|
||||
defaultImage = "https://governo.gov.ao/ao/noticias/presidente-joao-lourenco-ouviu-a-voz-da-igreja/"
|
||||
folderId: string;
|
||||
id: string;
|
||||
error: any;
|
||||
|
||||
publicationListStorage = PublicationListStorage
|
||||
@@ -66,9 +69,15 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
|
||||
if (typeof (this.id) == 'object') {
|
||||
this.id = this.id['ProcessId']
|
||||
}
|
||||
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
this.getPublications();
|
||||
this.testForkJoin()
|
||||
// this.getPublications();
|
||||
}, 1000);
|
||||
|
||||
this.backgroundservice.registerBackService('Online',() => {
|
||||
@@ -85,14 +94,20 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
// if (typeof (this.id == 'object') {
|
||||
// this.id = this.id['ProcessId']
|
||||
// }
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
// this.getPublications();
|
||||
|
||||
}
|
||||
|
||||
doRefresh = (event) => {
|
||||
setTimeout(() => {
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
// this.getPublications();
|
||||
event.target.complete();
|
||||
}, 3000);
|
||||
|
||||
@@ -119,7 +134,43 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}, 100);
|
||||
|
||||
}
|
||||
// goes to fork
|
||||
getPublicationsIds() {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
|
||||
this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
|
||||
|
||||
console.log(this.id)
|
||||
|
||||
this.publicationList = new Array();
|
||||
|
||||
res.forEach(element => {
|
||||
console.log('getPublications', element)
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
});
|
||||
this.sqliteservice.updateactions(this.id, JSON.stringify(this.publicationList));
|
||||
|
||||
// this.publicationListStorage.add(id, this.publicationList)
|
||||
// this.getpublication = this.publicationList;
|
||||
|
||||
// this.showLoader = false;
|
||||
// }, (error) => {
|
||||
|
||||
// if(error.status == '0') {
|
||||
// this.getFromDB();
|
||||
// }
|
||||
// if (error.status == '404') {
|
||||
// this.error = 'Sem publicações disponíveis!';
|
||||
// this.publicationList = [];
|
||||
// this.publicationListStorage.add(id, this.publicationList)
|
||||
// }
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
// goes to fork
|
||||
getPublications() {
|
||||
|
||||
this.showLoader = true;
|
||||
@@ -156,6 +207,16 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
testForkJoin(){
|
||||
forkJoin([
|
||||
this.getPublications(),
|
||||
this.getPublicationsIds()
|
||||
|
||||
]).subscribe(allResults =>{
|
||||
this.publicationList = allResults[2]
|
||||
})
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
|
||||
this.sqliteservice.getActionById(this.folderId).then((publications) => {
|
||||
|
||||
Reference in New Issue
Block a user