mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
pull from developer-prod made
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
|
||||
<div class="d-flex container-wrapper">
|
||||
|
||||
<div class="calendar-timeline d-flex flex-column height-100 bg-blue">
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- Toolbar -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div class="weeksToShow">
|
||||
<div class="weeksToShow">
|
||||
<!-- Calendar is here -->
|
||||
|
||||
<div class="calendar-segment-{{profile}}" [class.calendar-segment-pr-force]="SessionStore.user.Profile =='PR'">
|
||||
@@ -55,13 +55,13 @@
|
||||
class="select-calendar">
|
||||
<mat-form-field class="select-calendar" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="CalendarName" (selectionChange)="reloadCalendar()">
|
||||
|
||||
|
||||
<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 == '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 != '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>
|
||||
@@ -69,7 +69,7 @@
|
||||
Minha agenda
|
||||
</div>
|
||||
</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 == 'Ministro e Director do Gabinete do PR'"> {{ environment.agendaVP}} </div>
|
||||
@@ -82,14 +82,14 @@
|
||||
<mat-option value="PR+MDGPR" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && environment.presidential">
|
||||
PR+MDGPR
|
||||
</mat-option>
|
||||
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="float-button">
|
||||
|
||||
<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])">
|
||||
<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>
|
||||
@@ -105,7 +105,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ion-row>
|
||||
<ion-row class="ion-align-items-center calendar-options">
|
||||
|
||||
@@ -215,24 +215,30 @@
|
||||
</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="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
|
||||
<span >Hoje, </span> {{ timelineDate }}
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<span >Hoje, </span> {{ timelineDate }}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue; " >
|
||||
<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 class="EventListBox-container" >
|
||||
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
|
||||
{{ TimelineDay(events.key)}} <div style="text-transform: capitalize; display: inline;">{{ viewTitle }}</div>
|
||||
</div>
|
||||
<div *ngFor="let day of month.days " class="EventListBox-container" >
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox mb-10" >
|
||||
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
|
||||
{{ day.daysInfo.dayName }} <div style="text-transform: capitalize; display: inline;">{{month.monthInfo.monthName}}</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(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)"
|
||||
>
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
|
||||
@@ -258,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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
+157
-105
@@ -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,14 +213,14 @@ 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";
|
||||
} else if (this.eventService.hasSharedCalendar) {
|
||||
this.profile = "pr";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.calendarHeight = ["height-356"];
|
||||
@@ -253,7 +253,7 @@ export class AgendaPage implements OnInit {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -270,18 +270,29 @@ export class AgendaPage implements OnInit {
|
||||
this.segment = "Combinado";
|
||||
}
|
||||
if (realoadCounter != 0) {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
this.updateEventListBox()
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.calendar.currentDate = new Date();
|
||||
|
||||
try {
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.onDropDownScrollWeal()
|
||||
} catch (e) { }
|
||||
|
||||
this.updateEventListBox()
|
||||
|
||||
realoadCounter++;
|
||||
this.weekToShow()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
});
|
||||
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not table remove all component
|
||||
if (window.innerWidth <= 1024) {
|
||||
@@ -296,31 +307,31 @@ export class AgendaPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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'
|
||||
|
||||
if(dayBoxHeight == 0) {
|
||||
this.listBoxService.height = (weekNum * dayBoxHeight) + 'px'
|
||||
|
||||
if (dayBoxHeight == 0) {
|
||||
this.weekToShow()
|
||||
}
|
||||
} catch (e) {
|
||||
setTimeout(()=> {
|
||||
setTimeout(() => {
|
||||
this.weekToShow()
|
||||
}, 100)
|
||||
}
|
||||
@@ -328,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]
|
||||
@@ -410,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -424,10 +438,23 @@ export class AgendaPage implements OnInit {
|
||||
this.eventSelectedDate2 = ev.selectedTime;
|
||||
}
|
||||
|
||||
|
||||
currentMoth = {
|
||||
rangeStartDate: null,
|
||||
rangeEndDate: null
|
||||
}
|
||||
|
||||
onRangeChanged(ev: { startTime: Date, endTime: Date }) {
|
||||
this.rangeStartDate = ev.startTime;
|
||||
this.rangeEndDate = ev.endTime;
|
||||
|
||||
if (this.currentMoth.rangeEndDate == null) {
|
||||
this.currentMoth = {
|
||||
rangeStartDate: ev.startTime,
|
||||
rangeEndDate: ev.endTime
|
||||
}
|
||||
}
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
|
||||
@@ -554,8 +581,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date) {
|
||||
this.weekToShow()
|
||||
|
||||
if(!this.eventService.hasAnyCalendar) {
|
||||
|
||||
if (!this.eventService.hasAnyCalendar) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -565,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 {
|
||||
@@ -582,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
|
||||
}
|
||||
|
||||
@@ -602,18 +629,18 @@ export class AgendaPage implements OnInit {
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
let load = 0;
|
||||
|
||||
for ( const selectedCalendar of selectedCalendarIds) {
|
||||
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) => {
|
||||
|
||||
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"
|
||||
@@ -622,7 +649,7 @@ export class AgendaPage implements OnInit {
|
||||
let eventsList = response;
|
||||
this.CalendarStore.removeRangeForCalendar(startTime, endTime, label, selectedCalendar.CalendarId)
|
||||
this.CalendarStore.pushEvent(eventsList, label);
|
||||
|
||||
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
this.updateEventListBox()
|
||||
|
||||
@@ -632,10 +659,10 @@ export class AgendaPage implements OnInit {
|
||||
this.deleteLoadRangeEvent(startTime, endTime);
|
||||
|
||||
load++
|
||||
if(load == selectedCalendarIds.length) {
|
||||
if (load == selectedCalendarIds.length) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.updateEventListBox()
|
||||
@@ -645,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
|
||||
|
||||
@@ -657,50 +684,50 @@ 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']
|
||||
|
||||
if(Oficial && Pessoal) {
|
||||
|
||||
return [
|
||||
{
|
||||
CalendarId : Oficial,
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarName: calendar.CalendarName
|
||||
},
|
||||
{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId : Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
const calendar = this.eventService.calendarNamesType[this.CalendarName];
|
||||
let Oficial = calendar?.['OficialId']
|
||||
let Pessoal = calendar?.['PessoalId']
|
||||
|
||||
if (Oficial && Pessoal) {
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -710,11 +737,26 @@ export class AgendaPage implements OnInit {
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
const year = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
this.TimelineMDList = year
|
||||
|
||||
const selectedDay = momentG(this.eventSelectedDate, 'dd', 'pt');
|
||||
if(this.TimelineMDList[selectedDay]) {
|
||||
this.hasEventToday = true
|
||||
const yearName = momentG(new Date(this.eventSelectedDate), 'yyyy')
|
||||
const monthName = momentG(new Date(this.eventSelectedDate), 'MMMM')
|
||||
const dayName = momentG(new Date(this.eventSelectedDate), 'dd')
|
||||
|
||||
let YearIndex = year.findIndex( x => x.yearInfo.yearName == yearName)
|
||||
if(YearIndex == 0) {
|
||||
let MonthNameIndex = year[YearIndex].months.findIndex( x => x.monthInfo.monthName == monthName)
|
||||
if(MonthNameIndex == 0) {
|
||||
let DayNameIndex = year[YearIndex].months[MonthNameIndex].days.findIndex( x => x.daysInfo.dayName == dayName)
|
||||
if(DayNameIndex == 0) {
|
||||
this.hasEventToday = true
|
||||
} else {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
} else {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
} else {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
@@ -742,16 +784,13 @@ export class AgendaPage implements OnInit {
|
||||
} catch (e) { }
|
||||
|
||||
this.updateEventListBox()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
} else { }
|
||||
|
||||
}
|
||||
|
||||
changeMonth = (month) => {
|
||||
const a = this.calendar.currentDate;
|
||||
|
||||
|
||||
|
||||
const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null';
|
||||
|
||||
@@ -768,7 +807,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.updateEventListBox()
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,7 +835,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
changeProfile() {
|
||||
|
||||
|
||||
if (this.profile == "mdgpr") {
|
||||
this.profile = "pr";
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
@@ -839,7 +878,7 @@ export class AgendaPage implements OnInit {
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data) {
|
||||
|
||||
@@ -870,7 +909,7 @@ export class AgendaPage implements OnInit {
|
||||
openAddEventDismiss(data) {
|
||||
|
||||
try {
|
||||
|
||||
|
||||
let postEvent: Event = data;
|
||||
if (postEvent.Subject != null) {
|
||||
// this.eventSource.push({
|
||||
@@ -884,7 +923,7 @@ export class AgendaPage implements OnInit {
|
||||
this.myCal.loadEvents();
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
@@ -899,8 +938,8 @@ 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);
|
||||
|
||||
}
|
||||
|
||||
// open component
|
||||
@@ -914,16 +953,16 @@ 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)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1083,7 +1122,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
reloadCalendar() {
|
||||
//
|
||||
//
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
|
||||
@@ -1129,10 +1168,8 @@ export class AgendaPage implements OnInit {
|
||||
// THIS LINE
|
||||
this.updateEventListBox();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
shoeEventDay(events: any[]) {
|
||||
|
||||
if (this.segment == 'Combinado') {
|
||||
@@ -1150,3 +1187,18 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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.setDate(0);
|
||||
date.setHours(23);
|
||||
date.setMinutes(59);
|
||||
date.setSeconds(59);
|
||||
return date;
|
||||
}
|
||||
|
||||
const addDays = 5;
|
||||
const endDateRange = endOfMonth(new Date(5))
|
||||
endDateRange.setDate(endDateRange.getDate() + addDays)
|
||||
|
||||
@@ -18,6 +18,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -98,7 +99,8 @@ export class EditEventPage implements OnInit {
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
|
||||
/* this.postEvent = new Event(); */
|
||||
@@ -363,6 +365,9 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ) */;
|
||||
this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ) */;
|
||||
this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ) */;
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -93,6 +95,9 @@ export class NewEventPage implements OnInit {
|
||||
roomId: string;
|
||||
globalEnd = new Date('1999')
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[];
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -105,7 +110,9 @@ export class NewEventPage implements OnInit {
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private hhtpErrorHandle: HttpErrorHandle,
|
||||
private processeService: ProcessesService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.postEvent = new Event();
|
||||
@@ -196,6 +203,7 @@ export class NewEventPage implements OnInit {
|
||||
this.checkRoleInArray()
|
||||
this.changeAgenda()
|
||||
|
||||
this.fetchContacts("")
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -407,6 +415,9 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
this.postEvent.Subject = this.domSanitazerService.sanitizeInput(this.postEvent.Subject);
|
||||
this.postEvent.Location = this.domSanitazerService.sanitizeInput(this.postEvent.Location);
|
||||
this.postEvent.Body.Text = this.domSanitazerService.sanitizeInput(this.postEvent.Body.Text);
|
||||
|
||||
let eventId: any;
|
||||
|
||||
@@ -831,4 +842,33 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
return toAproveObject;
|
||||
}
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
|
||||
if (this.loggeduser.Profile == 'PR') {
|
||||
this.contactsService.getContacts(filter).subscribe(result => {
|
||||
if (this.eventPersons != null) {
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
|
||||
});
|
||||
}
|
||||
this.contacts = result;
|
||||
console.log('Attendes Email', this.loggeduser.Email)
|
||||
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
|
||||
console.log('Attendes Email', filterLoggedUserEmail)
|
||||
|
||||
this.contacts = filterLoggedUserEmail;
|
||||
const newAttendees: EventPerson[] = this.contacts;
|
||||
|
||||
this.setIntervenient(newAttendees);
|
||||
console.log('Attendes Email', this.contacts)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="title-content d-flex justify-between width-100 mb-10">
|
||||
<div class="left d-flex">
|
||||
<button class="btn-no-color d-flex align-center" (click)="goBack()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user