Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer

This commit is contained in:
Peter Maquiran
2022-04-08 13:52:18 +01:00
14 changed files with 124 additions and 54 deletions
+22 -6
View File
@@ -24,14 +24,22 @@ export class InactivityGuard implements CanActivate {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']);
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
this.router.navigate(['/home/agenda']);
}
else{
this.router.navigate(['/home/events']);
}
}
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)) {
this.router.navigate(['/home/publications']);
} else {
}
else {
this.alertController.create({
cssClass: 'my-custom-class',
@@ -57,14 +65,22 @@ export class InactivityGuard implements CanActivate {
else {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']);
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
this.router.navigate(['/home/agenda']);
}
else{
this.router.navigate(['/home/events']);
}
}
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
this.router.navigate(['/home/publications']);
} else {
}
else {
this.alertController.create({
cssClass: 'my-custom-class',
header: 'Utilizador sem acesso a aplicação',
+7 -2
View File
@@ -1,8 +1,10 @@
<ion-tabs class="tab" >
<ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="bottoms" slot="bottom">
<div *ngIf="this.platform.is('mobile')">
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
<ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && loggeduser.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])" class="bottoms" slot="bottom">
<ion-tab-button *ngIf="loggeduser.OwnerCalendars.length >= 1 || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
<!-- <ion-icon name="home"></ion-icon> -->
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
@@ -39,5 +41,8 @@
</ion-tab-button>
</ion-tab-bar>
</div>
</ion-tabs>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
+5 -5
View File
@@ -40,12 +40,12 @@ ion-badge {/* */
}
@media only screen and (min-width: 1366px) {
// @media only screen and (min-width: 1366px) {
ion-tabs.tab .bottoms{
display: none;
}
}
// ion-tabs.tab .bottoms{
// display: none;
// }
// }
ion-tab-button.active{
+8 -2
View File
@@ -31,6 +31,9 @@ import { v4 as uuidv4 } from 'uuid'
import { NativeNotificationService } from 'src/app/services/native-notification.service';
import { UserSession } from '../models/user.model';
import { PermissionList } from '../models/permission/permissionList';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@Component({
@@ -83,12 +86,14 @@ export class HomePage implements OnInit {
audioName: string = "";
public user: UserSession;
permissionList = new PermissionList();
loggeduser: LoginUserRespose;
constructor(
private router: Router,
public modalCtrl: AlertController,
private notificationsService: NotificationsService,
private platform: Platform,
public platform: Platform,
private activeroute: ActivatedRoute,
/* private webnotification: WebNotificationsService, */
public p: PermissionService,
@@ -106,8 +111,9 @@ export class HomePage implements OnInit {
public RouteService: RouteService,
private WsChatService: WsChatService,
private NativeNotificationService: NativeNotificationService,
private authService: AuthService,
) {
this.loggeduser = authService.ValidatedUser;
if (SessionStore.exist) {
this.user = SessionStore.user;
}
+2 -2
View File
@@ -111,7 +111,7 @@
</ion-item-sliding>
</ion-list>
<ion-list *ngSwitchCase="'Grupos'">
<ion-item-sliding *ngIf="!wsChatMethodsService.loadingWholeList">
<ion-item-sliding >
<div *ngFor="let group of wsChatMethodsService._group"
[class.item-active]="group.id ==idSelected"
class="item item-hover d-flex">
@@ -150,7 +150,7 @@
</div>
</div>
</ion-item-sliding>
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList || wsChatMethodsService.groupCount < 1">
<ion-item-sliding *ngIf="wsChatMethodsService.groupCount < 1">
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-group-chat-grey.svg"></ion-icon></div>
<div class="item-content flex-grow-1 cursor-pointer">
+15
View File
@@ -248,6 +248,21 @@ export class EventsPage implements OnInit {
this.totalEvent = list.length;
this.showLoader = false;
} else {
if(this.loggeduser.OwnerCalendars.length >= 1) {
console.log('OWN caledare')
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end)
this.listToPresent = onwEvent;
this.totalEvent = onwEvent.length;
this.showLoader = false;
} else {
console.log('ELSE')
}
//if need share calendare
//this.eventService.genericGetAllSharedEvents
}
@@ -15,7 +15,7 @@
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="validar">
<ion-segment-button value="validar" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">
Por validar ...
</ion-segment-button>
<ion-segment-button value="assinados">
@@ -30,14 +30,14 @@
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
<div class="width-100" [ngSwitch]="segment">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div *ngIf="diplomasList">
<div *ngIf="diplomasList && p.userPermission([p.permissionList.Gabinete.md_tasks])">
<ion-list *ngSwitchCase="'validar'">
<ion-item
class="expediente ion-no-padding cursor-pointer"
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
lines="none"
@@ -69,12 +69,12 @@
</div>
</ion-item>
</ion-list>
</div>
<div *ngIf="diplomasAssinadoList">
<ion-list *ngSwitchCase="'assinados'">
<ion-item
class="expediente ion-no-padding cursor-pointer"
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of diplomasAssinadoList"
(click)="goToDiploma(task.SerialNumber)"
lines="none"
@@ -109,15 +109,15 @@
</div>
</div>
<div
*ngIf="!skeletonLoader && diplomasList.length == 0 && diplomasAssinadoList.length == 0"
<div
*ngIf="!skeletonLoader && diplomasList.length == 0 && diplomasAssinadoList.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && diplomasAssinadoList.length == 0 && skeletonLoader && diplomasList.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
+18 -4
View File
@@ -205,9 +205,16 @@ export class InactivityPage implements OnInit {
setTimeout(()=>{
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events'], {replaceUrl: true});
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
this.router.navigate(['/home/agenda']);
}
else{
this.router.navigate(['/home/events']);
}
}
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
@@ -228,9 +235,16 @@ export class InactivityPage implements OnInit {
SessionStore.setPin(code);
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']);
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
this.router.navigate(['/home/agenda']);
}
else{
this.router.navigate(['/home/events']);
}
}
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
+9 -2
View File
@@ -163,9 +163,16 @@ export class LoginPage implements OnInit {
this.router.navigate([pathName]);
} else {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
this.router.navigate(['/home/events']);
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
this.router.navigate(['/home/agenda']);
}
else{
this.router.navigate(['/home/events']);
}
}
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
//If user has access permission to both Chat and Action, goes to Chat by default.
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
@@ -33,7 +33,7 @@ export class WsChatMethodsService {
_dm: RoomService[] = []
_group: RoomService[] = []
loadingWholeList = false
loadingWholeList = false;
dmCount = 0;
groupCount = 0;
@@ -121,7 +121,7 @@ export class WsChatMethodsService {
this._dm = []
this._group = []
this.loadingWholeList = false
this.loadingWholeList = false;
this.dmCount = 0;
this.groupCount = 0;
@@ -177,13 +177,13 @@ export class WsChatMethodsService {
const roomId = this.getRoomId(roomData);
if(roomData.t == 'd') {
const res = await this.chatService.getMembers(roomId).toPromise();
const members = res['members'];
const users = members.filter(data => data.username != this.loggedUser.me.username);
rooms.result.update[index]['members'] = users
await this.prepareRoom(roomData);
} else {
if (roomData.t === 'p') {
@@ -209,7 +209,7 @@ export class WsChatMethodsService {
console.log('save rooms', rooms)
await this.storage.set('Rooms', rooms);
setTimeout(()=>{
this.sortRoomList()
}, 1000)
@@ -218,7 +218,7 @@ export class WsChatMethodsService {
setTimeout(()=>{
this.sortRoomList()
}, 10000)
this.loadingWholeList = false
}
@@ -10,7 +10,7 @@
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="validar">
<ion-segment-button value="validar" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">
Diplomas por validar
</ion-segment-button>
<ion-segment-button value="assinados">
@@ -23,7 +23,7 @@
<div class="main-container width-100 overflow-y-auto height-100" [ngSwitch]="segment">
<div *ngIf="deplomasStore.diplomasList.length >= 1">
<div *ngIf="deplomasStore.diplomasList.length >= 1 && p.userPermission([p.permissionList.Gabinete.md_tasks])">
<ion-list *ngSwitchCase="'validar'">
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
+3 -2
View File
@@ -47,7 +47,7 @@
</div>
</div>
<div class="desktop mx-20">
<div *ngIf="this.platform.is('desktop')" class="desktop mx-20">
<div class="d-flex justify-space-between align-center">
<div tab="events" class="div-logo height-fit-content">
<div class="logo-icon">
@@ -64,7 +64,7 @@
</div>
</div>
<div class="d-flex flex-1 pr-20 pl-50" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2">
<div class="d-flex flex-1 pr-20 pl-50" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2 || (p.userPermission([permissionList.Agenda.access]) && loggeduser.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])">
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
[class.active]="locationPathname() == '/home/events'">
@@ -169,6 +169,7 @@
</div>
</div>
</div>
<div class="header-bottom-line"></div>
<!-- {{ RouteService.history | json }} -->
+14 -8
View File
@@ -121,16 +121,22 @@
display: none;
}
@media only screen and (min-width: 1366px) {
// @media only screen and (min-width: 1366px) {
.mobile{
display: none !important;
}
.desktop{
display: block;
}
// .mobile{
// display: none !important;
// }
// .desktop{
// display: block;
// }
}
// }
.mobile{
display: none !important;
}
.desktop{
display: block;
}
.tab{
height: 65px;
+1 -1
View File
@@ -39,7 +39,7 @@ export class HeaderPage implements OnInit {
private modalController: ModalController,
private animationController: AnimationController,
private storageservice: StorageService,
private platform: Platform,
public platform: Platform,
//private notificationsService: NotificationsService,
private eventrigger: EventTrigger,
public ThemeService: ThemeService,