mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
129 lines
3.3 KiB
TypeScript
129 lines
3.3 KiB
TypeScript
|
|
import { Component, OnInit } from '@angular/core';
|
||
|
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||
|
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||
|
|
import { SearchDocument } from 'src/app/models/search-document';
|
||
|
|
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
|
||
|
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||
|
|
import { AlertService } from 'src/app/services/alert.service';
|
||
|
|
import { environment } from 'src/environments/environment';
|
||
|
|
|
||
|
|
@Component({
|
||
|
|
selector: 'app-chat-options-features',
|
||
|
|
templateUrl: './chat-options-features.page.html',
|
||
|
|
styleUrls: ['./chat-options-features.page.scss'],
|
||
|
|
})
|
||
|
|
export class ChatOptionsFeaturesPage implements OnInit {
|
||
|
|
|
||
|
|
documents:SearchDocument[] = [];
|
||
|
|
members: any;
|
||
|
|
attendees: EventPerson[] = [];
|
||
|
|
|
||
|
|
constructor(
|
||
|
|
private popoverController: PopoverController,
|
||
|
|
private modalController: ModalController,
|
||
|
|
private alertService: AlertService,
|
||
|
|
private navParams: NavParams,
|
||
|
|
) {
|
||
|
|
|
||
|
|
this.members = this.navParams.get('members');
|
||
|
|
console.log(this.members);
|
||
|
|
this.attendees = this.members.map((val)=>{
|
||
|
|
return {
|
||
|
|
Name: val.name,
|
||
|
|
EmailAddress: val.username+"@"+environment.domain,
|
||
|
|
IsRequired: "true",
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
ngOnInit() {
|
||
|
|
console.log(this.attendees);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
notImplemented(){
|
||
|
|
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||
|
|
}
|
||
|
|
|
||
|
|
close(){
|
||
|
|
if( window.innerWidth <= 1024){
|
||
|
|
this.popoverController.dismiss();
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
this.modalController.dismiss();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
attachDocument(){
|
||
|
|
console.log('Anexar Documento');
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/* getGroupContacts(room:any){
|
||
|
|
this.showLoader = true;
|
||
|
|
//If group is private call getGroupMembers
|
||
|
|
if(this.room.t === 'p'){
|
||
|
|
this.chatService.getGroupMembers(this.roomId).subscribe(res=>{
|
||
|
|
console.log(res);
|
||
|
|
this.members = res['members'];
|
||
|
|
this.showLoader = false;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
//Otherwise call getChannelMembers for públic groups
|
||
|
|
else{
|
||
|
|
this.chatService.getChannelMembers(this.roomId).subscribe(res=>{
|
||
|
|
console.log(res);
|
||
|
|
this.members = res['members'];
|
||
|
|
this.showLoader = false;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
} */
|
||
|
|
|
||
|
|
async getDoc(){
|
||
|
|
const modal = await this.modalController.create({
|
||
|
|
component: SearchPage,
|
||
|
|
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
|
||
|
|
componentProps: {
|
||
|
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||
|
|
select: true,
|
||
|
|
showSearchInput: true,
|
||
|
|
}
|
||
|
|
});
|
||
|
|
await modal.present();
|
||
|
|
modal.onDidDismiss().then((res)=>{
|
||
|
|
if(res){
|
||
|
|
const data = res.data;
|
||
|
|
this.documents.push(data.selected);
|
||
|
|
console.log(res.data);
|
||
|
|
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
async bookMeeting() {
|
||
|
|
console.log(this.attendees);
|
||
|
|
|
||
|
|
if( window.innerWidth <= 800){
|
||
|
|
this.popoverController.dismiss();
|
||
|
|
const modal = await this.modalController.create({
|
||
|
|
component: NewEventPage,
|
||
|
|
componentProps:{
|
||
|
|
attendees: this.attendees,
|
||
|
|
},
|
||
|
|
cssClass: 'modal modal-desktop',
|
||
|
|
backdropDismiss: false
|
||
|
|
});
|
||
|
|
await modal.present();
|
||
|
|
modal.onDidDismiss().then((data) => {
|
||
|
|
if(data){
|
||
|
|
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
this.modalController.dismiss('meeting');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|