mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Revisão: Autenticação, Page Events, Page Expediente.
This commit is contained in:
@@ -7,43 +7,44 @@
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content *ngIf="eventItem | async as event" padding>
|
||||
<ion-content padding>
|
||||
<ion-item-group>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Assunto</ion-label>
|
||||
<ion-input value='{{event.Subject}}'></ion-input>
|
||||
<!-- <ion-input value='{{event.Subject}}'></ion-input> -->
|
||||
<ion-input [(ngModel)]="loadedEvent.Subject"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Descrição</ion-label>
|
||||
<ion-input value='{{event.Body.Text}}'></ion-input>
|
||||
<ion-input [(ngModel)]='loadedEvent.Body.Text'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Localização</ion-label>
|
||||
<ion-input value='{{event.Location}}'></ion-input>
|
||||
<ion-input [(ngModel)]='loadedEvent.Location'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Intervenientes</ion-label>
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let inter of event.RequiredAttendees">
|
||||
<ion-input value='{{inter.Name}}'></ion-input>
|
||||
<ion-item *ngFor="let inter of loadedEvent.RequiredAttendees">
|
||||
<ion-input [(ngModel)]='inter.Name'></ion-input>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Carácter</ion-label>
|
||||
<ion-input value='{{event.CalendarName}}'></ion-input>
|
||||
<ion-input [(ngModel)]='loadedEvent.CalendarName'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Tipo do evento</ion-label>
|
||||
<ion-input value='{{event.EventType}}'></ion-input>
|
||||
<ion-input [(ngModel)]='loadedEvent.EventType'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Início: </ion-label>
|
||||
<ion-input value='{{event.StartDate}}'></ion-input>
|
||||
<ion-input [(ngModel)]='loadedEvent.StartDate'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Fim</ion-label>
|
||||
<ion-input value='{{event.EndDate}}'></ion-input>
|
||||
<ion-input [(ngModel)]='loadedEvent.EndDate'></ion-input>
|
||||
</ion-item>
|
||||
<ion-list>
|
||||
<ion-list-header>Anexos</ion-list-header>
|
||||
@@ -54,8 +55,8 @@
|
||||
</ion-list>
|
||||
</ion-item-group>
|
||||
<div class="event-detail-buttons">
|
||||
<ion-button fill="outline" class="ion-button-left">Recusar</ion-button>
|
||||
<ion-button class="ion-button-right">Aprovar</ion-button>
|
||||
<!-- <ion-button fill="outline" class="ion-button-left">Recusar</ion-button> -->
|
||||
<ion-button class="ion-button-right" (click)="Save()">Gravar</ion-button>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
|
||||
@@ -28,7 +28,20 @@ export class EventDetailPage implements OnInit {
|
||||
/* Load my event detail */
|
||||
/* this.loadedEvent = this.eventsService.getEvent(eventId); */
|
||||
this.eventItem = this.eventsService.getEvent(eventId);
|
||||
|
||||
this.eventsService.getEvent(eventId).subscribe(response =>
|
||||
{
|
||||
this.loadedEvent = response;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
{
|
||||
this.eventsService.PutEvent(this.loadedEvent).subscribe(response =>
|
||||
{
|
||||
this.loadedEvent = response;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -11,19 +11,19 @@
|
||||
<ion-item-group>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Assunto</ion-label>
|
||||
<ion-input value='Reunião de Conselho de Ministros'></ion-input>
|
||||
<ion-input >{{task.Folio }}</ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Remetentes</ion-label>
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-input value='MINEC'></ion-input>
|
||||
<ion-input>{{ task.Senders }}</ion-input>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data</ion-label>
|
||||
<ion-input value=''></ion-input>
|
||||
<ion-input value=''>{{ task.CreateDate }}</ion-input>
|
||||
</ion-item>
|
||||
<ion-list>
|
||||
<ion-list-header>Documentos a Anexar</ion-list-header>
|
||||
|
||||
+21
-1
@@ -1,4 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
import { DailyWorkTask } from '../../../../models/dailyworktask.model';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -7,9 +11,25 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
constructor(private activateRoute: ActivatedRoute,private processes:ProcessesService) { }
|
||||
|
||||
task:DailyWorkTask;
|
||||
|
||||
serialnumber:string;
|
||||
|
||||
ngOnInit() {
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')){
|
||||
return;
|
||||
}
|
||||
this.serialnumber = paramMap.get('SerialNumber');
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
});
|
||||
}
|
||||
|
||||
LoadTaskDetail(serial:string)
|
||||
{
|
||||
this.task = this.processes.GetTaskDetail(serial);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,13 +22,15 @@
|
||||
<ion-list *ngSwitchCase="'expediente'">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<ion-item lines="none">
|
||||
<ion-item lines="none"
|
||||
*ngFor = "let task of taskslist">
|
||||
<div class="div-content-expediente">
|
||||
<ion-item lines="none" [routerLink]="['/home/gabinete-digital/1/1']">
|
||||
<ion-icon slot="end" name="document-outline"></ion-icon>
|
||||
<h3>Reunião de Conselho de Ministros</h3>
|
||||
<ion-item lines="none" [routerLink]="['/home/gabinete-digital/1',task.SerialNumber]">
|
||||
<ion-icon slot="end" name="document-outline">
|
||||
</ion-icon>
|
||||
<h3>{{ task.Folio }}</h3>
|
||||
</ion-item>
|
||||
<p><span class="span-left">MINEC, MINFIN</span><span class="span-right">13 JAN</span></p>
|
||||
<p><span class="span-left">{{ task.Senders }}</span><span class="span-right">{{ task.CreateDate }}</span></p>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
|
||||
@@ -4,6 +4,9 @@ import { ModalController } from '@ionic/angular';
|
||||
import { ExpedienteModalPage } from '../expediente-modal/expediente-modal.page';
|
||||
import { CalendarComponent } from 'ionic2-calendar';
|
||||
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente',
|
||||
templateUrl: './expediente.page.html',
|
||||
@@ -15,12 +18,16 @@ export class ExpedientePage implements OnInit {
|
||||
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
constructor(private router: Router,private modalCtrl: ModalController ) { }
|
||||
taskslist:DailyWorkTask[];
|
||||
|
||||
constructor(private router: Router,private modalCtrl: ModalController, private processes:ProcessesService ) { }
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "expediente";
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
async openExpedienteModal(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ExpedienteModalPage,
|
||||
@@ -58,5 +65,10 @@ export class ExpedientePage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
LoadList()
|
||||
{
|
||||
this.taskslist = this.processes.GetDailyWorkTasks();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,15 +7,16 @@ const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GabineteDigitalPage
|
||||
},
|
||||
{
|
||||
path: 'expediente',
|
||||
loadChildren: () => import('./expediente/expediente.module').then( m => m.ExpedientePageModule)
|
||||
},
|
||||
{
|
||||
path: 'expediente-modal',
|
||||
loadChildren: () => import('../../Pages/gabinete-digital/expediente-modal/expediente-modal.module').then( m => m.ExpedienteModalPageModule)
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'expediente',
|
||||
loadChildren: () => import('./expediente/expediente.module').then( m => m.ExpedientePageModule)
|
||||
},
|
||||
{
|
||||
path: 'expediente-modal',
|
||||
loadChildren: () => import('../../pages/gabinete-digital/expediente-modal/expediente-modal.module').then( m => m.ExpedienteModalPageModule)
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Gbinete Digital</ion-title>
|
||||
<ion-title>Gabinete Digital</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
<ion-card-content>
|
||||
<ion-item [routerLink]="['/home/gabinete-digital/1']">
|
||||
<ion-label>Correspondência</ion-label>
|
||||
<ion-button slot="end">1</ion-button>
|
||||
<ion-button slot="end">{{ count_exp_dailywork }}</ion-button>
|
||||
</ion-item>
|
||||
<ion-item [routerLink]="['/home/gabinete-digital/1']" class="ion-activated">
|
||||
<ion-label>Pedidos de parecer</ion-label>
|
||||
<ion-button slot="end">1</ion-button>
|
||||
<ion-button slot="end">{{count_exp_pp}}</ion-button>
|
||||
</ion-item>
|
||||
<ion-item [routerLink]="['/home/gabinete-digital/1']">
|
||||
<ion-label>Pedidos de deferimento</ion-label>
|
||||
<ion-button slot="end">1</ion-button>
|
||||
<ion-button slot="end">{{count_exp_pd}}</ion-button>
|
||||
</ion-item>
|
||||
</ion-card-content>
|
||||
</ion-card-header>
|
||||
@@ -30,11 +30,11 @@
|
||||
<ion-card-content>
|
||||
<ion-item (click)="load()" class="ion-item-change-color">
|
||||
<ion-label>Assinados pelo PR</ion-label>
|
||||
<ion-button slot="end">1</ion-button>
|
||||
<ion-button slot="end">{{count_dip_apr}}</ion-button>
|
||||
</ion-item>
|
||||
<ion-item primary (click)="load()" class="ion-activated">
|
||||
<ion-label>Por validar (MDGPR)</ion-label>
|
||||
<ion-button slot="end">1</ion-button>
|
||||
<ion-button slot="end">{{count_dip_pv}}</ion-button>
|
||||
</ion-item>
|
||||
</ion-card-content>
|
||||
</ion-card-header>
|
||||
@@ -45,7 +45,7 @@
|
||||
<ion-card-content>
|
||||
<ion-item (click)="load()" class="ion-item-change-color">
|
||||
<ion-label>Presidente da República</ion-label>
|
||||
<ion-button slot="end">1</ion-button>
|
||||
<ion-button slot="end">{{count_de_pr}}</ion-button>
|
||||
</ion-item>
|
||||
</ion-card-content>
|
||||
</ion-card-header>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
@@ -9,13 +10,30 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
segment:string;
|
||||
|
||||
constructor() { }
|
||||
constructor(private processesbackend:ProcessesService) { }
|
||||
|
||||
count_exp_dailywork : number;
|
||||
count_exp_pp : string;
|
||||
count_exp_pd : string;
|
||||
count_dip_apr : string;
|
||||
count_dip_pv : string;
|
||||
count_de_pr : string;
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadCounts();
|
||||
}
|
||||
|
||||
load(){
|
||||
|
||||
}
|
||||
|
||||
LoadCounts() {
|
||||
this.count_exp_dailywork = this.processesbackend.GetDailyWorkCount();
|
||||
this.count_exp_pp = "-";
|
||||
this.count_exp_pd = "-";
|
||||
this.count_dip_apr = "-";
|
||||
this.count_dip_pv = "-";
|
||||
this.count_de_pr = "-";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,23 +3,18 @@
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/fullLogo.png' alt='logo'>
|
||||
</div>
|
||||
<h2 class="center">Iniciar a sessão</h2>
|
||||
<h2 class="center">Inicie a sessão</h2>
|
||||
<form>
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Username ou email</ion-label>
|
||||
<ion-input type="text" name="username" [(ngModel)]="postData.username"></ion-input>
|
||||
<ion-label position="stacked">Nome de utilizador</ion-label>
|
||||
<ion-input type="text" [(ngModel)]="username" name="input-username"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Palavra-passe</ion-label>
|
||||
<ion-input type="password" name="password" [(ngModel)]="postData.password"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Domínio</ion-label>
|
||||
<ion-input type="text" name="domainName" [(ngModel)]="postData.domainName"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-button expand="block" shape="round" color="primary" (click)="simpleLogin()">Entrar</ion-button>
|
||||
<ion-input type="password" [(ngModel)]="password" name="input-password" ></ion-input>
|
||||
</ion-item>
|
||||
<ion-button expand="block" shape="round" color="primary" (click)="Login()">Iniciar</ion-button>
|
||||
</ion-list>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { ToastController } from '@ionic/angular';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -13,93 +12,43 @@ import { ToastController } from '@ionic/angular';
|
||||
export class LoginPage implements OnInit {
|
||||
|
||||
logstatus: boolean;
|
||||
|
||||
/* Declare variables */
|
||||
public postData = {
|
||||
username: '',
|
||||
password: '',
|
||||
domainName: ''
|
||||
}
|
||||
username: string = "";
|
||||
password: string = "";
|
||||
userattempt: User;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private storageService: StorageService,
|
||||
toastController: ToastController
|
||||
) { }
|
||||
private authService: AuthService) { }
|
||||
|
||||
ngOnInit() {
|
||||
/* console.log(this.authService.validateLogin()); */
|
||||
/* this.authService.login(this.postData); */
|
||||
|
||||
}
|
||||
/* Function to validade the login inputs */
|
||||
validateInput(){
|
||||
let username = this.postData.username.trim();
|
||||
let password = this.postData.password.trim();
|
||||
let domainName = this.postData.domainName.trim();
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
domainName: "",
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
|
||||
return (
|
||||
this.postData.username &&
|
||||
this.postData.password &&
|
||||
username.length > 0
|
||||
&& password.length > 0
|
||||
this.username.trim().length > 0
|
||||
&& this.password.trim().length > 0
|
||||
);
|
||||
}
|
||||
|
||||
loginRequest(){
|
||||
/* axios.get('https://gpr-dev-08.gabinetedigital.local/api/v2.0/me/calendarview?startDateTime=2014-10-01T01:00:00&endDateTime=2020-10-31T23:00:00')
|
||||
.then(response => {
|
||||
console.log(response.data.url);
|
||||
console.log(response.data.explanation);
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
loginAction(){/*
|
||||
if(this.validateInput()){
|
||||
//Try to login
|
||||
this.authService.login(this.postData).subscribe((res: any)=> {
|
||||
//userData must be in the API results as paratemers otherwise change to the param that is in the API
|
||||
if(res.userData){
|
||||
//Then we store this information at the staorage service
|
||||
this.storageService.store(AuthConnstants.AUTH, res.userData);
|
||||
//Then go to home view
|
||||
this.router.navigate(['home']);
|
||||
}
|
||||
else{
|
||||
console.log("Os dados inseridos são inválidos");
|
||||
}
|
||||
},
|
||||
///Write a connection error
|
||||
(error: any)=>{
|
||||
console.log("Erro de conexão com a API.");
|
||||
}
|
||||
);
|
||||
}
|
||||
else{
|
||||
//Display an error message
|
||||
console.log("Preencha todos campos");
|
||||
}*/
|
||||
}
|
||||
|
||||
async simpleLogin(){
|
||||
async Login(){
|
||||
//Go to our home in home/feed.
|
||||
|
||||
if(this.validateInput()){
|
||||
this.router.navigate(['/home/events']);
|
||||
|
||||
/* if (await this.authService.login(this.postData))
|
||||
if (await this.authService.login(this.userattempt))
|
||||
{
|
||||
this.router.navigate(['/home/feed']);
|
||||
console.log(this.postData);
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Não foi possível fazer login");
|
||||
} */
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log("Preencha todos campos");
|
||||
|
||||
Reference in New Issue
Block a user