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 { BackgroundService } from 'src/app/services/background.service';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
<<<<<<< HEAD
import { Directory, Filesystem } from '@capacitor/filesystem';
=======
import { StorageService } from 'src/app/services/storage.service';
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -48,22 +43,18 @@ export class AppComponent {
private screenOrientation: ScreenOrientation,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
<<<<<<< HEAD
=======
private storageservice: StorageService
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
) {
this.createCacheFolder()
// this.createCacheFolder()
this.initializeApp();
}
async createCacheFolder(){
await Filesystem.mkdir({
directory: Directory.Cache,
path: `CACHED-IMG`
})
}
// async createCacheFolder(){
// await Filesystem.mkdir({
// directory: Directory.Cache,
// path: `CACHED-IMG`
// })
// }
initializeApp() {
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 { StreamingMedia } from '@ionic-native/streaming-media/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';
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
/* import { FCM } from '@ionic-native/fcm/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));
} */
async selectImage() {
const image = await Camera.getPhoto({
<<<<<<< HEAD
quality: 50,
width:50,
height:50,
=======
quality: 20,
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
allowEditing: false,
resultType: CameraResultType.Uri,
source: CameraSource.Camera // Camera, Photos or Prompt!
});
if (image) {
this.saveImage(image)
}
@@ -39,11 +39,7 @@
(click)="goToPublicationDetail(publication.DocumentId)"
>
<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>
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
</div>
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image">
@@ -69,22 +69,10 @@ export class ViewPublicationsPage implements OnInit {
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.getPublicationDetail();
setTimeout(() => {
this.getPublicationsIds();
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
}, 1000);
this.backgroundservice.registerBackService('Online', () => {
@@ -106,23 +94,14 @@ export class ViewPublicationsPage implements OnInit {
// }
this.testForkJoin()
this.getPublicationDetail();
<<<<<<< HEAD
// this.getPublications();
=======
this.getPublicationsIds();
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
}
doRefresh = (event) => {
setTimeout(() => {
this.testForkJoin()
this.getPublicationDetail();
<<<<<<< HEAD
// this.getPublications();
=======
this.getPublicationsIds();
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
event.target.complete();
}, 3000);
@@ -161,51 +140,24 @@ export class ViewPublicationsPage implements OnInit {
this.publicationList = new Array();
<<<<<<< HEAD
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));
// getPublicationsIds() {
// this.publicationListStorage.add(id, this.publicationList)
// this.getpublication = this.publicationList;
// this.showLoader = true;
// const folderId = this.folderId
// this.showLoader = false;
// }, (error) => {
// this.publications.GetPublicationsID(this.folderId).subscribe(res => {
// 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
=======
getPublicationsIds() {
// console.log('publications ids', res)
// this.publicationList = new Array();
this.showLoader = true;
const folderId = this.folderId
this.publications.GetPublicationsID(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)
@@ -239,7 +191,6 @@ export class ViewPublicationsPage implements OnInit {
});
}
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
getPublications() {
this.showLoader = true;
-4
View File
@@ -84,9 +84,6 @@ export class PublicationsService {
return this.http.delete<any>(`${geturl}`, options);
}
<<<<<<< HEAD
//this worker obervable goes to ForkJoin as a second api call
=======
GetPublicationsID(folder:any) {
const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids';
let params = new HttpParams();
@@ -101,7 +98,6 @@ export class PublicationsService {
}
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
GetPublications(id:any){
const geturl = environment.apiURL + 'presidentialActions/'+ id +'/posts';
let params = new HttpParams();
-7
View File
@@ -1340,19 +1340,12 @@ ngx-mat-datetime-content{
.ldio-rpinwye8j0b div { box-sizing: content-box; }
.transparent-modal {
<<<<<<< HEAD
--background: #f1eaeae7;
--margin: 0;
--padding: 0;
ion-content {
--background:#f1f0ebe7;
=======
--background: #000000;
ion-content {
--background:#2e2121;
>>>>>>> 6a912b740d97159664c5fe5dff07ac378b028771
}
}