Merge branch 'developer' into feature/calendar

This commit is contained in:
Peter Maquiran
2021-04-13 15:44:21 +01:00
2 changed files with 41 additions and 28 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
///<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" /> //<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
import { Component, OnInit, NgZone } from '@angular/core'; import { Component, OnInit, NgZone } from '@angular/core';
import { EventsService } from '../services/events.service'; import { EventsService } from '../services/events.service';
import { Event } from '../models/event.model'; import { Event } from '../models/event.model';
@@ -12,8 +12,8 @@ import { Router } from '@angular/router';
import { ViewEventPage } from '../pages/agenda/view-event/view-event.page'; import { ViewEventPage } from '../pages/agenda/view-event/view-event.page';
import { ApproveEventModalPage } from '../pages/agenda/approve-event-modal/approve-event-modal.page'; import { ApproveEventModalPage } from '../pages/agenda/approve-event-modal/approve-event-modal.page';
import { ExpedienteDetailPage } from '../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'; import { ExpedienteDetailPage } from '../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { PublicationDetailPage } from '../pages/publications/publication-detail/publication-detail.page';
import { ViewPublicationsPage } from '../pages/publications/view-publications/view-publications.page'; import { ViewPublicationsPage } from '../pages/publications/view-publications/view-publications.page';
import { PublicationDetailPage } from '../pages/publications/view-publications/publication-detail/publication-detail.page';
/* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */ /* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */
@@ -73,6 +73,7 @@ export class HomePage implements OnInit {
ngOnInit() { ngOnInit() {
//Add a test
//this.pushCordova(); //this.pushCordova();
//Initialize profile as mdgpr //Initialize profile as mdgpr
@@ -9,6 +9,7 @@ import { ChatService } from 'src/app/services/chat.service';
styleUrls: ['./chat-popover.page.scss'], styleUrls: ['./chat-popover.page.scss'],
}) })
export class ChatPopoverPage implements OnInit { export class ChatPopoverPage implements OnInit {
roomId:string;
room: any; room: any;
constructor( constructor(
@@ -17,11 +18,11 @@ export class ChatPopoverPage implements OnInit {
private navParams: NavParams, private navParams: NavParams,
private chatService: ChatService, private chatService: ChatService,
) { ) {
this.room = this.navParams.get('room'); this.roomId = this.navParams.get('roomId');
} }
ngOnInit() { ngOnInit() {
console.log(this.room); console.log(this.roomId);
} }
close(){ close(){
@@ -36,7 +37,11 @@ export class ChatPopoverPage implements OnInit {
//Top menu options //Top menu options
//Close //Close
leaveGroup(){ leaveGroup(){
let body = { "roomId":this.room._id, } 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.closeGroup(body).subscribe(res=>{ this.chatService.closeGroup(body).subscribe(res=>{
console.log(res); console.log(res);
@@ -47,11 +52,17 @@ export class ChatPopoverPage implements OnInit {
console.log(res); console.log(res);
}); });
} }
});
this.popoverController.dismiss(true); this.popoverController.dismiss(true);
} }
//Delete //Delete
deleteGroup(){ deleteGroup(){
let body = { "roomId":this.room._id, } 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.deleteGroup(body).subscribe(res=>{ this.chatService.deleteGroup(body).subscribe(res=>{
console.log(res); console.log(res);
@@ -62,13 +73,14 @@ export class ChatPopoverPage implements OnInit {
console.log(res); console.log(res);
}); });
} }
});
this.popoverController.dismiss(true); this.popoverController.dismiss(true);
} }
async openChangeGroupName(){ async openChangeGroupName(){
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EditGroupPage, component: EditGroupPage,
componentProps: { componentProps: {
room: this.room, //room: this.room,
}, },
cssClass: 'contacts', cssClass: 'contacts',
backdropDismiss: false backdropDismiss: false