mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Refified processService methods;
Add approve page and criate its layout; Finish functionality for list approve page
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventListPage } from './event-list.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventListPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventListPageRoutingModule {}
|
||||
@@ -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 { EventListPageRoutingModule } from './event-list-routing.module';
|
||||
|
||||
import { EventListPage } from './event-list.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EventListPageRoutingModule
|
||||
],
|
||||
declarations: [EventListPage]
|
||||
})
|
||||
export class EventListPageModule {}
|
||||
@@ -0,0 +1,63 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="/gabinete-digital"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Eventos para Aprovação</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Seu calendário
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="PR">
|
||||
Presidente da República
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<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>
|
||||
</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-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>
|
||||
<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-content>
|
||||
@@ -0,0 +1,73 @@
|
||||
ion-item-sliding{
|
||||
margin-top: 5px;
|
||||
}
|
||||
.Rectangle {
|
||||
width: 360px;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
border: solid 1px #e9e9e9;
|
||||
background-color: var(--white);
|
||||
margin: 0 auto;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
.content-Oficial{
|
||||
width: 340px;
|
||||
border-radius: 5px;
|
||||
border-right: 5px solid #99e47b;
|
||||
overflow: auto;
|
||||
}
|
||||
.content-Pessoal{
|
||||
width: 340px;
|
||||
border-radius: 5px;
|
||||
border-right: 5px solid #958bfc;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.approve-event-time{
|
||||
float: left;
|
||||
}
|
||||
.approve-event-time p{
|
||||
width: 33px;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
line-height: normal;
|
||||
letter-spacing: normal;
|
||||
color: var(--Antartic-grey);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.approve-event-detail{
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.approve-event-detail p{
|
||||
width: 250px;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
line-height: normal;
|
||||
letter-spacing: normal;
|
||||
color: var(--black);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.approve-event-detail h3{
|
||||
width: 250px;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
line-height: normal;
|
||||
letter-spacing: normal;
|
||||
color: #0d89d1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventListPage } from './event-list.page';
|
||||
|
||||
describe('EventListPage', () => {
|
||||
let component: EventListPage;
|
||||
let fixture: ComponentFixture<EventListPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventListPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EventListPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,109 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
templateUrl: './event-list.page.html',
|
||||
styleUrls: ['./event-list.page.scss'],
|
||||
})
|
||||
export class EventListPage implements OnInit {
|
||||
segment:string;
|
||||
eventsPRList: any;
|
||||
eventsMDGPRList: any;
|
||||
eventPerson: EventPerson;
|
||||
eventBody: EventBody;
|
||||
categories: string[];
|
||||
serialnumber:string;
|
||||
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
) { }
|
||||
|
||||
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,
|
||||
},
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
LoadToApproveEvents(){
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
this.eventsPRList = res;
|
||||
});
|
||||
this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
this.eventsMDGPRList = res;
|
||||
});
|
||||
}
|
||||
async openApproveModal(eventSerialNumber){
|
||||
const modal = await this.modalController.create({
|
||||
component: ApproveEventModalPage,
|
||||
componentProps:{
|
||||
serialNumber: eventSerialNumber,
|
||||
},
|
||||
cssClass: 'cal-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user