diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index fa2b10805..2399c4927 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -16,8 +16,5 @@ "sound" ] } - }, - "server": { - "url": "http://192.168.0.60:8100" } } diff --git a/src/app/guards/login.guard.ts b/src/app/guards/login.guard.ts index d035602a3..1cdddb1ea 100644 --- a/src/app/guards/login.guard.ts +++ b/src/app/guards/login.guard.ts @@ -18,7 +18,7 @@ export class LoginGuard implements CanActivate { canActivate( route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - + if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) { this.router.navigate(['/home/events']); return false diff --git a/src/app/modals/view-document/view-document.page.ts b/src/app/modals/view-document/view-document.page.ts index 7499f72ba..e7da18647 100644 --- a/src/app/modals/view-document/view-document.page.ts +++ b/src/app/modals/view-document/view-document.page.ts @@ -46,7 +46,6 @@ export class ViewDocumentPage implements OnInit { this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=> { const link: string = res; - console.log(res,' link!!!') this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link); }, ()=>{ this.close(); diff --git a/src/app/models/user.model.ts b/src/app/models/user.model.ts index 29bc949cd..112d9725d 100644 --- a/src/app/models/user.model.ts +++ b/src/app/models/user.model.ts @@ -76,7 +76,7 @@ export class UserSession { UserName: string Password: string RochetChatUserId: string - Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' ; + Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' | 'Administrador'; LoginPreference: 'None' | 'Password' | 'Pin' | null; PIN: string Inactivity: boolean diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 86e045240..b62c42f52 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -293,7 +293,7 @@ -
+
@@ -333,8 +333,8 @@
- -
+ +
diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index a5a9765a6..88cbdc9c2 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -212,7 +212,7 @@ export class AgendaPage implements OnInit { } else if (this.loggeduser.Profile == 'PR') { this.profile = "pr"; } else { - if(this.eventService.calendarIds.length >= 2) { + if(this.eventService.usersCalendarIds.length >= 2) { this.profile = "mdgpr"; } else if (this.eventService.hasOwnCalendar) { this.profile = "mdgpr"; @@ -804,6 +804,8 @@ export class AgendaPage implements OnInit { this.addEventToDB(response, "md"); let eventsList = response; + + console.log('response', response); this.CalendarStore.removeRange(startTime, endTime, 'md') @@ -813,7 +815,9 @@ export class AgendaPage implements OnInit { this.listToPresent = this.CalendarStore.eventSource this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) - + + console.log('this.TimelineMDList', this.TimelineMDList); + this.myCal.update(); this.myCal.loadEvents(); diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 17440a86f..85354cb17 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -224,8 +224,8 @@ -
@@ -46,8 +43,8 @@
- -
-
+
@@ -127,8 +124,8 @@ {{file.title}} -
- +
+
@@ -147,7 +144,7 @@ {{file.description}} - + @@ -204,7 +201,7 @@ Apagou a mensagem
- +
@@ -214,29 +211,6 @@ - - diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 153db1b2f..16823370d 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -30,12 +30,14 @@
-
+
+ +
@@ -96,41 +98,45 @@ - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
+ class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> + +
+
+
+
+
+ + + + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
@@ -280,79 +286,87 @@ - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
+ class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> + +
+
+
+
+
+ + + + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
- -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
+ class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> + +
+
+
+
+
+ + + + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 4ca4ccfd6..463c479d2 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -159,9 +159,9 @@ export class GabineteDigitalPage implements OnInit { else { this.segmentVista = "boxview"; } - }; - this.checkRoutes(); + } + this.checkRoutes(); } closeAllDesktopComponent() { this.desktopComponent = { @@ -208,8 +208,6 @@ export class GabineteDigitalPage implements OnInit { this.backgroundservice.registerBackService('Online', () => { this.loadAllProcesses(); }); - - } async loadAllProcesses() { @@ -257,7 +255,6 @@ export class GabineteDigitalPage implements OnInit { allprocess.forEach(element => { let date = new Date(element.taskStartDate); date.setMonth(date.getMonth() + 1); - let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let task = { "SerialNumber": element.serialNumber, diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index a012c390d..3c9ae6af4 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -44,3 +44,5 @@
+ + diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index d8ad8cfb8..c55f09766 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -125,6 +125,8 @@ export class AuthService { } else if(session.RoleID == 99999886) { session.Profile = 'General secretary' + } else if (session.RoleID == 100000015) { + session.Profile = 'Administrador' } session.Password = user.password diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index f6a1ce627..48614ec51 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -42,6 +42,8 @@ export class WsChatMethodsService { sessionStore = SessionStore loggedUser: any; + + delete = [] constructor( private WsChatService: WsChatService, @@ -68,7 +70,7 @@ export class WsChatMethodsService { this.WsChatService.registerCallback({ type: 'reConnect', - funx: ()=>{ + funx: () => { /** * @description when the phone is in the background for a long time it could disconnects from the socket then the socket reconnects automatically, * when the connection is lost the subscribe is also lost, so we have to subscribe again when reconnection is establish. @@ -363,10 +365,16 @@ export class WsChatMethodsService { deleteRoom(roomId) { + + this.delete.push(roomId) delete this.group[roomId]; this._group = this._group.filter((e)=> e.id != roomId); } + deleteRecently(roomId) { + return this.delete.includes(roomId) + } + roomExist(roomId) { return this.dm[roomId]?.id || this.group[roomId]?.id } diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index b018aac9f..572de619c 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -42,6 +42,8 @@ export class EventsService { calendarIds = [] + usersCalendarIds = [] + hasSharedOficial: boolean = false; hasSharedPessoal: boolean = false; hasOwnOficial: boolean = false; @@ -122,7 +124,7 @@ export class EventsService { this.userCalendarNameOwnOficial = ''; this.userCalendarNameOwnPessoal = ''; - this.calendarIds = []; + this.usersCalendarIds = []; this.calendarNames = {} this.calendarNamesAry = [] @@ -200,9 +202,14 @@ export class EventsService { this.loggeduser.OwnerCalendars.forEach(calendar => { - if(!this.calendarIds.includes(calendar.OwnerUserId)) { - this.calendarIds.push(calendar.OwnerUserId) + if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) { + this.usersCalendarIds.push(calendar.OwnerUserId) } + + if(!this.calendarIds.includes(calendar.CalendarId)) { + this.calendarIds.push(calendar.CalendarId) + } + this.hasOwnCalendar = true if (calendar.CalendarName == 'Oficial') { @@ -225,12 +232,15 @@ export class EventsService { } }); - for (let sharedCalendar of this.loggeduser.SharedCalendars) { - if(!this.calendarIds.includes(sharedCalendar.OwnerUserId)) { - this.calendarIds.push(sharedCalendar.OwnerUserId) + if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) { + this.usersCalendarIds.push(sharedCalendar.OwnerUserId) + } + + if(!this.calendarIds.includes(sharedCalendar.CalendarId)) { + this.calendarIds.push(sharedCalendar.CalendarId) } this.hasSharedCalendar = true @@ -252,38 +262,39 @@ export class EventsService { this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName); } + } - for (let sharedCalendar of this.loggeduser.SharedCalendars) { - if(sharedCalendar?.OwnerUserId) { - this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { - this.calendarNames[sharedCalendar.CalendarId] = e.FullName - this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName - if(!this.calendarNamesAry.includes(e.FullName)) { - this.calendarNamesAry.push(e.FullName) - this.calendarNamesType[e.FullName] = {} - } + for (let sharedCalendar of this.loggeduser.SharedCalendars) { + if(sharedCalendar?.OwnerUserId) { + this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { + this.calendarNames[sharedCalendar.CalendarId] = e.FullName + this.myCalendarNames[sharedCalendar.CalendarId] = e.FullName - this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true - this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId - - }) - } - + if(!this.calendarNamesAry.includes(e.FullName)) { + this.calendarNamesAry.push(e.FullName) + this.calendarNamesType[e.FullName] = {} + } + + this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true + this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId + + }) + } + + } + + for (let sharedCalendar of this.loggeduser.OwnerCalendars) { + + this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario' + + if(!this.calendarNamesAry.includes('Meu calendario')) { + this.calendarNamesAry.push('Meu calendario') + this.calendarNamesType['Meu calendario'] = {} } - for (let sharedCalendar of this.loggeduser.OwnerCalendars) { - - this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario' - - if(!this.calendarNamesAry.includes('Meu calendario')) { - this.calendarNamesAry.push('Meu calendario') - this.calendarNamesType['Meu calendario'] = {} - } - - this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true - this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId - } + this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true + this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId } } } diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index ecec57ed6..16ed46908 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -165,7 +165,7 @@ export class NewEventPage implements OnInit { this.eventBody = { BodyType : "1", Text : ""}; this.postEvent.Body = this.eventBody; - if(this.selectedSegment != "Combinada"){ + if(this.selectedSegment != "Combinada") { this.postEvent ={ EventId: '', Subject: '', @@ -188,7 +188,7 @@ export class NewEventPage implements OnInit { }; } else{ - this.postEvent ={ + this.postEvent = { EventId: '', Subject: '', Body: this.eventBody, @@ -207,11 +207,11 @@ export class NewEventPage implements OnInit { Category: 'Reunião', HasAttachments: false, EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime}, - }; + } } if(this.postEvent.Attendees != null) { - this.postEvent.Attendees.forEach(e =>{ + this.postEvent.Attendees.forEach(e => { if(e.IsRequired) { this.taskParticipants.push(e); } else { diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts index 2ba00dd4d..b961de149 100644 --- a/src/app/shared/agenda/view-event/view-event.page.ts +++ b/src/app/shared/agenda/view-event/view-event.page.ts @@ -65,9 +65,12 @@ export class ViewEventPage implements OnInit { this.loadedEvent = new Event(); this.eventBody = { BodyType : "1", Text : ""}; this.loadedEvent.Body = this.eventBody; + + } ngOnInit() { + this.loadEvent(); } diff --git a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts index db9bb0e79..76984ad0f 100644 --- a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts @@ -35,7 +35,7 @@ export class PendentesPage implements OnInit { private storage: Storage ) { this.loggeduser = authService.ValidatedUser; - } + } ngOnInit() { @@ -80,13 +80,13 @@ export class PendentesPage implements OnInit { } }) -} + } -getFromDb() { - this.storage.get('pendente-list').then((pendentes) => { - this.listToPresent =pendentes - }) -} + getFromDb() { + this.storage.get('pendente-list').then((pendentes) => { + this.listToPresent =pendentes + }) + } doRefresh() { setTimeout(()=>{