add book meeting in desktop component

This commit is contained in:
tiago.kayaya
2021-08-18 16:40:58 +01:00
parent 25b0b2a418
commit 6196189bb9
16 changed files with 579 additions and 200 deletions
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ChatOptionsFeaturesPage } from './chat-options-features.page';
const routes: Routes = [
{
path: '',
component: ChatOptionsFeaturesPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ChatOptionsFeaturesPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ChatOptionsFeaturesPageRoutingModule } from './chat-options-features-routing.module';
import { ChatOptionsFeaturesPage } from './chat-options-features.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ChatOptionsFeaturesPageRoutingModule
],
declarations: [ChatOptionsFeaturesPage]
})
export class ChatOptionsFeaturesPageModule {}
@@ -0,0 +1,17 @@
<ion-content class="container">
<div class="arrow-right">
<button class="btn-no-color" (click)="close()">
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
</button>
</div>
<div class="buttons">
<button (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
<button (click)="notImplemented()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
<button (click)="getDoc()" class="btn-cancel" shape="round" >Anexar Documento</button>
<div class="solid"></div>
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
</div>
</ion-content>
@@ -0,0 +1,47 @@
.container{
--padding-top:20px !important;
--padding-bottom:20px !important;
--padding-start:20px !important;
--padding-end:20px !important;
}
.arrow-right{
display: none;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
margin-bottom: 10px !important;
}
}
.solid {
display: none;
width: 90%;
border-top: 1px solid #bbb;
margin: 0 auto !important;
margin-bottom: 10px;
}
@media only screen and (min-width: 1024px) {
.arrow-right{
display: flex;
justify-content: flex-end;
}
.btn-cancel{
width: 100% !important;
}
.btn-cancel:hover{
background-color: #42b9fe;
}
.mobile-only{
display: none !important;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ChatOptionsFeaturesPage } from './chat-options-features.page';
describe('ChatOptionsFeaturesPage', () => {
let component: ChatOptionsFeaturesPage;
let fixture: ComponentFixture<ChatOptionsFeaturesPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ChatOptionsFeaturesPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ChatOptionsFeaturesPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,128 @@
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');
}
}
}