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>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
|
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
|
||||||
<calendar
|
<calendar
|
||||||
class="calendar-component"
|
class="calendar-component"
|
||||||
[eventSource]="listToPresent"
|
[eventSource]="listToPresent"
|
||||||
|
|||||||
@@ -239,6 +239,14 @@ export class AgendaPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.weekToShow()
|
this.weekToShow()
|
||||||
|
|
||||||
|
this.eventService.registerOnLoadCalendars(()=> {
|
||||||
|
this.setCalendarByDefault(true)
|
||||||
|
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||||
|
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||||
|
|
||||||
|
this.tigerUpdate()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
tigerUpdate() {
|
tigerUpdate() {
|
||||||
@@ -257,7 +265,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.setCalendarByDefault()
|
this.setCalendarByDefault(false)
|
||||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||||
|
|
||||||
@@ -338,14 +346,20 @@ export class AgendaPage implements OnInit {
|
|||||||
}, 250)
|
}, 250)
|
||||||
}
|
}
|
||||||
|
|
||||||
setCalendarByDefault() {
|
setCalendarByDefault(force) {
|
||||||
if (!this.CalendarName) {
|
if (!this.CalendarName || force) {
|
||||||
if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
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';
|
this.CalendarName = 'Meu calendario';
|
||||||
} else {
|
} else {
|
||||||
this.CalendarName = this.eventService.calendarNamesAry[0]
|
this.CalendarName = this.eventService.calendarNamesAry[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Go to the next view of the calendar month/week/day
|
//Go to the next view of the calendar month/week/day
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ export class EventsService {
|
|||||||
|
|
||||||
HasMdGPR = false
|
HasMdGPR = false
|
||||||
|
|
||||||
|
onLoadCalendars: Function[] =[]
|
||||||
|
loadCalendars = false
|
||||||
|
|
||||||
|
|
||||||
onCalendarFinishLoad = new Subscribe({execute : false, deleteOnExecute: true})
|
onCalendarFinishLoad = new Subscribe({execute : false, deleteOnExecute: true})
|
||||||
|
|
||||||
constructor(
|
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