improve agenda request

This commit is contained in:
Peter Maquiran
2022-10-07 11:01:54 +01:00
parent 2ec28c95de
commit 972173413e
5 changed files with 36 additions and 24 deletions
@@ -48,7 +48,7 @@
</div>
<div class="profile-info">
<div class="user-role">{{SessionStore.user.RoleDescription}}</div>
<div class="user-role" *ngIf="SessionStore.user.RoleDescription">{{SessionStore.user.RoleDescription}}</div>
<div class="container-div width-100">
<div class="ion-item-class-2">
+1 -1
View File
@@ -31,7 +31,7 @@
<div class="profile-content">
<div class="profile-title d-flex justify-content-center width-100">
<ion-label >{{loggeduser.RoleDescription}}</ion-label>
<ion-label *ngIf="loggeduser.RoleDescription" >{{loggeduser.RoleDescription}}</ion-label>
</div>
<div class="d-flex mt-10 width-100">
-1
View File
@@ -850,7 +850,6 @@ export class AgendaPage implements OnInit {
if(this.loggeduser.SharedCalendars.length != 0 ) {
this.eventService.genericGetAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
this.addEventToDB(response, "pr");
-5
View File
@@ -1,8 +1,6 @@
<ion-content class="text-white">
<div class="main-wrapper">
<div class="wrapper">
<div class="bg-1 d-flex justify-center align-center">
<div class="bg-2 d-flex justify-center align-center">
<div class="bg-3 d-flex justify-center align-center">
@@ -40,12 +38,9 @@
<p class="msg-bottom-p"> </p>
</div>
</div>
</div>
<ion-icon style="width: 0px; height: 0px;" src='assets/images/theme/gov/icons-search.svg'></ion-icon>
<ion-icon style="width: 0px; height: 0px;" src='assets/images/icons-most-searched-words-open.svg'></ion-icon>
</ion-content>
+34 -16
View File
@@ -133,7 +133,7 @@ export class EventsService {
if (this.loggeduser) {
if (this.loggeduser.Profile == 'MDGPR') {
this.loggeduser.OwnerCalendars.forEach(calendar => {
for (let calendar of this.loggeduser.OwnerCalendars) {
if (calendar.CalendarName == 'Oficial') {
@@ -153,10 +153,10 @@ export class EventsService {
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
}
});
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
}
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
if (sharedCalendar.CalendarName == 'Oficial') {
this.hasSharedOficial = true
@@ -173,13 +173,13 @@ export class EventsService {
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
}
});
}
}
else if (this.loggeduser.Profile == 'PR') {
this.loggeduser.OwnerCalendars.forEach(calendar => {
for (let calendar of this.loggeduser.OwnerCalendars) {
if (calendar.CalendarName == 'Oficial') {
this.hasOwnOficial = true
@@ -197,11 +197,11 @@ export class EventsService {
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
}
});
}
}
this.loggeduser.OwnerCalendars.forEach(calendar => {
for (let calendar of this.loggeduser.OwnerCalendars) {
if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) {
this.usersCalendarIds.push(calendar.OwnerUserId)
}
@@ -230,7 +230,7 @@ export class EventsService {
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
}
});
}
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
@@ -423,8 +423,15 @@ export class EventsService {
let prO = [], prP = [];
prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise();
prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise();
for (let calendar of this.loggeduser.OwnerCalendars) {
if (calendar.CalendarName == 'Oficial') {
prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise();
}
if(calendar.CalendarName == 'Pessoal') {
prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise();
}
}
const resFinal = prO.concat(prP);
return new Promise(resolve => {
return resolve(resFinal)
@@ -554,8 +561,19 @@ export class EventsService {
}
async getAllSharedEvents(startdate: string, enddate: string) {
let prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
let prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
let prO = [], prP = [];
for(let calendar of this.loggeduser.SharedCalendars) {
if (calendar.CalendarName == 'Oficial') {
prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
}
if(calendar.CalendarName == 'Pessoal') {
prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
}
}
const resFinal = prO.concat(prP);
return new Promise(resolve => {