mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Improve
This commit is contained in:
@@ -17,7 +17,7 @@ export class ContactsPage implements OnInit {
|
||||
headers: HttpHeaders;
|
||||
options:any;
|
||||
|
||||
contacts: Contact[] = [
|
||||
contacts = [
|
||||
{
|
||||
first: 'Ana',
|
||||
last: 'Manuel',
|
||||
|
||||
-2
@@ -263,9 +263,7 @@
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="aside-righ flex-grow-1">
|
||||
|
||||
+38
-2
@@ -14,7 +14,7 @@ import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
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';
|
||||
import * as _rollupMoment from 'moment';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
@@ -63,6 +63,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
|
||||
showLoader = false
|
||||
|
||||
get dateStart () {
|
||||
@@ -157,8 +161,40 @@ export class BookMeetingModalPage implements OnInit {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postData.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Location: new FormControl(this.postData.Location, [
|
||||
Validators.required,
|
||||
]),
|
||||
CalendarName: new FormControl(this.postData.CalendarName, [
|
||||
Validators.required
|
||||
])
|
||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
// ]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
async saveTask(){
|
||||
// issue12323423
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
|
||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
this.eventBody={
|
||||
|
||||
+54
-7
@@ -4,10 +4,22 @@
|
||||
<ion-item lines="none">
|
||||
<ion-label class="title">{{modalTitle[taskType]}}</ion-label>
|
||||
</ion-item>
|
||||
<div class="ion-item-container width-100">
|
||||
|
||||
<div class="ion-item-container width-100" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input placeholder="Assunto*" [(ngModel)]="postData.DispatchFolder.Subject"></ion-input>
|
||||
</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>
|
||||
|
||||
<!-- Add scrolls -->
|
||||
<div class="d-flex flex-column height-100 overflow-y-auto">
|
||||
|
||||
@@ -16,18 +28,29 @@
|
||||
<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">
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
|
||||
<ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
</div>
|
||||
</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 width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom ">
|
||||
<ion-select
|
||||
placeholder="Prazo*"
|
||||
[(ngModel)]="postData.Priority"
|
||||
@@ -42,7 +65,7 @@
|
||||
<ion-select-option value="99999864"><b>Urgentíssimo</b> (8 horas para a execução da tarefa)</ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
<mat-form-field appearance="fill" class="width-100 d-none d-md-block">
|
||||
<mat-form-field appearance="fill" class="width-100 d-none d-md-block" appearance="none">
|
||||
<mat-select placeholder="Prazo*" [(ngModel)]="postData.Priority">
|
||||
<mat-option [value]="99999861"><b>Normal</b> (4 dias para a execução da tarefa)</mat-option>
|
||||
<mat-option [value]="99999862"><b>Urgente</b> (2 dias para a execução da tarefa)</mat-option>
|
||||
@@ -54,12 +77,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Priority').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Priority').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('Priority').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</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">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom ">
|
||||
<ion-item
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-md-none">
|
||||
<ion-select
|
||||
@@ -73,7 +108,8 @@
|
||||
<mat-form-field
|
||||
floatLabel="never"
|
||||
appearance="fill"
|
||||
class="width-100 d-none d-md-block">
|
||||
class="width-100 d-none d-md-block"
|
||||
appearance="none">
|
||||
<mat-select [formControl]="toppings" multiple placeholder="Selecione o tipo de evento*">
|
||||
<mat-option *ngFor="let type of subjectTypes" [value]="type.Code">{{type.Description}}</mat-option>
|
||||
</mat-select>
|
||||
@@ -81,6 +117,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('selectedTypes').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('selectedTypes').errors?.required">
|
||||
Campo obrigatório.
|
||||
</div>
|
||||
<div *ngIf="Form.get('selectedTypes').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
@@ -155,7 +203,6 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="postData" class="aside-right flex-column height-100">
|
||||
<app-empty-container
|
||||
|
||||
+3
@@ -208,3 +208,6 @@ font-size: 13px;
|
||||
}
|
||||
|
||||
|
||||
::ng-deep .mat-form-field-appearance-fill .mat-form-field-flex {
|
||||
background-color: #fff;
|
||||
}
|
||||
+46
-2
@@ -20,7 +20,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
|
||||
@@ -86,6 +86,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
loggeduser: User;
|
||||
toppings = new FormControl();
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
get toppingsValues() {
|
||||
return this.toppings.value;
|
||||
}
|
||||
@@ -162,7 +165,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
close(){
|
||||
close() {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
@@ -178,8 +181,49 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postData.DispatchFolder.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Location: new FormControl(this.postData.DispatchFolder.Message, [
|
||||
Validators.required,
|
||||
]),
|
||||
selectedTypes: new FormControl(this.toppingsValues, [
|
||||
Validators.required,
|
||||
]),
|
||||
Priority: new FormControl(this.postData.Priority, [
|
||||
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 saveTask(){
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
|
||||
if(this.postData.Priority=='99999861'){
|
||||
this.dispatchFolder.DeadlineType = 'Normal';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user