This commit is contained in:
Peter Maquiran
2023-01-22 18:48:45 +01:00
parent 658720f47f
commit 378ea8fe5b
6 changed files with 55 additions and 52 deletions
@@ -17,6 +17,7 @@ import { ThemeService } from 'src/app/services/theme.service';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { SessionStore } from 'src/app/store/session.service';
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -84,6 +85,7 @@ export class NewEventPage implements OnInit {
autoStartTime;
autoEndTime;
CalendarNamesOptions = ['Oficial', 'Pessoal']
roomId:string;
constructor(
private modalController: ModalController,
@@ -93,6 +95,7 @@ export class NewEventPage implements OnInit {
private toastService: ToastService,
public ThemeService: ThemeService,
private platform: Platform,
private chatMethodService: ChatMethodsService,
) {
this.loggeduser = SessionStore.user;
this.postEvent = new Event();
@@ -100,6 +103,7 @@ export class NewEventPage implements OnInit {
this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody;
this.roomId = this.navParams.get('roomId');
this.selectedSegment = this.navParams.get('segment');
this.selectedDate = this.navParams.get('eventSelectedDate');
this.taskParticipants = this.navParams.get('attendees');
@@ -107,20 +111,20 @@ export class NewEventPage implements OnInit {
ngOnInit() {
if (this.platform.is('desktop')) {
this.taskParticipants = [];
// this.taskParticipants = [];
}
this.CalendarName = this.loggeduser.Profile;
this.selectedRecurringType = "-1";
if(!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario';
console.log(this.eventService.calendarNamesAry)
} else {
this.CalendarName = this.eventService.calendarNamesAry[0]
}
}
this.selectedRecurringType = "-1";
this.getRecurrenceTypes();
@@ -413,8 +417,22 @@ export class NewEventPage implements OnInit {
});
let data1 = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": eventId,
"calendarId": CalendarId
}
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId, data1);
}
this.toastService._successMessage()
this.modalController.dismiss(this.postEvent);
let data = Object.assign(this.postEvent,{id:eventId})
this.modalController.dismiss(data);
} catch (error) {
this.toastService._badRequest()
@@ -198,24 +198,6 @@
</div>
<div *ngIf="msg.file && msg.delate == false">
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal">
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
</button><br />
<ion-label class="info-meeting-medium">
<ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a
{{showDateDuration(msg.file.end_date)}}
</ion-label><br />
<ion-label class="info-meeting-medium">
<ion-icon></ion-icon>
<ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}
</ion-label><br />
</div>
{{last ? scrollToBottom() : ''}}
</div>
<div *ngIf="msg.file && msg.delate == true">
Apagou a mensagem
</div>
+19 -4
View File
@@ -586,7 +586,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async bookMeeting() {
this.attendees = this.members.map((val) => {
let attendees = this.ChatSystemService.getDmRoom(this.roomId).members.map((val) => {
return {
Name: val.name,
EmailAddress: val.username + "@" + environment.domain,
@@ -599,15 +599,30 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const modal = await this.modalController.create({
component: NewEventPage,
componentProps: {
attendees: this.attendees,
attendees: attendees,
roomId: this.roomId
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((data) => {
if (data) {
console.log(data)
if (data?.data && data.data.id) {
// const roomId = this.roomId
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": "application/meeting",
// "subject": data.data.Subject,
// "start_date": data.data.StartDate,
// "end_date": data.data.EndDate,
// "venue": data.data.venue,
// "id": data.data.id,
// "calendarId": data.data.CalendarId
// },
// temporaryData: {}
// })
}
});
}
@@ -643,7 +643,6 @@ export class NewEventPage implements OnInit {
}
selectedCalendarId () {
console.log('1:1',this.eventService.calendarNamesType,'2', this.CalendarName)
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
console.log('1')
@@ -120,22 +120,11 @@ export class ChatOptionsPopoverPage implements OnInit {
async bookMeeting() {
this.popoverController.dismiss();
if( window.innerWidth <= 1024){
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){
}
});
if( window.innerWidth < 701){
this.popoverController.dismiss('meeting');
}
else{
this.modalController.dismiss('meeting');
}
}
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "c1816b863",
"SHA": "c1816b863e387315b1359975ecffa252775236a7",
"shortSHA": "658720f47",
"SHA": "658720f47ff463fe7e6ff672a2f562d74662480c",
"branch": "no_bug_movemente",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Fri Jan 20 16:09:27 2023 +0100'",
"lastCommitMessage": "merg",
"lastCommitNumber": "4676",
"lastCommitTime": "'Sun Jan 22 15:27:01 2023 +0100'",
"lastCommitMessage": "save",
"lastCommitNumber": "4677",
"change": "",
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/profile/profile.page.html\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/environments/environment.prod.ts",
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.html\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/popover/chat-options-popover/chat-options-popover.page.ts",
"changeAuthor": "peter.maquiran"
}