hide navigation bar if user dosent have own calendare

This commit is contained in:
Eudes Inácio
2022-04-07 17:47:45 +01:00
parent 18bff756f1
commit 871ac764f8
3 changed files with 23 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<ion-tabs class="tab" > <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"> <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">
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'"> <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 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/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> <ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
+7 -1
View File
@@ -32,6 +32,9 @@ import { v4 as uuidv4 } from 'uuid'
import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service';
import { UserSession } from '../models/user.model'; import { UserSession } from '../models/user.model';
import { PermissionList } from '../models/permission/permissionList'; import { PermissionList } from '../models/permission/permissionList';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@@ -83,6 +86,8 @@ export class HomePage implements OnInit {
audioName: string = ""; audioName: string = "";
public user: UserSession; public user: UserSession;
permissionList = new PermissionList(); permissionList = new PermissionList();
loggeduser: LoginUserRespose;
constructor( constructor(
private router: Router, private router: Router,
@@ -107,8 +112,9 @@ export class HomePage implements OnInit {
public RouteService: RouteService, public RouteService: RouteService,
private WsChatService: WsChatService, private WsChatService: WsChatService,
private NativeNotificationService: NativeNotificationService, private NativeNotificationService: NativeNotificationService,
private authService: AuthService,
) { ) {
this.loggeduser = authService.ValidatedUser;
if (SessionStore.exist) { if (SessionStore.exist) {
this.user = SessionStore.user; this.user = SessionStore.user;
} }
+15
View File
@@ -248,6 +248,21 @@ export class EventsPage implements OnInit {
this.totalEvent = list.length; this.totalEvent = list.length;
this.showLoader = false; 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
} }