From 408f68b22e23c22a4a4f52cb482fcc0a1285de19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Fri, 11 Aug 2023 16:14:25 +0100 Subject: [PATCH] bugs solved --- src/app/home/home.page.ts | 14 ++ .../pages/events/attendees/attendees.page.ts | 23 ++- .../book-meeting-modal.page.ts | 179 ++++++++++-------- .../new-publication/new-publication.page.html | 2 +- .../new-publication/new-publication.page.ts | 1 + .../organic-entity/organic-entity.page.html | 2 +- .../organic-entity/organic-entity.page.ts | 2 +- src/app/pages/search/search.page.html | 4 +- src/app/pages/search/search.page.ts | 51 ++--- src/app/pages/search/sender/sender.page.html | 2 +- src/app/pages/search/sender/sender.page.ts | 2 +- .../events/attendees/attendees.page.ts | 19 +- src/app/services/notifications.service.ts | 16 ++ src/app/services/search.service.ts | 6 +- .../agenda/new-event/new-event.module.ts | 4 +- .../agenda/new-event/new-event.page.html | 14 ++ .../shared/agenda/new-event/new-event.page.ts | 4 + .../attendee-modal/attendee-modal.page.ts | 30 ++- src/firebase-messaging-sw.js | 5 +- version/git-version.ts | 12 +- 20 files changed, 263 insertions(+), 129 deletions(-) diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 6df14dbf7..ee8ad02b8 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -133,6 +133,20 @@ export class HomePage implements OnInit { ngOnInit() { + navigator.serviceWorker.onmessage = (event) => { + console.log('Mensagem recebida do Service Worker:', event.data.data); + let object = { + notification: event.data + } + + + // Implemente a lógica para lidar com a mensagem recebida do Service Worker + if (event.data.notificationClicked) { + console.log('Notificação push do Firebase clicada em segundo plano!'); + // Implemente ações adicionais conforme necessário + } + }; + this.logDeviceInfo(); this.notificationsService.onReciveForeground(); diff --git a/src/app/pages/events/attendees/attendees.page.ts b/src/app/pages/events/attendees/attendees.page.ts index 8689d453a..e3096aa62 100644 --- a/src/app/pages/events/attendees/attendees.page.ts +++ b/src/app/pages/events/attendees/attendees.page.ts @@ -1,8 +1,10 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { EventPerson } from 'src/app/models/eventperson.model'; import { ModalController, NavParams } from '@ionic/angular'; import { ContactsService } from 'src/app/services/contacts.service'; import { ThemeService } from 'src/app/services/theme.service' +import { LoginUserRespose } from 'src/app/models/user.model'; +import { SessionStore } from 'src/app/store/session.service'; @Component({ selector: 'app-attendees', @@ -21,6 +23,9 @@ export class AttendeesPageModal implements OnInit { taskParticipants:EventPerson[] = []; taskParticipantsCc:EventPerson[] = []; + loggeduser: LoginUserRespose; + @Input() loggedAttendSon: boolean; + constructor( private modalCtrl: ModalController, @@ -32,6 +37,7 @@ export class AttendeesPageModal implements OnInit { this.adding = this.navParams.get('adding'); this.taskParticipants = this.navParams.get('taskParticipants'); this.taskParticipantsCc = this.navParams.get('taskParticipantsCc'); + this.loggeduser = SessionStore.user; } @@ -132,11 +138,24 @@ export class AttendeesPageModal implements OnInit { }); result.splice(index, 1); + }); } - this.contacts = this.sort(result as any); + if(this.loggedAttendSon) { + this.contacts = result; + this.showLoader = false; + } else { + this.contacts = result; + console.log('Attendes Email',this.loggeduser.Email) + let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) + console.log('Attendes Email', filterLoggedUserEmail) + let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") + this.contacts = filterEmptyEmail; + console.log('Attendes Email', this.contacts) this.showLoader = false; + + } } ); } 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 760c116c9..fbb84b204 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 @@ -56,7 +56,7 @@ export class BookMeetingModalPage implements OnInit { public touchUi = false; public enableMeridian = false; public minDate = new Date(); - public ionicMinDate = new Date().toISOString().slice(0,10) + public ionicMinDate = new Date().toISOString().slice(0, 10) // curent timestamp + 15 minutes public endMinDate = new Date(new Date().getTime() + 15 * 60000); @@ -77,11 +77,11 @@ export class BookMeetingModalPage implements OnInit { showLoader = false - get dateStart () { + get dateStart() { return this.dateControlStart.value; } - get dateEnd () { + get dateEnd() { return this.dateControlEnd.value; } @@ -95,9 +95,9 @@ export class BookMeetingModalPage implements OnInit { taskParticipants: EventPerson[]; taskParticipantsCc: EventPerson[] = []; - taskDocId:string; - loadedAttachments:any; - documents:SearchList[] = []; + taskDocId: string; + loadedAttachments: any; + documents: SearchList[] = []; adding: "intervenient" | "CC" = "intervenient"; @@ -106,46 +106,46 @@ export class BookMeetingModalPage implements OnInit { eventAttendees: EventPerson[]; formLocationSatus: boolean = false; - showAttendees= false; + showAttendees = false; emptyTextDescription = "Sem intervenientes selecionados"; CalendarName sessionStore = SessionStore; environment = environment - + constructor( private modalController: ModalController, private navParams: NavParams, private attachmentsService: AttachmentsService, - public calendarService: EventsService, + public calendarService: EventsService, private toastService: ToastService, public ThemeService: ThemeService, public eventService: EventsService, public RoleIdService: RoleIdService, private httpErroHandle: HttpErrorHandle - - - ) { - this.taskParticipants = []; - this.task = this.navParams.get('task'); - this.postData = new Event(); - this.eventBody = { BodyType : "1", Text : ""}; - this.postData.Body = this.eventBody; + ) { + this.taskParticipants = []; - this.postData.Subject = this.task.Folio; - this.postData.CalendarName = "Oficial"; + this.task = this.navParams.get('task'); - let startDate = this.roundTimeQuarterHour() - this.dateControlStart = new FormControl(moment(startDate)); - this.dateControlEnd = new FormControl(moment(this.roundTimeQuarterHourPlus15(startDate))); + this.postData = new Event(); + this.eventBody = { BodyType: "1", Text: "" }; + this.postData.Body = this.eventBody; - this.postData.Category = 'Reunião' + this.postData.Subject = this.task.Folio; + this.postData.CalendarName = "Oficial"; - if(!this.CalendarName) { - if(this.eventService.calendarNamesAry.includes('Meu calendario')) { + let startDate = this.roundTimeQuarterHour() + this.dateControlStart = new FormControl(moment(startDate)); + this.dateControlEnd = new FormControl(moment(this.roundTimeQuarterHourPlus15(startDate))); + + this.postData.Category = 'Reunião' + + if (!this.CalendarName) { + if (this.eventService.calendarNamesAry.includes('Meu calendario')) { this.CalendarName = 'Meu calendario'; // console.log(this.eventService.calendarNamesAry) } else { @@ -153,7 +153,7 @@ export class BookMeetingModalPage implements OnInit { } } - if(this.taskParticipants.length == 0) { + if (this.taskParticipants.length == 0) { this.taskParticipants = [{ EmailAddress: SessionStore.user.Email, IsRequired: true, @@ -173,10 +173,10 @@ export class BookMeetingModalPage implements OnInit { this.getRecurrenceTypes(); } - + getRecurrenceTypes() { - this.calendarService.getRecurrenceTypes().subscribe(res=>{ + this.calendarService.getRecurrenceTypes().subscribe(res => { this.recurringTypes = res; }); } @@ -185,8 +185,8 @@ export class BookMeetingModalPage implements OnInit { changeAgenda() { setTimeout(() => { - - if(this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.calendarService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + + if (this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.calendarService.calendarNamesType[this.CalendarName]?.['Pessoal']) { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] } else if (this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial']) { @@ -204,14 +204,14 @@ export class BookMeetingModalPage implements OnInit { }, 50) } - + setDefaultTime() { - this.postData.StartDate = this.roundTimeQuarterHour(); + this.postData.StartDate = this.roundTimeQuarterHour(); this.postData.EndDate = this.roundTimeQuarterHourPlus15(this.postData.StartDate); } getAttachments() { - this.attachmentsService.getAttachmentsBySerial(this.task.SerialNumber).subscribe(res=>{ + this.attachmentsService.getAttachmentsBySerial(this.task.SerialNumber).subscribe(res => { this.loadedAttachments = res; }); } @@ -227,11 +227,11 @@ export class BookMeetingModalPage implements OnInit { runValidation() { - this.validateFrom = true + this.validateFrom = true } get dateValid() { - return new Date(this.dateControlStart.value).getTime() < new Date(this.dateControlEnd.value).getTime() ? 'ok': null + return new Date(this.dateControlStart.value).getTime() < new Date(this.dateControlEnd.value).getTime() ? 'ok' : null } injectValidation() { @@ -262,19 +262,19 @@ export class BookMeetingModalPage implements OnInit { async saveTask() { - if(SessionStore.user.Profile != 'PR') { + if (SessionStore.user.Profile != 'PR') { this.injectValidation() this.runValidation() - if(this.Form.invalid) return false + if (this.Form.invalid) return false } let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - this.eventBody={ + this.eventBody = { BodyType: '1', Text: this.postData.Body.Text, } - this.postData = { + let postData = { EventId: '', Subject: this.postData.Subject, Body: this.eventBody, @@ -296,18 +296,32 @@ export class BookMeetingModalPage implements OnInit { Type: this.EventRecurrenceType, LastOccurrence: this.Occurrence }, + Attachments: [] } + const DocumentToSave = this.documents.map((e) => { + console.log('ASSUNTO', e.Assunto) + return { + ApplicationId: e.ApplicationType, + Source: 1, + SourceId: e.Id, + SourceName:e.Assunto, + Description: e.Assunto, + Stakeholders: e.EntidadeOrganicaNome + } + }); - + postData.Attachments = DocumentToSave; - if(this.task.FsId == '8') { + + + if (this.task.FsId == '8') { const loader = this.toastService.loading() try { const CalendarId = this.selectedCalendarId() - await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); - + await this.calendarService.genericPostExpedientEvent(this.task.DocId, postData, "", this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); + this.modalController.dismiss(); this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') @@ -320,14 +334,14 @@ export class BookMeetingModalPage implements OnInit { } - else if(this.task.FsId == '361') { + else if (this.task.FsId == '361') { console.log('361') const loader = this.toastService.loading() try { const CalendarId = this.selectedCalendarId() - console.log({CalendarId}) - await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); + console.log({ CalendarId }) + await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, postData, "", this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); this.close(); this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') @@ -346,8 +360,8 @@ export class BookMeetingModalPage implements OnInit { - - selectedCalendarId () { + + selectedCalendarId() { if (this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') { return this.calendarService.calendarNamesType[this.CalendarName]['OficialId'] @@ -365,10 +379,10 @@ export class BookMeetingModalPage implements OnInit { this.adding = "intervenient"; - if(window.innerWidth <= 801){ + if (window.innerWidth <= 801) { const modal = await this.modalController.create({ component: AttendeesPageModal, - componentProps: { + componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc @@ -381,7 +395,7 @@ export class BookMeetingModalPage implements OnInit { modal.onDidDismiss().then((data) => { - if(data) { + if (data) { data = data['data']; const newAttendees: EventPerson[] = data['taskParticipants']; @@ -403,7 +417,7 @@ export class BookMeetingModalPage implements OnInit { openLastOccurrence() { let input: any = document.querySelector('#last-occurrence') - if(input) { + if (input) { input.click() } } @@ -412,10 +426,10 @@ export class BookMeetingModalPage implements OnInit { this.adding = "CC"; - if(window.innerWidth <= 800) { + if (window.innerWidth <= 800) { const modal = await this.modalController.create({ component: AttendeesPageModal, - componentProps: { + componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc @@ -428,7 +442,7 @@ export class BookMeetingModalPage implements OnInit { modal.onDidDismiss().then((data) => { - if(data) { + if (data) { data = data['data']; const newAttendees: EventPerson[] = data['taskParticipants']; @@ -448,8 +462,8 @@ export class BookMeetingModalPage implements OnInit { async distartExpedientModal() { const modal = await this.modalController.create({ component: DiscartExpedientModalPage, - componentProps: { - serialNumber: this.task.SerialNumber, + componentProps: { + serialNumber: this.task.SerialNumber, }, cssClass: 'discart-expedient-modal', backdropDismiss: false @@ -457,11 +471,11 @@ export class BookMeetingModalPage implements OnInit { modal.onDidDismiss().then( - ()=> {} + () => { } , (error) => { console.log(error) }) - await modal.present(); + await modal.present(); } async getDoc() { @@ -475,37 +489,38 @@ export class BookMeetingModalPage implements OnInit { } }); await modal.present(); - modal.onDidDismiss().then((res)=> { - if(res){ - const data = res.data; - this.documents.push(data.selected); - } - }, (error) => { - console.log(error) - }); + modal.onDidDismiss().then((res) => { + if (res) { + const data = res.data; + this.documents.push(data.selected); + console.log(this.documents) + } + }, (error) => { + console.log(error) + }); } - removeAttachment(index: number){ - this.documents = this.documents.filter( (e, i) => index != i); + removeAttachment(index: number) { + this.documents = this.documents.filter((e, i) => index != i); } validateFormInputs() { let formLocation = this.postData.Location.trim(); - if(!this.postData.Location && formLocation.length <= 0){ + if (!this.postData.Location && formLocation.length <= 0) { this.formLocationSatus = true; } } - dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){ + dynamicSetIntervenient({ taskParticipants, taskParticipantsCc }) { this.taskParticipants = taskParticipants; this.taskParticipantsCc = taskParticipantsCc; } - setIntervenient(data){ + setIntervenient(data) { this.taskParticipants = data; } - setIntervenientCC(data){ + setIntervenientCC(data) { this.taskParticipantsCc = data; } @@ -515,8 +530,8 @@ export class BookMeetingModalPage implements OnInit { const minutes = date.getMinutes(); date.setSeconds(0); - if(minutes % 15 != 0) { - + if (minutes % 15 != 0) { + if (minutes > 45) { date.setMinutes(60) } else if (minutes > 30) { @@ -527,25 +542,25 @@ export class BookMeetingModalPage implements OnInit { date.setMinutes(15) } - } + } return date } - roundTimeQuarterHourPlus15(date:Date) { + roundTimeQuarterHourPlus15(date: Date) { const _date = new Date(date); - const minutes = _date .getMinutes(); - _date .setMinutes(minutes + 15) - return _date + const minutes = _date.getMinutes(); + _date.setMinutes(minutes + 15) + return _date } - + setStartDate() { this.postData.StartDate = this.roundTimeQuarterHour(); } - setEndDate(){ + setEndDate() { this.postData.EndDate = this.postData.StartDate; } diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index 6cedb94d0..6be8fb050 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -50,7 +50,7 @@ -
+
image
diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 6fd58511c..51acf78e0 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -71,6 +71,7 @@ export class NewPublicationPage implements OnInit { capturedImage: any = ''; capturedImageTitle: any; public photos: any[] = []; + pictureExiste = false imgResultBeforeCompress: string; imgResultAfterCompress: string; diff --git a/src/app/pages/search/organic-entity/organic-entity.page.html b/src/app/pages/search/organic-entity/organic-entity.page.html index 4dd96ae76..7747eaabc 100644 --- a/src/app/pages/search/organic-entity/organic-entity.page.html +++ b/src/app/pages/search/organic-entity/organic-entity.page.html @@ -26,7 +26,7 @@
diff --git a/src/app/pages/search/organic-entity/organic-entity.page.ts b/src/app/pages/search/organic-entity/organic-entity.page.ts index fc165eee6..2cb350c18 100644 --- a/src/app/pages/search/organic-entity/organic-entity.page.ts +++ b/src/app/pages/search/organic-entity/organic-entity.page.ts @@ -52,7 +52,7 @@ export class OrganicEntityPage implements OnInit { this.showOrganicEntities = entities; } - selectOrganicEntidy(selectedOraganicEntit: string){ + selectOrganicEntidy(selectedOraganicEntit){ this.modalController.dismiss(selectedOraganicEntit); } diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index e3c0d87f2..8fb0ac88c 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -102,7 +102,7 @@
- +
@@ -115,7 +115,7 @@
- +
diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index a3f795bab..53c34045d 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -52,8 +52,10 @@ export class SearchPage implements OnInit { // https params searchSubject: string; searchDocumentDate: string; - searchSender: string; - searchOrganicEntiry: string; + searchSenderdescription: string; + searchSenderId: number; + searchOrganicEntiryDescription: string; + searchOrganicEntiryCode: number; searchDocTypeId: string; ordinance: string; @@ -336,8 +338,8 @@ export class SearchPage implements OnInit { this.showLoader = true; - this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{ + this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '0').subscribe(res=>{ res.Categories.forEach( e => { e['Active'] = false; @@ -379,8 +381,8 @@ export class SearchPage implements OnInit { let counter = 0; - this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res => { + this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => { res.Categories.forEach( e => { e['Active'] = false; @@ -418,8 +420,8 @@ export class SearchPage implements OnInit { } }); - this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{ + this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '361').subscribe(res=>{ res.Categories.forEach( e => { e['Active'] = false; @@ -461,8 +463,8 @@ export class SearchPage implements OnInit { } else { let counter = 0; - this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res => { + this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => { res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) @@ -501,8 +503,8 @@ export class SearchPage implements OnInit { } }); - this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res => { + this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '361').subscribe(res => { res.Categories.forEach( e => { e['Active'] = false; @@ -556,8 +558,8 @@ export class SearchPage implements OnInit { let counter = 0; - this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ + this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res=>{ res.Categories.forEach( e => { e['Active'] = false; @@ -594,8 +596,8 @@ export class SearchPage implements OnInit { } else { let counter = 0; - this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ + this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res=>{ res.Categories.forEach( e => { e['Active'] = false; @@ -692,8 +694,8 @@ export class SearchPage implements OnInit { - this.search.basicSearchPublication(this.searchSubject, searchDocumentDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res => { + this.search.basicSearchPublication(this.searchSubject, searchDocumentDate, this.searchSenderId + ,this.searchOrganicEntiryCode, this.searchDocTypeId, '386').subscribe(res => { res.Categories.forEach( e => { @@ -780,13 +782,15 @@ export class SearchPage implements OnInit { } clearInputRemetente() { - this.searchSender = ""; + this.searchSenderdescription = ""; + this.searchSenderId = null; } clearInputOrganicEntity(){ - this.searchOrganicEntiry = ""; + this.searchOrganicEntiryDescription = ""; + this.searchOrganicEntiryCode = null; } /** @@ -815,7 +819,8 @@ export class SearchPage implements OnInit { modal.onDidDismiss().then((data) => { - this.searchSender = data.data; + this.searchSenderdescription = data.data.Name; + this.searchSenderId = data.data.Id }); await modal.present(); @@ -840,7 +845,9 @@ export class SearchPage implements OnInit { modal.onDidDismiss().then((data) => { - this.searchOrganicEntiry = data.data; + console.log('SerachEntity',data.data ) + this.searchOrganicEntiryDescription = data.data.Description; + this.searchOrganicEntiryCode = data.data.Code; }); await modal.present(); diff --git a/src/app/pages/search/sender/sender.page.html b/src/app/pages/search/sender/sender.page.html index f8f077441..7c8241c62 100644 --- a/src/app/pages/search/sender/sender.page.html +++ b/src/app/pages/search/sender/sender.page.html @@ -19,7 +19,7 @@
    -
  • +
  • {{ contact.Name }}
diff --git a/src/app/pages/search/sender/sender.page.ts b/src/app/pages/search/sender/sender.page.ts index e8043ffe3..2155ccc30 100644 --- a/src/app/pages/search/sender/sender.page.ts +++ b/src/app/pages/search/sender/sender.page.ts @@ -48,7 +48,7 @@ export class SenderPage implements OnInit { this.showContacts = persons; } - selectUser(username:string){ + selectUser(username){ this.selectedUser = username; this.close(this.selectedUser); } diff --git a/src/app/services/events/attendees/attendees.page.ts b/src/app/services/events/attendees/attendees.page.ts index 4936f9d95..2c2f19777 100644 --- a/src/app/services/events/attendees/attendees.page.ts +++ b/src/app/services/events/attendees/attendees.page.ts @@ -3,6 +3,8 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { ModalController, NavParams } from '@ionic/angular'; import { ContactsService } from 'src/app/services/contacts.service'; import { ThemeService } from 'src/app/services/theme.service' +import { LoginUserRespose } from 'src/app/models/user.model'; +import { SessionStore } from 'src/app/store/session.service'; @Component({ selector: 'app-attendees', @@ -21,6 +23,8 @@ export class AttendeesPageModal implements OnInit { taskParticipants:EventPerson[] = []; taskParticipantsCc:EventPerson[] = []; + loggeduser: LoginUserRespose; + @Input() loggedAttendSon: boolean; constructor( private modalCtrl: ModalController, @@ -32,6 +36,7 @@ export class AttendeesPageModal implements OnInit { this.adding = this.navParams.get('adding'); this.taskParticipants = this.navParams.get('taskParticipants'); this.taskParticipantsCc = this.navParams.get('taskParticipantsCc'); + this.loggeduser = SessionStore.user; } @@ -135,8 +140,20 @@ export class AttendeesPageModal implements OnInit { }); } - this.contacts = result; + if(this.loggedAttendSon) { + this.contacts = result; + this.showLoader = false; + } else { + this.contacts = result; + console.log('Attendes Email',this.loggeduser.Email) + let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) + console.log('Attendes Email', filterLoggedUserEmail) + let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") + this.contacts = filterEmptyEmail; + console.log('Attendes Email', this.contacts) this.showLoader = false; + + } } ); } diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index c673e9ce7..aee4b4978 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -225,6 +225,22 @@ export class NotificationsService { } } + + sendNotificationWithSend(userID, title, bodymsg, roomId) { + const geturl = environment.apiURL + `notifications/send`; + + const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; + const message = { + "Service": "chat", + "IdObject": roomId + } + let id = 437 + this.http.post(geturl + `?userId=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => { + this.active = true + }, (error) => { + + }) + } ChatSendMessageNotification(userID, title, bodymsg, roomId) { diff --git a/src/app/services/search.service.ts b/src/app/services/search.service.ts index 71acc268a..f78ece86f 100644 --- a/src/app/services/search.service.ts +++ b/src/app/services/search.service.ts @@ -42,7 +42,7 @@ export class SearchService { } - basicSearch(subject:string, date:string = null, sender:string = null, organicEntity:string = null, docTypeId:string = null, applicationType:string): Observable{ + basicSearch(subject:string, date:string = null, sender:number = null, organicEntity:number = null, docTypeId:string = null, applicationType:string): Observable{ // Endpoint const geturl = environment.apiURL + 'search'; // store params @@ -67,7 +67,7 @@ export class SearchService { } - basicSearchPublication(subject:string, date:string = null, sender:string = null, organicEntity:string = null, docTypeId:string = null, applicationType:string): Observable{ + basicSearchPublication(subject:string, date:string = null, sender:number = null, organicEntity:number = null, docTypeId:string = null, applicationType:string): Observable{ // Endpoint const geturl = environment.apiURL + 'search'; // store params @@ -113,7 +113,7 @@ export class SearchService { return this.http.get(`${geturl}`, options); } - searchForDoc(subject:string, date:string, sender:string, organicEntity:string, docTypeId:string, applicationType:string): Observable { + searchForDoc(subject:string, date:string, sender:number, organicEntity:number, docTypeId:string, applicationType:string): Observable { // Endpoint const geturl = environment.apiURL + 'search/attachment?'; // store params diff --git a/src/app/shared/agenda/new-event/new-event.module.ts b/src/app/shared/agenda/new-event/new-event.module.ts index c35cd2c00..0c03ce954 100644 --- a/src/app/shared/agenda/new-event/new-event.module.ts +++ b/src/app/shared/agenda/new-event/new-event.module.ts @@ -30,6 +30,7 @@ import { MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter'; import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; +import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; @NgModule({ @@ -55,7 +56,8 @@ import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/ //MatRadioModule, //MatCheckboxModule, MatButtonModule, - ReactiveFormsModule + ReactiveFormsModule, + AttendeeModalPageModule ], declarations: [NewEventPage], providers: [ diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index 468252286..2a32ce3a8 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -327,9 +327,18 @@ + +
+ +
+ +
+ +
+ @@ -344,5 +353,10 @@ Gravar + + + 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 652c359de..962a68ba4 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -70,6 +70,8 @@ export class NewEventPage implements OnInit { public color: ThemePalette = 'primary'; recurringTypes = [] selectedRecurringType: any; + loggedAttendDad: boolean = true; + mostrarModal = false; @Input() attendees: [] @Input() profile:string; @@ -701,6 +703,7 @@ export class NewEventPage implements OnInit { } async addParticipants() { + this.saveTemporaryData(); @@ -709,6 +712,7 @@ export class NewEventPage implements OnInit { }); this.clearContact.emit(); + this.mostrarModal = true; } async addParticipantsCc() { 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 04f5f5ce3..6e5c5a3c8 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -6,6 +6,8 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { ThemeService } from 'src/app/services/theme.service' import { ViewChild } from '@angular/core'; import { Searchbar } from 'ionic-angular'; +import { LoginUserRespose } from 'src/app/models/user.model'; +import { SessionStore } from 'src/app/store/session.service'; @Component({ selector: 'app-attendee-modal', @@ -16,6 +18,7 @@ export class AttendeePage implements OnInit { // Defined by the API contacts: EventPerson[]; + filterEmptyEmail: EventPerson[]; showLoader: boolean = false; eventPersons: EventPerson[]; inputFilter = '' @@ -30,6 +33,7 @@ export class AttendeePage implements OnInit { @Input() taskParticipants:EventPerson[] = []; @Input() taskParticipantsCc:EventPerson[] = []; + @Input() loggedAttendSon: boolean; @Input() footer: boolean; @@ -37,26 +41,34 @@ export class AttendeePage implements OnInit { LtaskParticipants: EventPerson[] = []; LtaskParticipantsCc: EventPerson[] = []; + loggeduser: LoginUserRespose; constructor( private modalCtrl: ModalController, private contactsService: ContactsService, public ThemeService: ThemeService ) { + + this.LtaskParticipants = removeDuplicate(this.taskParticipants); - this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + this.loggeduser = SessionStore.user; } ngOnChanges() { this.LtaskParticipants = removeDuplicate(this.taskParticipants); this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + console.log('PARTE PARTE',this.loggedAttendSon) } currentPath = window.location.pathname; @Input() adding: "intervenient" | "CC"; ngOnInit() { - + setTimeout(() => { + console.log('PARTE PARTE',this.loggedAttendSon) + }); + this.fetchContacts(""); if(this.LtaskParticipants == null || this.LtaskParticipants == undefined) { @@ -211,8 +223,20 @@ export class AttendeePage implements OnInit { }); } - this.contacts = this.sort(result as any); + if(this.loggedAttendSon) { + this.contacts = this.sort(result as any); + this.showLoader = false; + } else { + this.contacts = this.sort(result as any); + console.log('Attendes Email',this.loggeduser.Email) + let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) + console.log('Attendes Email', filterLoggedUserEmail) + let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") + this.contacts = filterEmptyEmail; + console.log('Attendes Email', this.contacts) this.showLoader = false; + + } } ); } diff --git a/src/firebase-messaging-sw.js b/src/firebase-messaging-sw.js index bb0d71d6f..d2564841f 100644 --- a/src/firebase-messaging-sw.js +++ b/src/firebase-messaging-sw.js @@ -26,8 +26,8 @@ messaging.onBackgroundMessage(function(payload) { body: payload.notification.body, }; - self.registration.showNotification(notificationTitle, - notificationOptions); + /* self.registration.showNotification(notificationTitle, + notificationOptions); */ }); @@ -63,6 +63,7 @@ self.addEventListener('notificationclick', function(event) { console.log("Push Clicked ", event); // Enviar uma mensagem para o cliente (componente) self.clients.matchAll().then((clients) => { + console.log("Push Clicked 2", clients); if (clients && clients.length) { clients.forEach((client) => { client.postMessage({ notificationClicked: true }); diff --git a/version/git-version.ts b/version/git-version.ts index 9ce0df502..d9f87a7a9 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "bf89e4684", - "SHA": "bf89e468416cca7863800d7aa06efec843d39156", + "shortSHA": "2bfec8211", + "SHA": "2bfec82113924fa075bd6bc54e9f2515f149e8fe", "branch": "developer", "lastCommitAuthor": "'Eudes Inácio'", - "lastCommitTime": "'Tue Aug 8 15:40:10 2023 +0100'", - "lastCommitMessage": "Improve tinymce autosave and notification web click solved", - "lastCommitNumber": "5138", + "lastCommitTime": "'Tue Aug 8 15:41:52 2023 +0100'", + "lastCommitMessage": "pull made", + "lastCommitNumber": "5142", "change": "", - "changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 1 and 3 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\tnew file: index.html\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tmodified: src/app/models/message.model.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/chat/chat.page.html\n\tmodified: src/app/pages/chat/chat.page.scss\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/chat/edit-group/edit-group.page.scss\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.html\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/events/events.page.html\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar/diplomas-gerar.page.ts\n\tmodified: src/app/pages/login/login.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.scss\n\tmodified: src/app/pages/publications/new-action/new-action.page.ts\n\tmodified: src/app/pages/publications/publications.page.scss\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/chat/room.service.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.html\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.ts\n\tmodified: src/app/shared/publication/new-action/new-action.page.html\n\tmodified: src/global.scss", + "changeStatus": "On branch developer\nYour branch is up to date with 'origin/developer'.\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/pages/events/attendees/attendees.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.html\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pages/search/organic-entity/organic-entity.page.html\n\tmodified: src/app/pages/search/organic-entity/organic-entity.page.ts\n\tmodified: src/app/pages/search/search.page.html\n\tmodified: src/app/pages/search/search.page.ts\n\tmodified: src/app/pages/search/sender/sender.page.html\n\tmodified: src/app/pages/search/sender/sender.page.ts\n\tmodified: src/app/services/events/attendees/attendees.page.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/app/services/search.service.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.module.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.html\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/event/attendee-modal/attendee-modal.page.ts\n\tmodified: src/firebase-messaging-sw.js", "changeAuthor": "eudes.inacio" } \ No newline at end of file