mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
|
||||
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
@@ -29,10 +29,6 @@ constructor(
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
|
||||
if(params['segment'] == 'validar') {
|
||||
@@ -43,8 +39,15 @@ constructor(
|
||||
|
||||
this.LoadList();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadList();
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
|
||||
@@ -83,10 +83,10 @@ export class ApproveEventPage implements OnInit {
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
//await this.processes.PostTaskAction(body).toPromise()
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
//this.successMessage()
|
||||
this.toastService.successMessage('Evento rejeitado!');
|
||||
//this.goBack();
|
||||
this.toastService.successMessage('Evento aprovado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
}
|
||||
@@ -111,7 +111,6 @@ export class ApproveEventPage implements OnInit {
|
||||
async rejectTask(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
//await this.successMessage('Processo rejeitado');
|
||||
|
||||
+4
-7
@@ -63,9 +63,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
console.log('HERE');
|
||||
|
||||
console.log(this.serialnumber);
|
||||
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')) {
|
||||
@@ -87,11 +84,11 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.toastService.presentToast('Não foi possível fazer login"');
|
||||
}
|
||||
|
||||
goBack() {
|
||||
/* goBack() {
|
||||
window.history.back()
|
||||
}
|
||||
} */
|
||||
|
||||
/* goBack(){
|
||||
goBack(){
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"expedientes": true,
|
||||
@@ -102,7 +99,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
} else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
|
||||
@@ -47,10 +47,6 @@ export class ExpedientePage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
openExpedientDetailPage(data){
|
||||
console.log(data);
|
||||
this.openExpedientDetail.emit(data);
|
||||
@@ -104,23 +100,5 @@ export class ExpedientePage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente/expediente-detail'], navigationExtras);
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
console.log(this.profile);
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedienteDetailPage,
|
||||
componentProps:{
|
||||
enterAnimation: "",
|
||||
serialNumber: serialNumber,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
console.log('refresh list');
|
||||
this.LoadList();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -303,6 +303,7 @@ export class GabineteDigitalPage implements OnInit {
|
||||
else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showEventsToApprove = true;
|
||||
this.eventsToApprove.doRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ ion-content{
|
||||
.main-wrapper{
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
display: flex;
|
||||
height: calc(100% - 50Px);
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
@@ -133,6 +134,8 @@ ion-item{
|
||||
}
|
||||
|
||||
.main-content {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: white;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
|
||||
@@ -65,10 +65,14 @@ export class LoginPage implements OnInit {
|
||||
ngOnInit() {}
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateInput() {
|
||||
validateUsername() {
|
||||
return (
|
||||
this.username.trim().length > 0
|
||||
&& this.password.trim().length > 0
|
||||
);
|
||||
}
|
||||
validatePassword() {
|
||||
return (
|
||||
this.password.trim().length > 0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -106,34 +110,37 @@ export class LoginPage implements OnInit {
|
||||
|
||||
async Login() {
|
||||
|
||||
if (this.validateInput()) {
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt)) {
|
||||
//this.loginRocketChat();
|
||||
this.authService.loginChat(this.userattempt);
|
||||
//this.getToken();
|
||||
|
||||
if(!this.pin) {
|
||||
this.setPint = true
|
||||
this.pin = true
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
if (this.validateUsername()) {
|
||||
if(this.validatePassword()){
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt)) {
|
||||
//this.loginRocketChat();
|
||||
this.authService.loginChat(this.userattempt);
|
||||
//this.getToken();
|
||||
|
||||
if(!this.pin) {
|
||||
this.setPint = true
|
||||
this.pin = true
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar');
|
||||
}
|
||||
}
|
||||
else {
|
||||
//this.toastService.presentToast('Não foi possível fazer login"');
|
||||
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
||||
else{
|
||||
this.toastService.badRequest('Por favor, insira a sua palavra-passe');
|
||||
}
|
||||
}
|
||||
else {
|
||||
//this.toastService.presentToast('Preencha todos campos');
|
||||
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
|
||||
this.toastService.badRequest('Por favor, insira o seu nome de utilizador');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ export class ToastService {
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(7000)
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ export class ToastService {
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},3000)
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Seu calendário
|
||||
</ion-segment-button>
|
||||
|
||||
@@ -36,37 +36,45 @@ export class EventsToApprovePage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.segment = this.loggeduser.Profile;
|
||||
console.log(this.segment);
|
||||
|
||||
this.LoadToApproveEvents();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.doRefresh();
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
});
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if( window.innerWidth <= 1024){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
LoadToApproveEvents() {
|
||||
segmentChanged(ev: any) {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
|
||||
async LoadToApproveEvents() {
|
||||
this.showLoader = true;
|
||||
|
||||
let prEvents = await this.processes.GetToApprovedEvents('PR','false').toPromise();
|
||||
this.eventsPRList = prEvents;
|
||||
console.log(this.eventsPRList);
|
||||
|
||||
this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
/* this.processes.GetToApprovedEvents('PR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsPRList = res;
|
||||
|
||||
console.log('this.eventsPRList', this.eventsPRList)
|
||||
});
|
||||
this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
}); */
|
||||
let mdEvents = await this.processes.GetToApprovedEvents('MDGPR','false').toPromise();
|
||||
this.eventsMDGPRList = mdEvents;
|
||||
console.log(this.eventsMDGPRList);
|
||||
/* this.processes.GetToApprovedEvents('MDGPR','false').subscribe(res=>{
|
||||
this.showLoader = false;
|
||||
this.eventsMDGPRList = res;
|
||||
|
||||
console.log('this.eventsMDGPRList', this.eventsMDGPRList)
|
||||
});
|
||||
}); */
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
goToEventDetail(eventToAprove){
|
||||
@@ -121,11 +129,7 @@ export class EventsToApprovePage implements OnInit {
|
||||
|
||||
doRefresh() {
|
||||
console.log('Refresh Events');
|
||||
|
||||
this.LoadToApproveEvents();
|
||||
console.log('refresh');
|
||||
setTimeout(() => {
|
||||
}, 2000);
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
Reference in New Issue
Block a user