From 6674d459b1c98ce3388f48bbaf3faaa65fe52291 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 4 Jul 2022 14:08:51 +0100 Subject: [PATCH 1/7] improve --- .../view-document/view-document.page.ts | 1 - src/app/pages/chat/chat.page.html | 4 +- src/app/pages/chat/chat.page.ts | 10 ---- .../gabinete-digital/gabinete-digital.page.ts | 49 ------------------- src/app/pages/login/login.page.html | 2 + .../services/chat/ws-chat-methods.service.ts | 10 +++- 6 files changed, 13 insertions(+), 63 deletions(-) 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/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 @@ { - // if not mobile remove all component - if (window.innerWidth < 701) { - this.modalController.dismiss(); - this.segmentVista = "listview"; - } - else { - this.segmentVista = "boxview"; - } - }; - this.checkRoutes(); - } closeAllDesktopComponent() { this.desktopComponent = { @@ -173,42 +160,6 @@ export class GabineteDigitalPage implements OnInit { ngOnInit() { - if (window.innerWidth < 701) { - this.segmentVista = "listview"; - } - else { - this.segmentVista = "boxview" - } - - const pathname = window.location.pathname - this.router.events.forEach((event) => { - if (event instanceof NavigationEnd && event.url == pathname) { - - this.waitForDomService.selector({ - selector: 'app-gabinete-digital ion-content .aside-wrapper', - callback: () => { - this.checkRoutes(); - // console.log('FIRST CALL') - this.LoadCounts(); - } - }) - } - }); - - this.hideRefreshButton(); - - this.waitForDomService.selector({ - selector: 'app-gabinete-digital ion-content .aside-wrapper', - callback: () => { - // console.log('SECOND CALL') - this.loadAllProcesses(); - } - }) - - this.backgroundservice.registerBackService('Online', () => { - this.loadAllProcesses(); - }); - } 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/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 } From 2725bffc9fde9c93ab3e88de9c121ceab4fdf0e6 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 4 Jul 2022 14:57:27 +0100 Subject: [PATCH 2/7] improve --- .../pages/chat/messages/messages.page.html | 4 +- .../gabinete-digital.page.html | 4 +- .../gabinete-digital/gabinete-digital.page.ts | 47 +++++++++++++++++++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index e64908279..14d283e3b 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -47,7 +47,7 @@
-
Apagou a mensagem
-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 153db1b2f..3ea279daa 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 @@ - +
+ +
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index f6ef619fd..ed5bc6f7e 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -149,6 +149,19 @@ export class GabineteDigitalPage implements OnInit { public p: PermissionService ) { + this.loggeduser = authService.ValidatedUser; + window.onresize = (event) => { + // if not mobile remove all component + if (window.innerWidth < 701) { + this.modalController.dismiss(); + this.segmentVista = "listview"; + } + else { + this.segmentVista = "boxview"; + } + } + + this.checkRoutes(); } closeAllDesktopComponent() { this.desktopComponent = { @@ -160,7 +173,41 @@ export class GabineteDigitalPage implements OnInit { ngOnInit() { + if (window.innerWidth < 701) { + this.segmentVista = "listview"; + } + else { + this.segmentVista = "boxview" + } + const pathname = window.location.pathname + this.router.events.forEach((event) => { + if (event instanceof NavigationEnd && event.url == pathname) { + + this.waitForDomService.selector({ + selector: 'app-gabinete-digital ion-content .aside-wrapper', + callback: () => { + this.checkRoutes(); + // console.log('FIRST CALL') + this.LoadCounts(); + } + }) + } + }); + + this.hideRefreshButton(); + + this.waitForDomService.selector({ + selector: 'app-gabinete-digital ion-content .aside-wrapper', + callback: () => { + // console.log('SECOND CALL') + this.loadAllProcesses(); + } + }) + + this.backgroundservice.registerBackService('Online', () => { + this.loadAllProcesses(); + }); } async loadAllProcesses() { From 1a8be35a6e307ef994c41f5de41972ef72a42fa2 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 4 Jul 2022 16:45:44 +0100 Subject: [PATCH 3/7] improve --- src/app/guards/login.guard.ts | 2 +- src/app/models/user.model.ts | 2 +- .../pages/chat/messages/messages.page.html | 39 ++++--------------- .../gabinete-digital/gabinete-digital.page.ts | 1 - src/app/services/auth.service.ts | 2 + 5 files changed, 12 insertions(+), 34 deletions(-) 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/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/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 14d283e3b..d00f37b80 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -46,8 +46,8 @@
- -
-
+
@@ -127,8 +127,8 @@ {{file.title}} -
- +
+
@@ -147,7 +147,7 @@ {{file.description}} - + @@ -203,8 +203,8 @@
Apagou a mensagem
- - +
+
@@ -214,29 +214,6 @@ - - diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index ed5bc6f7e..463c479d2 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -255,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/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 From 2531525cc3af1a49fcd84d2b60b481fac29db35c Mon Sep 17 00:00:00 2001 From: "gilson.manuel" Date: Mon, 4 Jul 2022 17:41:23 +0100 Subject: [PATCH 4/7] save --- android/app/src/main/assets/capacitor.config.json | 3 --- 1 file changed, 3 deletions(-) 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" } } From d8d1fc7b0c745435920eb4fc516ae9b69361f9c5 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 4 Jul 2022 17:53:39 +0100 Subject: [PATCH 5/7] add skeleton to gabinete page --- .../pages/chat/messages/messages.page.html | 3 - .../gabinete-digital.page.html | 222 +++++++++--------- .../pendentes/pendentes.page.ts | 14 +- 3 files changed, 124 insertions(+), 115 deletions(-) diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index d00f37b80..09e4eb52c 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -1,8 +1,5 @@ -
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 3ea279daa..16823370d 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -98,41 +98,45 @@ - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
- - -
- -

-

-
-
+ class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> + +
+
+
+
+
+ + + + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
@@ -282,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/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(()=>{ From e625fbfeb2860cf1aa6a203953750d78430225b8 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 4 Jul 2022 18:15:55 +0100 Subject: [PATCH 6/7] fix agenda calendar names --- src/app/services/events.service.ts | 56 +++++++++---------- .../shared/agenda/new-event/new-event.page.ts | 8 +-- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index b018aac9f..cc02c8c08 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -225,7 +225,6 @@ export class EventsService { } }); - for (let sharedCalendar of this.loggeduser.SharedCalendars) { @@ -252,38 +251,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 { From 744883bd6a9a7c0bc6c8ec3351a02a3f92d1e52d Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 4 Jul 2022 19:13:28 +0100 Subject: [PATCH 7/7] fix, agenda list box not showing --- src/app/pages/agenda/agenda.page.html | 6 +++--- src/app/pages/agenda/agenda.page.ts | 8 +++++-- src/app/services/events.service.ts | 21 ++++++++++++++----- .../agenda/view-event/view-event.page.ts | 3 +++ 4 files changed, 28 insertions(+), 10 deletions(-) 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/services/events.service.ts b/src/app/services/events.service.ts index cc02c8c08..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') { @@ -228,8 +235,12 @@ 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 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(); }