diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html index 2c071472b..339796b63 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html @@ -128,12 +128,12 @@ -
+
-
+
@@ -154,7 +154,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts index d2fb6c86f..6aa2de511 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts @@ -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; diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 3758b8ada..2ded95628 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -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"); } diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts index 2ef9fc097..3b5032634 100644 --- a/src/app/services/toast.service.ts +++ b/src/app/services/toast.service.ts @@ -125,4 +125,25 @@ export class ToastService { } + + loading() : HTMLDivElement { + let loader: HTMLDivElement = document.createElement('div') + loader.innerHTML = ` + +
+
+ +
+
+ ` + + document.body.append(loader) + + loader.addEventListener('click', ()=>{ + // loader.remove() + }) + return loader + + } + } 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 073538d0a..1cce4baee 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -342,9 +342,13 @@ export class NewEventPage implements OnInit { console.log(this.postEvent); + let loader = this.toastService.loading() + this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe( async (id) => { + loader.remove() + this.showLoader = false const eventId: any = id; @@ -382,6 +386,8 @@ export class NewEventPage implements OnInit { }, error => { + + loader.remove() this.showLoader = false this.toastService.badRequest('Evento não criado') }); diff --git a/src/app/shared/publication/new-action/new-action.page.ts b/src/app/shared/publication/new-action/new-action.page.ts index c86bce7d4..d8f4a15fe 100644 --- a/src/app/shared/publication/new-action/new-action.page.ts +++ b/src/app/shared/publication/new-action/new-action.page.ts @@ -70,7 +70,7 @@ export class NewActionPage implements OnInit { } get dateValid() { - if (window.innerWidth <= 800) { + if (window.innerWidth >= 800) { return this.folder.DateBegin < this.folder.DateEnd? ['ok']: [] } else { return ['ok'] diff --git a/src/assets/images/Blocks-loader.gif b/src/assets/images/Blocks-loader.gif new file mode 100644 index 000000000..b2a98465b Binary files /dev/null and b/src/assets/images/Blocks-loader.gif differ diff --git a/src/global.scss b/src/global.scss index 14f917116..17792315c 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1036,4 +1036,19 @@ ngx-mat-datetime-content{ .mat-form-field-infix, .mat-form-field-wrapper { padding: 0px !important; +} + + +.loading-blocker { + position: absolute; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: #0000006b; + + .loading-blocker-container { + + } } \ No newline at end of file