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/gabinete-digital/pedidos/pedidos.page.html b/src/app/pages/gabinete-digital/pedidos/pedidos.page.html index 4bdf3d3bd..586f92eed 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.html @@ -77,7 +77,7 @@ diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts index 0681084a4..be6ebf908 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts @@ -165,18 +165,6 @@ export class PedidosPage implements OnInit { }, 2000); } - async viewPedidoDetail(serialNumber:any) { - - let navigationExtras: NavigationExtras = { - queryParams: { - enterAnimation: "", - serialNumber: serialNumber, - } - }; - this.router.navigate(['/home/gabinete-digital/pedidos/pedido'], navigationExtras); - - } - } \ No newline at end of file diff --git a/src/app/pages/publications/edit-action/edit-action-routing.module.ts b/src/app/pages/publications/edit-action/edit-action-routing.module.ts new file mode 100644 index 000000000..1cc787832 --- /dev/null +++ b/src/app/pages/publications/edit-action/edit-action-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { EditActionPage } from './edit-action.page'; + +const routes: Routes = [ + { + path: '', + component: EditActionPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class EditActionPageRoutingModule {} diff --git a/src/app/pages/publications/edit-action/edit-action.module.ts b/src/app/pages/publications/edit-action/edit-action.module.ts new file mode 100644 index 000000000..99e36907b --- /dev/null +++ b/src/app/pages/publications/edit-action/edit-action.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { EditActionPageRoutingModule } from './edit-action-routing.module'; + +import { EditActionPage } from './edit-action.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + EditActionPageRoutingModule + ], + declarations: [EditActionPage] +}) +export class EditActionPageModule {} diff --git a/src/app/pages/publications/edit-action/edit-action.page.html b/src/app/pages/publications/edit-action/edit-action.page.html new file mode 100644 index 000000000..3abd6d729 --- /dev/null +++ b/src/app/pages/publications/edit-action/edit-action.page.html @@ -0,0 +1,9 @@ + + + edit-action + + + + + + diff --git a/src/app/pages/publications/edit-action/edit-action.page.scss b/src/app/pages/publications/edit-action/edit-action.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/pages/publications/edit-action/edit-action.page.spec.ts b/src/app/pages/publications/edit-action/edit-action.page.spec.ts new file mode 100644 index 000000000..402bd92ed --- /dev/null +++ b/src/app/pages/publications/edit-action/edit-action.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { EditActionPage } from './edit-action.page'; + +describe('EditActionPage', () => { + let component: EditActionPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ EditActionPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(EditActionPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/publications/edit-action/edit-action.page.ts b/src/app/pages/publications/edit-action/edit-action.page.ts new file mode 100644 index 000000000..c1b0fe866 --- /dev/null +++ b/src/app/pages/publications/edit-action/edit-action.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-edit-action', + templateUrl: './edit-action.page.html', + styleUrls: ['./edit-action.page.scss'], +}) +export class EditActionPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} 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/pages/publications/publications-routing.module.ts b/src/app/pages/publications/publications-routing.module.ts index 46e9a3d95..56e6828d2 100644 --- a/src/app/pages/publications/publications-routing.module.ts +++ b/src/app/pages/publications/publications-routing.module.ts @@ -1,42 +1,46 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { PublicationsPage } from './publications.page'; - -const routes: Routes = [ - { - path: '', - component: PublicationsPage - }, - { - path: 'new-publication', - loadChildren: () => import('./new-publication/new-publication.module').then( m => m.NewPublicationPageModule) - }, - { - path: 'gallery', - loadChildren: () => import('./gallery/gallery.module').then( m => m.GalleryPageModule) - }, - { - path: 'new-action', - loadChildren: () => import('./new-action/new-action.module').then( m => m.NewActionPageModule) - }, - { - path: 'view-publications', - children: [ - { - path:'', - loadChildren: ()=> import('./view-publications/view-publications.module').then(m => m.ViewPublicationsPageModule) - }, - { - path:'publication-detail', - loadChildren: ()=> import('./view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule) - }, - ] +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { PublicationsPage } from './publications.page'; + +const routes: Routes = [ + { + path: '', + component: PublicationsPage + }, + { + path: 'new-publication', + loadChildren: () => import('./new-publication/new-publication.module').then( m => m.NewPublicationPageModule) + }, + { + path: 'gallery', + loadChildren: () => import('./gallery/gallery.module').then( m => m.GalleryPageModule) + }, + { + path: 'new-action', + loadChildren: () => import('./new-action/new-action.module').then( m => m.NewActionPageModule) + }, + { + path: 'view-publications', + children: [ + { + path:'', + loadChildren: ()=> import('./view-publications/view-publications.module').then(m => m.ViewPublicationsPageModule) + }, + { + path:'publication-detail', + loadChildren: ()=> import('./view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule) + }, + ] + }, { + path: 'edit-action', + loadChildren: () => import('./edit-action/edit-action.module').then( m => m.EditActionPageModule) } -]; -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class PublicationsPageRoutingModule {} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class PublicationsPageRoutingModule {} diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 3c7eef106..dafecd572 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -34,7 +34,37 @@
-
--> + + +
+ +
+
+ +

{{viagem.Description}}

+

{{viagem.Detail}}

+
+
+ +
+
+ + + + + + +
+ + + + +
+ +
+
+ + +

{{evento.Description}}

+
+
+
+ +
+
+ + Apagar + +
+
diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index 51eddcc14..544157edd 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -162,6 +162,22 @@ ion-toolbar{ font-size: 20px; } } + + ion-item-option{ + display: flex; + background: #ffe0e0; + align-items: center; + align-content: center; + } + + .delete{ + padding: 7px; + font-size: 21px; + color:#d30a0a; + border-radius: 20px; + margin: 10px; + border: 1px solid #d30a0a; + } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 4781abae5..37a3727ac 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -12,6 +12,7 @@ import { LoadingController } from '@ionic/angular'; import { LoadingService } from 'src/app/services/loading.service'; import { Publication } from 'src/app/models/publication'; import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page'; +import { EditActionPage } from './edit-action/edit-action.page'; @Component({ @@ -89,6 +90,12 @@ export class PublicationsPage implements OnInit { this.hideRefreshBtn = false; } } + + refreshing() { + setTimeout(() => { + this.getActions(); + }, 1500); + } doRefresh(event) { this.getActions(); @@ -131,6 +138,27 @@ export class PublicationsPage implements OnInit { }); } + async editAction(id?: string){ + const modal = await this.modalController.create({ + component: EditActionPage, + componentProps:{ + item: id, + }, + cssClass: 'new-action modal modal-desktop', + backdropDismiss: false + }); + await modal.present(); + modal.onDidDismiss().then(()=>{ + this.getActions(); + }); + //this.refreshing() + } + + deleteAction(id?: string){ + this.publications.DeletePresidentialAction(id).toPromise(); + this.refreshing() + } + async AddPublicationFolder(item?:any) { this.closeDesktopComponent(); 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