mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve form validation
This commit is contained in:
+3
-3
@@ -128,12 +128,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="container-div" >
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom ">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -154,7 +154,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height" >
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
|
||||
+19
-3
@@ -206,9 +206,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
// IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||
// Validators.required
|
||||
// ]),
|
||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
// ]),
|
||||
participantes: new FormControl(this.taskParticipantsCc, [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
})
|
||||
}
|
||||
@@ -236,6 +236,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
else if(this.postData.Priority=='99999864') {
|
||||
this.dispatchFolder.DeadlineType = 'Urgentíssimo';
|
||||
}
|
||||
|
||||
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
attendees = attendees.map(function(val) {
|
||||
return {
|
||||
@@ -261,6 +262,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.selectedTypes = this.toppingsValues
|
||||
}
|
||||
|
||||
let loader = this.toastService.loading()
|
||||
|
||||
this.dispatchFolder.SubjectTypes = this.selectedTypes;
|
||||
|
||||
switch (this.loggeduser.Profile) {
|
||||
@@ -289,10 +292,13 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
console.log(this.postData);
|
||||
|
||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
|
||||
loader.remove()
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss();
|
||||
|
||||
} catch (error) {
|
||||
loader.remove()
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
console.log('this.taskResult', this.taskResult);
|
||||
@@ -319,10 +325,12 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
||||
loader.remove()
|
||||
await this.toastService.successMessage('Pedido enviado');
|
||||
this.modalController.dismiss(action_parecer);
|
||||
|
||||
} catch (error) {
|
||||
loader.remove()
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
break;
|
||||
@@ -347,9 +355,12 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
|
||||
|
||||
loader.remove()
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_deferimento);
|
||||
} catch (error) {
|
||||
loader.remove()
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
console.log('this.taskResult', this.taskResult);
|
||||
@@ -382,12 +393,15 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
|
||||
loader.remove()
|
||||
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
|
||||
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
|
||||
} catch (error) {
|
||||
loader.remove()
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
console.log('this.taskResult', this.taskResult);
|
||||
@@ -413,12 +427,14 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
loader.remove()
|
||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
|
||||
await this.toastService.badRequest('Processo não efetuado');
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
|
||||
} catch (error) {
|
||||
loader.remove()
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -123,11 +123,18 @@ export class NewActionPage implements OnInit {
|
||||
ActionType: this.segment,
|
||||
}
|
||||
|
||||
|
||||
let loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.publication.CreatePublicationFolder(this.folder).toPromise();
|
||||
|
||||
loader.remove()
|
||||
this.toastService.successMessage("Ação presidencial criado");
|
||||
this.close();
|
||||
} catch (error) {
|
||||
|
||||
loader.remove()
|
||||
this.toastService.badRequest("Ação presidencial não criado");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user