mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Improve
This commit is contained in:
@@ -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,6 +45,17 @@
|
|||||||
</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">
|
||||||
@@ -56,7 +80,7 @@
|
|||||||
<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('Location')?.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 +93,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="Form && validateFrom" >
|
||||||
|
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
|
||||||
|
<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,42 @@ 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),
|
||||||
|
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;
|
||||||
|
|||||||
@@ -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 = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user