Fixe ageanda timeline centalizer and header profile

This commit is contained in:
Peter Maquiran
2021-05-12 11:34:28 +01:00
parent 3df73c063a
commit 695bd3a6df
7 changed files with 60 additions and 35 deletions
+6 -4
View File
@@ -353,10 +353,9 @@ export class AgendaPage implements OnInit {
const timelineMarker = document.querySelector('.cal-current-time-marker'); const timelineMarker = document.querySelector('.cal-current-time-marker');
const scrollContainer = document.querySelector('.timeline-wrapper'); const scrollContainer = document.querySelector('.timeline-wrapper');
try { try {
scrollContainer.scroll({ scrollContainer.scroll({
top: timelineMarker['offsetTop'] - ((scrollContainer['offsetHeight']/2) - 60), top: parseInt(timelineMarker['style']['top'].replace('px','')) - ((scrollContainer['offsetHeight']/2) - 60),
left: 0, left: 0,
behavior: 'smooth' behavior: 'smooth'
}) })
@@ -888,22 +887,24 @@ export class AgendaPage implements OnInit {
setTimeout(()=>{ setTimeout(()=>{
if(this.eventSelectedDate.toLocaleDateString('en-US') != (new Date()).toLocaleDateString('en-US')) {
let sortedDate = this.eventSource.sort((a,b) =>{ let sortedDate = this.eventSource.sort((a,b) =>{
return (b.startTime) -(a.startTime); return (b.startTime) -(a.startTime);
}); });
let filterDate = sortedDate.filter((e) => { let filterDate = sortedDate.filter((e) => {
console.log( e.startTime.toLocaleDateString('en-US'),' == ',this.eventSelectedDate.toLocaleDateString('en-US'));
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US'); return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
}); });
console.log('Event -- ',filterDate[filterDate.length - 1]); console.log('Event -- ',filterDate[filterDate.length - 1], filterDate['startTime']);
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours(); const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
console.log('firstEventStartHours-- ', firstEventStartHours) console.log('firstEventStartHours-- ', firstEventStartHours)
if(firstEventStartHours) {
const scrollContainer = document.querySelector('.timeline-wrapper'); const scrollContainer = document.querySelector('.timeline-wrapper');
scrollContainer.scroll({ scrollContainer.scroll({
@@ -926,6 +927,7 @@ export class AgendaPage implements OnInit {
ev.target.complete(); ev.target.complete();
}, 250) }, 250)
} }
showAlert(){ showAlert(){
this.alertController.presentAlert("Funcionalidade em desenvolvimento."); this.alertController.presentAlert("Funcionalidade em desenvolvimento.");
} }
@@ -8,6 +8,10 @@
</div> </div>
<div class="div-profile"> <div class="div-profile">
<ion-icon src='assets/images/icons-profile-pr.svg'></ion-icon> <ion-icon src='assets/images/icons-profile-pr.svg'></ion-icon>
<ion-icon class="font-45" *ngIf="loggeduser.Profile == 'MDGPR'" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon class="font-45" *ngIf="loggeduser.Profile == 'PR' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
</div> </div>
</div> </div>
</ion-toolbar> </ion-toolbar>
+9 -1
View File
@@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { User } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@Component({ @Component({
selector: 'app-header-pr', selector: 'app-header-pr',
@@ -7,9 +9,15 @@ import { Component, OnInit } from '@angular/core';
}) })
export class HeaderPrPage implements OnInit { export class HeaderPrPage implements OnInit {
constructor() { } loggeduser: User;
constructor(authService: AuthService) {
this.loggeduser = authService.ValidatedUser;
}
ngOnInit() { ngOnInit() {
} }
locationPathname(): string { locationPathname(): string {
+4 -4
View File
@@ -12,10 +12,10 @@
</div> </div>
<div class="div-profile"> <div class="div-profile">
<button class="btn-no-color" (click)="openProfile()"> <button class="btn-no-color" (click)="openProfile()">
<ion-icon class="font-45" *ngIf="profile == 'mdgpr' " src='assets/images/icons-profile.svg'></ion-icon> <ion-icon class="font-45" *ngIf="loggeduser.Profile == 'MDGPR'" src='assets/images/icons-profile.svg'></ion-icon>
</button> </button>
<button class="btn-no-color" (click)="openProfile()"> <button class="btn-no-color" (click)="openProfile()">
<ion-icon class="font-45" *ngIf="profile == 'pr' " src='assets/images/icons-profile-pr-header.svg'></ion-icon> <ion-icon class="font-45" *ngIf="loggeduser.Profile == 'PR' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
</button> </button>
</div> </div>
</div> </div>
@@ -81,8 +81,8 @@
</div> </div>
<div class="div-profile justify-end d-flex cursor-pointer" (click)="openProfile()"> <div class="div-profile justify-end d-flex cursor-pointer" (click)="openProfile()">
<ion-icon class="font-45" *ngIf="profile == 'mdgpr' " src='assets/images/icons-profile.svg'></ion-icon> <ion-icon class="font-45" *ngIf="loggeduser.Profile == 'MDGPR'" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon class="font-45" *ngIf="profile == 'pr' " src='assets/images/icons-profile-pr-header.svg'></ion-icon> <ion-icon class="font-45" *ngIf="loggeduser.Profile == 'PR' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
</div> </div>
</div> </div>
</div> </div>
+6 -5
View File
@@ -3,6 +3,8 @@ import { AnimationController, ModalController } from '@ionic/angular';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ProfileComponent } from '../headers/header-no-search/profile/profile.component'; import { ProfileComponent } from '../headers/header-no-search/profile/profile.component';
import { AuthService } from 'src/app/services/auth.service';
import { User } from 'src/app/models/user.model';
@Component({ @Component({
selector: 'app-header', selector: 'app-header',
@@ -11,17 +13,16 @@ import { ProfileComponent } from '../headers/header-no-search/profile/profile.co
}) })
export class HeaderPage implements OnInit { export class HeaderPage implements OnInit {
profile: string = 'mdgpr';
searchSubject: string = ''; searchSubject: string = '';
showSearch=false; showSearch=false;
loggeduser: User;
constructor( constructor(
private router: Router,private modalController: ModalController, private router: Router,private modalController: ModalController,
private animationController: AnimationController,) { private animationController: AnimationController,
authService: AuthService) {
window['header'] = (profile:string) => { this.loggeduser = authService.ValidatedUser;
this.profile = profile;
}
router.events.subscribe((val) => { router.events.subscribe((val) => {
@@ -10,7 +10,8 @@
</div> </div>
<div class="div-profile" (click)="openProfile()"> <div class="div-profile" (click)="openProfile()">
<ion-icon class="font-45" src='assets/images/icons-profile.svg'></ion-icon> <ion-icon class="font-45" *ngIf="loggeduser.Profile == 'MDGPR'" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon class="font-45" *ngIf="loggeduser.Profile == 'PR' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
</div> </div>
</div> </div>
@@ -56,7 +57,8 @@
</div> --> </div> -->
<div class="div-profile cursor-pointer" (click)="openProfile()"> <div class="div-profile cursor-pointer" (click)="openProfile()">
<ion-icon src='assets/images/icons-profile.svg'></ion-icon> <ion-icon class="font-45" *ngIf="loggeduser.Profile == 'MDGPR'" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon class="font-45" *ngIf="loggeduser.Profile == 'PR' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
</div> </div>
</div> </div>
</div> </div>
@@ -4,6 +4,8 @@ import { SearchPage } from 'src/app/pages/search/search.page';
import { MenuController } from '@ionic/angular'; import { MenuController } from '@ionic/angular';
import { ProfileComponent } from './profile/profile.component'; import { ProfileComponent } from './profile/profile.component';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { AuthService } from 'src/app/services/auth.service';
import { User } from 'src/app/models/user.model';
@Component({ @Component({
selector: 'app-header-no-search', selector: 'app-header-no-search',
templateUrl: './header-no-search.page.html', templateUrl: './header-no-search.page.html',
@@ -11,10 +13,16 @@ import { Router } from '@angular/router';
}) })
export class HeaderNoSearchPage implements OnInit { export class HeaderNoSearchPage implements OnInit {
loggeduser: User;
constructor(private modalController: ModalController, constructor(private modalController: ModalController,
private menu: MenuController, private menu: MenuController,
private animationController: AnimationController, private animationController: AnimationController,
private router: Router) { } private router: Router,
authService: AuthService) {
this.loggeduser = authService.ValidatedUser;
}
ngOnInit() { ngOnInit() {
} }