-
+ +
+
+
+
+ Campo obrigatório. +
+
+ O campo deve ter pelo menos 4 caracteres. +
+
+
+
-
+
@@ -30,8 +42,19 @@ Campo obrigatório --> -
+ +
+
+
+ Campo obrigatório. +
+
+ O campo deve ter pelo menos 4 caracteres. +
+
+
+
@@ -161,13 +184,21 @@
+ +
+
+
+ Adicionar participant. +
+
+
-
+
@@ -190,7 +221,7 @@
-
+
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index 9d133d599..34e38c31d 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -10,7 +10,7 @@ import { SearchPage } from 'src/app/pages/search/search.page'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { Attachment } from 'src/app/models/attachment.model'; import { ToastService } from 'src/app/services/toast.service'; -import { FormControl } from '@angular/forms'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; import * as moment from 'moment'; @Component({ @@ -43,6 +43,9 @@ export class EditEventPage implements OnInit { public stepMinute = 5; public stepSecond = 5; + Form: FormGroup; + validateFrom = false + @Input() taskParticipants: EventPerson[]; @Input() taskParticipantsCc: EventPerson[]; @Input() profile:string; @@ -147,8 +150,49 @@ export class EditEventPage implements OnInit { this.deleteTemporaryData(); } + + runValidation() { + this.validateFrom = true + } + + injectValidation() { + + this.Form = new FormGroup({ + Subject: new FormControl(this.postEvent.Subject, [ + Validators.required, + // Validators.minLength(4) + ]), + Location: new FormControl(this.postEvent.Location, [ + Validators.required, + ]), + CalendarName: new FormControl(this.postEvent.CalendarName), + Categories: new FormControl(this.postEvent.Categories[0], [ + Validators.required + ]), + dateStart: new FormControl(this.dateStart, [ + Validators.required + ]), + dateEnd: new FormControl(this.dateEnd, [ + Validators.required + ]), + IsRecurring: new FormControl(this.postEvent.IsRecurring, [ + Validators.required + ]), + participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [ + Validators.required + ]), + + }) + } + + async save() { + this.injectValidation() + this.runValidation() + + if(this.Form.invalid) return false + this.getDatepickerData() this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index 57e724b43..55376a244 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -42,16 +42,16 @@
-
-
-
- Campo obrigatório. -
-
- O campo deve ter pelo menos 4 caracteres. -
+
+
+
+ Campo obrigatório. +
+
+ O campo deve ter pelo menos 4 caracteres.
+
@@ -144,13 +144,13 @@ -
+
@@ -190,7 +190,6 @@
-
diff --git a/src/app/shared/agenda/new-event/new-event.page.scss b/src/app/shared/agenda/new-event/new-event.page.scss index f7dbbd685..0e05a84b1 100644 --- a/src/app/shared/agenda/new-event/new-event.page.scss +++ b/src/app/shared/agenda/new-event/new-event.page.scss @@ -214,4 +214,5 @@ .materia-top { padding-top: 7px; -} \ No newline at end of file +} + diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index 49e632fce..d7c83fefc 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -62,7 +62,7 @@ export class NewEventPage implements OnInit { public touchUi = false; public enableMeridian = false; public minDate = new Date(); - public maxDate = ''; + public endMinDate = new Date(new Date().getTime() + 15 * 60000); public stepHour = 1; public stepMinute = 5; public stepSecond = 5; @@ -323,7 +323,7 @@ export class NewEventPage implements OnInit { this.injectValidation() this.runValidation() - + if(this.Form.invalid) return false this.getDatepickerData() diff --git a/src/global.scss b/src/global.scss index a205e26e5..5237adf0d 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1004,3 +1004,12 @@ background: rgb(92, 92, 92); color: white !important; } } + +ngx-mat-datetime-content{ + .actions { + .mat-button-disabled { + background-color: #ff5a5a59 !important; + } + } + +}