mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
criar evento com recorrencia
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<!-- <input type="text" ngbDatepicker #d="ngbDatepicker"/> -->
|
||||
|
||||
|
||||
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@
|
||||
<!-- <span class="error ion-padding" >
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="Form && validateFrom" >
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
@@ -64,9 +64,9 @@
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione agenda*"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
required>
|
||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||
@@ -89,9 +89,9 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione tipo de evento*"
|
||||
[(ngModel)]="postEvent.Categories[0]"
|
||||
interface="action-sheet"
|
||||
<ion-select placeholder="Selecione tipo de evento*"
|
||||
[(ngModel)]="postEvent.Categories[0]"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||
@@ -110,20 +110,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
<ion-datetime
|
||||
placeholder="Início*"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
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="{{minDate}}"
|
||||
min="{{minDate}}"
|
||||
max="2025"
|
||||
>
|
||||
</ion-datetime>
|
||||
@@ -131,14 +131,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
<ion-datetime
|
||||
<ion-datetime
|
||||
placeholder="Fim*"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
@@ -146,51 +146,51 @@
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="{{minDate}}"
|
||||
max="2025"
|
||||
|
||||
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<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-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*"
|
||||
<ion-select placeholder="Selecione a repetição*"
|
||||
[(ngModel)]="selectedRecurringType"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)"
|
||||
interface="action-sheet"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option *ngFor="let recurring of recurringTypes" value="{{recurring.Code}}">{{recurring.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<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-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
<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"
|
||||
max="2045"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
@@ -217,7 +217,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
@@ -245,20 +245,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height flex-grow-1">
|
||||
|
||||
|
||||
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" ></ion-textarea>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ion-item-container-no-border cursor-pointer" (click)="getDoc()">
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
@@ -266,27 +266,27 @@
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Adicionar documentos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let document of documents; let i = index" >
|
||||
|
||||
<div *ngFor="let document of documents; let i = index" >
|
||||
<ion-list class="list">
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<span class="close-button text-black cursor-pointer" (click)="removeAttachment(i)" >
|
||||
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</span>
|
||||
</p>
|
||||
</p>
|
||||
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yy'}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border d-flex justify-center px-20">
|
||||
<ion-toolbar class=" ">
|
||||
@@ -302,4 +302,4 @@
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
</ion-footer>
|
||||
|
||||
@@ -63,12 +63,12 @@ export class NewEventPage implements OnInit {
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private eventService: EventsService,
|
||||
private eventService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
userService: AuthService,
|
||||
) {
|
||||
) {
|
||||
this.loggeduser = userService.ValidatedUser;
|
||||
this.postEvent = new Event();
|
||||
this.postEvent.EventRecurrence = {Type:'-1'};
|
||||
@@ -87,16 +87,16 @@ export class NewEventPage implements OnInit {
|
||||
ngOnInit() {
|
||||
this.selectedRecurringType = "-1";
|
||||
console.log(this.postEvent);
|
||||
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
/* console.log(this.profile); */
|
||||
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
|
||||
if(this.selectedSegment != "Combinada"){
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
@@ -148,9 +148,12 @@ export class NewEventPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
console.log(this.postEvent);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
@@ -173,7 +176,7 @@ export class NewEventPage implements OnInit {
|
||||
this.selectedRecurringType = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
@@ -216,22 +219,22 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
async save() {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
|
||||
if(this.documents.length >= 0) {
|
||||
this.postEvent.HasAttachments = true;
|
||||
}
|
||||
if(this.selectedRecurringType != '-1'){
|
||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||
}
|
||||
|
||||
|
||||
let eventId: any;
|
||||
|
||||
|
||||
try {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -240,15 +243,15 @@ export class NewEventPage implements OnInit {
|
||||
console.log(this.loggeduser.Profile);
|
||||
|
||||
console.log(this.postEvent);
|
||||
|
||||
|
||||
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||
console.log(eventId);
|
||||
loader.remove()
|
||||
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
console.log(this.loggeduser.Profile);
|
||||
|
||||
|
||||
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||
loader.remove()
|
||||
}
|
||||
@@ -272,14 +275,14 @@ export class NewEventPage implements OnInit {
|
||||
} catch(error) {
|
||||
console.log('document not save')
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.toastService.successMessage()
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
@@ -287,7 +290,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
async openAttendees() {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
@@ -302,7 +305,7 @@ export class NewEventPage implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
|
||||
if(data){
|
||||
data = data['data'];
|
||||
|
||||
@@ -319,7 +322,7 @@ export class NewEventPage implements OnInit {
|
||||
this.taskParticipants = data;
|
||||
this.postEvent.Attendees = data;
|
||||
}
|
||||
|
||||
|
||||
setIntervenientCC(data){
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
@@ -359,4 +362,4 @@ export class NewEventPage implements OnInit {
|
||||
this.documents = this.documents.filter( (e, i) => index != i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
@@ -39,9 +39,9 @@
|
||||
<ion-input type="text" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Location').errors?.required">
|
||||
@@ -52,13 +52,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<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 class="ion-input-class flex-grow-1 d-flex justify-center align-center material-inputs materia-top ">
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs ">
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="postEvent.CalendarName" >
|
||||
@@ -80,7 +80,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1 d-flex justify-center align-center material-inputs materia-top">
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs">
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
|
||||
<!-- <input matInput type="text" > -->
|
||||
@@ -109,23 +109,23 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
[className]="Form?.get('Subject')?.invalid ? 'input-error ion-input-class flex-grow-1' : 'ion-input-class ion-input-class flex-grow-1' "
|
||||
-->
|
||||
<div class="ion-input-class flex-grow-1" >
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlStart"
|
||||
[min]="minDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
[showSpinners]="showSpinners"
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
>
|
||||
@@ -135,29 +135,29 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<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>
|
||||
<!--
|
||||
<!--
|
||||
[className]="Form?.get('Subject')?.invalid ? 'input-error ion-input-class flex-grow-1' : 'ion-input-class ion-input-class flex-grow-1' "
|
||||
-->
|
||||
<div (click)="openFim()" class="ion-input-class flex-grow-1" >
|
||||
<div (click)="openFim()" class="ion-input-class flex-grow-1 justify-center align-center materia-top">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="endMinDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
[showSpinners]="showSpinners"
|
||||
<ngx-mat-datetime-picker #fim
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
>
|
||||
@@ -167,21 +167,44 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
|
||||
|
||||
|
||||
<!-- <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-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)]="selectedRecurringType"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<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 class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1 d-flex justify-center align-center material-inputs materia-top">
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||
<mat-select placeholder="Selecione repetição*" [(ngModel)]="postEvent.IsRecurring">
|
||||
<mat-option value="false">
|
||||
Não se repete
|
||||
</mat-option>
|
||||
<mat-option value="true">
|
||||
Repete
|
||||
<mat-select placeholder="Selecione repetição*"
|
||||
[(ngModel)]="postEvent.EventRecurrence.Type"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)">
|
||||
<mat-option
|
||||
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
|
||||
>
|
||||
{{recurring.Description}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@@ -189,7 +212,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('participantes').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('participantes').errors?.required">
|
||||
@@ -204,7 +227,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height flex-grow-1" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom">
|
||||
|
||||
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -220,7 +243,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
@@ -228,7 +251,7 @@
|
||||
</div>
|
||||
<div class="ion-input-class-no-height flex-grow-1" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom">
|
||||
<div class="list-people">
|
||||
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="taskParticipantsCc.length ==0" class="list-people-title">Com conhecimento</ion-label>
|
||||
@@ -243,20 +266,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height flex-grow-1">
|
||||
|
||||
|
||||
<ion-textarea [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" ></ion-textarea>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ion-item-container-no-border cursor-pointer" (click)="getDoc()">
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
@@ -264,28 +287,28 @@
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Adicionar documentos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<span class="close-button text-black cursor-pointer" (click)="removeAttachment(i)" >
|
||||
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</span>
|
||||
</p>
|
||||
</p>
|
||||
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yy'}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border px-20">
|
||||
<ion-toolbar class="d-flex justify-space-between">
|
||||
@@ -301,4 +324,4 @@
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
</ion-footer>
|
||||
|
||||
@@ -66,13 +66,15 @@ export class NewEventPage implements OnInit {
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
public color: ThemePalette = 'primary';
|
||||
recurringTypes: any;
|
||||
selectedRecurringType: any;
|
||||
|
||||
@Input() profile:string;
|
||||
@Input() selectedSegment: string;
|
||||
@Input() selectedDate: Date;
|
||||
@Input() taskParticipants: EventPerson[] = [];
|
||||
@Input() taskParticipantsCc: any = [];
|
||||
|
||||
|
||||
@Output() setIntervenient = new EventEmitter<any>();
|
||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||
|
||||
@@ -122,7 +124,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private eventService: EventsService,
|
||||
private eventService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private toastService: ToastService,
|
||||
private userService: AuthService,
|
||||
@@ -137,23 +139,23 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
if(!this.restoreTemporaryData()){
|
||||
// clear
|
||||
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
this.postEvent.Body = this.eventBody;
|
||||
|
||||
/* console.log(this.profile); */
|
||||
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
|
||||
|
||||
|
||||
if(this.selectedSegment != "Combinada"){
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
@@ -173,7 +175,7 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Categories: ['Reunião'],
|
||||
HasAttachments: false,
|
||||
EventRecurrence: null,
|
||||
EventRecurrence: {Type:'-1'},
|
||||
};
|
||||
}
|
||||
else{
|
||||
@@ -195,7 +197,7 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Categories: ['Reunião'],
|
||||
HasAttachments: false,
|
||||
EventRecurrence: null,
|
||||
EventRecurrence: {Type:'-1'},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -206,7 +208,7 @@ export class NewEventPage implements OnInit {
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
@@ -221,7 +223,8 @@ export class NewEventPage implements OnInit {
|
||||
this.date = new Date(2021,9,4,5,6,7);
|
||||
this.getDatepickerData()
|
||||
|
||||
this.injectValidation()
|
||||
this.injectValidation();
|
||||
|
||||
}
|
||||
|
||||
runValidation() {
|
||||
@@ -292,7 +295,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
close(){
|
||||
|
||||
this.deleteTemporaryData();
|
||||
@@ -303,6 +306,24 @@ export class NewEventPage implements OnInit {
|
||||
this.setIntervenientCC.emit([]);
|
||||
}
|
||||
|
||||
getRecurrenceTypes() {
|
||||
this.eventService.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.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
||||
}
|
||||
if(ev.length == 0){
|
||||
this.postEvent.EventRecurrence.Type = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
getDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.postEvent.StartDate = this.dateStart
|
||||
@@ -332,6 +353,9 @@ export class NewEventPage implements OnInit {
|
||||
if(this.documents.length >= 0) {
|
||||
this.postEvent.HasAttachments = true;
|
||||
}
|
||||
if(this.selectedRecurringType != '-1'){
|
||||
/* this.postEvent.EventRecurrence.Type = this.selectedRecurringType; */
|
||||
}
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
// console.log('MD - Aqui');
|
||||
@@ -340,9 +364,12 @@ export class NewEventPage implements OnInit {
|
||||
this.showLoader = true;
|
||||
|
||||
console.log(this.postEvent);
|
||||
|
||||
|
||||
let loader = this.toastService.loading()
|
||||
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
console.log(this.postEvent);
|
||||
|
||||
|
||||
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||
async (id) => {
|
||||
@@ -365,10 +392,10 @@ export class NewEventPage implements OnInit {
|
||||
SerialNumber: ''
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
await DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||
|
||||
|
||||
if(DocumentToSave.length == (i+1)){
|
||||
this.afterSave();
|
||||
}
|
||||
@@ -376,7 +403,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(DocumentToSave.length == 0){
|
||||
|
||||
this.afterSave();
|
||||
@@ -386,11 +413,12 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
},
|
||||
error => {
|
||||
|
||||
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.toastService.badRequest('Evento não criado')
|
||||
});
|
||||
loader.remove();
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
console.log('PR - Aqui');
|
||||
@@ -398,7 +426,7 @@ export class NewEventPage implements OnInit {
|
||||
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||
(id) => {
|
||||
console.log(id);
|
||||
|
||||
|
||||
|
||||
const eventId: any = id;
|
||||
|
||||
@@ -417,7 +445,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||
|
||||
|
||||
if(DocumentToSave.length == (i+1)){
|
||||
this.afterSave();
|
||||
}
|
||||
@@ -465,7 +493,7 @@ export class NewEventPage implements OnInit {
|
||||
async addParticipantsCc() {
|
||||
|
||||
this.saveTemporaryData();
|
||||
|
||||
|
||||
this.openAttendeesComponent.emit({
|
||||
type: "CC"
|
||||
});
|
||||
@@ -483,7 +511,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @description o pipeline já esta a funcionar tuda vez que nos fazer push na branch master e test o pipeline executa os teste, mas agora os teste temos que melhora para testar a app em tudos os pontos
|
||||
* o pipeline já está a funcionar toda vez que nos fazer um push na branch master ou teste o pipeline executa os testes, mas agora os testes temos que melhorar para testar a app em todos os pontos
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user