mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add inactivity page
This commit is contained in:
@@ -22,7 +22,7 @@ import {
|
||||
import { CustomDateFormatter } from './custom-date-formatter.provider';
|
||||
import { NewEventPage } from './new-event/new-event.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { eventSource } from 'src/app/models/agenda/eventSource';
|
||||
@@ -150,7 +150,7 @@ export class AgendaPage implements OnInit {
|
||||
*/
|
||||
IsEvent: "edit" | "add" | "view";
|
||||
viewingEventObject: CalendarEvent ;
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
constructor(
|
||||
private alertCtrl: AlertController,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
@@ -56,7 +56,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
documents:SearchList[] = [];
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
members:any;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ModalController, Platform } from '@ionic/angular';
|
||||
import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { ProcessesService } from '../../services/processes.service';
|
||||
import { DailyWorkTask } from '../../models/dailyworktask.model';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
@@ -69,7 +69,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
@Output() openExpedientListPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
existingScreenOrientation: string;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
|
||||
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';
|
||||
import { __awaiter } from 'tslib';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
@@ -45,7 +45,7 @@ export class DespachosPrPage implements OnInit {
|
||||
dicIndex = 0;
|
||||
inicial = false
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
skeletonLoader = true
|
||||
despachoprstore = DespachosprStore
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -112,7 +112,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
formLocationSatus: boolean = false;
|
||||
showAttendees= false;
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
|
||||
constructor(
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.pag
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
@@ -84,7 +84,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
taskResult: any = {}
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
toppings = new FormControl();
|
||||
|
||||
Form: FormGroup;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||
@@ -40,7 +40,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
documents: SearchList[] = [];
|
||||
attachments:any;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
@@ -25,7 +25,7 @@ export class ExpedientesPrPage implements OnInit {
|
||||
serialNumber:string;
|
||||
showLoader:boolean;
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
skeletonLoader = true
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationExtras, Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
|
||||
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
|
||||
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
|
||||
@@ -83,7 +83,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
serialNumber:string;
|
||||
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
mdgpr = "MDGPR";
|
||||
pr = "PR";
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
@@ -40,7 +40,7 @@ export class PedidoPage implements OnInit {
|
||||
caller: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
constructor(private activatedRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
|
||||
@@ -24,7 +24,7 @@ export class PendentesPage implements OnInit {
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
showLoader: boolean;
|
||||
loggeduser: User;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="main-wrapper">
|
||||
|
||||
|
||||
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' ">
|
||||
<div class="wrapper" *ngIf="SessionStore.user.LoginPreference == 'Password' && SessionStore.hasPin || SessionStore.user.LoginPreference == null && SessionStore.hasPin ">
|
||||
|
||||
<div class="bg-1 d-flex justify-center align-center">
|
||||
<div class="bg-2 d-flex justify-center align-center">
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin" >
|
||||
<div class="main-content d-flex flex-column height-100 width" *ngIf="!SessionStore.hasPin || SessionStore.hasPin && SessionStore.user.LoginPreference == 'Pin' " >
|
||||
|
||||
<div class="div-top-header">
|
||||
|
||||
|
||||
@@ -17,13 +17,17 @@ ion-content{
|
||||
background: white !important;
|
||||
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
width: 400px;
|
||||
/* width: 400px; */
|
||||
height: auto;
|
||||
padding: 0 !important;
|
||||
margin: auto !important;
|
||||
/* margin: auto !important; */
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
background: linear-gradient(180deg, #42B9FE 0%, #0782C9 100%) !important;
|
||||
}
|
||||
|
||||
.logo{
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
|
||||
@@ -45,6 +45,58 @@ export class InactivityPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateUsername() {
|
||||
return (
|
||||
this.username.trim().length > 0
|
||||
);
|
||||
}
|
||||
|
||||
validatePassword() {
|
||||
return (
|
||||
this.password.trim().length > 0
|
||||
);
|
||||
}
|
||||
|
||||
async Login() {
|
||||
|
||||
if (this.validateUsername()) {
|
||||
if(this.validatePassword()) {
|
||||
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
let attempt = await this.authService.login(this.userattempt, false)
|
||||
|
||||
if (attempt) {
|
||||
|
||||
// if current attemp is equal to the current user
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
await this.getToken();
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
} else {
|
||||
SessionStore.delete()
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira a sua palavra-passe');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira o seu nome de utilizador');
|
||||
}
|
||||
}
|
||||
|
||||
getToken() {
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
}
|
||||
|
||||
@@ -84,26 +84,8 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
/* loginRocketChat() {
|
||||
|
||||
let postData = {
|
||||
"user": this.username,
|
||||
"password": this.password,
|
||||
}
|
||||
|
||||
this.authService.loginChat(postData).subscribe((res: any) => {
|
||||
console.log(res.data);
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
}, (error: any) => {
|
||||
console.log('Network error');
|
||||
this.presentAlert('Network error ' + error);
|
||||
});
|
||||
} */
|
||||
|
||||
getToken() {
|
||||
this.notificatinsservice.getAndpostToken(this.username);
|
||||
//console.log('HERE');
|
||||
}
|
||||
|
||||
async Login() {
|
||||
@@ -120,8 +102,8 @@ export class LoginPage implements OnInit {
|
||||
let attempt = await this.authService.login(this.userattempt)
|
||||
|
||||
if (attempt) {
|
||||
this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
await this.getToken();
|
||||
|
||||
this.router.navigate(['/pin']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user