mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve agenda load time
This commit is contained in:
@@ -383,7 +383,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
let top = '0';
|
let top = '0';
|
||||||
|
|
||||||
console.log('startMinutos', startMinutos);
|
// console.log('startMinutos', startMinutos);
|
||||||
|
|
||||||
if(startHours < endHours){
|
if(startHours < endHours){
|
||||||
if (startMinutos != 0 ){
|
if (startMinutos != 0 ){
|
||||||
@@ -494,9 +494,6 @@ export class AgendaPage implements OnInit {
|
|||||||
const startHoursOtherFormate = new Date(element.StartDate).getHours().toLocaleString()+':'+new Date(element.StartDate).getMinutes().toLocaleString();
|
const startHoursOtherFormate = new Date(element.StartDate).getHours().toLocaleString()+':'+new Date(element.StartDate).getMinutes().toLocaleString();
|
||||||
const EndHoursOtherFormate = formatDate(new Date(element.EndDate), 'HH:mm', 'pt');
|
const EndHoursOtherFormate = formatDate(new Date(element.EndDate), 'HH:mm', 'pt');
|
||||||
|
|
||||||
if( profile =='md' && eventIndex==3){
|
|
||||||
console.log('mdEvent:', element,eventIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
events.push({
|
events.push({
|
||||||
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex, profile),
|
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex, profile),
|
||||||
@@ -623,7 +620,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
case "Pessoal":
|
case "Pessoal":
|
||||||
//Inicializa o array eventSource
|
//Inicializa o array eventSource
|
||||||
this.eventSource=[];
|
|
||||||
if(this.profile == "mdgpr") {
|
if(this.profile == "mdgpr") {
|
||||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
|
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
|
||||||
|
|
||||||
@@ -699,7 +696,6 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
case "Oficial":
|
case "Oficial":
|
||||||
//Inicializa o array eventSource
|
//Inicializa o array eventSource
|
||||||
this.eventSource=[];
|
|
||||||
this.eventsListOficial = [];
|
this.eventsListOficial = [];
|
||||||
|
|
||||||
if(this.profile == "mdgpr") {
|
if(this.profile == "mdgpr") {
|
||||||
@@ -776,7 +772,7 @@ export class AgendaPage implements OnInit {
|
|||||||
//this.showTimelineMD = false;
|
//this.showTimelineMD = false;
|
||||||
|
|
||||||
// calendar
|
// calendar
|
||||||
|
let counter = 0;
|
||||||
|
|
||||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
|
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
|
||||||
response => {
|
response => {
|
||||||
@@ -791,7 +787,7 @@ export class AgendaPage implements OnInit {
|
|||||||
this.eventsList = response;
|
this.eventsList = response;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.eventSource=[];
|
this.eventSource= this.eventSource.filter(e => e.profile != 'md');
|
||||||
// loop
|
// loop
|
||||||
this.eventsList.forEach((element, eventIndex) => {
|
this.eventsList.forEach((element, eventIndex) => {
|
||||||
|
|
||||||
@@ -819,8 +815,12 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
this.showTimelineMD = true;
|
this.showTimelineMD = true;
|
||||||
|
|
||||||
|
counter++;
|
||||||
|
if(counter==2){
|
||||||
|
this.showLoader = false;
|
||||||
this.timelineBoxCorrectHeight(500);
|
this.timelineBoxCorrectHeight(500);
|
||||||
this.centralizeTimeline(500);
|
this.centralizeTimeline(500);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -837,7 +837,7 @@ export class AgendaPage implements OnInit {
|
|||||||
this.eventsList = response;
|
this.eventsList = response;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.eventSource=[];
|
this.eventSource = this.eventSource.filter(e => e.profile != 'pr');
|
||||||
|
|
||||||
this.eventsList.forEach((element, eventIndex) => {
|
this.eventsList.forEach((element, eventIndex) => {
|
||||||
|
|
||||||
@@ -863,10 +863,13 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
this.showTimelinePR = true;
|
this.showTimelinePR = true;
|
||||||
|
|
||||||
|
counter++;
|
||||||
|
|
||||||
|
if(counter==2){
|
||||||
|
this.showLoader = false;
|
||||||
this.timelineBoxCorrectHeight(500);
|
this.timelineBoxCorrectHeight(500);
|
||||||
this.centralizeTimeline(500);
|
this.centralizeTimeline(500);
|
||||||
|
}
|
||||||
this.showLoader = false;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user