This commit is contained in:
Peter Maquiran
2023-03-09 16:35:54 +01:00
parent 789c2f4e8b
commit b8a1734abb
5 changed files with 64 additions and 48 deletions
@@ -546,6 +546,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
else if (res.data == 'edit') { else if (res.data == 'edit') {
this.editGroup(this.roomId); this.editGroup(this.roomId);
} else if (res.data == 'addUser') {
this.addContacts();
} }
}); });
} }
@@ -820,7 +823,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async addContacts() { async addContacts() {
if(this.isAdmin) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: GroupContactsPage, component: GroupContactsPage,
@@ -841,6 +844,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
} }
}
async editGroup(roomId) { async editGroup(roomId) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EditGroupPage, component: EditGroupPage,
@@ -528,7 +528,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
console.log(res)
if (res.data == 'leave') { if (res.data == 'leave') {
this.getRoomInfo(); this.getRoomInfo();
this.closeAllDesktopComponents.emit(); this.closeAllDesktopComponents.emit();
@@ -546,6 +546,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
//this.closeAllDesktopComponents.emit(); //this.closeAllDesktopComponents.emit();
this.openEditGroupPage.emit(this.roomId); this.openEditGroupPage.emit(this.roomId);
} else if (res.data == 'addUser') {
this.openGroupContactsPage();
} }
else { else {
@@ -616,7 +619,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
} }
async addContacts() { async addContacts() {
if(this.isAdmin) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: GroupContactsPage, component: GroupContactsPage,
componentProps: { componentProps: {
@@ -636,6 +639,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}); });
} }
}
async addDocGestaoDocumental() { async addDocGestaoDocumental() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
@@ -6,7 +6,7 @@
</button> </button>
</div> </div>
<div class="buttons"> <div class="buttons">
<button class="btn-cancel" shape="round" >Adicionar</button> <button *ngIf="isAdmin" (click)="addUser()" class="btn-cancel" shape="round" >Adicionar</button>
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button> <button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
<button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" >Alterar nome do grupo</button> <button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" >Alterar nome do grupo</button>
<div class="solid"></div> <div class="solid"></div>
@@ -5,8 +5,6 @@ import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page'; import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'; import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { HttpErrorResponse } from '@angular/common/http';
import { SessionStore } from 'src/app/store/session.service';
@Component({ @Component({
@@ -41,11 +39,11 @@ export class ChatPopoverPage implements OnInit {
close(action:any){ close(action:any){
if( window.innerWidth < 701){ if( window.innerWidth < 701){
this.popoverController.dismiss(action); this.popoverController.dismiss(action);
this.modalController.dismiss(action); this.modalController.dismiss(action)
} }
else{ else{
this.popoverController.dismiss(action); this.popoverController.dismiss(action);
this.modalController.dismiss(action); this.modalController.dismiss(action)
} }
} }
@@ -126,16 +124,24 @@ export class ChatPopoverPage implements OnInit {
} }
}); });
this.popoverController.dismiss('delete'); this.popoverController.dismiss('delete');
this.modalController.dismiss('delete'); this.modalController.dismiss('delete')
} }
async openChangeGroupName(){ async openChangeGroupName(){
if( window.innerWidth < 701){ if( window.innerWidth < 701){
this.popoverController.dismiss('edit'); this.popoverController.dismiss('edit');
this.modalController.dismiss('edit')
} }
else{ else{
this.modalController.dismiss('edit'); this.popoverController.dismiss('edit');
this.modalController.dismiss('edit')
} }
} }
async addUser() {
this.popoverController.dismiss('addUser');
this.modalController.dismiss('addUser')
}
} }
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "0b4cafda2", "shortSHA": "789c2f4e8",
"SHA": "0b4cafda22aba43e3e2acb6f454b2a8ae51ef467", "SHA": "789c2f4e8b10fe5ecb2975baf9b1a328f8f72607",
"branch": "no_bug_movemente", "branch": "no_bug_movemente",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Thu Mar 9 15:15:06 2023 +0100'", "lastCommitTime": "'Thu Mar 9 15:18:19 2023 +0100'",
"lastCommitMessage": "remove all date", "lastCommitMessage": "remove json text",
"lastCommitNumber": "4854", "lastCommitNumber": "4855",
"change": "", "change": "",
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html", "changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.html\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }