diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 91f16b78c..3658c257d 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -210,9 +210,6 @@ export class NewEventPage implements OnInit { Categories: new FormControl(this.postEvent.Categories[0], [ Validators.required ]), - IsRecurring: new FormControl(this.postEvent.IsRecurring, [ - Validators.required - ]), participantes: new FormControl(this.taskParticipants, [ Validators.required ]), @@ -224,7 +221,9 @@ export class NewEventPage implements OnInit { this.injectValidation() this.runValidation() - if(this.Form.invalid) return false + if(this.Form.invalid) { + return false + } if(this.documents.length >= 0) { this.postEvent.HasAttachments = true; diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index ae529d0a9..21033918d 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -59,8 +59,6 @@ export class DespachoPage implements OnInit { this.caller = params["params"].caller; } }); - - alert('nice') } ngOnInit() { diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index d11e69fb4..99a65d1f6 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -367,14 +367,14 @@ export class PublicationsPage implements OnInit { //translucent: true }); await modal.present(); - modal.onDidDismiss().then(res =>{ - if(res['data']=='edit'){ + modal.onDidDismiss().then(res => { + if(res['data']=='edit') { this.closeDesktopComponent(); this.desktopComponent.showEditActions = true; } else if (res['data']=='delete') { - setTimeout(()=>{ + setTimeout(() => { this.getActions(); - },1000) + }, 1000) this.closeDesktopComponent() } }); diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index 393b0f91d..b9ff5d63e 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -42,23 +42,13 @@ -
-
-
- Campo obrigatório. -
-
- O campo deve ter pelo menos 4 caracteres. -
-
-
-
+
@@ -117,7 +107,7 @@ @@ -144,12 +134,12 @@ -
+
@@ -169,7 +159,6 @@
- - - -
-
+ + {{ this.postEvent.EventRecurrence.Type }} +
-
+
diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index d72d8e085..444e3c6f5 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -116,13 +116,7 @@ export class NewEventPage implements OnInit { showLoader = false - get dateStart () { - return this.dateControlStart.value - } - get dateEnd () { - return this.dateControlEnd.value - } get dateOccurrence () { return this.dateControlOccurrence.value @@ -251,22 +245,19 @@ export class NewEventPage implements OnInit { Categories: new FormControl(this.postEvent.Categories[0], [ Validators.required ]), - dateStart: new FormControl(this.dateStart, [ + dateStart: new FormControl(this.postEvent.StartDate, [ Validators.required ]), - dateEnd: new FormControl(this.dateEnd, [ + dateEnd: new FormControl(this.postEvent.EndDate, [ Validators.required ]), - dateOccurrence: new FormControl(this.dateOccurrence, [ - Validators.required - ]), - IsRecurring: new FormControl(this.postEvent.IsRecurring, [ + dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.dateOccurrence, [ Validators.required ]), participantes: new FormControl(this.taskParticipants, [ Validators.required ]), - Date: new FormControl(this.dateControlStart.toLocaleString() < this.dateControlEnd.toLocaleString() ? 'ok': null,[ + Date: new FormControl(this.postEvent.StartDate.toLocaleString() < this.postEvent.EndDate.toLocaleString() ? 'ok': null,[ Validators.required ]), @@ -345,8 +336,6 @@ export class NewEventPage implements OnInit { getDatepickerData() { if (this.postEvent) { - this.postEvent.StartDate = this.dateStart - this.postEvent.EndDate = this.dateEnd this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence } } @@ -364,7 +353,10 @@ export class NewEventPage implements OnInit { this.injectValidation() this.runValidation() - if(this.Form.invalid) return false + if(this.Form.invalid) { + console.log('not passed') + return false + } this.getDatepickerData() @@ -437,8 +429,9 @@ export class NewEventPage implements OnInit { loader.remove() this.showLoader = false this.toastService.badRequest('Evento não criado') - }); - loader.remove(); + + }); + } else if(this.loggeduser.Profile == 'PR') { console.log('PR - Aqui');