diff --git a/src/app/pages/agenda/agenda.page.scss b/src/app/pages/agenda/agenda.page.scss index df5bbfc73..45ea1a24d 100644 --- a/src/app/pages/agenda/agenda.page.scss +++ b/src/app/pages/agenda/agenda.page.scss @@ -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 { diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 8eb1b3170..b65b4f3f6 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -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(); diff --git a/src/app/services/agenda/list-box.service.ts b/src/app/services/agenda/list-box.service.ts index 3e04d7cc5..7bd92916c 100644 --- a/src/app/services/agenda/list-box.service.ts +++ b/src/app/services/agenda/list-box.service.ts @@ -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) diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index fc5fcd35c..12b418fe0 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -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) diff --git a/src/app/store/calendar.service.ts b/src/app/store/calendar.service.ts index 22ac64ba1..e0f50a851 100644 --- a/src/app/store/calendar.service.ts +++ b/src/app/store/calendar.service.ts @@ -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) } diff --git a/version/git-version.ts b/version/git-version.ts index 99ca2d99a..ade33bfab 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -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 ...\" 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 ...\" 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" } \ No newline at end of file