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 c6f63a9d0..028404566 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 @@ -78,20 +78,8 @@
- - Oficial - Pessoal - - - + Oficial @@ -114,19 +102,8 @@
- - Reunião - Viagem - Conferência - Encontro - - - + @@ -144,7 +121,6 @@ -
@@ -155,17 +131,8 @@
- - - +
- - - +
-<<<<<<< HEAD - -======= ->>>>>>> develop_bitOut-fix
- - - - { @@ -374,7 +382,6 @@ export class DocumentSetUpMeetingPage implements OnInit { modal.onDidDismiss().then((res)=> { if(res){ const data = res.data; - console.log('data', data) this.attachments.push(data.selected); } }); diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index d9178ec38..76159ab95 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -57,11 +57,15 @@ export class EventActionsPopoverPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() - this.toastService.successMessage(); + this.toastService._successMessage('Evento aprovar') this.goBack(); } catch (error) { - - this.toastService.badRequest() + if(error.status == 0) { + this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') + } else { + + this.toastService._badRequest('Evento não aprovar') + } } finally { loader.remove() @@ -77,11 +81,15 @@ export class EventActionsPopoverPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() - this.toastService.successMessage(); + this.toastService._successMessage('Evento enviado para revisão'); this.goBack(); } catch (error) { - - this.toastService.badRequest() + if(error.status == 0) { + this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') + } else { + + this.toastService._badRequest('Evento não enviado para revisão'); + } } finally { loader.remove() @@ -119,9 +127,15 @@ export class EventActionsPopoverPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise(); - this.toastService.successMessage('Pedido enviado'); + this.toastService._successMessage('Evento enviado para revisão'); this.goBack(); } catch (error) { + if(error.status == 0) { + this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') + } else { + + this.toastService._badRequest('Evento não enviado para revisão'); + } this.toastService.badRequest(); } finally { @@ -140,10 +154,15 @@ export class EventActionsPopoverPage implements OnInit { const loader = this.toastService.loading(); try { await this.processes.PostTaskAction(body).toPromise(); - await this.toastService.successMessage('Processo rejeitado'); + this.toastService._successMessage('Evento rejeitado') this.goBack(); } catch (error) { - this.toastService.badRequest(); + if(error.status == 0) { + this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') + } else { + + this.toastService._badRequest('Evento não rejeitado') + } } finally { loader.remove(); diff --git a/src/app/pages/agenda/new-event/new-event.page.html b/src/app/pages/agenda/new-event/new-event.page.html index f6323e183..3b6d54c6f 100644 --- a/src/app/pages/agenda/new-event/new-event.page.html +++ b/src/app/pages/agenda/new-event/new-event.page.html @@ -122,7 +122,6 @@ placeholder="Data Inicio*" [(ngModel)]="postEvent.StartDate" [disabled]="disabled" - [min]="currentDate" >
-
diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index bc410e53c..21c724d57 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -410,7 +410,7 @@ export class ChatPage implements OnInit { doRefresh(event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 1000); } diff --git a/src/app/pages/events/edit-event/edit-event.page.ts b/src/app/pages/events/edit-event/edit-event.page.ts index 918dd2797..ba9f618dc 100644 --- a/src/app/pages/events/edit-event/edit-event.page.ts +++ b/src/app/pages/events/edit-event/edit-event.page.ts @@ -211,9 +211,9 @@ export class EditEventPage implements OnInit { } doRefresh(event){ /* this.RefreshEvents(); */ - event.target.complete(); + event?.target?.complete(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts b/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts index 8cbe6fe86..1d9d2c64d 100644 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts +++ b/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts @@ -209,9 +209,9 @@ export class EventDetailModalPage implements OnInit { } doRefresh(event){ /* this.RefreshEvents(); */ - event.target.complete(); + event?.target?.complete(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/events/event-detail/event-detail.page.ts b/src/app/pages/events/event-detail/event-detail.page.ts index 21d84ef16..df9a312a2 100644 --- a/src/app/pages/events/event-detail/event-detail.page.ts +++ b/src/app/pages/events/event-detail/event-detail.page.ts @@ -207,9 +207,9 @@ export class EventDetailPage implements OnInit { } doRefresh(event){ /* this.RefreshEvents(); */ - event.target.complete(); + event?.target?.complete(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index d7b249733..7e65d35c5 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -129,7 +129,7 @@ export class EventsPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } this.RefreshEvents(); diff --git a/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts index 2659ba89b..054df15ed 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts @@ -227,7 +227,7 @@ export class DespachosPrPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } setTimeout(() => { diff --git a/src/app/pages/gabinete-digital/despachos/despachos.page.ts b/src/app/pages/gabinete-digital/despachos/despachos.page.ts index a78e3cd5e..d0b30d841 100644 --- a/src/app/pages/gabinete-digital/despachos/despachos.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despachos.page.ts @@ -117,7 +117,7 @@ export class DespachosPage implements OnInit { this.LoadList(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index 1a9c14aa0..e61e04517 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -232,7 +232,7 @@ export class EventListPage implements OnInit { setTimeout(() => { this.LoadToApproveEvents(); - event.target.complete(); + event?.target?.complete(); }, 1000); } 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 4e7d0f496..f23c6590d 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 @@ -87,19 +87,8 @@
- - Reunião - Viagem - Conferência - Encontro - - - + @@ -128,23 +117,11 @@
- - - + @@ -167,24 +144,13 @@
- - - +
-
@@ -228,24 +172,13 @@
- - - - diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index f4c86aaa9..97edd0698 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -75,21 +75,11 @@ export class BookMeetingModalPage implements OnInit { showLoader = false get dateStart () { - if( window.innerWidth < 801) { - return this.postData.StartDate; - } - else{ - return this.dateControlStart.value; - } + return this.dateControlStart.value; } get dateEnd () { - if( window.innerWidth < 801) { - return this.postData.EndDate; - } - else{ - return this.dateControlEnd.value; - } + return this.dateControlEnd.value; } @ViewChild('picker') picker: any; @@ -234,11 +224,7 @@ export class BookMeetingModalPage implements OnInit { } get dateValid() { - if (window.innerWidth <= 800) { - return this.postData.StartDate < this.postData.EndDate? ['ok']: [] - } else { - return ['ok'] - } + return new Date(this.dateControlStart.value).getTime() < new Date(this.dateControlEnd.value).getTime() ? 'ok': null } injectValidation() { diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.ts b/src/app/pages/gabinete-digital/expediente/expediente.page.ts index bc27d8bea..8a83066c9 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.ts @@ -103,7 +103,7 @@ export class ExpedientePage implements OnInit { doRefresh(event) { this.LoadList(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 1000); } diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts index 97c563faf..3940c94ad 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts +++ b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts @@ -95,7 +95,7 @@ export class ExpedientesPrPage implements OnInit { doRefresh(event) { this.LoadList(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts index 0d37165cb..5491bf809 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts @@ -299,7 +299,7 @@ export class PedidosPage implements OnInit { doRefresh(event) { this.LoadList(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts index 4df108867..05de31ff0 100644 --- a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts @@ -170,7 +170,7 @@ export class PendentesPage implements OnInit { this.LoadList(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } 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 853c838b8..72447f31c 100644 --- a/src/app/pages/publications/new-action/new-action.page.html +++ b/src/app/pages/publications/new-action/new-action.page.html @@ -28,17 +28,9 @@
- - - + +
+
-
- - +
- + diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 1d3f95802..ebd0175b8 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -75,8 +75,8 @@ export class NewActionPage implements OnInit { this.dateControlStart = new FormControl(moment(new Date())); this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000))); - // this.folder.DateBegin = new Date().toISOString() - // this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString() + // this.dateControlStart.value = new Date().toISOString() + // this.dateControlEnd.value = (new Date(new Date().getTime() + 15 * 60000)).toISOString() } @@ -85,33 +85,18 @@ export class NewActionPage implements OnInit { // this.setDefaultTime() } - setDefaultTime() { - this.folder.DateBegin = new Date().toISOString() - this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString() - } segmentChanged(ev: any) { } get dateValid() { - var validado: boolean; - - if (window.innerWidth <= 800) { - if ((this.folder.DateBegin < this.folder.DateEnd)) { - validado = true; - } else { - validado = false; - } - return validado == true ? ['ok']: []; - } else { - return ['ok'] - } + return new Date(this.dateStart).getTime() < new Date(this.dateEnd).getTime() ? 'ok': null } runValidation() { this.validateFrom = true; - if(new Date(this.folder.DateBegin).getTime() > new Date(this.folder.DateEnd).getTime()){ + if(new Date(this.dateControlStart.value).getTime() > new Date(this.dateControlEnd.value).getTime()){ this.toastService._badRequest("A data de início não pode ser superior a data de fim"); } } @@ -144,8 +129,8 @@ export class NewActionPage implements OnInit { ProcessId: null, Description: this.folder.Description, Detail: this.folder.Detail, - DateBegin: this.folder.DateBegin, - DateEnd: this.folder.DateEnd, + DateBegin: this.dateControlStart.value, + DateEnd: this.dateControlEnd.value, ActionType: this.segment, } diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts index 33551ca50..452ce4222 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -54,7 +54,7 @@ export class PublicationDetailPage implements OnInit { this.getPublicationDetail(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index ea982cf74..6882c1b45 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -124,7 +124,7 @@ export class PublicationsPage implements OnInit { doRefresh(event) { this.getActions(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 250); } diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index 69ea05b84..23b6b92e9 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -63,7 +63,7 @@ export class PublicationDetailPage implements OnInit { this.getPublicationDetail(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index ec2fafa17..76fb37f95 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -98,7 +98,7 @@ export class ViewPublicationsPage implements OnInit { //this.testForkJoin() this.getPublicationDetail(); this.getPublicationsIds(); - event.target.complete(); + event?.target?.complete(); //}, 3000); } diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index 0d3509a4c..364e8fdab 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -371,6 +371,13 @@ export class MessageService { var memeberTosend = this.ChatSystemService.getRoomById(this.rid).membersExcludeMe console.log(ChatMessage) this.notificationService.ChatSendMessageNotification(memeberTosend[0].username,ChatMessage.u.name,ChatMessage.msg,this.rid) + } else { + var memeberTosend = this.ChatSystemService.getRoomById(this.rid).membersExcludeMe + var usersNames = []; + for(let i = 0; i < memeberTosend.length; i++) { + usersNames.push(memeberTosend[i].username) + } + this.notificationService.ChatSendMessageNotificationGrup(usersNames,ChatMessage.u.name,ChatMessage.msg,this.rid) } diff --git a/src/app/services/events/edit-event/edit-event.page.ts b/src/app/services/events/edit-event/edit-event.page.ts index d6566596d..d481ac538 100644 --- a/src/app/services/events/edit-event/edit-event.page.ts +++ b/src/app/services/events/edit-event/edit-event.page.ts @@ -206,9 +206,9 @@ export class EditEventPage implements OnInit { } doRefresh(event){ /* this.RefreshEvents(); */ - event.target.complete(); + event?.target?.complete(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/services/events/event-detail-modal/event-detail-modal.page.ts b/src/app/services/events/event-detail-modal/event-detail-modal.page.ts index 7edc0a417..faf8bb0e6 100644 --- a/src/app/services/events/event-detail-modal/event-detail-modal.page.ts +++ b/src/app/services/events/event-detail-modal/event-detail-modal.page.ts @@ -203,9 +203,9 @@ export class EventDetailModalPage implements OnInit { } doRefresh(event){ /* this.RefreshEvents(); */ - event.target.complete(); + event?.target?.complete(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/services/events/event-detail/event-detail.page.ts b/src/app/services/events/event-detail/event-detail.page.ts index fd77669ad..0df1d1109 100644 --- a/src/app/services/events/event-detail/event-detail.page.ts +++ b/src/app/services/events/event-detail/event-detail.page.ts @@ -204,9 +204,9 @@ export class EventDetailPage implements OnInit { } doRefresh(event){ /* this.RefreshEvents(); */ - event.target.complete(); + event?.target?.complete(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/services/events/events.page.ts b/src/app/services/events/events.page.ts index 22affd076..7de67ac4d 100644 --- a/src/app/services/events/events.page.ts +++ b/src/app/services/events/events.page.ts @@ -125,7 +125,7 @@ export class EventsPage implements OnInit { doRefresh(event) { this.RefreshEvents(); this.LoadList(); - event.target.complete(); + event?.target?.complete(); } onSegmentChange() { diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 820e63d57..daf51c1b0 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -24,11 +24,13 @@ export class NotificationsService { DataArray = new Array(); - callbacks: {[key: string]: { - type: notificationObject, - funx: Function - id: string - }} = {} + callbacks: { + [key: string]: { + type: notificationObject, + funx: Function + id: string + } + } = {} active = false isPushNotificationsAvailable = Capacitor.isPluginAvailable('PushNotifications'); @@ -85,8 +87,8 @@ export class NotificationsService { } requestPermissions() { - if(!this.isPushNotificationsAvailable) { - return false + if (!this.isPushNotificationsAvailable) { + return false } PushNotifications.requestPermissions().then(result => { @@ -100,36 +102,36 @@ export class NotificationsService { } getAndpostToken(username) { - if(!this.isPushNotificationsAvailable) { - return false + if (!this.isPushNotificationsAvailable) { + return false } const geturl = environment.apiURL + 'notifications/token'; PushNotifications.addListener('registration', (token: Token) => { - const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; - const body = { - UserId: SessionStore.user.UserId, - TokenId: token.value, - Status: 1, - Service: 1 - }; + const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; + const body = { + UserId: SessionStore.user.UserId, + TokenId: token.value, + Status: 1, + Service: 1 + }; - this.http.post(`${geturl}`, body, { headers }).subscribe(data => { - this.active = true - console.log(data) - }, (error) => { - console.log(error) - }) + this.http.post(`${geturl}`, body, { headers }).subscribe(data => { + this.active = true + console.log(data) + }, (error) => { + console.log(error) + }) } ); - + } registrationError() { - if(!this.isPushNotificationsAvailable) { - return false + if (!this.isPushNotificationsAvailable) { + return false } PushNotifications.addListener('registrationError', @@ -140,44 +142,44 @@ export class NotificationsService { } onReciveForeground() { - if(!this.isPushNotificationsAvailable) { - return false + if (!this.isPushNotificationsAvailable) { + return false } console.log('foregrund'); - PushNotifications.addListener('pushNotificationReceived', - (notification: PushNotificationSchema) => { + PushNotifications.addListener('pushNotificationReceived', + (notification: PushNotificationSchema) => { this.active = true - console.log(notification) - //this.DataArray.push(notification) - //console.log(this.DataArray) - - this.storageService.get("Notifications").then((store) => { - store.push(notification) - this.storageService.store("Notifications", store) - }).catch((error) => { - if(!error) { - this.storageService.store("Notifications", [notification]) - } - }) - - // this.runNotificationCallback(notification) - /* this.eventTriger.publish('notificatioRecive') */ - this.eventtrigger.publishSomeData({ - notification: "recive" - }) - } - ); + console.log(notification) + //this.DataArray.push(notification) + //console.log(this.DataArray) + + this.storageService.get("Notifications").then((store) => { + store.push(notification) + this.storageService.store("Notifications", store) + }).catch((error) => { + if (!error) { + this.storageService.store("Notifications", [notification]) + } + }) + + // this.runNotificationCallback(notification) + /* this.eventTriger.publish('notificatioRecive') */ + this.eventtrigger.publishSomeData({ + notification: "recive" + }) + } + ); } onReciveBackground() { - if(!this.isPushNotificationsAvailable) { - return false + if (!this.isPushNotificationsAvailable) { + return false } console.log('fbackgrund'); - PushNotifications.addListener('pushNotificationActionPerformed', - (notification: ActionPerformed) => { + PushNotifications.addListener('pushNotificationActionPerformed', + (notification: ActionPerformed) => { this.active = true console.log(notification) /* this.DataArray.push(notification.notification) @@ -186,45 +188,48 @@ export class NotificationsService { this.eventtrigger.publishSomeData({ notification: "recive" }) */ - this.notificatinsRoutes(notification) - // this.runNotificationCallback(notification) - } - ); + this.notificatinsRoutes(notification) + // this.runNotificationCallback(notification) + } + ); } - ChatSendMessageNotification(userID,title,bodymsg,roomId) { + ChatSendMessageNotification(userID, title, bodymsg, roomId) { const geturl = environment.apiURL + `notifications/sendbyUsername`; const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; - const message = { - "Service": "chat", - "IdObject": roomId - } - let id = 437 - console.log(userID,title,bodymsg,roomId) - this.http.post(geturl+`?username=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => { - this.active = true - console.log(data) - }, (error) => { - console.log(error) - }) + const message = { + "Service": "chat", + "IdObject": roomId + } + let id = 437 + console.log(userID, title, bodymsg, roomId) + this.http.post(geturl + `?username=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => { + this.active = true + console.log(data) + }, (error) => { + console.log(error) + }) } - ChatSendMessageNotificationGrup(userID,title,bodymsg,roomId) { - const geturl = environment.apiURL + `notifications/send`; + ChatSendMessageNotificationGrup(usersID, title, bodymsg, roomId) { + const geturl = environment.apiURL + `notifications/sendByUsernames`; const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; - const message = { - "Service": "chat", - "IdObject": roomId - } - console.log(userID,title,bodymsg,roomId) - this.http.post(geturl+`?userId=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => { - this.active = true - console.log(data) - }, (error) => { - console.log(error) - }) + const message = { + "Users": usersID, + "NotificationData": { + "Service": "chat", + "IdObject": roomId + } + } + console.log(usersID, title, bodymsg, roomId) + this.http.post(geturl + `?title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => { + this.active = true + console.log(data) + }, (error) => { + console.log(error) + }) } tempClearArray(data) { @@ -234,51 +239,51 @@ export class NotificationsService { notificatinsRoutes = (notification) => { - - if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { - - this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") { - //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); - this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda'])); - } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") { + if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true })); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") { + this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") { + //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); + this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda'])); - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") { + } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true })); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") { - this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject])); - } - else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") { - this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital'])); - } else if (notification.notification.data.Service === "chat") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") { + this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject])); + } + else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") { + this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital'])); + } else if (notification.notification.data.Service === "chat") { let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } }; this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras)); } diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts index 953e2c271..1463ebabe 100644 --- a/src/app/shared/agenda/event-list/event-list.page.ts +++ b/src/app/shared/agenda/event-list/event-list.page.ts @@ -168,7 +168,7 @@ export class EventListPage implements OnInit { this.LoadToApproveEvents(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts index 1ba181929..f4feb806e 100644 --- a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts @@ -62,7 +62,7 @@ export class AllProcessesPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } setTimeout(() => { diff --git a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts index 80ade841e..f9e05e50c 100644 --- a/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts +++ b/src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts @@ -89,13 +89,13 @@ constructor ( doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } setTimeout(() => { this.LoadList(); - //event.target.complete(); + //event?.target?.complete(); }, 1000); } diff --git a/src/app/shared/gabinete-digital/despachos/despachos.page.ts b/src/app/shared/gabinete-digital/despachos/despachos.page.ts index 862f6cc58..a2eebfd0b 100644 --- a/src/app/shared/gabinete-digital/despachos/despachos.page.ts +++ b/src/app/shared/gabinete-digital/despachos/despachos.page.ts @@ -49,7 +49,7 @@ export class DespachosPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts index 6c68005f6..6e3998ae3 100644 --- a/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts +++ b/src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts @@ -52,7 +52,7 @@ export class DiplomasAssinarPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts b/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts index 991be71f7..d52d9b170 100644 --- a/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts +++ b/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts @@ -41,7 +41,7 @@ export class DiplomasGerarPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/diplomas-gerar/expedients/expedients.page.ts b/src/app/shared/gabinete-digital/diplomas-gerar/expedients/expedients.page.ts index ec803e7ff..4be0e734c 100644 --- a/src/app/shared/gabinete-digital/diplomas-gerar/expedients/expedients.page.ts +++ b/src/app/shared/gabinete-digital/diplomas-gerar/expedients/expedients.page.ts @@ -97,7 +97,7 @@ export class ExpedientsPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } setTimeout(() => { diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts b/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts index 5b46dabbf..be14d6caa 100644 --- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts +++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.ts @@ -127,7 +127,7 @@ export class DiplomasPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts index dcdaac781..cb7128427 100644 --- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts +++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts @@ -87,7 +87,7 @@ export class ExpedientesPrPage implements OnInit { doRefresh(event) { this.LoadList(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.ts b/src/app/shared/gabinete-digital/expedients/expedients.page.ts index 4a883aa50..3aa4de89e 100644 --- a/src/app/shared/gabinete-digital/expedients/expedients.page.ts +++ b/src/app/shared/gabinete-digital/expedients/expedients.page.ts @@ -96,7 +96,7 @@ export class ExpedientsPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts b/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts index 746575fb0..14c7e5f5c 100644 --- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts @@ -124,7 +124,7 @@ export class PedidosPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } setTimeout(() => { diff --git a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts index af503c4d5..da2c8a9d4 100644 --- a/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts +++ b/src/app/shared/gabinete-digital/pendentes/pendentes.page.ts @@ -90,7 +90,7 @@ export class PendentesPage implements OnInit { doRefresh(event) { if (event) { setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts index fa1aff7ef..2ef3b802b 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts @@ -54,7 +54,7 @@ export class PublicationDetailPage implements OnInit { this.getPublicationDetail(); setTimeout(() => { - event.target.complete(); + event?.target?.complete(); }, 2000); } diff --git a/version/git-version.ts b/version/git-version.ts index 15cea8322..addd789e5 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "3a23b6554", - "SHA": "3a23b655439b52dcd2e02d5cb516be40f865afec", + "shortSHA": "9f13967ae", + "SHA": "9f13967ae3f2c7986e9c58d14c8501601da77735", "branch": "no_bug_movemente", "lastCommitAuthor": "'Eudes Inácio'", - "lastCommitTime": "'Mon Feb 6 10:11:49 2023 +0100'", - "lastCommitMessage": "onother merger made", - "lastCommitNumber": "4730", + "lastCommitTime": "'Mon Feb 6 14:02:38 2023 +0100'", + "lastCommitMessage": "condintion added to publication details", + "lastCommitNumber": "4731", "change": "", - "changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 2 and 5 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html", + "changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 3 and 5 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.html\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/events/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/events/event-detail-modal/event-detail-modal.page.ts\n\tmodified: src/app/pages/events/event-detail/event-detail.page.ts\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedidos.page.ts\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/pages/publications/new-action/new-action.page.html\n\tmodified: src/app/pages/publications/new-action/new-action.page.ts\n\tmodified: src/app/pages/publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/events/edit-event/edit-event.page.ts\n\tmodified: src/app/services/events/event-detail-modal/event-detail-modal.page.ts\n\tmodified: src/app/services/events/event-detail/event-detail.page.ts\n\tmodified: src/app/services/events/events.page.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/app/shared/agenda/event-list/event-list.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts\n\tmodified: src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-gerar/expedients/expedients.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas/diplomas.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedients/expedients.page.ts\n\tmodified: src/app/shared/gabinete-digital/pedidos/pedidos.page.ts\n\tmodified: src/app/shared/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts", "changeAuthor": "eudes.inacio" } \ No newline at end of file