mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
make improvements
This commit is contained in:
@@ -47,14 +47,19 @@
|
||||
<ion-toolbar>
|
||||
<ion-item lines="none">
|
||||
<p>
|
||||
<ion-button class="button-edit-event" shape="round" (click)="emendarTask(loadedEvent.serialNumber)">Emendar</ion-button>
|
||||
<ion-button class="button-edit-event" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Emendar</ion-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-button class="button-options" shape="round" fill="clear" (click)="openOptions(loadedEvent)"><ion-icon slot="icon-only" name="ellipsis-vertical-outline"></ion-icon></ion-button>
|
||||
<ion-button disabled class="button-options" shape="round" fill="clear" (click)="openOptions($event)"><ion-icon slot="icon-only" name="ellipsis-vertical-outline"></ion-icon></ion-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-button class="button-approve" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</ion-button>
|
||||
</p>
|
||||
</ion-item>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<p>
|
||||
<ion-button class="button-reject" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Rejeitar</ion-button>
|
||||
</p>
|
||||
</ion-item>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
|
||||
@@ -17,13 +17,21 @@ ion-toolbar{
|
||||
--background: #e0e9ee;
|
||||
--color:#061b52;
|
||||
}
|
||||
.button-options {
|
||||
height: 44px;
|
||||
--color: #42b9fe;
|
||||
}
|
||||
.button-approve {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
}
|
||||
.button-options {
|
||||
height: 44px;
|
||||
--color: #42b9fe;
|
||||
opacity: 0;
|
||||
}
|
||||
.button-approve {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
}
|
||||
.button-reject {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
--color: #d30a0a;
|
||||
border-radius: 22.5px;
|
||||
--background: #ffe0e0;
|
||||
}
|
||||
@@ -27,44 +27,19 @@ export class ApproveEventModalPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.serialNumber);
|
||||
this.getTask();
|
||||
|
||||
this.event = {
|
||||
EventId: '1',
|
||||
Subject: 'Reunião do Conselho de Ministros',
|
||||
Body: null,
|
||||
Location: 'Palácio Presidencial, Luanda',
|
||||
CalendarId: 'string',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: new Date,
|
||||
EndDate: new Date,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: true,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 2,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
getTask(){
|
||||
this.processes.GetTask(this.serialNumber).subscribe(res => {
|
||||
console.log(res);
|
||||
this.loadedEvent = res;
|
||||
})
|
||||
|
||||
}
|
||||
editEvent(){
|
||||
|
||||
}
|
||||
approveTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
@@ -73,7 +48,15 @@ export class ApproveEventModalPage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
emendarTask(serialNumber:string){
|
||||
emendTask(serialNumber:string){
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Emendar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
rejectTask(serialNumber:string){
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<p>
|
||||
<ion-button class="button-edit-event" shape="round" (click)="editTask()">Emendar</ion-button>
|
||||
<ion-button class="button-edit-event" shape="round" (click)="emendarTask()">Emendar</ion-button>
|
||||
</p>
|
||||
<p>
|
||||
<ion-button class="button-approve" shape="round" (click)="approveTask()">Aprovar</ion-button>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams, PopoverController } from '@ionic/angular';
|
||||
import { Router } from '@angular/router';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-actions-popover',
|
||||
@@ -9,18 +11,32 @@ import { NavParams, PopoverController } from '@ionic/angular';
|
||||
export class EventActionsPopoverPage implements OnInit {
|
||||
|
||||
constructor(private navParams: NavParams,
|
||||
private popoverController: PopoverController,) { }
|
||||
private processes:ProcessesService,
|
||||
private router:Router,
|
||||
private modalController: ModalController,
|
||||
private popoverController: PopoverController,) {
|
||||
/* this.serialNumber = this.navParams.get('serialNumber'); */
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
closePopover(){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
approveTask(){
|
||||
|
||||
approveTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
editTask(){
|
||||
|
||||
emendarTask(serialNumber:string){
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
this.processes.PostTaskAction(body);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
deleteTask(){
|
||||
|
||||
|
||||
@@ -18,46 +18,51 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div [ngSwitch]="segment">
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div [ngSwitch]="segment">
|
||||
<ion-list *ngSwitchCase="'MDGPR'">
|
||||
<div *ngIf="eventsMDGPRList">
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle" lines="none"
|
||||
*ngFor="let event of eventsMDGPRList" (click)="openApproveModal(event.serialNumber)">
|
||||
<div class="content-{{event.workflowInstanceDataFields.Agenda}}">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle" lines="none"
|
||||
*ngFor="let event of eventsMDGPRList" (click)="openApproveModal(event.serialNumber)">
|
||||
<div class="content-{{event.workflowInstanceDataFields.Agenda}}">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p>{{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p>{{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-list *ngSwitchCase="'PR'">
|
||||
<ion-item-sliding *ngIf="eventsPRList">
|
||||
<ion-item class="Rectangle" lines="none"
|
||||
*ngFor="let event of eventsPRList" (click)="openApproveModal(event.serialNumber)">
|
||||
<div class="content-{{event.workflowInstanceDataFields.Agenda}}">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
|
||||
<div *ngIf="eventsPRList">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle" lines="none"
|
||||
*ngFor="let event of eventsPRList" (click)="openApproveModal(event.serialNumber)">
|
||||
<div class="content-{{event.workflowInstanceDataFields.Agenda}}">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'hh:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p>{{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p>{{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Event } from 'src/app/models/event.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ApproveEventModalPage } from '../../agenda/approve-event-modal/approve-event-modal.page';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
@@ -13,6 +14,7 @@ import { ApproveEventModalPage } from '../../agenda/approve-event-modal/approve-
|
||||
})
|
||||
export class EventListPage implements OnInit {
|
||||
segment:string;
|
||||
showLoader: boolean;
|
||||
eventsPRList: any;
|
||||
eventsMDGPRList: any;
|
||||
eventPerson: EventPerson;
|
||||
@@ -24,71 +26,29 @@ export class EventListPage implements OnInit {
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadToApproveEvents();
|
||||
|
||||
this.segment = "MDGPR";
|
||||
this.eventBody = {
|
||||
BodyType: 'string',
|
||||
Text: 'string',
|
||||
}
|
||||
this.eventPerson = {
|
||||
EmailAddress: 'tiago.kayaya@hotmail.com',
|
||||
Name: 'Tiago',
|
||||
IsRequired: false,
|
||||
}
|
||||
|
||||
this.eventsPRList = [
|
||||
{
|
||||
EventId: '1',
|
||||
Subject: 'Reunião do Conselho de Ministros',
|
||||
Body: this.eventBody,
|
||||
Location: 'Luanda',
|
||||
CalendarId: 'string',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: new Date,
|
||||
EndDate: new Date,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: true,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 2,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
},
|
||||
{
|
||||
EventId: '1',
|
||||
Subject: 'Viagem',
|
||||
Body: this.eventBody,
|
||||
Location: 'Luanda',
|
||||
CalendarId: 'string',
|
||||
CalendarName: 'Pessoal',
|
||||
StartDate: new Date,
|
||||
EndDate: new Date,
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: true,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 2,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
},
|
||||
]
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
LoadToApproveEvents(){
|
||||
this.showLoader = true;
|
||||
console.log(this.showLoader);
|
||||
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsPRList = res;
|
||||
});
|
||||
this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
this.eventsMDGPRList = res;
|
||||
this.showLoader = false;
|
||||
this.eventsMDGPRList = res;
|
||||
});
|
||||
}
|
||||
async openApproveModal(eventSerialNumber){
|
||||
@@ -105,5 +65,13 @@ export class EventListPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
doRefresh(event) {
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ExpedientTaskModalPage } from './expedient-task-modal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ExpedientTaskModalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ExpedientTaskModalPageRoutingModule {}
|
||||
+20
@@ -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 { ExpedientTaskModalPageRoutingModule } from './expedient-task-modal-routing.module';
|
||||
|
||||
import { ExpedientTaskModalPage } from './expedient-task-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ExpedientTaskModalPageRoutingModule
|
||||
],
|
||||
declarations: [ExpedientTaskModalPage]
|
||||
})
|
||||
export class ExpedientTaskModalPageModule {}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>expedient-task-modal</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
</ion-content>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ExpedientTaskModalPage } from './expedient-task-modal.page';
|
||||
|
||||
describe('ExpedientTaskModalPage', () => {
|
||||
let component: ExpedientTaskModalPage;
|
||||
let fixture: ComponentFixture<ExpedientTaskModalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ExpedientTaskModalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ExpedientTaskModalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedient-task-modal',
|
||||
templateUrl: './expedient-task-modal.page.html',
|
||||
styleUrls: ['./expedient-task-modal.page.scss'],
|
||||
})
|
||||
export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,12 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'expediente-detail',
|
||||
loadChildren: () => import('./expediente-detail/expediente-detail.module').then( m => m.ExpedienteDetailPageModule)
|
||||
},
|
||||
{
|
||||
path: 'expedient-task-modal',
|
||||
loadChildren: () => import('./expedient-task-modal/expedient-task-modal.module').then( m => m.ExpedientTaskModalPageModule)
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -88,13 +88,12 @@ export class ProcessesService {
|
||||
const geturl = environment.apiURL + 'Tasks/Complete';
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.post<any>(`${geturl}`,body, options);
|
||||
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user