mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
remove alert
This commit is contained in:
@@ -131,47 +131,51 @@ export class EventsService {
|
||||
if (SessionStore.user) {
|
||||
if (SessionStore.user.Profile == 'MDGPR') {
|
||||
|
||||
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
if(SessionStore?.user?.OwnerCalendars) {
|
||||
for (let calendar of SessionStore?.user?.OwnerCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
|
||||
if (calendar.CalendarName == 'Oficial') {
|
||||
if (calendar.CalendarName == 'Oficial') {
|
||||
|
||||
this.hasOwnOficial = true
|
||||
this.hasOwnOficial = true
|
||||
|
||||
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if (calendar.CalendarName == 'Pessoal') {
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if (calendar.CalendarName == 'Pessoal') {
|
||||
|
||||
this.hasOwnPessoal = true
|
||||
this.hasOwnPessoal = true
|
||||
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
if(SessionStore?.user?.SharedCalendars) {
|
||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
|
||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||
|
||||
this.hasSharedOficial = true
|
||||
this.hasSharedOficial = true
|
||||
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
else if (sharedCalendar.CalendarName == 'Pessoal') {
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
else if (sharedCalendar.CalendarName == 'Pessoal') {
|
||||
|
||||
this.hasSharedPessoal = true
|
||||
this.hasSharedPessoal = true
|
||||
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +183,7 @@ export class EventsService {
|
||||
|
||||
else if (SessionStore.user.Profile == 'PR') {
|
||||
|
||||
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||
for (let calendar of SessionStore?.user?.OwnerCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
if (calendar.CalendarName == 'Oficial') {
|
||||
|
||||
@@ -202,7 +206,7 @@ export class EventsService {
|
||||
|
||||
}
|
||||
|
||||
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||
for (let calendar of SessionStore?.user?.OwnerCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) {
|
||||
this.usersCalendarIds.push(calendar.OwnerUserId)
|
||||
@@ -234,7 +238,7 @@ export class EventsService {
|
||||
}
|
||||
}
|
||||
|
||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||
for (let sharedCalendar of SessionStore?.user?.SharedCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
|
||||
if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) {
|
||||
@@ -267,7 +271,7 @@ export class EventsService {
|
||||
}
|
||||
|
||||
|
||||
for (let OwnerCalendar of SessionStore.user.OwnerCalendars) {
|
||||
for (let OwnerCalendar of SessionStore?.user?.OwnerCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
|
||||
this.calendarNames[OwnerCalendar.CalendarId] = 'Meu calendario'
|
||||
@@ -284,7 +288,7 @@ export class EventsService {
|
||||
this.calendarNamesType['Meu calendario']['OwnerId'] = OwnerCalendar.OwnerUserId || SessionStore.user.UserId
|
||||
this.calendarNamesType['Meu calendario']['FullName'] = SessionStore.user.FullName
|
||||
}
|
||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||
for (let sharedCalendar of SessionStore?.user?.SharedCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
if(sharedCalendar?.OwnerUserId) {
|
||||
const e = await this.GetCalendarName(sharedCalendar.OwnerUserId).toPromise()
|
||||
@@ -339,7 +343,7 @@ export class EventsService {
|
||||
})
|
||||
|
||||
|
||||
if(SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
if(SessionStore.user?.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
this.hasAnyCalendar = false
|
||||
} else {
|
||||
this.hasAnyCalendar = true
|
||||
@@ -353,7 +357,7 @@ export class EventsService {
|
||||
(() => {
|
||||
const keys = {}
|
||||
|
||||
for (let e of SessionStore.user.OwnerCalendars) {
|
||||
for (let e of SessionStore.user?.OwnerCalendars) {
|
||||
if(!keys[e.CalendarId]) {
|
||||
keys[e.CalendarId] = e.CalendarId
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user