This commit is contained in:
tiago.kayaya
2021-08-17 14:17:19 +01:00
parent 6714825bb7
commit 13a5ca0702
5 changed files with 42 additions and 23 deletions
+11 -11
View File
@@ -290,17 +290,17 @@ hideRefreshButton(){
this.showLoader = true; this.showLoader = true;
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{ this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
this.privateGroups = res.groups; this.privateGroups = res.groups;
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{ /* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels; this.publicGroups = res.channels; */
let all = this.privateGroups.concat(this.publicGroups); //let all = this.privateGroups.concat(this.publicGroups);
this.allGroups = all.sort((a,b)=>{ this.allGroups = this.privateGroups.sort((a,b)=>{
var dateA = new Date(a._updatedAt).getTime(); var dateA = new Date(a._updatedAt).getTime();
var dateB = new Date(b._updatedAt).getTime(); var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA; return dateB - dateA;
}); });
console.log(this.allGroups); console.log(this.allGroups);
this.showLoader = false; this.showLoader = false;
}); /* }); */
}); });
} }
@@ -9,6 +9,7 @@ import { ContactsPage } from '../new-group/contacts/contacts.page';
import { NewGroupPage } from '../new-group/new-group.page'; import { NewGroupPage } from '../new-group/new-group.page';
import { GroupContactsPage } from './group-contacts/group-contacts.page'; import { GroupContactsPage } from './group-contacts/group-contacts.page';
import {Router} from '@angular/router' import {Router} from '@angular/router'
import { EditGroupPage } from '../edit-group/edit-group.page';
@Component({ @Component({
selector: 'app-group-messages', selector: 'app-group-messages',
@@ -123,12 +124,12 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
}); });
} }
//Otherwise call getChannelMembers for públic groups //Otherwise call getChannelMembers for públic groups
else{ /* else{
this.chatService.getPublicGroupMessages(this.roomId).subscribe(res=>{ this.chatService.getPublicGroupMessages(this.roomId).subscribe(res=>{
console.log(res); console.log(res);
this.messages = res['messages'].reverse(); this.messages = res['messages'].reverse();
}); });
} } */
} }
sendMessage(){ sendMessage(){
let body = { let body = {
@@ -161,7 +162,9 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
else if(res.data == 'cancel'){ else if(res.data == 'cancel'){
console.log('cancel'); console.log('cancel');
} }
console.log('OK2'); else if(res.data == 'edit'){
this.editGroup(this.roomId);
}
}); });
} }
@@ -200,6 +203,21 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
}); });
} }
async editGroup(roomId){
const modal = await this.modalController.create({
component: EditGroupPage,
cssClass: 'modal modal-desktop',
componentProps: {
roomId: roomId,
},
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log(res.data);
this.modalController.dismiss(res.data);
});
}
/* async actionSheet() { /* async actionSheet() {
const actionSheet = await this.actionSheetController.create({ const actionSheet = await this.actionSheetController.create({
cssClass: 'my-custom-class', cssClass: 'my-custom-class',
+1 -1
View File
@@ -176,7 +176,7 @@ async openChatOptions(ev?: any) {
if(this.route.url != "/home/chat"){ if(this.route.url != "/home/chat"){
console.log("Timer message stop") console.log("Timer message stop")
} else { } else {
await new Promise(resolve => setTimeout(resolve, 1000)); await new Promise(resolve => setTimeout(resolve, 1000));
await this.serverLongPull(); await this.serverLongPull();
console.log('Timer message running') console.log('Timer message running')
} }
@@ -222,8 +222,8 @@ export class ExpedientePrPage implements OnInit {
} }
} }
viewDocument() { viewDocument(DocId:string) {
this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{ this.processes.GetDocumentUrl(DocId, this.task.FsId).subscribe(res=>{
console.log(res); console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank"); const browser = this.iab.create(url,"_blank");
@@ -82,6 +82,7 @@ export class ChatPopoverPage implements OnInit {
} }
async openChangeGroupName(){ async openChangeGroupName(){
this.popoverController.dismiss('edit');
this.modalController.dismiss('edit'); this.modalController.dismiss('edit');
} }