-
+
+ + +
+
+
+ Campo obrigatório. +
+
+ O campo deve ter pelo menos 4 caracteres. +
+
+
+
-
+
@@ -32,13 +45,24 @@ -->
+ +
+
+
+ Campo obrigatório. +
+
+ O campo deve ter pelo menos 4 caracteres. +
+
+
-
+
+
+
+ {{ postEvent.Categories[0] }} +
+ Campo obrigatório. +
+
+
+
-
+
+ +
+
+ {{ postEvent.Categories[0] }} +
+ Campo obrigatório. +
+
+
diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 9af991193..b3490dfba 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -12,6 +12,10 @@ import { ToastService } from 'src/app/services/toast.service'; import { Event } from '../../../models/event.model'; import { AttendeesPageModal } from '../../events/attendees/attendees.page'; import { SearchPage } from '../../search/search.page'; +import { ThemePalette } from '@angular/material/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import * as moment from 'moment'; + @Component({ selector: 'app-new-event', @@ -20,6 +24,23 @@ import { SearchPage } from '../../search/search.page'; }) export class NewEventPage implements OnInit { + // date picker + public date: any; + public disabled = false; + public showSpinners = true; + public showSeconds = false; + public touchUi = false; + public enableMeridian = false; + public minDate = new Date(); + public endMinDate = new Date(new Date().getTime() + 15 * 60000); + public stepHour = 1; + public stepMinute = 5; + public stepSecond = 5; + public color: ThemePalette = 'primary'; + + Form: FormGroup; + validateFrom = false + postEvent: Event; eventBody: EventBody; segment:string = "true"; @@ -27,7 +48,6 @@ export class NewEventPage implements OnInit { eventAttendees: EventPerson[]; selectedSegment: string; selectedDate: Date; - minDate: string; adding: "intervenient" | "CC"; @@ -65,7 +85,6 @@ export class NewEventPage implements OnInit { let selectedEndDate = new Date(this.selectedDate); /* Set + 30minutes to seleted datetime */ selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ; - this.minDate = this.selectedDate.toString(); if(this.selectedSegment != "Combinada"){ this.postEvent ={ @@ -122,9 +141,44 @@ export class NewEventPage implements OnInit { this.modalController.dismiss(); } + + 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, [ + Validators.required + ]), + Categories: new FormControl(this.postEvent.Categories[0], [ + Validators.required + ]), + IsRecurring: new FormControl(this.postEvent.IsRecurring, [ + Validators.required + ]), + // participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [ + // Validators.required + // ]), + + }) + } + async save() { - /* console.log(this.postEvent); - console.log(this.profile); */ + this.injectValidation() + this.runValidation() + + if(this.Form.invalid) return false + + console.log('passed') if(this.documents.length >= 0) { this.postEvent.HasAttachments = true; diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 45065d2a9..ca7e4a003 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -71,7 +71,7 @@
-
+
Entrar com senha
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 55376a244..1ca114dfa 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -118,7 +118,7 @@ @@ -193,7 +193,7 @@
- Adicionar participant. + Adicionar participante.
diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.html b/src/app/shared/headers/header-no-search/profile/profile.page.html index 0d6d6415b..78759ad91 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.html +++ b/src/app/shared/headers/header-no-search/profile/profile.page.html @@ -30,7 +30,6 @@
- PIN
diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.ts b/src/app/shared/headers/header-no-search/profile/profile.page.ts index d578dba59..23bd43dd5 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.ts +++ b/src/app/shared/headers/header-no-search/profile/profile.page.ts @@ -14,7 +14,7 @@ import { PinPage } from 'src/app/shared/pin/pin.page'; export class ProfileComponent implements OnInit { loggeduser: User; - userLoginPreference: boolean + userLoginPreference = '' constructor(private modalController:ModalController, private authService: AuthService, @@ -140,7 +140,7 @@ export class ProfileComponent implements OnInit { if (userData.hasOwnProperty('loginPreference')) { this.userLoginPreference = userData.loginPreference } else { - this.userLoginPreference = false + this.userLoginPreference = '' } }