mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
add defualt calendar
This commit is contained in:
@@ -140,7 +140,7 @@
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
|
||||
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
|
||||
<calendar
|
||||
class="calendar-component"
|
||||
[eventSource]="listToPresent"
|
||||
|
||||
@@ -239,6 +239,14 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
this.weekToShow()
|
||||
|
||||
this.eventService.registerOnLoadCalendars(()=> {
|
||||
this.setCalendarByDefault(true)
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
this.tigerUpdate()
|
||||
})
|
||||
}
|
||||
|
||||
tigerUpdate() {
|
||||
@@ -257,7 +265,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.setCalendarByDefault()
|
||||
this.setCalendarByDefault(false)
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
@@ -338,14 +346,20 @@ export class AgendaPage implements OnInit {
|
||||
}, 250)
|
||||
}
|
||||
|
||||
setCalendarByDefault() {
|
||||
if (!this.CalendarName) {
|
||||
if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
setCalendarByDefault(force) {
|
||||
if (!this.CalendarName || force) {
|
||||
const prObject = this.eventService.calendarNamesAry.find(e => e?.RoleId == 100000014)
|
||||
|
||||
if(prObject) {
|
||||
console.log({prObject})
|
||||
this.CalendarName = prObject.Fullname
|
||||
} else if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.CalendarName = 'Meu calendario';
|
||||
} else {
|
||||
this.CalendarName = this.eventService.calendarNamesAry[0]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Go to the next view of the calendar month/week/day
|
||||
|
||||
@@ -65,6 +65,10 @@ export class EventsService {
|
||||
|
||||
HasMdGPR = false
|
||||
|
||||
onLoadCalendars: Function[] =[]
|
||||
loadCalendars = false
|
||||
|
||||
|
||||
onCalendarFinishLoad = new Subscribe({execute : false, deleteOnExecute: true})
|
||||
|
||||
constructor(
|
||||
@@ -368,6 +372,20 @@ export class EventsService {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.onLoadCalendars.forEach(e=> e());
|
||||
this.loadCalendars = true
|
||||
}
|
||||
|
||||
|
||||
registerOnLoadCalendars(e: Function) {
|
||||
if( this.loadCalendars) {
|
||||
e()
|
||||
} else {
|
||||
this.onLoadCalendars.push(e)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user