mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -290,17 +290,17 @@ hideRefreshButton(){
|
||||
this.showLoader = true;
|
||||
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
|
||||
this.privateGroups = res.groups;
|
||||
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.publicGroups = res.channels;
|
||||
let all = this.privateGroups.concat(this.publicGroups);
|
||||
this.allGroups = all.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
this.showLoader = false;
|
||||
});
|
||||
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.publicGroups = res.channels; */
|
||||
//let all = this.privateGroups.concat(this.publicGroups);
|
||||
this.allGroups = this.privateGroups.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
this.showLoader = false;
|
||||
/* }); */
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||
import { NewGroupPage } from '../new-group/new-group.page';
|
||||
import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
import {Router} from '@angular/router'
|
||||
import { EditGroupPage } from '../edit-group/edit-group.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -123,12 +124,12 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
|
||||
});
|
||||
}
|
||||
//Otherwise call getChannelMembers for públic groups
|
||||
else{
|
||||
/* else{
|
||||
this.chatService.getPublicGroupMessages(this.roomId).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.messages = res['messages'].reverse();
|
||||
});
|
||||
}
|
||||
} */
|
||||
}
|
||||
sendMessage(){
|
||||
let body = {
|
||||
@@ -161,7 +162,9 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
|
||||
else if(res.data == '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() {
|
||||
const actionSheet = await this.actionSheetController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
|
||||
@@ -176,7 +176,7 @@ async openChatOptions(ev?: any) {
|
||||
if(this.route.url != "/home/chat"){
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
|
||||
@@ -222,8 +222,8 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
viewDocument() {
|
||||
this.processes.GetDocumentUrl(this.task.DocId, this.task.FsId).subscribe(res=>{
|
||||
viewDocument(DocId:string) {
|
||||
this.processes.GetDocumentUrl(DocId, this.task.FsId).subscribe(res=>{
|
||||
console.log(res);
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
|
||||
@@ -16,7 +16,7 @@ export class ChatPopoverPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private chatService: ChatService,
|
||||
) {
|
||||
) {
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
}
|
||||
|
||||
@@ -39,18 +39,18 @@ export class ChatPopoverPage implements OnInit {
|
||||
//Close
|
||||
leaveGroup(){
|
||||
console.log('leave');
|
||||
|
||||
|
||||
let body = { "roomId":this.roomId, }
|
||||
|
||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.leaveGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
else{
|
||||
else{
|
||||
this.chatService.leaveChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
@@ -66,12 +66,12 @@ export class ChatPopoverPage implements OnInit {
|
||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
else{
|
||||
else{
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
@@ -82,6 +82,7 @@ export class ChatPopoverPage implements OnInit {
|
||||
}
|
||||
|
||||
async openChangeGroupName(){
|
||||
this.popoverController.dismiss('edit');
|
||||
this.modalController.dismiss('edit');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user