fix agenda

This commit is contained in:
Peter Maquiran
2023-03-30 15:22:40 +01:00
parent b7d878851e
commit 936878f6cd
6 changed files with 46 additions and 29 deletions
+10 -10
View File
@@ -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 {
+24 -8
View File
@@ -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();
+4 -3
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
}
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "8deed4cf9",
"SHA": "8deed4cf9433d2aeaf3419039896cd7dd1855e24",
"shortSHA": "b7d878851",
"SHA": "b7d878851efda8eb9859d6a21b9c2efc57238903",
"branch": "feature/agenda-layout",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Tue Mar 28 13:59:37 2023 +0100'",
"lastCommitMessage": "fix agenda",
"lastCommitNumber": "4885",
"lastCommitTime": "'Thu Mar 30 14:31:58 2023 +0100'",
"lastCommitMessage": "change agenda",
"lastCommitNumber": "4886",
"change": "",
"changeStatus": "On branch feature/agenda-layout\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/models/envarioment.ts\n\tmodified: src/app/pages/agenda/agenda.page.html\n\tmodified: src/app/pages/agenda/agenda.page.scss\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/search/search.page.ts\n\tmodified: src/app/services/agenda/list-box.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/store/calendar.service.ts\n\tmodified: src/environments/suport/doneIt.ts\n\tmodified: src/environments/suport/oapr.ts\n\tmodified: src/theme/variables.scss",
"changeStatus": "On branch feature/agenda-layout\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/agenda/agenda.page.scss\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/services/agenda/list-box.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/store/calendar.service.ts",
"changeAuthor": "peter.maquiran"
}