This commit is contained in:
ivan gomes
2021-11-30 10:23:46 +01:00
parent 9c70c23919
commit b2e55317b5
7 changed files with 22 additions and 110 deletions
+7 -16
View File
@@ -11,12 +11,7 @@ import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-pick
import { SqliteService } from 'src/app/services/sqlite.service'; import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
<<<<<<< HEAD
import { Directory, Filesystem } from '@capacitor/filesystem';
=======
import { StorageService } from 'src/app/services/storage.service'; import { StorageService } from 'src/app/services/storage.service';
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -48,22 +43,18 @@ export class AppComponent {
private screenOrientation: ScreenOrientation, private screenOrientation: ScreenOrientation,
private sqliteservice: SqliteService, private sqliteservice: SqliteService,
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
<<<<<<< HEAD
=======
private storageservice: StorageService private storageservice: StorageService
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
) { ) {
this.createCacheFolder() // this.createCacheFolder()
this.initializeApp(); this.initializeApp();
} }
async createCacheFolder(){ // async createCacheFolder(){
await Filesystem.mkdir({ // await Filesystem.mkdir({
directory: Directory.Cache, // directory: Directory.Cache,
path: `CACHED-IMG` // path: `CACHED-IMG`
}) // })
} // }
initializeApp() { initializeApp() {
this.platform.ready().then(() => { this.platform.ready().then(() => {
+1 -7
View File
@@ -65,14 +65,8 @@ import { MediaCapture } from '@ionic-native/media-capture/ngx';
import { Media } from '@ionic-native/media/ngx'; import { Media } from '@ionic-native/media/ngx';
import { StreamingMedia } from '@ionic-native/streaming-media/ngx'; import { StreamingMedia } from '@ionic-native/streaming-media/ngx';
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx'; import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
<<<<<<< HEAD
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
=======
import {NgxImageCompressService} from 'ngx-image-compress'; import {NgxImageCompressService} from 'ngx-image-compress';
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771 import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
/* import { FCM } from '@ionic-native/fcm/ngx'; /* import { FCM } from '@ionic-native/fcm/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
@@ -395,22 +395,13 @@ export class NewPublicationPage implements OnInit {
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl)); this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
} */ } */
async selectImage() { async selectImage() {
const image = await Camera.getPhoto({ const image = await Camera.getPhoto({
<<<<<<< HEAD
quality: 50,
width:50,
height:50,
=======
quality: 20, quality: 20,
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
allowEditing: false, allowEditing: false,
resultType: CameraResultType.Uri, resultType: CameraResultType.Uri,
source: CameraSource.Camera // Camera, Photos or Prompt! source: CameraSource.Camera // Camera, Photos or Prompt!
}); });
if (image) { if (image) {
this.saveImage(image) this.saveImage(image)
} }
@@ -39,11 +39,7 @@
(click)="goToPublicationDetail(publication.DocumentId)" (click)="goToPublicationDetail(publication.DocumentId)"
> >
<div *ngIf="publication.FileBase64.length > 30" class="post-img"> <div *ngIf="publication.FileBase64.length > 30" class="post-img">
<<<<<<< HEAD
<img [debug]= "true" [defaultImage] = "defaultImage" [lazyLoad]="publication.FileBase64" src="{{publication.FileBase64}}" alt="image">
=======
<ion-img src="{{publication.FileBase64}}" alt="image"></ion-img> <ion-img src="{{publication.FileBase64}}" alt="image"></ion-img>
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
</div> </div>
<div *ngIf="publication.FileBase64.length < 30" class="post-img"> <div *ngIf="publication.FileBase64.length < 30" class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image"> <img src="/assets/icon/icon-no-image.svg" alt="image">
@@ -69,22 +69,10 @@ export class ViewPublicationsPage implements OnInit {
this.folderId = this.folderId['ProcessId'] this.folderId = this.folderId['ProcessId']
} }
<<<<<<< HEAD
if (typeof (this.id) == 'object') {
this.id = this.id['ProcessId']
}
this.getPublicationDetail();
setTimeout(() => {
this.testForkJoin()
// this.getPublications();
=======
this.getPublicationsIds() this.getPublicationsIds()
this.getPublicationDetail(); this.getPublicationDetail();
setTimeout(() => { setTimeout(() => {
this.getPublicationsIds(); this.getPublicationsIds();
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
}, 1000); }, 1000);
this.backgroundservice.registerBackService('Online', () => { this.backgroundservice.registerBackService('Online', () => {
@@ -106,23 +94,14 @@ export class ViewPublicationsPage implements OnInit {
// } // }
this.testForkJoin() this.testForkJoin()
this.getPublicationDetail(); this.getPublicationDetail();
<<<<<<< HEAD
// this.getPublications();
=======
this.getPublicationsIds(); this.getPublicationsIds();
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
} }
doRefresh = (event) => { doRefresh = (event) => {
setTimeout(() => { setTimeout(() => {
this.testForkJoin() this.testForkJoin()
this.getPublicationDetail(); this.getPublicationDetail();
<<<<<<< HEAD
// this.getPublications();
=======
this.getPublicationsIds(); this.getPublicationsIds();
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
event.target.complete(); event.target.complete();
}, 3000); }, 3000);
@@ -161,51 +140,24 @@ export class ViewPublicationsPage implements OnInit {
this.publicationList = new Array(); this.publicationList = new Array();
<<<<<<< HEAD // getPublicationsIds() {
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.showLoader = true;
// this.getpublication = this.publicationList; // const folderId = this.folderId
// this.showLoader = false; // this.publications.GetPublicationsID(this.folderId).subscribe(res => {
// }, (error) => {
// if(error.status == '0') { // console.log('publications ids', res)
// this.getFromDB(); // this.publicationList = new Array();
// }
// 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
=======
getPublicationsIds() {
this.showLoader = true; // for(let i of res) {
const folderId = this.folderId // this.publications.GetPublicationById(i).subscribe(ress => {
// console.log('publications by ids', ress)
this.publications.GetPublicationsID(this.folderId).subscribe(res => { // let item: Publication = this.publicationPipe.itemList(ress)
// console.log('publications by ids 2', item)
console.log('publications ids', res) // this.publicationList.push(item);
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);
})
}
/* res.forEach(element => { /* res.forEach(element => {
console.log('publications elements', element) console.log('publications elements', element)
@@ -239,7 +191,6 @@ export class ViewPublicationsPage implements OnInit {
}); });
} }
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
getPublications() { getPublications() {
this.showLoader = true; this.showLoader = true;
-4
View File
@@ -84,9 +84,6 @@ export class PublicationsService {
return this.http.delete<any>(`${geturl}`, options); return this.http.delete<any>(`${geturl}`, options);
} }
<<<<<<< HEAD
//this worker obervable goes to ForkJoin as a second api call
=======
GetPublicationsID(folder:any) { GetPublicationsID(folder:any) {
const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids'; const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids';
let params = new HttpParams(); let params = new HttpParams();
@@ -101,7 +98,6 @@ export class PublicationsService {
} }
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
GetPublications(id:any){ GetPublications(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+ id +'/posts'; const geturl = environment.apiURL + 'presidentialActions/'+ id +'/posts';
let params = new HttpParams(); let params = new HttpParams();
-7
View File
@@ -1340,19 +1340,12 @@ ngx-mat-datetime-content{
.ldio-rpinwye8j0b div { box-sizing: content-box; } .ldio-rpinwye8j0b div { box-sizing: content-box; }
.transparent-modal { .transparent-modal {
<<<<<<< HEAD
--background: #f1eaeae7; --background: #f1eaeae7;
--margin: 0; --margin: 0;
--padding: 0; --padding: 0;
ion-content { ion-content {
--background:#f1f0ebe7; --background:#f1f0ebe7;
=======
--background: #000000;
ion-content {
--background:#2e2121;
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
} }
} }