bugs solved

This commit is contained in:
Eudes Inácio
2024-06-11 11:23:38 +01:00
parent 05bbbd0242
commit 26c68fa7a2
10 changed files with 181 additions and 113 deletions
+3 -3
View File
@@ -70,16 +70,16 @@
<div *ngIf="environment.presidential">
<div *ngIf="calendars.roleId == RoleIdService.PRES">PR </div>
<div *ngIf="calendars.roleId == RoleIdService.MD && calendars.roleId != SessionStore.user.RoleID">MDGPR</div>
<div *ngIf="calendars.roleId != RoleIdService.MD && calendars.roleId != RoleIdService.PRES && calendars.wxFullName && calendars.wxUserId != SessionStore.user.UserId "> Agenda do {{calendars.wxFullName}} </div>
<div *ngIf="calendars.roleId != RoleIdService.MD && calendars.roleId != RoleIdService.PRES && calendars.wxFullName && calendars.wxUserId != SessionStore.user.UserId "> Agenda {{calendars.wxFullName}} </div>
<div *ngIf="calendars.wxUserId == SessionStore.user.UserId ">
Minha agenda
</div>
</div>
<div *ngIf="environment.presidential">
<div *ngIf="!environment.presidential">
<div *ngIf="calendars.roleId == RoleIdService.PRES">{{ environment.agendaPR}} </div>
<div *ngIf="calendars.roleId == RoleIdService.MD && calendars.roleId != SessionStore.user.RoleID">{{ environment.agendaVP}}</div>
<div *ngIf="calendars.roleId != RoleIdService.MD && calendars.roleId != RoleIdService.PRES && calendars.wxFullName && calendars.wxUserId != SessionStore.user.UserId "> Agenda do {{calendars.wxFullName}} </div>
<div *ngIf="calendars.roleId != RoleIdService.MD && calendars.roleId != RoleIdService.PRES && calendars.wxFullName && calendars.wxUserId != SessionStore.user.UserId "> Agenda {{calendars.wxFullName}} </div>
<div *ngIf="calendars.wxUserId == SessionStore.user.UserId ">
Minha agenda
</div>
@@ -86,13 +86,13 @@
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(value)]="postEvent.Category" >
<mat-option value="Reunião">
<mat-option value="Meeting">
Reunião
</mat-option>
<mat-option value="Viagem">
<mat-option value="Travel">
Viagem
</mat-option>
<mat-option value="Conferência">
<mat-option value="Conference">
Conferência
</mat-option>
<mat-option value="Encontro">
@@ -188,17 +188,6 @@
<mat-form-field appearance="none" class="date-hour-picker">
<!-- <input matInput [matDatepicker]="picker1"
placeholder="Data Inicio*"
[(ngModel)]="postEvent.StartDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker> -->
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Data Inicio*"
[(ngModel)]="postEvent.StartDate"
@@ -222,16 +211,6 @@
<mat-form-field appearance="none" class="date-hour-picker">
<!-- <input matInput [matDatepicker]="picker1"
placeholder="Data Inicio*"
[(ngModel)]="postEvent.StartDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker> -->
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Data Inicio*"
@@ -229,7 +229,7 @@ export class NewEventPage implements OnInit {
Organizer: '',
Category: 'Reunião',
HasAttachments: false,
EventRecurrence: { frequency: this.eventRecurence, until: this.autoEndTime,
EventRecurrence: { frequency: this.eventRecurence, until: "",
Type: '' },
};
}
@@ -252,7 +252,7 @@ export class NewEventPage implements OnInit {
Organizer: '',
Category: 'Reunião',
HasAttachments: false,
EventRecurrence: { frequency: this.eventRecurence, until: this.autoEndTime,
EventRecurrence: { frequency: this.eventRecurence, until: "",
Type: '' },
};
}
@@ -416,7 +416,7 @@ export class NewEventPage implements OnInit {
}
injectValidation() {
this.Form = new FormGroup({
Subject: new FormControl(this.postEvent.Subject, [
Validators.required,
@@ -437,9 +437,9 @@ export class NewEventPage implements OnInit {
participantes: new FormControl(this.taskParticipants, [
Validators.required
]),
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
/* dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
Validators.required
]),
]), */
})
@@ -472,11 +472,14 @@ export class NewEventPage implements OnInit {
this.injectValidation()
this.runValidation()
console.log(new Date(this.postEvent.StartDate).getTime())
console.log(new Date(this.postEvent.EndDate).getTime())
console.log(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null)
if (this.Form.invalid) {
if (new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()) {
/* if (new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()) {
this.toastService._badRequest("Data de inicio menor que a data de fim")
}
} */
return false
}
@@ -242,35 +242,73 @@ export class ViewEventPage implements OnInit {
} */
deleteYesOrNo() {
this.alertController.create({
header: 'Eliminar evento?',
message: '',
buttons: [
{
text: 'Sim',
handler: () => {
this.deleteEvent();
if (this.loadedEvent.IsRecurring) {
this.alertController.create({
header: 'Eliminar evento?',
message: '',
inputs: [
{
name: 'confirm',
type: 'checkbox',
label: 'Este evento tem recorrência, deseja eliminar a Sequência de eventos?',
value: 'confirm',
checked: false,
}
},
{
text: 'Não',
handler: () => {
// sconsole.log('Let me think');
],
buttons: [
{
text: 'Sim',
handler: (data) => {
if (data.includes('confirm')) {
this.deleteEvent(true);
} else {
this.deleteEvent(false);
}
}
},
{
text: 'Não',
handler: () => {
// sconsole.log('Let me think');
}
}
}
]
}).then(res => {
res.present();
});
]
}).then(res => {
res.present();
});
} else {
this.alertController.create({
header: 'Eliminar evento?',
message: '',
buttons: [
{
text: 'Sim',
handler: (data) => {
this.deleteEvent(false);
}
},
{
text: 'Não',
handler: () => {
// sconsole.log('Let me think');
}
}
]
}).then(res => {
res.present();
});
}
}
deleteEvent() {
deleteEvent(deleteAll) {
const loader = this.toastService.loading()
console.log(this.loadedEvent.EventId)
this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId).subscribe(async () => {
this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
@@ -292,47 +330,47 @@ export class ViewEventPage implements OnInit {
/* if (this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.httpErrorHandle.httpsSucessMessagge('delete event')
}, () => { },
() => {
loader.remove();
});
} else {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.httpErrorHandle.httpsSucessMessagge('delete event')
}, (error) => {
this.httpErrorHandle.httpStatusHandle(error)
},
() => {
loader.remove();
});
} */
/* if (this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.httpErrorHandle.httpsSucessMessagge('delete event')
}, () => { },
() => {
loader.remove();
});
} else {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.httpErrorHandle.httpsSucessMessagge('delete event')
}, (error) => {
this.httpErrorHandle.httpStatusHandle(error)
},
() => {
loader.remove();
});
} */
}