improvedUiTasks

This commit is contained in:
ivan gomes
2021-11-30 17:56:56 +01:00
parent 49c0aeae95
commit 40e0aa0d39
5 changed files with 79 additions and 48 deletions
@@ -40,7 +40,7 @@
</ion-button>
</ion-col>
<ion-col size="3" class="ion-text-center">
<ion-button (click)="getIconGallery()" fill="clear" color="light">
<ion-button (click)="redirPage()" fill="clear" color="light">
<ion-icon src="assets/icon/chat/Ellipselast.svg" ></ion-icon>
@@ -48,12 +48,16 @@
</ion-button>
</ion-col>
<ion-col size="3" class="ion-text-center">
<ion-button (click)="getIconShare()" fill="clear" color="light">
<ion-icon src="assets/icon/chat/Ellipse 9.svg" ></ion-icon>
</ion-button>
</ion-col>
<!-- <ion-col size="3" class="ion-text-center">
<ion-button (click)="zoom(true)" fill="clear" color="light">
@@ -4,6 +4,8 @@ import { ImageCroppedEvent } from 'ngx-image-cropper';
import { PublicationsService } from 'src/app/services/publications.service';
import { GroupIconsPage } from '../group-icons/group-icons.page';
import { Share } from '@capacitor/share';
import { Router } from '@angular/router';
import { Directory, Filesystem } from '@capacitor/filesystem';
@Component({
selector: 'app-preview-camera',
@@ -14,6 +16,7 @@ export class PreviewCameraPage implements OnInit {
constructor( private modalController: ModalController,
private navParams:NavParams,
public router: Router,
private publicService: PublicationsService) { }
@@ -94,16 +97,24 @@ async getIconGallery(){
}
deleteImage(){
window.onload = function(){
const delmage = document.getElementById("img")
delmage.onclick = function(){
return window.localStorage.removeItem("img")
}
document.addEventListener('DOMContentLoaded', ()=>{
document.querySelector('img').addEventListener('click',removeImage)
})
function removeImage(ev){
console.log(ev.target, ev.currentTarget)
let img = ev.currentTarget
let src = ev.target.closest('.img')
src?.parentElement.removeChild(src)
}
}
}
async getIconShare(){
await Share.share({
title: 'See cool stuff',
text: 'Really awesome thing you need to see right meow',
@@ -113,8 +124,25 @@ async getIconShare(){
}
redirPage(){
this.router.navigateByUrl('/chat')
}
async deleteFile(entry){
if(entry.isFile){
await Filesystem.deleteFile({
directory: Directory.Documents,
path: this.image.src + '/' + entry.name
})
}else{
await Filesystem.rmdir({
directory: Directory.Documents,
path: this.image.src + '/' + entry.name,
recursive:true //remove all file as well
})
}
}
}
+11 -11
View File
@@ -24,7 +24,7 @@ import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
import { Haptics, ImpactStyle } from '@capacitor/haptics';
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
// import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { Share } from '@capacitor/share';
const IMAGE_DIR = 'stored-images';
@@ -91,7 +91,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private processes: ProcessesService,
public ThemeService: ThemeService,
private changeDetectorRef: ChangeDetectorRef,
private socialSharing: SocialSharing
// private socialSharing: SocialSharing
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId');
@@ -675,15 +675,15 @@ getPicture(img){
}
async ShareEmail(msg){
// Check if sharing via email is supported
await Share.share({
title: msg.u.username,
text: msg._updatedAt,
url: msg.attachments[0].image_url,
dialogTitle: 'Share with buddies',
});
}
// async ShareEmail(msg){
// // Check if sharing via email is supported
// await Share.share({
// title: msg.u.username,
// text: msg._updatedAt,
// url: msg.attachments[0].image_url,
// dialogTitle: 'Share with buddies',
// });
// }
}
@@ -68,8 +68,7 @@ export class ViewPublicationsPage implements OnInit {
if (typeof (this.folderId) == 'object') {
this.folderId = this.folderId['ProcessId']
}
this.getPublicationsIds()
this.testForkJoin()
this.getPublicationDetail();
setTimeout(() => {
this.getPublicationsIds();
@@ -77,7 +76,7 @@ export class ViewPublicationsPage implements OnInit {
this.backgroundservice.registerBackService('Online', () => {
this.getPublicationDetail();
this.getPublicationsIds();
this.testForkJoin()
})
@@ -94,14 +93,14 @@ export class ViewPublicationsPage implements OnInit {
// }
this.testForkJoin()
this.getPublicationDetail();
this.getPublicationsIds();
// this.getPublicationsIds();
}
doRefresh = (event) => {
setTimeout(() => {
this.testForkJoin()
this.getPublicationDetail();
this.getPublicationsIds();
// this.getPublicationsIds();
event.target.complete();
}, 3000);
@@ -129,35 +128,35 @@ export class ViewPublicationsPage implements OnInit {
}
// 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();
// getPublicationsIds() {
// this.showLoader = true;
// const folderId = this.folderId
// this.publications.GetPublicationsID(this.folderId).subscribe(res => {
// this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
// console.log(this.id)
// 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);
// })
// }
getPublicationsIds() {
this.showLoader = true;
const folderId = this.folderId
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);
})
}
/* res.forEach(element => {
console.log('publications elements', element)
+1 -1
View File
@@ -84,7 +84,7 @@ export class PublicationsService {
return this.http.delete<any>(`${geturl}`, options);
}
GetPublicationsID(folder:any) {
GetPublicationsImages(folder:any) {
const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids';
let params = new HttpParams();