mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Revisão: Autenticação, Page Events, Page Expediente.
This commit is contained in:
+5
-2
@@ -128,7 +128,9 @@
|
|||||||
"tsconfig.spec.json",
|
"tsconfig.spec.json",
|
||||||
"e2e/tsconfig.json"
|
"e2e/tsconfig.json"
|
||||||
],
|
],
|
||||||
"exclude": ["**/node_modules/**"]
|
"exclude": [
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"e2e": {
|
"e2e": {
|
||||||
@@ -174,7 +176,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
"defaultCollection": "@ionic/angular-toolkit"
|
"defaultCollection": "@ionic/angular-toolkit",
|
||||||
|
"analytics": false
|
||||||
},
|
},
|
||||||
"schematics": {
|
"schematics": {
|
||||||
"@ionic/angular-toolkit:component": {
|
"@ionic/angular-toolkit:component": {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const routes: Routes = [
|
|||||||
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente.module').then(m => m.ExpedientePageModule)
|
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente.module').then(m => m.ExpedientePageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path:':expediente-detailId',
|
path:':SerialNumber',
|
||||||
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule)
|
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export interface DailyWorkTask{
|
||||||
|
|
||||||
|
SerialNumber: string;
|
||||||
|
Folio: string;
|
||||||
|
Senders: string;
|
||||||
|
CreateDate: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export interface User {
|
||||||
|
username: string,
|
||||||
|
password: string,
|
||||||
|
domainName: string,
|
||||||
|
BasicAuthKey: string
|
||||||
|
}
|
||||||
@@ -7,43 +7,44 @@
|
|||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content *ngIf="eventItem | async as event" padding>
|
<ion-content padding>
|
||||||
<ion-item-group>
|
<ion-item-group>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Assunto</ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Descrição</ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Localização</ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Intervenientes</ion-label>
|
<ion-label position="stacked">Intervenientes</ion-label>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item *ngFor="let inter of event.RequiredAttendees">
|
<ion-item *ngFor="let inter of loadedEvent.RequiredAttendees">
|
||||||
<ion-input value='{{inter.Name}}'></ion-input>
|
<ion-input [(ngModel)]='inter.Name'></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Carácter</ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Tipo do evento</ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Data Início: </ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Data Fim</ion-label>
|
<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-item>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-list-header>Anexos</ion-list-header>
|
<ion-list-header>Anexos</ion-list-header>
|
||||||
@@ -54,8 +55,8 @@
|
|||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-item-group>
|
</ion-item-group>
|
||||||
<div class="event-detail-buttons">
|
<div class="event-detail-buttons">
|
||||||
<ion-button fill="outline" class="ion-button-left">Recusar</ion-button>
|
<!-- <ion-button fill="outline" class="ion-button-left">Recusar</ion-button> -->
|
||||||
<ion-button class="ion-button-right">Aprovar</ion-button>
|
<ion-button class="ion-button-right" (click)="Save()">Gravar</ion-button>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,20 @@ export class EventDetailPage implements OnInit {
|
|||||||
/* Load my event detail */
|
/* Load my event detail */
|
||||||
/* this.loadedEvent = this.eventsService.getEvent(eventId); */
|
/* this.loadedEvent = this.eventsService.getEvent(eventId); */
|
||||||
this.eventItem = 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-group>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Assunto</ion-label>
|
<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-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Remetentes</ion-label>
|
<ion-label position="stacked">Remetentes</ion-label>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-input value='MINEC'></ion-input>
|
<ion-input>{{ task.Senders }}</ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Data</ion-label>
|
<ion-label position="stacked">Data</ion-label>
|
||||||
<ion-input value=''></ion-input>
|
<ion-input value=''>{{ task.CreateDate }}</ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-list-header>Documentos a Anexar</ion-list-header>
|
<ion-list-header>Documentos a Anexar</ion-list-header>
|
||||||
|
|||||||
+21
-1
@@ -1,4 +1,8 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
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({
|
@Component({
|
||||||
selector: 'app-expediente-detail',
|
selector: 'app-expediente-detail',
|
||||||
@@ -7,9 +11,25 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class ExpedienteDetailPage implements OnInit {
|
export class ExpedienteDetailPage implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
constructor(private activateRoute: ActivatedRoute,private processes:ProcessesService) { }
|
||||||
|
|
||||||
|
task:DailyWorkTask;
|
||||||
|
|
||||||
|
serialnumber:string;
|
||||||
|
|
||||||
ngOnInit() {
|
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-list *ngSwitchCase="'expediente'">
|
||||||
<ion-item-group>
|
<ion-item-group>
|
||||||
<ion-item-sliding>
|
<ion-item-sliding>
|
||||||
<ion-item lines="none">
|
<ion-item lines="none"
|
||||||
|
*ngFor = "let task of taskslist">
|
||||||
<div class="div-content-expediente">
|
<div class="div-content-expediente">
|
||||||
<ion-item lines="none" [routerLink]="['/home/gabinete-digital/1/1']">
|
<ion-item lines="none" [routerLink]="['/home/gabinete-digital/1',task.SerialNumber]">
|
||||||
<ion-icon slot="end" name="document-outline"></ion-icon>
|
<ion-icon slot="end" name="document-outline">
|
||||||
<h3>Reunião de Conselho de Ministros</h3>
|
</ion-icon>
|
||||||
|
<h3>{{ task.Folio }}</h3>
|
||||||
</ion-item>
|
</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>
|
</div>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-item-sliding>
|
</ion-item-sliding>
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import { ModalController } from '@ionic/angular';
|
|||||||
import { ExpedienteModalPage } from '../expediente-modal/expediente-modal.page';
|
import { ExpedienteModalPage } from '../expediente-modal/expediente-modal.page';
|
||||||
import { CalendarComponent } from 'ionic2-calendar';
|
import { CalendarComponent } from 'ionic2-calendar';
|
||||||
|
|
||||||
|
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expediente',
|
selector: 'app-expediente',
|
||||||
templateUrl: './expediente.page.html',
|
templateUrl: './expediente.page.html',
|
||||||
@@ -15,12 +18,16 @@ export class ExpedientePage implements OnInit {
|
|||||||
|
|
||||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||||
|
|
||||||
constructor(private router: Router,private modalCtrl: ModalController ) { }
|
taskslist:DailyWorkTask[];
|
||||||
|
|
||||||
|
constructor(private router: Router,private modalCtrl: ModalController, private processes:ProcessesService ) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
this.segment = "expediente";
|
this.segment = "expediente";
|
||||||
|
this.LoadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
async openExpedienteModal(){
|
async openExpedienteModal(){
|
||||||
const modal = await this.modalCtrl.create({
|
const modal = await this.modalCtrl.create({
|
||||||
component: ExpedienteModalPage,
|
component: ExpedienteModalPage,
|
||||||
@@ -58,5 +65,10 @@ export class ExpedientePage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadList()
|
||||||
|
{
|
||||||
|
this.taskslist = this.processes.GetDailyWorkTasks();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7,13 +7,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: GabineteDigitalPage
|
component: GabineteDigitalPage
|
||||||
},
|
},
|
||||||
|
{
|
||||||
path: 'expediente',
|
path: 'expediente',
|
||||||
loadChildren: () => import('./expediente/expediente.module').then( m => m.ExpedientePageModule)
|
loadChildren: () => import('./expediente/expediente.module').then( m => m.ExpedientePageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'expediente-modal',
|
path: 'expediente-modal',
|
||||||
path: 'expediente-modal',
|
loadChildren: () => import('../../pages/gabinete-digital/expediente-modal/expediente-modal.module').then( m => m.ExpedienteModalPageModule)
|
||||||
}
|
}
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>Gbinete Digital</ion-title>
|
<ion-title>Gabinete Digital</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
@@ -11,15 +11,15 @@
|
|||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ion-item [routerLink]="['/home/gabinete-digital/1']">
|
<ion-item [routerLink]="['/home/gabinete-digital/1']">
|
||||||
<ion-label>Correspondência</ion-label>
|
<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>
|
||||||
<ion-item [routerLink]="['/home/gabinete-digital/1']" class="ion-activated">
|
<ion-item [routerLink]="['/home/gabinete-digital/1']" class="ion-activated">
|
||||||
<ion-label>Pedidos de parecer</ion-label>
|
<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>
|
||||||
<ion-item [routerLink]="['/home/gabinete-digital/1']">
|
<ion-item [routerLink]="['/home/gabinete-digital/1']">
|
||||||
<ion-label>Pedidos de deferimento</ion-label>
|
<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-item>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card-header>
|
</ion-card-header>
|
||||||
@@ -30,11 +30,11 @@
|
|||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ion-item (click)="load()" class="ion-item-change-color">
|
<ion-item (click)="load()" class="ion-item-change-color">
|
||||||
<ion-label>Assinados pelo PR</ion-label>
|
<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>
|
||||||
<ion-item primary (click)="load()" class="ion-activated">
|
<ion-item primary (click)="load()" class="ion-activated">
|
||||||
<ion-label>Por validar (MDGPR)</ion-label>
|
<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-item>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card-header>
|
</ion-card-header>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ion-item (click)="load()" class="ion-item-change-color">
|
<ion-item (click)="load()" class="ion-item-change-color">
|
||||||
<ion-label>Presidente da República</ion-label>
|
<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-item>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card-header>
|
</ion-card-header>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-gabinete-digital',
|
selector: 'app-gabinete-digital',
|
||||||
@@ -9,13 +10,30 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
segment:string;
|
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() {
|
ngOnInit() {
|
||||||
|
this.LoadCounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
load(){
|
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">
|
<div class="div-logo">
|
||||||
<img src='assets/images/fullLogo.png' alt='logo'>
|
<img src='assets/images/fullLogo.png' alt='logo'>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="center">Iniciar a sessão</h2>
|
<h2 class="center">Inicie a sessão</h2>
|
||||||
<form>
|
<form>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Username ou email</ion-label>
|
<ion-label position="stacked">Nome de utilizador</ion-label>
|
||||||
<ion-input type="text" name="username" [(ngModel)]="postData.username"></ion-input>
|
<ion-input type="text" [(ngModel)]="username" name="input-username"></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="stacked">Palavra-passe</ion-label>
|
<ion-label position="stacked">Palavra-passe</ion-label>
|
||||||
<ion-input type="password" name="password" [(ngModel)]="postData.password"></ion-input>
|
<ion-input type="password" [(ngModel)]="password" name="input-password" ></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-button expand="block" shape="round" color="primary" (click)="Login()">Iniciar</ion-button>
|
||||||
<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-list>
|
</ion-list>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { StorageService } from 'src/app/services/storage.service';
|
import { User } from 'src/app/models/user.model';
|
||||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
|
||||||
import { ToastController } from '@ionic/angular';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -13,93 +12,43 @@ import { ToastController } from '@ionic/angular';
|
|||||||
export class LoginPage implements OnInit {
|
export class LoginPage implements OnInit {
|
||||||
|
|
||||||
logstatus: boolean;
|
logstatus: boolean;
|
||||||
|
username: string = "";
|
||||||
/* Declare variables */
|
password: string = "";
|
||||||
public postData = {
|
userattempt: User;
|
||||||
username: '',
|
|
||||||
password: '',
|
|
||||||
domainName: ''
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private authService: AuthService,
|
private authService: AuthService) { }
|
||||||
private storageService: StorageService,
|
|
||||||
toastController: ToastController
|
|
||||||
) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
/* console.log(this.authService.validateLogin()); */
|
|
||||||
/* this.authService.login(this.postData); */
|
|
||||||
}
|
}
|
||||||
/* Function to validade the login inputs */
|
/* Function to validade the login inputs */
|
||||||
validateInput(){
|
validateInput(){
|
||||||
let username = this.postData.username.trim();
|
this.userattempt = {
|
||||||
let password = this.postData.password.trim();
|
username: this.username,
|
||||||
let domainName = this.postData.domainName.trim();
|
password: this.password,
|
||||||
|
domainName: "",
|
||||||
|
BasicAuthKey: ""
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
this.postData.username &&
|
this.username.trim().length > 0
|
||||||
this.postData.password &&
|
&& this.password.trim().length > 0
|
||||||
username.length > 0
|
|
||||||
&& password.length > 0
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
loginRequest(){
|
async Login(){
|
||||||
/* 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(){
|
|
||||||
//Go to our home in home/feed.
|
//Go to our home in home/feed.
|
||||||
|
|
||||||
if(this.validateInput()){
|
if(this.validateInput()){
|
||||||
this.router.navigate(['/home/events']);
|
if (await this.authService.login(this.userattempt))
|
||||||
|
|
||||||
/* if (await this.authService.login(this.postData))
|
|
||||||
{
|
{
|
||||||
this.router.navigate(['/home/feed']);
|
this.router.navigate(['/home/events']);
|
||||||
console.log(this.postData);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("Não foi possível fazer login");
|
console.log("Não foi possível fazer login");
|
||||||
} */
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("Preencha todos campos");
|
console.log("Preencha todos campos");
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
|
|||||||
import { StorageService } from './storage.service';
|
import { StorageService } from './storage.service';
|
||||||
import { HttpService } from './http.service';
|
import { HttpService } from './http.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { AuthConnstants } from '../config/auth-constants';
|
import { AuthConnstants } from '../config/auth-constants';
|
||||||
import axios from "axios";
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { User } from '../models/user.model';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -15,70 +15,38 @@ export class AuthService {
|
|||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpService: HttpService,
|
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private http: HttpClient
|
private http: HttpClient
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async login(postData: any): Promise<any> {
|
public ValidatedUser:User;
|
||||||
|
|
||||||
var session_url = 'https://gpr-dev-08.gabinetedigital.local/api/v2.0/me';
|
async login(user: User): Promise<boolean> {
|
||||||
var credentials = btoa(postData.domainName + '\\' + postData.username + ':' + postData.password); //conversão em base64 das credenciais inseridas
|
user.domainName = environment.domain;
|
||||||
var statusresult = -1;
|
user.BasicAuthKey = 'Basic ' + btoa(user.domainName + '\\' + user.username + ':' + user.password); //conversão em base64 das credenciais inseridas
|
||||||
|
|
||||||
//configuração dos headers para autênticação básica, passando as credenciais convertidas em base64
|
const options = { headers: {'Authorization': user.BasicAuthKey }};
|
||||||
var config = {
|
const service = environment.apiURL + "userauthentication/GetValidateAuth";
|
||||||
headers: {
|
|
||||||
'Authorization': 'Basic ' + credentials,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
await axios.get(session_url, config)
|
let result: boolean | PromiseLike<boolean>;
|
||||||
.then(function (response) {
|
|
||||||
statusresult = response.status;
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
if (error.response) {
|
|
||||||
statusresult = error.response.status;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (statusresult == 200)
|
try {
|
||||||
{
|
result = await this.http.get<boolean>(service, options).toPromise();
|
||||||
return true;
|
} catch(e) {
|
||||||
}
|
console.log(e);
|
||||||
else
|
result = false;
|
||||||
if (statusresult == 401)
|
}
|
||||||
{
|
|
||||||
return false;
|
if (result)
|
||||||
}
|
{
|
||||||
else
|
this.ValidatedUser = user;
|
||||||
{
|
}
|
||||||
return false;
|
|
||||||
}
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logout(){
|
||||||
/* logout(){
|
this.ValidatedUser = null;
|
||||||
this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
|
|
||||||
this.router.navigate([''])
|
|
||||||
})
|
|
||||||
|
|
||||||
} */
|
|
||||||
validateLogin(){
|
|
||||||
const options = { headers: {'Authorization': 'Basic cGF1bG8ucGludG86dGFidGVzdGVAMDA2'}};
|
|
||||||
const url = 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/api/calendar/ValidateAuth';
|
|
||||||
/* return this.http.get(`${url}`, options); */
|
|
||||||
axios.get(url, options)
|
|
||||||
.then(resp => {
|
|
||||||
if(resp.data)
|
|
||||||
console.log(resp.data);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
// Handle Error Here
|
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import { Event } from '../models/event.model';
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { stringify } from 'querystring';
|
||||||
|
import { AuthService } from '../services/auth.service';
|
||||||
|
import { User } from '../models/user.model';
|
||||||
|
import { CalModalPageRoutingModule } from '../pages/cal-modal/cal-modal-routing.module';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -56,18 +59,31 @@ export class EventsService {
|
|||||||
Attachments: null,
|
Attachments: null,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
options = {};
|
||||||
|
loggeduser: User;
|
||||||
|
|
||||||
url = 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/api/calendar/GetEvents?StartDate=2020-08-14 00:00:00&EndDate=2020-08-19 23:59:00&CalendarName=Pessoal';
|
constructor(private http: HttpClient, private user: AuthService) {
|
||||||
options = { headers: {'Authorization': 'Basic cGF1bG8ucGludG86dGFidGVzdGVAMDA2'}};
|
this.loggeduser = user.ValidatedUser;
|
||||||
|
this.options = { headers: {'Authorization': this.loggeduser.BasicAuthKey}};
|
||||||
constructor(private http: HttpClient) { }
|
}
|
||||||
|
|
||||||
allEvents(): Observable<Event[]>{
|
allEvents(): Observable<Event[]>{
|
||||||
return this.http.get<Event[]>(`${this.url}`, this.options)
|
console.log(this.loggeduser);
|
||||||
|
const geturl = environment.apiURL + 'calendar/GetEvents?StartDate=2020-08-14 00:00:00&EndDate=2020-08-19 23:59:00&CalendarName=Pessoal';
|
||||||
|
|
||||||
|
return this.http.get<Event[]>(`${geturl}`, this.options)
|
||||||
}
|
}
|
||||||
getEvent(ev: string): Observable<Event>{
|
getEvent(ev: string): Observable<Event>{
|
||||||
const url = 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/api/calendar/GetEvent?EventId=';
|
const geturl = environment.apiURL + 'calendar/GetEvent?EventId=';
|
||||||
return this.http.get<Event>(`${url + ev}`, this.options)
|
|
||||||
|
return this.http.get<Event>(`${geturl + ev}`, this.options)
|
||||||
|
}
|
||||||
|
|
||||||
|
PutEvent(event: Event): Observable<Event>
|
||||||
|
{
|
||||||
|
const puturl = environment.apiURL +'calendar/PutEvent?conflictResolutionMode=2&sendInvitationsOrCancellationsMode=3';
|
||||||
|
|
||||||
|
return this.http.put<Event>(`${puturl}`, event,this.options)
|
||||||
}
|
}
|
||||||
|
|
||||||
AddEvent(postEvent: any){
|
AddEvent(postEvent: any){
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ProcessesService } from './processes.service';
|
||||||
|
|
||||||
|
describe('ProcessesService', () => {
|
||||||
|
let service: ProcessesService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(ProcessesService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
import { DailyWorkTask } from '../models/dailyworktask.model';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ProcessesService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
GetDailyWorkCount()
|
||||||
|
{
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
private tasks: DailyWorkTask[] = [
|
||||||
|
{
|
||||||
|
SerialNumber: "1",
|
||||||
|
Folio: "Teste 1",
|
||||||
|
Senders: "MINEC, MINPLAN, MINFIN",
|
||||||
|
CreateDate: "2020-08-18"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
SerialNumber: "2",
|
||||||
|
Folio: "Teste 2",
|
||||||
|
Senders: "MINFIN",
|
||||||
|
CreateDate: "2020-08-19"
|
||||||
|
},{
|
||||||
|
SerialNumber: "3",
|
||||||
|
Folio: "Teste 3",
|
||||||
|
Senders: "MINEC",
|
||||||
|
CreateDate: "2020-08-20"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
GetDailyWorkTasks()
|
||||||
|
{
|
||||||
|
return this.tasks;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetTaskDetail(serialnumber:string)
|
||||||
|
{
|
||||||
|
console.log(serialnumber);
|
||||||
|
return this.tasks.find(t => t.SerialNumber = serialnumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,7 +4,8 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiURL: ''
|
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/v1/api/',
|
||||||
|
domain: 'gabinetedigital.local'
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user