mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix agenda
This commit is contained in:
@@ -728,18 +728,18 @@ app-approve-event{
|
||||
}
|
||||
|
||||
|
||||
.filter-Pessoal {
|
||||
.content-pr-Oficial, .content-mdgpr-Oficial, .content-md-Pessoal {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
// .filter-Pessoal {
|
||||
// .content-pr-Oficial, .content-mdgpr-Oficial, .content-md-Pessoal {
|
||||
// display: none !important;
|
||||
// }
|
||||
// }
|
||||
|
||||
.filter-Oficial {
|
||||
.content-pr-Pessoal, .content-mdgpr-Pessoal, .content-md-Pessoal {
|
||||
display: none !important;
|
||||
}
|
||||
// .filter-Oficial {
|
||||
// .content-pr-Pessoal, .content-mdgpr-Pessoal, .content-md-Pessoal {
|
||||
// display: none !important;
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
.dropdown-scroll-weel {
|
||||
|
||||
@@ -574,11 +574,11 @@ export class AgendaPage implements OnInit {
|
||||
let load = 0;
|
||||
|
||||
for ( const selectedCalendar of selectedCalendarIds) {
|
||||
this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.calendarId).then((response: any) => {
|
||||
this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.CalendarId).then((response: any) => {
|
||||
|
||||
let label;
|
||||
|
||||
if(SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.calendarId)) {
|
||||
if(SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
|
||||
label = 'md'
|
||||
} else {
|
||||
label = "pr"
|
||||
@@ -588,7 +588,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
// this.addEventToDB(response, label);
|
||||
let eventsList = response;
|
||||
this.CalendarStore.removeRangeForCalendar(startTime, endTime, label, selectedCalendar.calendarId)
|
||||
this.CalendarStore.removeRangeForCalendar(startTime, endTime, label, selectedCalendar.CalendarId)
|
||||
this.CalendarStore.pushEvent(eventsList, label);
|
||||
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
@@ -617,6 +617,18 @@ export class AgendaPage implements OnInit {
|
||||
selectedAgenda = {}
|
||||
|
||||
getSelectedAgendaCalendars () {
|
||||
|
||||
if(this.CalendarName == 'PR+MDGPR') {
|
||||
|
||||
let result = this.SessionStore.user.OwnerCalendars
|
||||
|
||||
const pr = this.SessionStore.user.SharedCalendars.filter(e => e.CalendarRoleId == this.RoleIdService.PRES.toString())
|
||||
const md = this.SessionStore.user.SharedCalendars.filter(e => e.CalendarRoleId == this.RoleIdService.PV.toString())
|
||||
const join = pr.concat(md)
|
||||
|
||||
return result.concat(join)
|
||||
} else {
|
||||
|
||||
const calendar = this.eventService.calendarNamesType[this.CalendarName];
|
||||
let Oficial = calendar?.['OficialId']
|
||||
let Pessoal = calendar?.['PessoalId']
|
||||
@@ -625,13 +637,13 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
return [
|
||||
{
|
||||
calendarId : Oficial,
|
||||
CalendarId : Oficial,
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarName: calendar.CalendarName
|
||||
},
|
||||
{
|
||||
OwnerId: calendar.OwnerId,
|
||||
calendarId : Pessoal,
|
||||
CalendarId : Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
}
|
||||
]
|
||||
@@ -639,18 +651,23 @@ export class AgendaPage implements OnInit {
|
||||
} else if (Oficial) {
|
||||
return [{
|
||||
OwnerId: calendar.OwnerId,
|
||||
calendarId : Oficial,
|
||||
CalendarId : Oficial,
|
||||
CalendarName: calendar.CalendarName
|
||||
}]
|
||||
|
||||
} else {
|
||||
return [{
|
||||
OwnerId: calendar.OwnerId,
|
||||
calendarId : Pessoal,
|
||||
CalendarId : Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
}]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// trasnformData(response, profile) {
|
||||
@@ -1196,7 +1213,6 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
this.showTimelineFilterState = false;
|
||||
|
||||
|
||||
// THIS LINE
|
||||
this.updateEventListBox();
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export class ListBoxService {
|
||||
}
|
||||
|
||||
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
|
||||
|
||||
return eventSource.filter( data => data.calendarName == segment)
|
||||
}
|
||||
|
||||
@@ -43,9 +44,9 @@ export class ListBoxService {
|
||||
// }
|
||||
|
||||
|
||||
// if(segment!='Combinado') {
|
||||
// eventSource = this.filterSegment(eventSource, segment)
|
||||
// }
|
||||
if(segment!='Combinado') {
|
||||
eventSource = this.filterSegment(eventSource, segment)
|
||||
}
|
||||
|
||||
// if(profile != 'all') {
|
||||
// eventSource = this.filterProfile(eventSource, profile)
|
||||
|
||||
@@ -528,7 +528,7 @@ export class EventsService {
|
||||
}
|
||||
|
||||
|
||||
async getEventsByCalendarId( startdate: string, enddate: string, calendarId: string) {
|
||||
async getEventsByCalendarId( startdate: string, enddate: string, calendarId: any) {
|
||||
const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars)
|
||||
const agendasCalendars = calendars.filter( e => e.CalendarId == calendarId)
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ export class CalendarService {
|
||||
|
||||
let result = [];
|
||||
for (const calendar of ids) {
|
||||
const events = this._eventSource.filter(e => e.CalendarId == calendar.calendarId)
|
||||
const events = this._eventSource.filter(e => e.CalendarId == calendar.CalendarId)
|
||||
result = result.concat(events)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user