mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +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{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "57ee7dd7c",
|
||||
"SHA": "57ee7dd7cf01a33e68fc9752e5e9257bb7f9058e",
|
||||
"shortSHA": "36bf94866",
|
||||
"SHA": "36bf948660c744b25a4eb62bdcf584049f26965b",
|
||||
"branch": "feature/agenda-api-peter",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Mon Jul 15 12:52:21 2024 +0100'",
|
||||
"lastCommitMessage": "fix input filter",
|
||||
"lastCommitNumber": "5867",
|
||||
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/shared/agenda/approve-event/approve-event.page.ts",
|
||||
"lastCommitTime": "'Mon Jul 15 14:27:17 2024 +0100'",
|
||||
"lastCommitMessage": "add attendies",
|
||||
"lastCommitNumber": "5868",
|
||||
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/guards/auth.guard.ts\n\tmodified: src/app/guards/inactivity.guard.ts\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts\n\tmodified: src/app/pages/inactivity/inactivity.page.ts\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/first-enter.service.ts\n\tmodified: version/git-version.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user