mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'develop' into bugfix/chat-create-event
This commit is contained in:
@@ -27,13 +27,11 @@ import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-vi
|
||||
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Howl } from 'howler';
|
||||
import { runInThisContext } from 'vm';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
|
||||
|
||||
@@ -49,8 +47,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
@ViewChild('message-item') messageContainer: ElementRef;
|
||||
|
||||
loggedUser: any;
|
||||
|
||||
messages: any;
|
||||
dm: any;
|
||||
userPresence = '';
|
||||
@@ -126,7 +122,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private platform: Platform,
|
||||
private fileOpener: FileOpener,
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
|
||||
this.checkAudioPermission()
|
||||
}
|
||||
@@ -448,15 +443,15 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
else {
|
||||
|
||||
var str = msg.attachments[0].image_url;
|
||||
str = str.substring(1, ((str.length) - 1));
|
||||
// var str = msg.attachments[0].image_url;
|
||||
// str = str.substring(1, ((str.length) - 1));
|
||||
|
||||
const encodedData = btoa(str);
|
||||
// const encodedData = btoa(str);
|
||||
|
||||
let file = this.base64toBlob(encodedData, 'application/pdf')
|
||||
let fileURL = URL.createObjectURL(file)
|
||||
// let file = this.base64toBlob(encodedData, 'application/pdf')
|
||||
// let fileURL = URL.createObjectURL(file)
|
||||
|
||||
window.open(fileURL);
|
||||
// window.open(fileURL);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1028,7 +1023,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||
this.downloadFileMsg(msg)
|
||||
//this.testDownlod(msg)
|
||||
|
||||
} else {
|
||||
var str = msg.attachments[0].image_url;
|
||||
@@ -1075,12 +1069,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
}
|
||||
|
||||
|
||||
testEditMessage(msg: MessageService) {
|
||||
// msg.receptorReceive()
|
||||
// alert('cool!')
|
||||
}
|
||||
|
||||
start(track) {
|
||||
if(this.audioPlay){
|
||||
this.audioPlay.stop();
|
||||
|
||||
@@ -59,7 +59,6 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -76,9 +75,8 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
}
|
||||
|
||||
close(){
|
||||
//this.modalController.dismiss();
|
||||
|
||||
close() {
|
||||
|
||||
this.addGroupMessage.emit();
|
||||
}
|
||||
|
||||
@@ -91,6 +89,9 @@ export class NewGroupPage implements OnInit{
|
||||
let customFields = {}
|
||||
let res:any;
|
||||
|
||||
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
if(this.thedate) {
|
||||
let customFields = {
|
||||
"countDownDate":this.thedate
|
||||
@@ -102,6 +103,8 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
|
||||
|
||||
loader.remove();
|
||||
|
||||
// FsId
|
||||
// DocId
|
||||
|
||||
@@ -109,36 +112,17 @@ export class NewGroupPage implements OnInit{
|
||||
this.addGroupMessage.emit(res.result.rid);
|
||||
await this.wsChatMethodsService.getAllRooms();
|
||||
|
||||
setTimeout(()=> {
|
||||
this.documents.forEach(element => {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).send({
|
||||
file: {
|
||||
"name": element.Assunto,
|
||||
"type": "application/webtrix",
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"DocId": element.DocId,
|
||||
"Assunto": element.Assunto,
|
||||
},
|
||||
temporaryData: {
|
||||
data: {
|
||||
selected: {
|
||||
Id: element.DocId,
|
||||
ApplicationType: element.ApplicationId
|
||||
}
|
||||
}
|
||||
},
|
||||
attachments: [{
|
||||
"title": element.Assunto,
|
||||
"description": element.Assunto,
|
||||
"title_link_download": true,
|
||||
"type": "webtrix",
|
||||
"text": element.Assunto,
|
||||
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||
}],
|
||||
})
|
||||
});
|
||||
|
||||
}, 500)
|
||||
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
} else {
|
||||
setTimeout(()=> {
|
||||
|
||||
this.createGroupWithAttachments(res)
|
||||
|
||||
}, 500)
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
@@ -148,6 +132,48 @@ export class NewGroupPage implements OnInit{
|
||||
|
||||
}
|
||||
|
||||
createGroupWithAttachmentsCath(res: any) {
|
||||
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
|
||||
setTimeout(()=>{
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
}, 1500)
|
||||
} else {
|
||||
this.createGroupWithAttachments(res)
|
||||
}
|
||||
}
|
||||
|
||||
createGroupWithAttachments(res: any) {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).hasLoadHistory = true;
|
||||
|
||||
this.documents.forEach(element => {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).send({
|
||||
file: {
|
||||
"name": element.Assunto,
|
||||
"type": "application/webtrix",
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"DocId": element.DocId,
|
||||
"Assunto": element.Assunto,
|
||||
},
|
||||
temporaryData: {
|
||||
data: {
|
||||
selected: {
|
||||
Id: element.DocId,
|
||||
ApplicationType: element.ApplicationId
|
||||
}
|
||||
}
|
||||
},
|
||||
attachments: [{
|
||||
"title": element.Assunto,
|
||||
"description": element.Assunto,
|
||||
"title_link_download": true,
|
||||
"type": "webtrix",
|
||||
"text": element.Assunto,
|
||||
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||
}],
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async addContacts(){
|
||||
this.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user