merge with developer-prod changes

This commit is contained in:
Eudes Inácio
2023-11-07 12:07:54 +01:00
parent f4e0d56946
commit 3485ac8cf0
4 changed files with 268 additions and 120 deletions
+24 -22
View File
@@ -59,10 +59,10 @@
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
<div *ngIf="environment.presidential">
<div *ngIf="calendars.Role == 'Presidente da República'"> PR </div>
<div *ngIf="calendars.Role == 'Presidente da República'"> PR </div>
<div *ngIf="calendars.Role == 'Ministro e Director do Gabinete do PR'"> MDGPR </div>
<div *ngIf="calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República' && calendars.Fullname"> Agenda do {{calendars.Fullname}} </div>
<div *ngIf="calendars.Role != 'Presidente da República' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars == 'Meu calendario' ">
<div *ngIf="calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República' && calendars.Fullname"> Agenda do {{calendars.Fullname}} </div>
<div *ngIf="calendars.Role != 'Presidente da República' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars == 'Meu calendario' ">
<!-- <span *ngIf="SessionStore.user.Profile == 'PR' ">PR</span>
<span *ngIf="SessionStore.user.Profile == 'MDGPR' ">MDGPR</span>
<span *ngIf="SessionStore.user.Profile != 'MDGPR' && SessionStore.user.Profile != 'PR' ">Minha agenda</span> -->
@@ -71,9 +71,9 @@
</div>
<div *ngIf="!environment.presidential">
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> {{ environment.agendaPR}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> {{ environment.agendaPR}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> {{ environment.agendaVP}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.Fullname}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.Fullname}} </div>
<div *ngIf="calendars == 'Meu calendario'">Minha agenda</div>
</div>
@@ -90,7 +90,7 @@
<div class="float-button">
<button title="Visualizar a lista de Eventos para aprovação" class="cursor-pointer resize pr-20-rem" (click)="viewEventsToApprove()" *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])">
<button title="Visualizar a lista de Eventos para aprovação" class="cursor-pointer resize pr-20-rem" (click)="viewEventsToApprove()" *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && !mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event-selected.svg"></ion-icon>
@@ -109,7 +109,7 @@
</ion-row>
<ion-row class="ion-align-items-center calendar-options">
<button title="Visualizar a lista de Eventos para aprovação" class="cursor-pointer resize pr-10" (click)="viewEventsToApprove()" *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])">
<button title="Visualizar a lista de Eventos para aprovação" class="cursor-pointer resize pr-10" (click)="viewEventsToApprove()" *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && !mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event-selected.svg"></ion-icon>
@@ -215,33 +215,34 @@
</div>
<div class="timeline-wrapper flex-grow-1 height-100" >
<div class="height-100">
<div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}}" >
<div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}} flex-column" >
<!-- <div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" >
-->
<!-- <div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
<div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
<span >Hoje,&nbsp;</span> {{ timelineDate }}
</div> -->
</div>
<div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" >
<div *ngFor="let year of TimelineMDList " >
<!-- {{year.yearInfo.yearName}} -->
<div *ngFor="let month of year.months " class="header-day" >
<!-- {{ month.monthInfo.monthName | json }} -->
<!-- <hr> -->
<div *ngFor="let events of TimelineMDList | keyvalue; " >
<div *ngFor="let day of month.days " class="EventListBox-container" >
<div class="EventListBox-container" >
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
{{ TimelineDay(events.key)}} <div style="text-transform: capitalize; display: inline;">{{ events.value[0].start | date: 'MMMM'}}</div>
</div>
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
{{ day.daysInfo.dayName }} <div style="text-transform: capitalize; display: inline;">{{month.monthInfo.monthName}}</div>
</div>
<div *ngFor="let event of events.value" class="EventListBox mb-10" >
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
<div *ngFor="let event of day.events " class="EventListBox mb-10" >
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
*ngIf="viewEventMonth <= dateMonth(event) ">
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
<div *ngIf="event.startMany && !event.middle" class="time-start labelb">Início</div>
<div *ngIf="event.startMany && !event.middle" class="time-start labelb">Início</div>
<div *ngIf="event.endMany && !event.middle " class="time-end labelb">Fim</div>
<div *ngIf="!(event.endMany && !event.middle) && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
@@ -263,10 +264,11 @@
<div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div>
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+4 -5
View File
@@ -875,13 +875,12 @@ $font-size: rem(15);
font-weight: bold !important;
}
.ss-timeline > :nth-child(2) .dayShow {
display: none;
.header-day .dayShow:nth-child(1) {
display: none !important;
}
.ss-timeline > :nth-child(1) .dayShow {
margin-top: 0px !important;
}
.calendar-options {
position: relative;
+77 -74
View File
@@ -105,7 +105,7 @@ export class AgendaPage implements OnInit {
selectedEvent: Event;
selectedEventId: string | number;
selectedEventCalendarId : string | number;
selectedEventCalendarId: string | number;
postEvent: any;
// temporary data
@@ -213,7 +213,7 @@ export class AgendaPage implements OnInit {
} else if (this.loggeduser.Profile == 'PR') {
this.profile = "pr";
} else {
if(this.eventService.usersCalendarIds.length >= 2) {
if (this.eventService.usersCalendarIds.length >= 2) {
this.profile = "mdgpr";
} else if (this.eventService.hasOwnCalendar) {
this.profile = "mdgpr";
@@ -309,8 +309,8 @@ export class AgendaPage implements OnInit {
let weekNum = 0;
function Week(a) {
for(let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) {
for (let b of a.querySelectorAll('td')) {
if (!b.className.includes('text-muted')) {
weekNum++;
return true
}
@@ -320,18 +320,18 @@ export class AgendaPage implements OnInit {
const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight
const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr');
for (let week of weeks as any ){
for (let week of weeks as any) {
Week(week)
}
this.showCalendar = true
this.listBoxService.height = (weekNum * dayBoxHeight) +'px'
this.listBoxService.height = (weekNum * dayBoxHeight) + 'px'
if(dayBoxHeight == 0) {
if (dayBoxHeight == 0) {
this.weekToShow()
}
} catch (e) {
setTimeout(()=> {
setTimeout(() => {
this.weekToShow()
}, 100)
}
@@ -339,8 +339,8 @@ export class AgendaPage implements OnInit {
}
setCalendarByDefault() {
if(!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
if (!this.CalendarName) {
if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario';
} else {
this.CalendarName = this.eventService.calendarNamesAry[0]
@@ -421,13 +421,16 @@ export class AgendaPage implements OnInit {
onDropDownScrollWeal() {
setTimeout(() => {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
try {
setTimeout(() => {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300)
}, 10)
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
setTimeout(() => {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300)
}, 10)
} catch (error) {
console.log(error)
}
}
@@ -445,7 +448,7 @@ export class AgendaPage implements OnInit {
this.rangeStartDate = ev.startTime;
this.rangeEndDate = ev.endTime;
if(this.currentMoth.rangeEndDate == null) {
if (this.currentMoth.rangeEndDate == null) {
this.currentMoth = {
rangeStartDate: ev.startTime,
rangeEndDate: ev.endTime
@@ -579,7 +582,7 @@ export class AgendaPage implements OnInit {
loadRangeEvents(startTime: Date, endTime: Date) {
this.weekToShow()
if(!this.eventService.hasAnyCalendar) {
if (!this.eventService.hasAnyCalendar) {
return false
}
@@ -589,9 +592,9 @@ export class AgendaPage implements OnInit {
this.showLoader = true;
const index = `${startTime}${endTime}`
if(!this.loadRequest[index]) {
this.loadRequest[index] = {startTime, endTime}
this.loadRequestHistory[index] = {lastTimeUpdate: new Date()}
if (!this.loadRequest[index]) {
this.loadRequest[index] = { startTime, endTime }
this.loadRequestHistory[index] = { lastTimeUpdate: new Date() }
this.loadRangeEventRun(startTime, endTime)
} else {
@@ -606,7 +609,7 @@ export class AgendaPage implements OnInit {
loadRangeEventRun(startTime: Date, endTime: Date) {
if(SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
if (SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
return false
}
@@ -628,16 +631,16 @@ export class AgendaPage implements OnInit {
}
let load = 0;
let load = 0;
for ( const selectedCalendar of selectedCalendarIds) {
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) => {
let label;
if(SessionStore.user.Profile == 'PR') {
if (SessionStore.user.Profile == 'PR') {
label = "pr"
} else if(SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
} else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
label = 'md'
} else {
label = "pr"
@@ -656,7 +659,7 @@ export class AgendaPage implements OnInit {
this.deleteLoadRangeEvent(startTime, endTime);
load++
if(load == selectedCalendarIds.length) {
if (load == selectedCalendarIds.length) {
this.showLoader = false;
}
@@ -669,9 +672,9 @@ export class AgendaPage implements OnInit {
selectedAgenda = {}
getSelectedAgendaCalendars () {
getSelectedAgendaCalendars() {
if(this.CalendarName == 'PR+MDGPR') {
if (this.CalendarName == 'PR+MDGPR') {
let result = this.SessionStore.user.OwnerCalendars
@@ -682,46 +685,46 @@ export class AgendaPage implements OnInit {
return result.concat(join)
} else {
const calendar = this.eventService.calendarNamesType[this.CalendarName];
let Oficial = calendar?.['OficialId']
let Pessoal = calendar?.['PessoalId']
const calendar = this.eventService.calendarNamesType[this.CalendarName];
let Oficial = calendar?.['OficialId']
let Pessoal = calendar?.['PessoalId']
if(Oficial && Pessoal) {
if (Oficial && Pessoal) {
return [
{
CalendarId : Oficial,
OwnerId: calendar.OwnerId,
CalendarName: calendar.CalendarName
},
{
OwnerId: calendar.OwnerId,
CalendarId : Pessoal,
CalendarName: calendar.CalendarName
return [
{
CalendarId: Oficial,
OwnerId: calendar.OwnerId,
CalendarName: calendar.CalendarName
},
{
OwnerId: calendar.OwnerId,
CalendarId: Pessoal,
CalendarName: calendar.CalendarName
}
]
} else if (Oficial) {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId: Oficial,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
} else {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId: Pessoal,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
]
} else if (Oficial) {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId : Oficial,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
} else {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId : Pessoal,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
}
}
@@ -737,8 +740,8 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
const selectedDay = momentG(this.eventSelectedDate, 'dd', 'pt');
if(this.TimelineMDList[selectedDay]) {
if(momentG(new Date(this.TimelineMDList[selectedDay][0].start), 'MMMM', 'pt') == momentG(this.eventSelectedDate, 'MMMM', 'pt')) {
if (this.TimelineMDList[selectedDay]) {
if (momentG(new Date(this.TimelineMDList[selectedDay][0].start), 'MMMM', 'pt') == momentG(this.eventSelectedDate, 'MMMM', 'pt')) {
this.hasEventToday = true
}
@@ -769,7 +772,7 @@ export class AgendaPage implements OnInit {
} catch (e) { }
this.updateEventListBox()
} else {}
} else { }
}
@@ -908,7 +911,7 @@ export class AgendaPage implements OnInit {
this.myCal.loadEvents();
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
} catch (error) {
} catch (error) {
}
@@ -923,7 +926,7 @@ export class AgendaPage implements OnInit {
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras);
this.router.navigate(['/home/agenda/', eventId, 'agenda'], navigationExtras);
}
@@ -938,13 +941,13 @@ export class AgendaPage implements OnInit {
this.postEvent = data.event;
this.mobileComponent.showEditEvent = true;
} else if(data.type == 'delete') {
} else if (data.type == 'delete') {
}
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
setTimeout(()=>{
setTimeout(() => {
this.onCurrentChanged(this.eventSelectedDate)
}, 500)
@@ -1173,10 +1176,10 @@ export class AgendaPage implements OnInit {
}
function endOfMonth(myDate){
function endOfMonth(myDate) {
let date = new Date(myDate);
date.setDate(1); // Avoids edge cases on the 31st day of some months
date.setMonth(date.getMonth() +1);
date.setMonth(date.getMonth() + 1);
date.setDate(0);
date.setHours(23);
date.setMinutes(59);