mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -39,6 +39,10 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: 'document-detail',
|
path: 'document-detail',
|
||||||
loadChildren: () => import('./modals/document-detail/document-detail.module').then( m => m.DocumentDetailPageModule)
|
loadChildren: () => import('./modals/document-detail/document-detail.module').then( m => m.DocumentDetailPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'edit-group',
|
||||||
|
loadChildren: () => import('./shared/chat/edit-group/edit-group.module').then( m => m.EditGroupPageModule)
|
||||||
},
|
},
|
||||||
|
|
||||||
/* {
|
/* {
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path:'',
|
path:'',
|
||||||
loadChildren: ()=> import('../modals/document-detail/document-detail.module').then(m => m.DocumentDetailPageModule)
|
loadChildren: ()=> import('../modals/document-detail/document-detail.module').then(m => m.DocumentDetailPageModule)
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.pag
|
|||||||
import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page';
|
import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page';
|
||||||
import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-contacts/group-contacts.page';
|
import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-contacts/group-contacts.page';
|
||||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||||
|
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -33,6 +34,7 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
|||||||
ContactsPage,
|
ContactsPage,
|
||||||
GroupMessagesPage,
|
GroupMessagesPage,
|
||||||
NewGroupPage,
|
NewGroupPage,
|
||||||
|
EditGroupPage,
|
||||||
GroupContactsPage,
|
GroupContactsPage,
|
||||||
EmptyChatPage,
|
EmptyChatPage,
|
||||||
],
|
],
|
||||||
@@ -42,6 +44,7 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
|||||||
ContactsPage,
|
ContactsPage,
|
||||||
GroupMessagesPage,
|
GroupMessagesPage,
|
||||||
NewGroupPage,
|
NewGroupPage,
|
||||||
|
EditGroupPage,
|
||||||
GroupContactsPage,
|
GroupContactsPage,
|
||||||
EmptyChatPage,
|
EmptyChatPage,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
<app-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showMessages" #messagecontainer></app-messages>
|
<app-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showMessages" #messagecontainer></app-messages>
|
||||||
<app-contacts (openMessage)="openMessagesPage($event)" *ngIf="showContacts" class="d-flex height-100 flex-column"></app-contacts>
|
<app-contacts (openMessage)="openMessagesPage($event)" *ngIf="showContacts" class="d-flex height-100 flex-column"></app-contacts>
|
||||||
<app-new-group (addGroupMessage)="openGroupContactsPage($event)" *ngIf="showNewGroup" class="d-flex height-100 flex-column"></app-new-group>
|
<app-new-group (addGroupMessage)="openGroupContactsPage($event)" *ngIf="showNewGroup" class="d-flex height-100 flex-column"></app-new-group>
|
||||||
|
<app-edit-group [roomId]="roomId" *ngIf="showEditGroup" class="d-flex height-100 flex-column"></app-edit-group>
|
||||||
<app-group-contacts (openGroupMessage)="openGroupMessagesPage($event)" [roomId]="groupRoomId" class="d-flex height-100 flex-column" *ngIf="showGroupContacts"></app-group-contacts>
|
<app-group-contacts (openGroupMessage)="openGroupMessagesPage($event)" [roomId]="groupRoomId" class="d-flex height-100 flex-column" *ngIf="showGroupContacts"></app-group-contacts>
|
||||||
<app-group-messages (openGroupContacts)="openGroupContactsPage($event)" *ngIf="showGroupMessages" class="d-flex height-100 flex-column" [roomId]="roomId" #messagecontainer></app-group-messages>
|
<app-group-messages (openGroupContacts)="openGroupContactsPage($event)" *ngIf="showGroupMessages" class="d-flex height-100 flex-column" [roomId]="roomId" #messagecontainer></app-group-messages>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { NewGroupPage } from './new-group/new-group.page';
|
|||||||
import { NewchatPage } from './newchat/newchat.page';
|
import { NewchatPage } from './newchat/newchat.page';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
|
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-chat',
|
selector: 'app-chat',
|
||||||
@@ -63,6 +64,7 @@ export class ChatPage implements OnInit {
|
|||||||
showMessages=false;
|
showMessages=false;
|
||||||
showContacts=false;
|
showContacts=false;
|
||||||
showNewGroup=false;
|
showNewGroup=false;
|
||||||
|
showEditGroup=false;
|
||||||
showGroupMessages=false;
|
showGroupMessages=false;
|
||||||
showGroupContacts=false;
|
showGroupContacts=false;
|
||||||
emptyTextDescription = 'Sem conversa selecionada';
|
emptyTextDescription = 'Sem conversa selecionada';
|
||||||
@@ -105,6 +107,7 @@ export class ChatPage implements OnInit {
|
|||||||
this.showMessages=false;
|
this.showMessages=false;
|
||||||
this.showContacts=false;
|
this.showContacts=false;
|
||||||
this.showNewGroup=false;
|
this.showNewGroup=false;
|
||||||
|
this.showEditGroup=false;
|
||||||
this.showGroupMessages=false;
|
this.showGroupMessages=false;
|
||||||
this.showEmptyComponent=false;
|
this.showEmptyComponent=false;
|
||||||
this.showGroupContacts=false;
|
this.showGroupContacts=false;
|
||||||
@@ -154,6 +157,17 @@ export class ChatPage implements OnInit {
|
|||||||
this.showNewGroup=true;
|
this.showNewGroup=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openEditGroupPage(rid) {
|
||||||
|
if( window.innerWidth <= 1024){
|
||||||
|
this.editGroup(rid);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.closeAllDesktopComponents();
|
||||||
|
this.showEditGroup=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
openGroupMessagesPage(data) {
|
openGroupMessagesPage(data) {
|
||||||
console.log('HERE');
|
console.log('HERE');
|
||||||
|
|
||||||
@@ -263,6 +277,19 @@ export class ChatPage implements OnInit {
|
|||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss();
|
modal.onDidDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async editGroup(roomId){
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: EditGroupPage,
|
||||||
|
cssClass: 'edit-group',
|
||||||
|
componentProps: {
|
||||||
|
roomId: roomId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss();
|
||||||
|
}
|
||||||
|
|
||||||
async openMessagesModal(roomId:any){
|
async openMessagesModal(roomId:any){
|
||||||
this.closeAllDesktopComponents();
|
this.closeAllDesktopComponents();
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
<div class="main-header">
|
<div class="main-header">
|
||||||
<div class="title-content">
|
<div class="title-content">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
<button class="btn-no-color" (click)="close()">
|
||||||
|
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<ion-label class="title">Alterar assunto</ion-label>
|
<ion-label class="title">Alterar assunto</ion-label>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export class EditGroupPage implements OnInit {
|
|||||||
selectedDuration = ['','',''];
|
selectedDuration = ['','',''];
|
||||||
groupName:string;
|
groupName:string;
|
||||||
room:any;
|
room:any;
|
||||||
|
roomId:string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -21,12 +22,19 @@ export class EditGroupPage implements OnInit {
|
|||||||
private chatService: ChatService,
|
private chatService: ChatService,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
) {
|
) {
|
||||||
this.room = this.navParams.get('room');
|
this.roomId = this.navParams.get('roomId');
|
||||||
this.groupName = this.room.name.split('-').join(' ');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log(this.room);
|
this.getRoomInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
getRoomInfo(){
|
||||||
|
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||||
|
this.room = room['room'];
|
||||||
|
console.log(this.room);
|
||||||
|
this.groupName = this.room.name.split('-').join(' ');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
close(){
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.t == 'r'" class="info-text">
|
<div *ngIf="msg.t == 'r'" class="info-text">
|
||||||
<ion-label>Alterou o assunto de para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
<ion-label>Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { EditGroupPage } from './edit-group.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: EditGroupPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class EditGroupPageRoutingModule {}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { EditGroupPageRoutingModule } from './edit-group-routing.module';
|
||||||
|
|
||||||
|
import { EditGroupPage } from './edit-group.page';
|
||||||
|
import { SharedModule } from '../../shared.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
SharedModule,
|
||||||
|
EditGroupPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [EditGroupPage]
|
||||||
|
})
|
||||||
|
export class EditGroupPageModule {}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<ion-header class="ion-no-border">
|
||||||
|
<ion-toolbar class="header-toolbar">
|
||||||
|
<div class="main-header">
|
||||||
|
<div class="title-content">
|
||||||
|
<div class="left">
|
||||||
|
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="middle">
|
||||||
|
<ion-label class="title">Alterar assunto</ion-label>
|
||||||
|
</div>
|
||||||
|
<app-btn-seguinte *ngIf="groupName" (click)="changeGroupName()"></app-btn-seguinte>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="item-container">
|
||||||
|
<ion-input [(ngModel)]="groupName" placeholder="Título"></ion-input>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="false" class="item-container-no-border">
|
||||||
|
<ion-checkbox (ionChange)="_ionChange($event)" color="primary"></ion-checkbox>
|
||||||
|
<ion-label>Grupo Ultra-secreto</ion-label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="showDuration" class="container-div">
|
||||||
|
<div class="ion-item-class-2">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-duration.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="ion-input-class">
|
||||||
|
<ion-input (click)="showPicker()" [(ngModel)]="displayDuration" placeholder="Duração"></ion-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
ion-content{
|
||||||
|
--background:transparent;
|
||||||
|
}
|
||||||
|
.header-toolbar{
|
||||||
|
--background:transparent;
|
||||||
|
--opacity: 1;
|
||||||
|
}
|
||||||
|
.div-top-header{
|
||||||
|
width: 400px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #0782c9;
|
||||||
|
overflow: auto;
|
||||||
|
padding-top: 15px;
|
||||||
|
border: 0!important;
|
||||||
|
|
||||||
|
.div-search{
|
||||||
|
font-size: 45px;
|
||||||
|
float: left;
|
||||||
|
margin: 0 0 0 10px
|
||||||
|
}
|
||||||
|
.div-logo{
|
||||||
|
background: transparent;
|
||||||
|
width: 140px;
|
||||||
|
margin: 5px 0 0px 71px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.div-logo img{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.div-profile{
|
||||||
|
font-size: 45px;
|
||||||
|
float: right;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.main-header{
|
||||||
|
width: 100%; /* 400px */
|
||||||
|
height: 100%;
|
||||||
|
font-family: Roboto;
|
||||||
|
border-top-left-radius: 25px;
|
||||||
|
border-top-right-radius: 25px;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow:hidden;
|
||||||
|
padding: 30px 20px 0px 20px;
|
||||||
|
color:#000;
|
||||||
|
transform: translate3d(0, 1px, 0);
|
||||||
|
|
||||||
|
.title-content{
|
||||||
|
width: 360px;
|
||||||
|
margin: 0px auto;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 0 !important;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.left{
|
||||||
|
width: 37px;
|
||||||
|
float: left;
|
||||||
|
font-size: 35px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.middle{
|
||||||
|
padding: 0!important;
|
||||||
|
float: left;
|
||||||
|
width: 221px;
|
||||||
|
margin: 2.5px 0 0 5px;
|
||||||
|
}
|
||||||
|
.right{
|
||||||
|
padding: 0!important;
|
||||||
|
float: right;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #0782c9;
|
||||||
|
margin: 8px 0 0 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title{
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
.div-icon{
|
||||||
|
width: 40px;
|
||||||
|
float: right;
|
||||||
|
font-size: 35px;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
.div-icon ion-icon{
|
||||||
|
float: right;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.main-content{
|
||||||
|
width: 100%; /* 400px */
|
||||||
|
height: 100%;
|
||||||
|
font-family: Roboto;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow:auto;
|
||||||
|
padding: 15px 20px 0 20px;
|
||||||
|
|
||||||
|
.item-container{
|
||||||
|
width: 360px;
|
||||||
|
margin: 15px auto;
|
||||||
|
border: 1px solid #ebebeb;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-container-no-border{
|
||||||
|
display: flex;
|
||||||
|
width: 360px;
|
||||||
|
margin: 25px auto;
|
||||||
|
border-radius: 5px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-container-no-border ion-label{
|
||||||
|
padding-left: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container-div{
|
||||||
|
margin-bottom: 15px;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.ion-item-class-2{
|
||||||
|
width: 360px;
|
||||||
|
margin: 0px auto;
|
||||||
|
|
||||||
|
.ion-icon-class{
|
||||||
|
width: 45px;
|
||||||
|
height: 45px;
|
||||||
|
float: left;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ion-input-class{
|
||||||
|
width: 315px;
|
||||||
|
height: 45px;
|
||||||
|
border: 1px solid #ebebeb;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 10px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { EditGroupPage } from './edit-group.page';
|
||||||
|
|
||||||
|
describe('EditGroupPage', () => {
|
||||||
|
let component: EditGroupPage;
|
||||||
|
let fixture: ComponentFixture<EditGroupPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EditGroupPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(EditGroupPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { ModalController, NavParams, PickerController } from '@ionic/angular';
|
||||||
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-edit-group',
|
||||||
|
templateUrl: './edit-group.page.html',
|
||||||
|
styleUrls: ['./edit-group.page.scss'],
|
||||||
|
})
|
||||||
|
export class EditGroupPage implements OnInit {
|
||||||
|
showLoader: boolean;
|
||||||
|
displayDuration: any;
|
||||||
|
showDuration: boolean;
|
||||||
|
selectedDuration = ['','',''];
|
||||||
|
groupName:string;
|
||||||
|
room:any;
|
||||||
|
@Input() roomId:string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private modalController: ModalController,
|
||||||
|
private pickerController: PickerController,
|
||||||
|
private chatService: ChatService,
|
||||||
|
private navParams: NavParams,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.getRoomInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
getRoomInfo(){
|
||||||
|
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||||
|
this.room = room['room'];
|
||||||
|
console.log(this.room);
|
||||||
|
this.groupName = this.room.name.split('-').join(' ');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
close(){
|
||||||
|
this.modalController.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeGroupName(){
|
||||||
|
if(this.groupName.trim().length > 1){
|
||||||
|
let name = this.groupName.split(' ').join('-');
|
||||||
|
let body = {
|
||||||
|
"roomId": this.room._id,
|
||||||
|
"name": name,
|
||||||
|
}
|
||||||
|
this.chatService.renameGroup(body).subscribe(res=>{
|
||||||
|
this.modalController.dismiss(res['group']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
console.log("Invalid name!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ionChange(event){
|
||||||
|
this.showDuration = event.detail.checked;
|
||||||
|
}
|
||||||
|
async showPicker(){
|
||||||
|
const picker = await this.pickerController.create({
|
||||||
|
cssClass: '',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: 'Cancelar', role: 'cancel', cssClass: 'btn-cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Ok',
|
||||||
|
cssClass: 'btn-cancel',
|
||||||
|
handler:(value:any)=>{
|
||||||
|
console.log('button done pressed');
|
||||||
|
this.selectedDuration = [
|
||||||
|
value.days.value,
|
||||||
|
value.hours.value,
|
||||||
|
value.minutes.value,
|
||||||
|
]
|
||||||
|
console.log(this.selectedDuration);
|
||||||
|
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
|
||||||
|
if(value.days.value > 0){
|
||||||
|
if(value.days.value == 1){
|
||||||
|
if(value.hours.value == 1){
|
||||||
|
this.displayDuration = value.days.value + " day " +
|
||||||
|
value.hours.value + " hora " +
|
||||||
|
value.minutes.value + " minutos";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.displayDuration = value.days.value + " days " +
|
||||||
|
value.hours.value + " horas " +
|
||||||
|
value.minutes.value + " minutos";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(value.hours.value == 1){
|
||||||
|
this.displayDuration = value.days.value + " days " +
|
||||||
|
value.hours.value + " hora " +
|
||||||
|
value.minutes.value + " minutos";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.displayDuration = value.days.value + " days " +
|
||||||
|
value.hours.value + " horas " +
|
||||||
|
value.minutes.value + " minutos";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(value.hours.value == 1){
|
||||||
|
this.displayDuration = value.hours.value + " hora " +
|
||||||
|
value.minutes.value + " minutos";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.displayDuration = value.hours.value + " horas " +
|
||||||
|
value.minutes.value + " minutos";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
name: 'days',
|
||||||
|
prefix: 'Dias',
|
||||||
|
options: [
|
||||||
|
{ text: '0', value: 0 },
|
||||||
|
{ text: '1', value: 1 },
|
||||||
|
{ text: '2', value: 2 },
|
||||||
|
{ text: '3', value: 3 },
|
||||||
|
{ text: '4', value: 4 },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'hours',
|
||||||
|
prefix: 'Horas',
|
||||||
|
options: [
|
||||||
|
{ text: '0', value: 0 },
|
||||||
|
{ text: '1', value: 1 },
|
||||||
|
{ text: '2', value: 2 },
|
||||||
|
{ text: '3', value: 3 },
|
||||||
|
{ text: '4', value: 4 },
|
||||||
|
{ text: '5', value: 5 },
|
||||||
|
{ text: '6', value: 6 },
|
||||||
|
{ text: '7', value: 7 },
|
||||||
|
{ text: '8', value: 8 },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'minutes',
|
||||||
|
prefix: 'Minutos',
|
||||||
|
selectedIndex: 3,
|
||||||
|
options: [
|
||||||
|
{ text: '0', value: 0 },
|
||||||
|
{ text: '5', value: 5 },
|
||||||
|
{ text: '10', value: 10 },
|
||||||
|
{ text: '15', value: 15 },
|
||||||
|
{ text: '20', value: 20 },
|
||||||
|
{ text: '25', value: 25 },
|
||||||
|
{ text: '30', value: 30 },
|
||||||
|
{ text: '35', value: 35 },
|
||||||
|
{ text: '45', value: 45 },
|
||||||
|
{ text: '50', value: 50 },
|
||||||
|
{ text: '55', value: 55 },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
await picker.present();
|
||||||
|
picker.onDidDismiss().then(async data =>{
|
||||||
|
let day = await picker.getColumn('days');
|
||||||
|
let hour = await picker.getColumn('hours');
|
||||||
|
let minutes = await picker.getColumn('minutes');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -52,8 +52,6 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.popoverController.dismiss(true);
|
this.popoverController.dismiss(true);
|
||||||
}
|
}
|
||||||
@@ -80,7 +78,7 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: EditGroupPage,
|
component: EditGroupPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
//room: this.room,
|
roomId: this.roomId,
|
||||||
},
|
},
|
||||||
cssClass: 'contacts',
|
cssClass: 'contacts',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
|
|||||||
Reference in New Issue
Block a user