mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Improve create process
This commit is contained in:
@@ -14,7 +14,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
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 { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
|
||||
@@ -69,6 +69,9 @@ export class CreateProcessPage implements OnInit {
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
profile: string;
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
showEmptyContainer = true;
|
||||
|
||||
@@ -162,8 +165,40 @@ export class CreateProcessPage implements OnInit {
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
}
|
||||
async saveTask(){
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postData.DispatchFolder.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Message: new FormControl(this.postData.DispatchFolder.Message, [
|
||||
Validators.required,
|
||||
]),
|
||||
Priority: new FormControl(this.postData.Priority, [
|
||||
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