mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
add ocurrency inputs
This commit is contained in:
@@ -196,44 +196,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div width-100">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2 d-flex">
|
||||||
<div class="ion-icon-class">
|
<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-refresh.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('dateOccurrence')?.invalid && validateFrom ">
|
||||||
<ion-select
|
|
||||||
class="d-block d-md-none"
|
|
||||||
[(ngModel)]="postData.IsRecurring"
|
|
||||||
placeholder="Selecione repetição*"
|
|
||||||
value="false"
|
|
||||||
interface="action-sheet"
|
|
||||||
Cancel-text="Cancelar"
|
|
||||||
required
|
|
||||||
|
|
||||||
|
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||||
|
<mat-select placeholder="Selecione repetição*"
|
||||||
|
[(ngModel)]="EventRecurrenceType"
|
||||||
|
(ngModelChange)="onSelectedRecurringChanged($event)">
|
||||||
|
<mat-option
|
||||||
|
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
|
||||||
>
|
>
|
||||||
<ion-select-option value="false">Não se repete</ion-select-option>
|
{{recurring.Description}}
|
||||||
<ion-select-option value="true">Repete</ion-select-option>
|
|
||||||
<!-- <ion-select-option value="true">Semanal</ion-select-option>
|
|
||||||
<ion-select-option value="true">Diário</ion-select-option>
|
|
||||||
<ion-select-option value="true">Anual</ion-select-option> -->
|
|
||||||
</ion-select>
|
|
||||||
|
|
||||||
|
|
||||||
<mat-form-field
|
|
||||||
floatLabel="never"
|
|
||||||
class="width-100 d-none d-md-block"
|
|
||||||
value="false"
|
|
||||||
interface="action-sheet"
|
|
||||||
required
|
|
||||||
appearance="none"
|
|
||||||
>
|
|
||||||
<mat-select placeholder="Selecione repetição*" [(ngModel)]="postData.IsRecurring" >
|
|
||||||
<mat-option value="false">
|
|
||||||
Não se repete
|
|
||||||
</mat-option>
|
|
||||||
<mat-option value="true">
|
|
||||||
Repete
|
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@@ -242,8 +219,45 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="EventRecurrenceType != '-1'" class="container-div width-100">
|
||||||
|
<div class="ion-item-class-2 d-flex">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div (click)="openLastOccurrence()" class="ion-input-class flex-grow-1">
|
||||||
|
<!-- <ion-datetime
|
||||||
|
placeholder="Última ocorrência"
|
||||||
|
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||||
|
displayFormat="DD MMM YYYY"
|
||||||
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
|
min="2021"
|
||||||
|
max="2045"
|
||||||
|
>
|
||||||
|
</ion-datetime> -->
|
||||||
|
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||||
|
|
||||||
|
<!-- [formControl]="dateControlOccurrence" -->
|
||||||
|
|
||||||
|
<mat-form-field class="date-hour-picker">
|
||||||
|
<input matInput [ngxMatDatetimePicker]="occurrrence"
|
||||||
|
placeholder="Choose a date"
|
||||||
|
[(ngModel)]="Occurrence"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||||
|
<ngx-mat-datetime-picker #occurrrence
|
||||||
|
[showSpinners]="showSpinners"
|
||||||
|
[showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
[stepSecond]="stepSecond"
|
||||||
|
[touchUi]="touchUi"
|
||||||
|
>
|
||||||
|
</ngx-mat-datetime-picker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { MAT_DATE_LOCALE } from '@angular/material/core';
|
|||||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { DocumentService } from 'src/app/Rules/document.service';
|
import { DocumentService } from 'src/app/Rules/document.service';
|
||||||
import { DocumentSetUpMeeting, Attachments } from 'src/app/models/CallMeeting';
|
import { DocumentSetUpMeeting, Attachments } from 'src/app/models/CallMeeting';
|
||||||
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
|
||||||
const moment = _rollupMoment || _moment;
|
const moment = _rollupMoment || _moment;
|
||||||
|
|
||||||
@@ -38,6 +39,9 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
|||||||
selector: 'app-document-set-up-meeting',
|
selector: 'app-document-set-up-meeting',
|
||||||
templateUrl: './document-set-up-meeting.page.html',
|
templateUrl: './document-set-up-meeting.page.html',
|
||||||
styleUrls: ['./document-set-up-meeting.page.scss'],
|
styleUrls: ['./document-set-up-meeting.page.scss'],
|
||||||
|
providers: [
|
||||||
|
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||||
|
]
|
||||||
})
|
})
|
||||||
export class DocumentSetUpMeetingPage implements OnInit {
|
export class DocumentSetUpMeetingPage implements OnInit {
|
||||||
|
|
||||||
@@ -60,6 +64,9 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
|
|
||||||
Form: FormGroup;
|
Form: FormGroup;
|
||||||
validateFrom = false
|
validateFrom = false
|
||||||
|
recurringTypes = [];
|
||||||
|
Occurrence: Date = new Date()
|
||||||
|
EventRecurrenceType = '-1'
|
||||||
|
|
||||||
showLoader = false
|
showLoader = false
|
||||||
|
|
||||||
@@ -115,7 +122,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
private processes:ProcessesService,
|
private processes:ProcessesService,
|
||||||
authService: AuthService,
|
authService: AuthService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private documentService: DocumentService
|
private documentService: DocumentService,
|
||||||
|
private calendarService: EventsService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
@@ -135,6 +143,13 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
this.adding = "intervenient";
|
this.adding = "intervenient";
|
||||||
console.log(this.task);
|
console.log(this.task);
|
||||||
this.setDefaultTime()
|
this.setDefaultTime()
|
||||||
|
this.getRecurrenceTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
getRecurrenceTypes() {
|
||||||
|
this.calendarService.getRecurrenceTypes().subscribe(res=>{
|
||||||
|
this.recurringTypes = res;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setDefaultTime() {
|
setDefaultTime() {
|
||||||
@@ -193,6 +208,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
if(this.loggeduser.Profile == 'MDGPR') {
|
if(this.loggeduser.Profile == 'MDGPR') {
|
||||||
this.injectValidation()
|
this.injectValidation()
|
||||||
this.runValidation()
|
this.runValidation()
|
||||||
|
if(this.Form.invalid) return false
|
||||||
}
|
}
|
||||||
|
|
||||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||||
@@ -205,11 +221,14 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
EndDate: this.dateEnd,
|
EndDate: this.dateEnd,
|
||||||
EventType: 'Reunião',
|
EventType: 'Reunião',
|
||||||
ParticipantsList: Attendees,
|
ParticipantsList: Attendees,
|
||||||
EventRecurrence: null,
|
|
||||||
Subject: this.postData.Subject,
|
Subject: this.postData.Subject,
|
||||||
IsRecurring: this.postData.IsRecurring,
|
IsRecurring: this.postData.IsRecurring,
|
||||||
Message: this.postData.Subject,
|
Message: this.postData.Subject,
|
||||||
IsAllDayEvent: this.postData.IsRecurring,
|
IsAllDayEvent: this.postData.IsRecurring,
|
||||||
|
EventRecurrence: {
|
||||||
|
Type: this.EventRecurrenceType,
|
||||||
|
LastOccurrence: this.Occurrence
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Attachments: []
|
Attachments: []
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ export class DocumentSetUpMeeting {
|
|||||||
"ParticipantsList"?: EventPerson[],
|
"ParticipantsList"?: EventPerson[],
|
||||||
"Message": string,
|
"Message": string,
|
||||||
"EventRecurrence": {
|
"EventRecurrence": {
|
||||||
"Type": 0,
|
"Type": string,
|
||||||
"Day"?: 1,
|
"Day"?: any,
|
||||||
"DayOfWeek"?: 0,
|
"DayOfWeek"?: any,
|
||||||
"Month"?: 1,
|
"Month"?: any,
|
||||||
"LastOccurrence"?: string
|
"LastOccurrence"?: any
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Attachments: Attachments[]
|
Attachments: Attachments[]
|
||||||
|
|||||||
@@ -43,9 +43,13 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
|
{{ toDayEventStorage.eventsList | json}}
|
||||||
|
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item class="cursor-pointer" lines="none" *ngFor="let event of toDayEventStorage.eventsList"
|
<ion-item class="cursor-pointer" lines="none" *ngFor="let event of toDayEventStorage.eventsList"
|
||||||
(click)="goToEvent(event.EventId)">
|
(click)="goToEvent(event.EventId)"
|
||||||
|
>
|
||||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||||
|
|
||||||
<div class="schedule-time">
|
<div class="schedule-time">
|
||||||
|
|||||||
-3
@@ -261,9 +261,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
|
|||||||
-1
@@ -40,7 +40,6 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
|||||||
templateUrl: './book-meeting-modal.page.html',
|
templateUrl: './book-meeting-modal.page.html',
|
||||||
styleUrls: ['./book-meeting-modal.page.scss'],
|
styleUrls: ['./book-meeting-modal.page.scss'],
|
||||||
providers: [
|
providers: [
|
||||||
// { provide: MAT_DATE_LOCALE, useValue: 'pt' },
|
|
||||||
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -113,11 +113,10 @@ export class ViewEventPage implements OnInit {
|
|||||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
});
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteEvent(){
|
async deleteEvent() {
|
||||||
|
|
||||||
if (this.loadedEvent.IsRecurring) {
|
if (this.loadedEvent.IsRecurring) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user