This commit is contained in:
Eudes Inácio
2021-07-02 11:08:28 +01:00
8 changed files with 112 additions and 16 deletions
+3 -1
View File
@@ -370,7 +370,8 @@ td.monthview-primary-with-event {
.calendar-tool-tip{ .calendar-tool-tip{
padding: 20px 10px 30px 10px; padding: 30px 10px 20px 10px;
//border: 1px solid orange;
} }
@@ -597,6 +598,7 @@ td.monthview-primary-with-event {
.container-wrapper{ .container-wrapper{
height: 100%; height: 100%;
.calendar-timeline{ .calendar-timeline{
border-top-right-radius: 24px; border-top-right-radius: 24px;
width: calc(100%); width: calc(100%);
@@ -14,15 +14,28 @@
<div class="main-content"> <div class="main-content">
<!-- <input type="text" ngbDatepicker #d="ngbDatepicker"/> --> <!-- <input type="text" ngbDatepicker #d="ngbDatepicker"/> -->
<div class="ion-item-container"> <div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input> <ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
</div> </div>
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
<div *ngIf="Form.get('Subject').errors?.required">
Campo obrigatório.
</div>
<div *ngIf="Form.get('Subject').errors?.minlength">
O campo deve ter pelo menos 4 caracteres.
</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">
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div> </div>
<div class="ion-input-class"> <div class="ion-input-class" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
<ion-input placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input> <ion-input placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
</div> </div>
</div> </div>
@@ -32,13 +45,24 @@
</span> --> </span> -->
</div> </div>
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
<div *ngIf="Form.get('Location').errors?.required">
Campo obrigatório.
</div>
<div *ngIf="Form.get('Location').errors?.minlength">
O campo deve ter pelo menos 4 caracteres.
</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">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div> </div>
<div class="ion-input-class"> <div class="ion-input-class" [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
<ion-select placeholder="Selecione agenda*" <ion-select placeholder="Selecione agenda*"
selectedText="{{postEvent.CalendarName}}" selectedText="{{postEvent.CalendarName}}"
[(ngModel)]="postEvent.CalendarName" [(ngModel)]="postEvent.CalendarName"
@@ -51,12 +75,21 @@
</div> </div>
</div> </div>
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message">
{{ postEvent.Categories[0] }}
<div *ngIf="Form.get('CalendarName').errors?.required">
Campo obrigatório.
</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">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </div>
<div class="ion-input-class"> <div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*" <ion-select placeholder="Selecione tipo de evento*"
[(ngModel)]="postEvent.Categories[0]" [(ngModel)]="postEvent.Categories[0]"
interface="action-sheet" interface="action-sheet"
@@ -69,6 +102,15 @@
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
{{ postEvent.Categories[0] }}
<div *ngIf="Form.get('Categories').errors?.required">
Campo obrigatório.
</div>
</div>
</div>
<div class="container-div"> <div class="container-div">
<div class="ion-item-class-2"> <div class="ion-item-class-2">
@@ -12,6 +12,10 @@ import { ToastService } from 'src/app/services/toast.service';
import { Event } from '../../../models/event.model'; import { Event } from '../../../models/event.model';
import { AttendeesPageModal } from '../../events/attendees/attendees.page'; import { AttendeesPageModal } from '../../events/attendees/attendees.page';
import { SearchPage } from '../../search/search.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({ @Component({
selector: 'app-new-event', selector: 'app-new-event',
@@ -20,6 +24,23 @@ import { SearchPage } from '../../search/search.page';
}) })
export class NewEventPage implements OnInit { 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; postEvent: Event;
eventBody: EventBody; eventBody: EventBody;
segment:string = "true"; segment:string = "true";
@@ -27,7 +48,6 @@ export class NewEventPage implements OnInit {
eventAttendees: EventPerson[]; eventAttendees: EventPerson[];
selectedSegment: string; selectedSegment: string;
selectedDate: Date; selectedDate: Date;
minDate: string;
adding: "intervenient" | "CC"; adding: "intervenient" | "CC";
@@ -65,7 +85,6 @@ export class NewEventPage implements OnInit {
let selectedEndDate = new Date(this.selectedDate); let selectedEndDate = new Date(this.selectedDate);
/* Set + 30minutes to seleted datetime */ /* Set + 30minutes to seleted datetime */
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ; selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
this.minDate = this.selectedDate.toString();
if(this.selectedSegment != "Combinada"){ if(this.selectedSegment != "Combinada"){
this.postEvent ={ this.postEvent ={
@@ -122,9 +141,44 @@ export class NewEventPage implements OnInit {
this.modalController.dismiss(); 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() { async save() {
/* console.log(this.postEvent); this.injectValidation()
console.log(this.profile); */ this.runValidation()
if(this.Form.invalid) return false
console.log('passed')
if(this.documents.length >= 0) { if(this.documents.length >= 0) {
this.postEvent.HasAttachments = true; this.postEvent.HasAttachments = true;
@@ -102,7 +102,6 @@ export class ExpedientesPrPage implements OnInit {
console.log(this.taskslist); console.log(this.taskslist);
this.showLoader = false; this.showLoader = false;
}); });
break; break;
} }
} }
+1 -1
View File
@@ -71,7 +71,7 @@
</div> </div>
<div *ngIf="hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="enterWithPassword=true"> <div *ngIf="hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="loginPreference = 'none'">
Entrar com senha Entrar com senha
</div> </div>
@@ -118,7 +118,7 @@
<input matInput [ngxMatDatetimePicker]="picker1" <input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date" placeholder="Choose a date"
[formControl]="dateControlStart" [formControl]="dateControlStart"
[min]="minDate" [max]="maxDate" [min]="minDate"
[disabled]="disabled" [disabled]="disabled"
> >
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle> <mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
@@ -193,7 +193,7 @@
<div *ngIf="Form && validateFrom" > <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('participantes').invalid " class="input-errror-message"> <div *ngIf="Form.get('participantes').invalid " class="input-errror-message">
<div *ngIf="Form.get('participantes').errors?.required"> <div *ngIf="Form.get('participantes').errors?.required">
Adicionar participant. Adicionar participante.
</div> </div>
</div> </div>
</div> </div>
@@ -30,7 +30,6 @@
<ion-row> <ion-row>
<ion-col class="align-center d-flex"> <ion-col class="align-center d-flex">
<div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')"> <div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')">
<!-- -->
<ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox> <ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox>
PIN PIN
</div> </div>
@@ -14,7 +14,7 @@ import { PinPage } from 'src/app/shared/pin/pin.page';
export class ProfileComponent implements OnInit { export class ProfileComponent implements OnInit {
loggeduser: User; loggeduser: User;
userLoginPreference: boolean userLoginPreference = ''
constructor(private modalController:ModalController, constructor(private modalController:ModalController,
private authService: AuthService, private authService: AuthService,
@@ -140,7 +140,7 @@ export class ProfileComponent implements OnInit {
if (userData.hasOwnProperty('loginPreference')) { if (userData.hasOwnProperty('loginPreference')) {
this.userLoginPreference = userData.loginPreference this.userLoginPreference = userData.loginPreference
} else { } else {
this.userLoginPreference = false this.userLoginPreference = ''
} }
} }