mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix missing loader
This commit is contained in:
+137
-110
@@ -184,25 +184,27 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
// const loader = this.toastService.loading()
|
||||
|
||||
this.profile = "mdgpr";
|
||||
|
||||
const pathname = window.location.pathname
|
||||
|
||||
let rrealoadCounter = 0
|
||||
let realoadCounter = 0
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
|
||||
if(event instanceof NavigationEnd && event.url == pathname ) {
|
||||
if (this.segment == null){
|
||||
|
||||
if (this.segment == null) {
|
||||
this.segment = "Combinado";
|
||||
}
|
||||
else if ( rrealoadCounter != 0) {
|
||||
if ( realoadCounter != 0) {
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
rrealoadCounter++;
|
||||
|
||||
}
|
||||
realoadCounter++;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
window.onresize = (event) => {
|
||||
@@ -463,8 +465,6 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date){
|
||||
|
||||
console.log('==========================================================')
|
||||
|
||||
this.eventSelectedDate = new Date(startTime);
|
||||
|
||||
this.showLoader = true;
|
||||
@@ -835,6 +835,11 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
}).finally(()=>{
|
||||
counter++;
|
||||
if(counter==2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
@@ -882,6 +887,11 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
}).finally(()=>{
|
||||
counter++;
|
||||
if(counter==2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -955,131 +965,148 @@ export class AgendaPage implements OnInit {
|
||||
startTime: startDate,
|
||||
endTime: event.end
|
||||
})
|
||||
|
||||
// console.log(event.end.toISOString() == endDate.toISOString())
|
||||
|
||||
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
|
||||
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.manyDays = false
|
||||
|
||||
|
||||
event.todayOnly = new Date(event.start).toLocaleDateString() == new Date(event.end).toLocaleDateString()
|
||||
|
||||
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
// difference
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) {
|
||||
|
||||
console.log(new Date(startDate).toLocaleDateString(),'!=' , new Date(endDate).toLocaleDateString())
|
||||
|
||||
// difference
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
startMany: true,
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
console.log(event)
|
||||
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
startMany: true,
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
event.other = true
|
||||
|
||||
event.other = true
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
|
||||
days[otherDays] = []
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: false
|
||||
})
|
||||
|
||||
days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: false
|
||||
})
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
days[otherDays].push(EndEvent)
|
||||
|
||||
} else {
|
||||
const EndEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
end: event.end,
|
||||
color: event.color,
|
||||
id: event.id,
|
||||
index: event.index,
|
||||
profile: event.profile,
|
||||
CalendarName: event.CalendarName,
|
||||
event: {
|
||||
Subject: event.event.Subject,
|
||||
StartDate: event.event.StartDate,
|
||||
EndDate: event.event.EndDate,
|
||||
Location: event.event.Location,
|
||||
EventId: event.event.EventId,
|
||||
CalendarName: event.event.CalendarName
|
||||
},
|
||||
Subject: event.Subject,
|
||||
startMany: false,
|
||||
endMany: true,
|
||||
middle: true
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
} else {
|
||||
days[day].push(event)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
days[day].push(event)
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height" [class.input-error]="Form?.get('participantes')?.invalid && validateFrom ">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
|
||||
@@ -213,9 +213,9 @@ export class NewEventPage implements OnInit {
|
||||
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||
Validators.required
|
||||
]),
|
||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
// ]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ export class ApproveEventModalPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
|
||||
alert('54321')
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("serialNumber")){
|
||||
|
||||
@@ -58,6 +58,7 @@ export class ApproveEventPage implements OnInit {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -187,8 +188,7 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async getAttachments(instanceId:string){
|
||||
const loader = this.toastService.loading()
|
||||
async getAttachments(instanceId:string) {
|
||||
|
||||
try {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(instanceId).toPromise();
|
||||
|
||||
@@ -177,8 +177,7 @@ export class EventsService {
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
async getAllMdEvents(startdate:string, enddate:string){
|
||||
console.log('md once')
|
||||
async getAllMdEvents(startdate:string, enddate:string) {
|
||||
let prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise();
|
||||
let prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise();
|
||||
const resFinal = prO.concat(prP);
|
||||
@@ -189,7 +188,6 @@ export class EventsService {
|
||||
}
|
||||
|
||||
async getAllSharedEvents(startdate:string, enddate:string) {
|
||||
console.log('pr once')
|
||||
let prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
||||
let prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
|
||||
const resFinal = prO.concat(prP);
|
||||
|
||||
@@ -48,6 +48,7 @@ export class ApproveEventPage implements OnInit {
|
||||
private toastService: ToastService
|
||||
) {
|
||||
// Event to approve list
|
||||
alert('123')
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user