From a3a11fb4dcfd14ef412e8fb3033c21612ff0171f Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 12:31:34 +0100 Subject: [PATCH 01/10] fix chat --- src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 6d33819f1..574d11d06 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,7 +5,7 @@ export const environment = { // apiChatUrl: 'http://192.168.0.29:3000/api/v1/', // apiWsChatUrl: 'wss://192.168.0.29:3000/websocket', apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/', - apiWsChatUrl: 'ws://gd-chat.oapr.gov.ao/websocket', + apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', /* apiChatUrl: 'https://www.tabularium.pt/api/v1/', apiWsChatUrl: 'wss://www.tabularium.pt/websocket', */ // apiChatUrl: 'https://www.tabularium.pt/api/v1/', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index f7c24870d..b9e6cbcf5 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,7 +5,7 @@ export const environment = { // apiChatUrl: 'http://192.168.0.29:3000/api/v1/', // apiWsChatUrl: 'wss://192.168.0.29:3000/websocket', apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/', - apiWsChatUrl: 'ws://gd-chat.oapr.gov.ao/websocket', + apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', /* apiChatUrl: 'https://www.tabularium.pt/api/v1/', apiWsChatUrl: 'wss://www.tabularium.pt/websocket', */ // apiChatUrl: 'https://www.tabularium.pt/api/v1/', From c357966d2eaf09294ee727a7362840236a2fe70f Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 12:34:56 +0100 Subject: [PATCH 02/10] fix chat eror --- src/app/services/chat/chat-system.service.ts | 8 +++++--- src/app/services/chat/message.service.ts | 17 ++++++++++++++--- src/app/services/chat/room.service.ts | 13 +++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts index d1d9716d0..17f212e13 100644 --- a/src/app/services/chat/chat-system.service.ts +++ b/src/app/services/chat/chat-system.service.ts @@ -95,10 +95,12 @@ export class ChatSystemService { } loadChat() { - this.ReLoadChat() + if(SessionStore.user.ChatData) { + this.ReLoadChat() + } } - async ReLoadChat() { + private async ReLoadChat() { await this.chatService.refreshtoken(); await this.restoreUsers(); @@ -400,7 +402,7 @@ export class ChatSystemService { if (setData.name != 'Rocket Cat') { // create room if(!this.roomExist(roomId)) { - let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this) + let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this) room.setData(setData) room.receiveMessage() room.getAllUsers = this.getUsers diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index 299f98e87..56e5606d3 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -12,7 +12,7 @@ import { AESEncrypt } from '../aesencrypt.service' import { HttpEventType } from '@angular/common/http'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service'; - +import { ChatSystemService } from './chat-system.service'; @Injectable({ providedIn: 'root' }) @@ -67,7 +67,8 @@ export class MessageService { private ChatMethodsService: ChatMethodsService, private AESEncrypt: AESEncrypt, private AttachmentsService: AttachmentsService, - private NetworkServiceService: NetworkServiceService) { + private NetworkServiceService: NetworkServiceService, + private ChatSystemService: ChatSystemService) { } setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, from }:Message) { @@ -119,6 +120,17 @@ export class MessageService { } } + if(!this.u.name && this.u.username) { + const user = this.ChatSystemService.users.find((u)=> u.username == this.u.username) + if(user) { + this.u.name = user.name + } else if( this.u.username == SessionStore.user.UserName) { + this.u.name = SessionStore.user.FullName + } else { + // console.log(user.username, SessionStore.user.UserName) + } + } + this.calDateDuration() } @@ -203,7 +215,6 @@ export class MessageService { // console.log('online send') this.RochetChatConnectorService.send(params).then( (ChatMessage: any) => { - console.log('response') ChatMessage = ChatMessage.message.result this.messageSend = true diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 12c98a042..826b29e0a 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -184,7 +184,7 @@ export class RoomService { } } - setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) { + setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService), _updatedAt }) { this.customFields = customFields this.id = id this.name = name @@ -710,10 +710,11 @@ export class RoomService { } else { const offlineMessage = await this.prepareMessageCreateIfNotExist({message:ChatMessage}) - offlineMessage.from = 'Offline' - offlineMessage.loadHistory = this.hasLoadHistory if(offlineMessage) { + offlineMessage.from = 'Offline' + offlineMessage.loadHistory = this.hasLoadHistory + this.messagesLocalReference.push(offlineMessage.localReference) offlineMessage?.decryptMessage() @@ -827,7 +828,7 @@ export class RoomService { message = this.fix_updatedAt(message) - const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) + const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService) wewMessage.setData(message) wewMessage.loadHistory = this.hasLoadHistory @@ -884,7 +885,7 @@ export class RoomService { async prepareCreate({message, save = true}): Promise { message = this.fix_updatedAt(message) - const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) + const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService) wewMessage.setData(message) wewMessage.loadHistory = this.hasLoadHistory @@ -922,7 +923,7 @@ export class RoomService { simplePrepareMessage(message) { message = this.fix_updatedAt(message) - const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) + const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService) wewMessage.setData(message) wewMessage.loadHistory = this.hasLoadHistory From 82ff89919989192cc62ab2be3f17a5b44bc2629f Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 15:18:47 +0100 Subject: [PATCH 03/10] save --- .../pages/publications/publications.page.html | 2 +- .../attendee-modal/attendee-modal.page.ts | 28 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 0136d4e90..8e58da4a8 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -37,7 +37,7 @@ - + diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.ts b/src/app/shared/event/attendee-modal/attendee-modal.page.ts index e9aeba0cf..2300a42a7 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -16,6 +16,7 @@ export class AttendeePage implements OnInit { contacts: EventPerson[]; showLoader: boolean = false; eventPersons: EventPerson[]; + inputFilter = '' @Output() closeComponent = new EventEmitter(); @@ -39,10 +40,10 @@ export class AttendeePage implements OnInit { public ThemeService: ThemeService ) { this.LtaskParticipants = removeDuplicate(this.taskParticipants); - this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); - } + this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + } - ngOnChanges(){ + ngOnChanges() { this.LtaskParticipants = removeDuplicate(this.taskParticipants); this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); } @@ -63,7 +64,6 @@ export class AttendeePage implements OnInit { } } - save() { @@ -107,7 +107,7 @@ export class AttendeePage implements OnInit { this.setContactWithClose(); } - close(){ + close() { this.closeComponent.emit(); } @@ -140,7 +140,7 @@ export class AttendeePage implements OnInit { }); // if to show - if(undefined != result2){ + if(undefined != result2) { return false; } @@ -149,7 +149,7 @@ export class AttendeePage implements OnInit { } - remove(itm: EventPerson){ + remove(itm: EventPerson) { if(this.adding == "intervenient"){ @@ -178,7 +178,17 @@ export class AttendeePage implements OnInit { } - + sort(data: []) { + return data.sort(function (a: any, b: any) { + if (a.Name > b.Name) { + return -1; + } + if (b.Name > a.Name) { + return 1; + } + return 0; + }).reverse() + } async fetchContacts(filter: string) { this.showLoader = true; @@ -196,7 +206,7 @@ export class AttendeePage implements OnInit { }); } - this.contacts = result; + this.contacts = this.sort(result as any); this.showLoader = false; } ); From 8aea090a37e49fa72a92d4f5b89dfd0f86797685 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 16:19:23 +0100 Subject: [PATCH 04/10] save --- src/app/pages/events/events.page.html | 2 +- src/app/pages/events/events.page.ts | 13 +++++-------- .../publications/new-action/new-action.page.html | 2 -- src/app/pages/search/search.page.ts | 10 +++++++++- .../publication/new-action/new-action.page.html | 2 -- .../publication/new-action/new-action.page.ts | 11 +++++++++-- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 4a398e0d2..d8f7fe964 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -62,7 +62,7 @@
diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index e22c7f711..78c8864e2 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -460,18 +460,15 @@ export class EventsPage implements OnInit { }); } - goToEvent(eventId: any) { - this.router.navigate(['/home/events', eventId, 'events']); + goToEvent(event: any) { + let navigationExtras: NavigationExtras = { queryParams: { CalendarId: event.CalendarId } } + + + this.router.navigate(['/home/events', event.EventId, 'agenda'], navigationExtras); } goToExpediente(SerialNumber: any) { this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); - /* if (this.loggeduser.Profile == 'MDGPR') { - this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); - } - else if (this.loggeduser.Profile == 'PR') { - this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']); - } */ } viewExpedientListPage() { diff --git a/src/app/pages/publications/new-action/new-action.page.html b/src/app/pages/publications/new-action/new-action.page.html index b0a6b8150..e1410f6c7 100644 --- a/src/app/pages/publications/new-action/new-action.page.html +++ b/src/app/pages/publications/new-action/new-action.page.html @@ -35,7 +35,6 @@ displayFormat="D MMM YYYY H:mm" minuteValues="0,5,10,15,20,25,30,35,40,45,50,55" monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez" - min="{{minDate}}" max="2025"> @@ -43,7 +42,6 @@ diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 34cd15c99..2fab89b7d 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -259,6 +259,7 @@ export class SearchPage implements OnInit { if(this.type == "Agenda" ){ + alert('agenda seach') this.showLoader = true; @@ -287,7 +288,8 @@ export class SearchPage implements OnInit { this.loadWordCloud(); },error => { - this.searchResult = "Registo não encontrado" + this.showLoader = false; + // this.searchResult = "Registo não encontrado" console.log(error) }); } @@ -551,6 +553,11 @@ export class SearchPage implements OnInit { this.loadWordCloud(); },error => { + counter++; + + if(counter ==2){ + this.showLoader = false; + } this.searchResult = "Registo não encontrado" console.log(error) }); @@ -586,6 +593,7 @@ export class SearchPage implements OnInit { this.showLoader = false; this.loadWordCloud(); },error => { + this.showLoader = false; this.searchResult = "Registo não encontrado" console.log(error) }); diff --git a/src/app/shared/publication/new-action/new-action.page.html b/src/app/shared/publication/new-action/new-action.page.html index 826ca06c6..9f60cc61b 100644 --- a/src/app/shared/publication/new-action/new-action.page.html +++ b/src/app/shared/publication/new-action/new-action.page.html @@ -46,7 +46,6 @@ placeholder="Data inicio*" [(ngModel)]="folder.DateBegin" [disabled]="disabled" - [min]="currentDate" > 700) { - return new Date(this.folder.DateBegin).toLocaleString('pt') < new Date(this.folder.DateEnd).toLocaleString("pt")? ['ok'] : [] + var validado: boolean; + + if (window.innerWidth <= 800) { + if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) { + validado = true; + }else{ + validado = false; + } + return validado == true ? ['ok']: []; } else { return ['ok'] } From e5a5d94f672106090ce619502cee18c58f683041 Mon Sep 17 00:00:00 2001 From: Hirondino Van-Dunem Date: Sat, 17 Dec 2022 17:01:36 +0100 Subject: [PATCH 05/10] changed agenda edit event timepicker interval by 15 minutes --- .../agenda/edit-event/edit-event.page.html | 2 +- .../agenda/edit-event/edit-event.page.ts | 39 +++++++++++++++++-- .../agenda/edit-event/edit-event.page.html | 2 +- .../agenda/edit-event/edit-event.page.ts | 39 +++++++++++++++++-- 4 files changed, 74 insertions(+), 8 deletions(-) diff --git a/src/app/pages/agenda/edit-event/edit-event.page.html b/src/app/pages/agenda/edit-event/edit-event.page.html index 57b957ae0..15a4baafa 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.html +++ b/src/app/pages/agenda/edit-event/edit-event.page.html @@ -163,7 +163,7 @@ diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 5542f0d12..f240e8da0 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -66,9 +66,9 @@ export class EditEventPage implements OnInit { public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10) public maxDate: any; public stepHour = 1; - public stepMinute = 5; - public stepSecond = 5; - currentDate = new Date(); + public stepMinute = 15; + public stepSecond = 15; + currentDate = this.roundTimeQuarterHour(); loadedEventAttachments: Attachment[] = []; taskParticipants: any = []; @@ -171,6 +171,39 @@ export class EditEventPage implements OnInit { }); } + roundTimeQuarterHour() { + var timeToReturn = new Date(); + // var minutes = timeToReturn.getMinutes(); + var minutes = timeToReturn.getMinutes(); + var hours = timeToReturn.getHours(); + + // console.log("MINUTOS: " +minutes); + // console.log("BEFORE MINUTES: " +(Math.round(minutes/15) * 15)); + + var m = (Math.round(minutes/15) * 15) % 60; + // console.log("AFTER MINUTES: " +m); + var h = minutes > 52 ? (hours === 23 ? 0 : ++hours) : hours; + + if (m == 0) { + if(minutes > m){ + m = m + 15; + } + timeToReturn.setHours(h); + timeToReturn.setMinutes(m); + }else{ + if(minutes > m){ + + m = m + 15; + + timeToReturn.setHours(h); + timeToReturn.setMinutes(m); + }else { + timeToReturn.setHours(h); + timeToReturn.setMinutes(m); + } + } + } + onSelectedRecurringChanged(ev?:any) { this.calculetedLastOccurrence(ev); diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 8008ac9af..874535257 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -147,7 +147,7 @@ [(ngModel)]="postEvent.EndDate" [max]="maxDate" [disabled]="disabled" - [min]="currentDate" + [min]="postEvent.StartDate" > 52 ? (hours === 23 ? 0 : ++hours) : hours; + + if (m == 0) { + if(minutes > m){ + m = m + 15; + } + timeToReturn.setHours(h); + timeToReturn.setMinutes(m); + }else{ + if(minutes > m){ + + m = m + 15; + + timeToReturn.setHours(h); + timeToReturn.setMinutes(m); + }else { + timeToReturn.setHours(h); + timeToReturn.setMinutes(m); + } + } + } + onSelectedRecurringChanged(ev:any){ this.calculetedLastOccurrence(ev); From 75b74a0a09295fa40a8a7a0069b68c56ed1161e5 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 17:08:13 +0100 Subject: [PATCH 06/10] fix --- .../document-set-up-meeting.page.html | 4 ++-- .../pages/agenda/edit-event/edit-event.page.html | 4 ++-- .../book-meeting-modal.page.html | 4 ++-- src/app/pages/search/search.page.ts | 3 --- src/app/services/chat/chat-system.service.ts | 14 ++++++++++---- .../edit-event-to-approve.page.html | 4 ++-- .../shared/agenda/edit-event/edit-event.page.html | 4 ++-- .../edit-event-to-approve/edit-event.page.html | 4 ++-- 8 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html index f98cc5950..0bf2a7447 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html @@ -220,7 +220,7 @@
-
+
diff --git a/src/app/pages/agenda/edit-event/edit-event.page.html b/src/app/pages/agenda/edit-event/edit-event.page.html index 57b957ae0..f6d63277c 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.html +++ b/src/app/pages/agenda/edit-event/edit-event.page.html @@ -180,7 +180,7 @@
-
+
diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html index 92ba13904..68058bd0c 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html @@ -199,7 +199,7 @@
-
+
diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 2fab89b7d..438106d26 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -258,11 +258,8 @@ export class SearchPage implements OnInit { if(this.type == "Agenda" ){ - - alert('agenda seach') this.showLoader = true; - this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{ diff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts index 17f212e13..0033dc89c 100644 --- a/src/app/services/chat/chat-system.service.ts +++ b/src/app/services/chat/chat-system.service.ts @@ -18,6 +18,7 @@ import { ChatMethodsService } from './chat-methods.service'; import { AESEncrypt } from '../aesencrypt.service' import { AttachmentsService } from 'src/app/services/attachments.service'; import { NetworkServiceService} from 'src/app/services/network-service.service'; +import { JsonStore } from '../jsonStore.service'; @Injectable({ providedIn: 'root' @@ -273,6 +274,7 @@ export class ChatSystemService { } } + this.loadingWholeList = false await this.storage.set('Rooms', rooms); setTimeout(() => { @@ -284,7 +286,6 @@ export class ChatSystemService { this.sortRoomList() }, 10000) - this.loadingWholeList = false } /** @@ -575,9 +576,14 @@ export class ChatSystemService { })[0] if(roomName) { - const firstName = capitalizeTxt(roomName.split('.')[0]) - const lastName = capitalizeTxt(roomName.split('.')[1]) - return firstName + ' ' + lastName + try { + const firstName = capitalizeTxt(roomName.split('.')[0]) + const lastName = capitalizeTxt(roomName.split('.')[1]) + return firstName + ' ' + lastName + } catch(e) { + return roomData['membersExcludeMe'][0].name + } + } else if(roomData.name) { return roomData.name } else { diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html index 133ba6497..aa24a3ecc 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html @@ -210,7 +210,7 @@
-
+
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 8008ac9af..a3d4b7129 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -162,7 +162,7 @@
-
+
diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html index 84b084e29..ae6c88b83 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html @@ -155,7 +155,7 @@
-
+
From 067c54bf002b663dbe410f7df73b6fea25f6b920 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 17:48:34 +0100 Subject: [PATCH 07/10] fix --- src/app/shared/chat/add-user.pipe.spec.ts | 8 ++++++++ src/app/shared/chat/add-user.pipe.ts | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/app/shared/chat/add-user.pipe.spec.ts create mode 100644 src/app/shared/chat/add-user.pipe.ts diff --git a/src/app/shared/chat/add-user.pipe.spec.ts b/src/app/shared/chat/add-user.pipe.spec.ts new file mode 100644 index 000000000..f6b5010a8 --- /dev/null +++ b/src/app/shared/chat/add-user.pipe.spec.ts @@ -0,0 +1,8 @@ +import { AddUserPipe } from './add-user.pipe'; + +describe('AddUserPipe', () => { + it('create an instance', () => { + const pipe = new AddUserPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/src/app/shared/chat/add-user.pipe.ts b/src/app/shared/chat/add-user.pipe.ts new file mode 100644 index 000000000..8f770b343 --- /dev/null +++ b/src/app/shared/chat/add-user.pipe.ts @@ -0,0 +1,12 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'addUser' +}) +export class AddUserPipe implements PipeTransform { + + transform(value: unknown, ...args: unknown[]): unknown { + return null; + } + +} From 1c8abb2de7e04f0b315e1e0f594d86c54fdc38bf Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 17:52:35 +0100 Subject: [PATCH 08/10] save --- src/app/app-routing.module.ts | 4 ++++ src/app/pages/chat/chat.page.html | 11 +++++++++ src/app/shared/chat/add-user.pipe.spec.ts | 8 ------- src/app/shared/chat/add-user.pipe.ts | 12 ---------- .../chat/add-user/add-user-routing.module.ts | 17 +++++++++++++ .../shared/chat/add-user/add-user.module.ts | 20 ++++++++++++++++ .../shared/chat/add-user/add-user.page.html | 9 +++++++ .../shared/chat/add-user/add-user.page.scss | 0 .../chat/add-user/add-user.page.spec.ts | 24 +++++++++++++++++++ src/app/shared/chat/add-user/add-user.page.ts | 15 ++++++++++++ .../chat-popover/chat-popover.page.html | 1 + 11 files changed, 101 insertions(+), 20 deletions(-) delete mode 100644 src/app/shared/chat/add-user.pipe.spec.ts delete mode 100644 src/app/shared/chat/add-user.pipe.ts create mode 100644 src/app/shared/chat/add-user/add-user-routing.module.ts create mode 100644 src/app/shared/chat/add-user/add-user.module.ts create mode 100644 src/app/shared/chat/add-user/add-user.page.html create mode 100644 src/app/shared/chat/add-user/add-user.page.scss create mode 100644 src/app/shared/chat/add-user/add-user.page.spec.ts create mode 100644 src/app/shared/chat/add-user/add-user.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 974df44e1..b5c5b9a5a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -252,6 +252,10 @@ const routes = [ }, { path: 'chat-message-debugging', loadChildren: () => import('./shared/popover/chat-message-debugging/chat-message-debugging.module').then( m => m.ChatMessageDebuggingPageModule) + }, + { + path: 'add-user', + loadChildren: () => import('./shared/chat/add-user/add-user.module').then( m => m.AddUserPageModule) } diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index b16b1ef84..1b20e9b86 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -218,6 +218,17 @@ class=" height-100 flex-column"> + + { - it('create an instance', () => { - const pipe = new AddUserPipe(); - expect(pipe).toBeTruthy(); - }); -}); diff --git a/src/app/shared/chat/add-user.pipe.ts b/src/app/shared/chat/add-user.pipe.ts deleted file mode 100644 index 8f770b343..000000000 --- a/src/app/shared/chat/add-user.pipe.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ - name: 'addUser' -}) -export class AddUserPipe implements PipeTransform { - - transform(value: unknown, ...args: unknown[]): unknown { - return null; - } - -} diff --git a/src/app/shared/chat/add-user/add-user-routing.module.ts b/src/app/shared/chat/add-user/add-user-routing.module.ts new file mode 100644 index 000000000..49bc8b4fe --- /dev/null +++ b/src/app/shared/chat/add-user/add-user-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { AddUserPage } from './add-user.page'; + +const routes: Routes = [ + { + path: '', + component: AddUserPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class AddUserPageRoutingModule {} diff --git a/src/app/shared/chat/add-user/add-user.module.ts b/src/app/shared/chat/add-user/add-user.module.ts new file mode 100644 index 000000000..78b0aaeca --- /dev/null +++ b/src/app/shared/chat/add-user/add-user.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { AddUserPageRoutingModule } from './add-user-routing.module'; + +import { AddUserPage } from './add-user.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + AddUserPageRoutingModule + ], + declarations: [AddUserPage] +}) +export class AddUserPageModule {} diff --git a/src/app/shared/chat/add-user/add-user.page.html b/src/app/shared/chat/add-user/add-user.page.html new file mode 100644 index 000000000..c4bb0ea98 --- /dev/null +++ b/src/app/shared/chat/add-user/add-user.page.html @@ -0,0 +1,9 @@ + + + addUser + + + + + + diff --git a/src/app/shared/chat/add-user/add-user.page.scss b/src/app/shared/chat/add-user/add-user.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/shared/chat/add-user/add-user.page.spec.ts b/src/app/shared/chat/add-user/add-user.page.spec.ts new file mode 100644 index 000000000..382032742 --- /dev/null +++ b/src/app/shared/chat/add-user/add-user.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { AddUserPage } from './add-user.page'; + +describe('AddUserPage', () => { + let component: AddUserPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ AddUserPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(AddUserPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/chat/add-user/add-user.page.ts b/src/app/shared/chat/add-user/add-user.page.ts new file mode 100644 index 000000000..e35b74795 --- /dev/null +++ b/src/app/shared/chat/add-user/add-user.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-add-user', + templateUrl: './add-user.page.html', + styleUrls: ['./add-user.page.scss'], +}) +export class AddUserPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.html b/src/app/shared/popover/chat-popover/chat-popover.page.html index 099781440..c2f47a60b 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.html +++ b/src/app/shared/popover/chat-popover/chat-popover.page.html @@ -6,6 +6,7 @@
+
From 864d5e87800b66dd9072990e2f3ca9df8472a098 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 17 Dec 2022 19:24:14 +0100 Subject: [PATCH 09/10] improve --- .../document-set-up-meeting.page.html | 2 +- .../pages/agenda/new-event/new-event.page.html | 18 ++++++++++++++++++ src/app/pages/inactivity/inactivity.page.ts | 3 --- src/app/pages/login/login.page.ts | 3 +-- .../request-options/request-options.page.html | 4 ---- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html index 0bf2a7447..10bb60111 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html @@ -227,7 +227,7 @@
- +
+ +
diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index 27255c30d..b2d76e196 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -57,9 +57,6 @@ export class InactivityPage implements OnInit { // let circleHeight = document.querySelector('.circle')['offsetHeight'] // let circleWidth = document.querySelector('.circle')['offsetWidth'] - // - - // // document.querySelectorAll('.circle').forEach(e=>{ // e['style']['height'] = (circleHeight -1 )+'px' diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 5baee9067..8fd964e5f 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -11,7 +11,6 @@ import { ClearStoreService } from 'src/app/services/clear-store.service'; import { ChangeProfileService } from 'src/app/services/change-profile.service'; import { ThemeService } from 'src/app/services/theme.service'; import { PermissionService } from 'src/app/services/permission.service'; -import { PermissionList } from 'src/app/models/permission/permissionList'; import { MessageModel, DeleteMessageModel } from '../../models/beast-orm'; import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'; import { ChatSystemService } from 'src/app/services/chat/chat-system.service'; @@ -158,7 +157,7 @@ export class LoginPage implements OnInit { this.getToken(); - this.router.navigateByUrl('/pin', { replaceUrl: true }); + this.router.navigateByUrl('/home/events', { replaceUrl: true }); } } else{ diff --git a/src/app/shared/popover/request-options/request-options.page.html b/src/app/shared/popover/request-options/request-options.page.html index eab5b99a6..87bb35a98 100644 --- a/src/app/shared/popover/request-options/request-options.page.html +++ b/src/app/shared/popover/request-options/request-options.page.html @@ -40,7 +40,6 @@
- @@ -55,8 +54,5 @@
-
From d3f9b35a7f00fa40b6ece253f8f831774b9a6d2f Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 19 Dec 2022 00:07:05 +0100 Subject: [PATCH 10/10] save --- .../document-set-up-meeting.page.html | 2 +- src/app/pages/inactivity/inactivity.page.html | 3 +- src/app/pages/inactivity/inactivity.page.ts | 61 ++----------------- src/app/store/session.service.ts | 5 ++ 4 files changed, 12 insertions(+), 59 deletions(-) diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html index 0bf2a7447..2d8ecca3f 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html @@ -227,7 +227,7 @@
- +
-
Digite o PIN
Digite o novo PIN
@@ -26,7 +25,7 @@
-
+
1
2
3
diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index 27255c30d..a78c96b8a 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -39,41 +39,10 @@ export class InactivityPage implements OnInit { ngOnInit() { - - // window.addEventListener('resize', (event) => { - // if(this.router.url != '/login') return false - - // if(this.loop == false) { - // this.loop = true - // this.runloop() - // } - - // }, true); - } runloop() { - // const containerHeight = 651 - // let circleHeight = document.querySelector('.circle')['offsetHeight'] - // let circleWidth = document.querySelector('.circle')['offsetWidth'] - // - - // - - // document.querySelectorAll('.circle').forEach(e=>{ - // e['style']['height'] = (circleHeight -1 )+'px' - // e['style']['width'] = (circleWidth -1 )+'px' - // }) - - - // if( window.innerHeight< containerHeight) { - // setTimeout(()=>{ - // this.runloop() - // }, 100) - // } else { - // this.loop = false - // } } @@ -165,8 +134,8 @@ export class InactivityPage implements OnInit { if(!SessionStore.hasPin) { // this.storePin() + this.pinLogin() } else { - // this.pinLogin() } } @@ -187,7 +156,7 @@ export class InactivityPage implements OnInit { setTimeout(() => { this.clearCode() - }, 1000) + }, 5000) } else { this.toastService._badRequest('Pin incorreto') @@ -222,7 +191,7 @@ export class InactivityPage implements OnInit { } - }, 5000) + }, 100) } @@ -230,28 +199,8 @@ export class InactivityPage implements OnInit { storePin() { - setTimeout(() => { - const code = this.code.join(''); - SessionStore.setPin(code); - - 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){ - this.router.navigate(['/home/agenda']); - } - else{ - this.router.navigate(['/home/events']); - } - } - //If user has access permission to both Chat and Action, goes to Chat by default. - else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){ - this.router.navigate(['/home/chat']); - } - else if(this.p.userPermission(this.p.permissionList.Actions.access)){ - this.router.navigate(['/home/publications']); - } - - }, 5000) + const code = this.code.join(''); + SessionStore.setPin(code); } diff --git a/src/app/store/session.service.ts b/src/app/store/session.service.ts index eff78096c..955428411 100644 --- a/src/app/store/session.service.ts +++ b/src/app/store/session.service.ts @@ -56,6 +56,11 @@ class SessionService { return this._user.Inactivity } + + isUserActive() { + return this._user.Inactivity + } + setInativity(value: boolean) { this._user.Inactivity = value this._user.UrlBeforeInactivity = ''