mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
remove alert
This commit is contained in:
@@ -68,7 +68,7 @@ export class AuthGuard implements CanActivate {
|
||||
return false
|
||||
}
|
||||
} else if (pathname.startsWith('/home/events')) {
|
||||
if(SessionStore.user.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) {
|
||||
if(SessionStore?.user?.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) {
|
||||
return true
|
||||
} else {
|
||||
this.router.navigate(['/login']);
|
||||
|
||||
@@ -26,10 +26,10 @@ export class InactivityGuard implements CanActivate {
|
||||
// console.log('hire inactinity!', state.url)
|
||||
|
||||
if ( (this.platform.is('desktop') || this.platform.is('mobileweb')) ) {
|
||||
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars.length == 0){
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
@@ -79,7 +79,7 @@ export class InactivityGuard implements CanActivate {
|
||||
if((SessionStore?.user?.Inactivity)) {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars.length == 0) {
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
@@ -98,14 +98,14 @@ export class InactivityGuard implements CanActivate {
|
||||
buttons: [{
|
||||
text: 'Ok',
|
||||
handler: () => {
|
||||
|
||||
|
||||
}
|
||||
}]
|
||||
}).then( async (alertPopup)=>{
|
||||
await alertPopup.present();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
// Validators.required
|
||||
Validators.required
|
||||
]),
|
||||
Categories: new FormControl(this.postData.Category, [
|
||||
// Validators.required
|
||||
|
||||
@@ -707,7 +707,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
tracing.addEvent('load range start')
|
||||
|
||||
if (SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
if (SessionStore?.user?.OwnerCalendars?.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -94,8 +94,6 @@ export class DespachoPage implements OnInit {
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
}
|
||||
|
||||
this.modalController.dismiss();
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -131,7 +131,7 @@ export class InactivityPage implements OnInit {
|
||||
if (this.code.length == 4) {
|
||||
|
||||
if (!SessionStore.hasPin) {
|
||||
//
|
||||
//
|
||||
this.storePin()
|
||||
this.pinLogin()
|
||||
} else {
|
||||
@@ -174,7 +174,7 @@ export class InactivityPage implements OnInit {
|
||||
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars?.length == 0) {
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -246,7 +246,7 @@ export class LoginPage implements OnInit {
|
||||
} else {
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) {
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) {
|
||||
if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars.length == 0) {
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -18,7 +18,7 @@ export class FirstEnterService {
|
||||
enter( ) {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user?.OwnerCalendars?.length == 0){
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user