Files
doneit-web/src/app/shared/popover/chat-options-popover/chat-options-popover.page.ts
T

132 lines
3.0 KiB
TypeScript
Raw Normal View History

2020-12-29 12:40:19 +01:00
import { Component, OnInit } from '@angular/core';
2021-08-18 09:23:53 +01:00
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { EventPerson } from 'src/app/models/eventperson.model';
2021-08-20 12:02:27 +01:00
import { SearchList } from 'src/app/models/search-document';
2021-08-18 09:23:53 +01:00
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
2021-04-21 16:22:56 +01:00
import { SearchPage } from 'src/app/pages/search/search.page';
2021-08-18 09:23:53 +01:00
import { environment } from 'src/environments/environment';
2021-10-25 15:31:43 +01:00
import { ThemeService } from 'src/app/services/theme.service'
2023-01-24 15:56:47 +01:00
import { PermissionService } from 'src/app/services/permission.service';
2020-12-29 12:40:19 +01:00
@Component({
selector: 'app-chat-options-popover',
templateUrl: './chat-options-popover.page.html',
styleUrls: ['./chat-options-popover.page.scss'],
})
export class ChatOptionsPopoverPage implements OnInit {
2021-08-20 12:02:27 +01:00
documents:SearchList[] = [];
2021-08-18 09:23:53 +01:00
members: any;
attendees: EventPerson[] = [];
2021-04-21 16:22:56 +01:00
2020-12-29 14:05:45 +01:00
constructor(
2021-03-18 16:30:03 +01:00
private popoverController: PopoverController,
private modalController: ModalController,
2021-08-18 09:23:53 +01:00
private navParams: NavParams,
2023-01-24 15:56:47 +01:00
public ThemeService: ThemeService,
public p: PermissionService,
2021-08-18 09:23:53 +01:00
) {
this.members = this.navParams.get('members');
2022-04-08 16:53:26 +01:00
if(this.members) {
this.attendees = this.navParams.get('members').map((val)=>{
return {
Name: val.name,
EmailAddress: val.username+"@"+environment.domain,
IsRequired: "true",
}
});
}
2021-08-18 09:23:53 +01:00
}
2020-12-29 12:40:19 +01:00
ngOnInit() {
2022-04-28 09:32:27 +01:00
2021-08-18 09:23:53 +01:00
2020-12-29 12:40:19 +01:00
}
2021-09-14 10:30:13 +01:00
takePicture(){
if( window.innerWidth < 701){
2021-09-21 14:05:59 +01:00
this.popoverController.dismiss('take-picture');
2021-09-14 10:30:13 +01:00
}
else{
2021-09-21 14:05:59 +01:00
this.modalController.dismiss('take-picture');
2021-09-14 10:30:13 +01:00
}
}
2021-10-07 15:30:36 +01:00
addFile(){
if( window.innerWidth < 701){
this.popoverController.dismiss('add-document');
}
else{
this.modalController.dismiss('add-document');
}
}
2021-09-13 12:37:58 +01:00
anexarFoto(){
if( window.innerWidth < 701){
2021-09-21 14:05:59 +01:00
this.popoverController.dismiss('add-picture');
2021-09-13 12:37:58 +01:00
}
else{
2021-09-21 14:05:59 +01:00
this.modalController.dismiss('add-picture');
}
}
addDocGestaoDocumental(){
if( window.innerWidth < 701){
this.popoverController.dismiss('documentoGestaoDocumental');
}
else{
this.modalController.dismiss('documentoGestaoDocumental');
2021-09-13 12:37:58 +01:00
}
}
2020-12-29 14:05:45 +01:00
close(){
2021-08-20 14:45:44 +01:00
if( window.innerWidth < 701){
2021-03-18 16:30:03 +01:00
this.popoverController.dismiss();
}
else{
this.modalController.dismiss();
}
2020-12-29 14:05:45 +01:00
}
2021-04-21 16:22:56 +01:00
attachDocument(){
2022-04-28 09:32:27 +01:00
2021-08-18 09:23:53 +01:00
2021-04-21 16:22:56 +01:00
}
2021-09-21 14:05:59 +01:00
2021-04-21 16:22:56 +01:00
async getDoc(){
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
componentProps: {
2021-04-30 14:12:45 +01:00
type: 'AccoesPresidenciais & ArquivoDespachoElect',
2021-05-05 19:29:17 +01:00
select: true,
showSearchInput: true,
2021-04-21 16:22:56 +01:00
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
const data = res.data;
this.documents.push(data.selected);
2022-04-28 09:32:27 +01:00
2021-08-18 09:23:53 +01:00
2021-04-21 16:22:56 +01:00
}
});
}
2021-08-18 09:23:53 +01:00
async bookMeeting() {
2022-04-28 09:32:27 +01:00
2023-01-24 15:56:47 +01:00
if( window.innerWidth < 701){
this.popoverController.dismiss('meeting');
}
else{
this.modalController.dismiss('meeting');
2021-08-18 09:23:53 +01:00
}
}
2020-12-29 12:40:19 +01:00
}