mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
merge
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
<div class="d-flex mt-10 width-100">
|
||||
<ion-buttons slot="start" class="buttonSize" >
|
||||
<button (click)="logout()" class="btn-delete" fill="clear" style="background:#ffe0e0;" >
|
||||
<button (click)="logout()" class="btn-delete" fill="clear" >
|
||||
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
|
||||
</button>
|
||||
<button (click)="editProfile()" class="btn-cancel" fill="clear" color="#fff" >
|
||||
@@ -30,39 +30,29 @@
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="notifications-content">
|
||||
<ion-label>2 novas notificações</ion-label>
|
||||
<ion-label>{{notificationdata.length}} novas notificações</ion-label>
|
||||
<ion-list>
|
||||
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none">
|
||||
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none"
|
||||
*ngFor = "let item of notificationdata; let i = index"
|
||||
(click)="notificatinsRoutes(item.Service,item.Object,item.IdObject,item.FolderId)"
|
||||
>
|
||||
<div class="item-content width-100">
|
||||
<div class="notification-item">
|
||||
<img class="notification-icon" slot="end" src="assets/images/icons-default-agenda.svg" >
|
||||
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'agenda'" src="assets/images/icons-default-agenda.svg" >
|
||||
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'gabinete-digital'" src="assets/images/icons-correspondencias.svg" >
|
||||
<img class="notification-icon" slot="end" *ngIf = "item.Service == 'accoes'" src="assets/images/icons-nav-actions.svg" >
|
||||
</div>
|
||||
<div class="approve-event-time">
|
||||
<p>08:00</p>
|
||||
<p>09:00</p>
|
||||
<p>{{item.dateInit}}</p>
|
||||
<p>{{item.dateEnd}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p>Luanda | Palácio Presidencial</p>
|
||||
<h3>Almoço de Família</h3>
|
||||
<p>{{item.Location}}</p>
|
||||
<h3>{{item.alert}}</h3>
|
||||
</div>
|
||||
<div class="notification-label"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none">
|
||||
<div class="item-content width-100">
|
||||
<div class="notification-item">
|
||||
<img class="notification-icon" slot="end" src="assets/images/icons-correspondencias.svg" >
|
||||
</div>
|
||||
<div class="approve-event-time">
|
||||
<p>28-07-21</p>
|
||||
<p>09:00</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<h3>Relatório FMI</h3>
|
||||
<p>Luanda | Palácio Presidencial</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-list>
|
||||
|
||||
|
||||
@@ -45,9 +45,11 @@
|
||||
}
|
||||
|
||||
.btn-delete{
|
||||
background:#ffe0e0 !important;
|
||||
width: 40% !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.btn-cancel{
|
||||
width: 40% !important;
|
||||
margin-right: 0 !important;
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
///<reference path="../../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
|
||||
///<reference path="../../../../plugins/cordova-plugin-mfp-jsonstore/typings/jsonstore.d.ts" />
|
||||
import { Component, OnInit,NgZone } from '@angular/core';
|
||||
import { Router,NavigationExtras } from '@angular/router';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
|
||||
import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
import { EditProfilePage } from './edit-profile/edit-profile.page';
|
||||
import { JsonStore } from '../../services/jsonStore.service';
|
||||
import { StorageService } from '../../services/storage.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -17,13 +22,18 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
loggeduser: User;
|
||||
userLoginPreference = ''
|
||||
notificationdata: any[];
|
||||
DataArray: Array<Object> = [];
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
constructor(private modalController: ModalController,
|
||||
private authService: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private router: Router,
|
||||
private localstoreService: LocalstoreService
|
||||
) {
|
||||
private localstoreService: LocalstoreService,
|
||||
private jsonstore: JsonStore,
|
||||
private storageservice: StorageService,
|
||||
private zone: NgZone,
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
@@ -32,19 +42,100 @@ export class ProfilePage implements OnInit {
|
||||
this.checkState()
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() {
|
||||
this.storageservice.get("Notifications").then((value) => {
|
||||
|
||||
var data = JSON.parse(value);
|
||||
data.forEach(element => {
|
||||
console.log("ARaaAA", element)
|
||||
var payload = JSON.parse(element.payload)
|
||||
let notificationObject = {
|
||||
alert: element.alert,
|
||||
Service: payload.Service,
|
||||
Object: payload.Object,
|
||||
IdObject: payload.IdObject,
|
||||
FolderId: payload.FolderId,
|
||||
desc: payload.desc,
|
||||
dateInit: payload.dateInit,
|
||||
dateEnd: payload.dateEnd,
|
||||
Location: payload.Location,
|
||||
TypeAgenda: payload.TypeAgenda,
|
||||
Status: payload.Status
|
||||
}
|
||||
|
||||
this.DataArray.push(notificationObject)
|
||||
});
|
||||
this.notificationdata = this.DataArray
|
||||
console.log("Notificaaa", this.notificationdata)
|
||||
})
|
||||
console.log("Notificaaa", this.notificationdata)
|
||||
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
notImplemented(){}
|
||||
notImplemented() { }
|
||||
|
||||
notificatinsRoutes = (Service,Object,IdObject,FolderId) => {
|
||||
if (Service === "agenda") {
|
||||
this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "expediente") {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente',IdObject,'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "event-list") {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'gabinete-digital']));
|
||||
}else if (Service === "gabinete-digital" && Object === "despachos") {
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',IdObject,'gabinete-digital'],{replaceUrl: true}));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "parecer") {
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',IdObject,'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "deferimento") {
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',IdObject,'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "despachos-pr") {
|
||||
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": IdObject,
|
||||
}
|
||||
};
|
||||
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr/despacho-pr'], navigationExtras));
|
||||
}
|
||||
else if (Service === "accoes" && Object === "accao") {
|
||||
this.zone.run(() => this.router.navigate(['/home/publications',IdObject]));
|
||||
}
|
||||
else if (Service === "accoes" && Object === "publicacao") {
|
||||
this.zone.run(() => this.router.navigate(['/home/publications/view-publications',FolderId,IdObject]));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "diplomas") {
|
||||
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "diplomas-assinar") {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"serialNumber": IdObject,
|
||||
}
|
||||
};
|
||||
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "expedientes-pr") {
|
||||
this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/expedientes-pr',IdObject,'gabinete-digital']));
|
||||
}
|
||||
}
|
||||
|
||||
logout() {
|
||||
//const loader = this.toastService.loading();
|
||||
// clear local storage
|
||||
window.localStorage.clear();
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
window.location.pathname = '/'
|
||||
location.reload();
|
||||
}, 1000)
|
||||
@@ -58,7 +149,7 @@ export class ProfilePage implements OnInit {
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
} else {
|
||||
this.userLoginPreference = ''
|
||||
this.userLoginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user