mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -155,41 +155,41 @@
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione a repetição*"
|
||||
[(ngModel)]="postEvent.EventRecurrence.Type"
|
||||
selectedText="{{postEvent.EventRecurrence.Type}}"
|
||||
[(ngModel)]="selectedRecurringType"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="-1">Nunca</ion-select-option>
|
||||
<ion-select-option value="0">Diário</ion-select-option>
|
||||
<ion-select-option value="1">Semanal</ion-select-option>
|
||||
<ion-select-option value="2">Mensal</ion-select-option>
|
||||
<ion-select-option value="3">Anual</ion-select-option>
|
||||
<ion-select-option *ngFor="let recurring of recurringTypes" value="{{recurring.Code}}">{{recurring.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div *ngIf="selectedRecurringType != '-1'" class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione repetição*"
|
||||
[(ngModel)]="postEvent.IsRecurring"
|
||||
selectedText="{{isRecurring}}"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="false">Não se repete</ion-select-option>
|
||||
<ion-select-option value="true">Repete</ion-select-option>
|
||||
</ion-select>
|
||||
<ion-datetime
|
||||
placeholder="Última ocorrência"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOcurrence"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2021"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div (click)="addParticipants()" class="ion-item-class-2 cursor-pointer">
|
||||
<div class="ion-icon-class">
|
||||
|
||||
@@ -36,6 +36,8 @@ export class EditEventPage implements OnInit {
|
||||
minDate: string;
|
||||
initCalendarName: string;
|
||||
caller:string;
|
||||
recurringTypes: any;
|
||||
selectedRecurringType: any;
|
||||
|
||||
|
||||
loadedEventAttachments: Attachment[];
|
||||
@@ -57,10 +59,9 @@ export class EditEventPage implements OnInit {
|
||||
) {
|
||||
|
||||
this.postEvent = new Event();
|
||||
console.log(this.postEvent);
|
||||
this.postEvent.EventRecurrence = {Type:'-1'}
|
||||
this.isEventEdited = false;
|
||||
this.postEvent = this.navParams.get('event');
|
||||
this.postEvent.EventRecurrence = {Type:'-1'};
|
||||
this.caller = this.navParams.get('caller');
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
|
||||
@@ -97,8 +98,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.caller);
|
||||
this.selectedRecurringType = "-1";
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
@@ -126,9 +126,21 @@ export class EditEventPage implements OnInit {
|
||||
getRecurrenceTypes() {
|
||||
this.eventsService.getRecurrenceTypes().subscribe(res=>{
|
||||
console.log(res);
|
||||
this.recurringTypes = res;
|
||||
});
|
||||
}
|
||||
|
||||
onSelectedRecurringChanged(ev:any){
|
||||
console.log(ev);
|
||||
if(ev.length > 1){
|
||||
console.log(ev.filter(data => data != '-1'));
|
||||
this.selectedRecurringType = ev.filter(data => data != '-1');
|
||||
}
|
||||
if(ev.length == 0){
|
||||
this.selectedRecurringType = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
@@ -171,8 +183,9 @@ export class EditEventPage implements OnInit {
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
try{
|
||||
console.log(this.postEvent);
|
||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||
|
||||
/* this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
if(this.initCalendarName != this.postEvent.CalendarName){
|
||||
let body = {
|
||||
"EventId": this.postEvent.EventId,
|
||||
@@ -185,7 +198,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
}, error => {
|
||||
this.toastService.badRequest()
|
||||
}); */
|
||||
});
|
||||
|
||||
this.isEventEdited = true;
|
||||
this.goBack();
|
||||
|
||||
Reference in New Issue
Block a user