From 6b5d61d2becde543e0413ef5b2023dda3cf078a8 Mon Sep 17 00:00:00 2001 From: "EQUILIBRIUM\\hirondino.van-dunem" Date: Wed, 6 Jul 2022 14:52:53 +0100 Subject: [PATCH 1/6] fixed the select repetition on edit event --- .../agenda/edit-event/edit-event.page.ts | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index 237473091..008df2e4e 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -109,16 +109,17 @@ export class EditEventPage implements OnInit { } } - const result = this.participantsPipe.transform(this.postEvent.Attendees) - this.taskParticipants = result.taskParticipants - this.taskParticipantsCc = result.taskParticipantsCc + if (this.postEvent.Attendees != null) { + const result = this.participantsPipe.transform(this.postEvent.Attendees) + this.taskParticipants = result.taskParticipants + this.taskParticipantsCc = result.taskParticipantsCc - this.taskParticipants = removeDuplicate(this.taskParticipants); - this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); - - this.setIntervenient.emit(this.taskParticipants); - this.setIntervenientCC.emit(this.taskParticipantsCc); + this.taskParticipants = removeDuplicate(this.taskParticipants); + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); + this.setIntervenient.emit(this.taskParticipants); + this.setIntervenientCC.emit(this.taskParticipantsCc); + } } this.initCalendarName = this.postEvent.CalendarName; @@ -127,14 +128,10 @@ export class EditEventPage implements OnInit { this.getRecurrenceTypes(); - this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); - - // this.postEvent.EventRecurrence.LastOccurrence = this.currentDate; - setTimeout(() => { this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); - }, 1000); + }, 500); } From 9dde6d6fd3dda8501eb9c8a681e7650640d5f24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 6 Jul 2022 17:02:42 +0100 Subject: [PATCH 2/6] Preview image on chat solved --- .../group-messages/group-messages.page.ts | 46 +++-- src/app/pages/chat/messages/messages.page.ts | 174 ++++++++++-------- .../group-messages/group-messages.page.ts | 51 +++-- src/app/shared/chat/messages/messages.page.ts | 68 +++---- 4 files changed, 203 insertions(+), 136 deletions(-) diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index fd96b8a75..6af9aecb4 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -31,6 +31,7 @@ import { MessageService } from 'src/app/services/chat/message.service'; import { File } from '@awesome-cordova-plugins/file/ngx'; import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { SessionStore } from 'src/app/store/session.service'; +import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; @Component({ selector: 'app-group-messages', @@ -1054,7 +1055,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { return blob; } - openFile(pdfString, filename) { + openFile(pdfString, filename, type) { const blob = this.b64toBlob(pdfString, 'application/pdf') let pathFile = '' const fileName = filename @@ -1105,21 +1106,38 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - this.downloadFileFromBrowser(msg.attachments[0].name, str) - /* const modal = await this.modalController.create({ - component: ViewMediaPage, - cssClass: 'modal modal-desktop', - componentProps: { - image: str, - type: msg.file.type, - username: msg.u.name, - _updatedAt: msg._updatedAt - } - }); - modal.present(); */ + if (msg.file.type == "application/img") { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + type: msg.file.type, + username: msg.u.name, + _updatedAt: msg._updatedAt + } + }); + modal.present(); + } else { + this.downloadFileFromBrowser(msg.attachments[0].name, str) + } } else { - this.openFile(str, msg.attachments[0].name); + if (msg.file.type == "application/img") { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + type: msg.file.type, + username: msg.u.name, + _updatedAt: msg._updatedAt + } + }); + modal.present(); + } else { + this.openFile(str, msg.attachments[0].name, msg.file.type); + } } } } diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index cc8657f78..325f8f804 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -19,7 +19,7 @@ import { ChatUserStorage } from 'src/app/store/chat/chat-user.service'; import { environment } from 'src/environments/environment'; import { ThemeService } from 'src/app/services/theme.service' -import { VoiceRecorder, RecordingData, GenericResponse} from 'capacitor-voice-recorder'; +import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder'; import { Haptics, ImpactStyle } from '@capacitor/haptics'; import { SqliteService } from 'src/app/services/sqlite.service'; import { ViewEventPage } from 'src/app/modals/view-event/view-event.page'; @@ -37,6 +37,9 @@ import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'; import { DomSanitizer } from '@angular/platform-browser'; import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorResponse } from '@angular/common/http'; +import { File } from '@awesome-cordova-plugins/file/ngx'; +import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; +import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; const IMAGE_DIR = 'stored-images'; @@ -100,7 +103,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { downloadProgess: number; downloadLoader: boolean; - audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null + audioPermissionStatus: 'granted' | 'denied' | 'prompt' | null = null sessionStore = SessionStore constructor( @@ -132,10 +135,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { private sanitiser: DomSanitizer, private alertController: AlertController, // private document: DocumentViewer + private file: File, + private fileOpener: FileOpener, ) { this.loggedUser = authService.ValidatedUserChat['data']; this.roomId = this.navParams.get('roomId'); - + window.onresize = (event) => { if (window.innerWidth > 701) { @@ -143,7 +148,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } } - + this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}) this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked @@ -159,9 +164,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { ngOnInit() { this.chatService.refreshtoken(); this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { - + }) - + this.getChatMembers(); } @@ -210,11 +215,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { try { this.storage.get('recordData').then((recordData) => { - + if (recordData?.value?.recordDataBase64.includes('data:audio')) { this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64); } - else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) { + else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) { this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`); } }); @@ -225,22 +230,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { async startRecording() { VoiceRecorder.requestAudioRecordingPermission(); - if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){ - if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){ + if (await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) => { return result.value })) { + if (await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => { return result.value })) { //if(await this.hasAudioRecordingPermission()){ - if (this.recording) { - return; - } - this.recording = true; - VoiceRecorder.startRecording(); - this.calculateDuration(); + if (this.recording) { + return; + } + this.recording = true; + VoiceRecorder.startRecording(); + this.calculateDuration(); //} } - else{ + else { this.toastService._badRequest('Para gravar uma mensagem de voz, permita o acesso do Gabinete Digital ao seu microfone.'); } } - else{ + else { this.toastService._badRequest('Este dispositivo não tem capacidade para gravação de áudio!'); } } @@ -248,13 +253,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { stopRecording() { this.deleteRecording(); this.allowTyping = false; - + if (!this.recording) { return; } this.recording = false; VoiceRecorder.stopRecording().then(async (result: RecordingData) => { - + this.recording = false; if (result.value && result.value.recordDataBase64) { const recordData = result.value.recordDataBase64; @@ -263,7 +268,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { //Save file this.storage.set('fileName', fileName); this.storage.set('recordData', result).then(() => { - + }) } }) @@ -348,7 +353,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { }); await modal.present(); modal.onDidDismiss().then((res) => { - + }); } @@ -412,16 +417,16 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { if (recordData?.value?.recordDataBase64.includes('data:audio')) { this.audioRecorded = recordData?.value?.recordDataBase64; } - else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) { + else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) { this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`; } - + //Converting base64 to blob const encodedData = btoa(this.audioRecorded); const blob = this.base64toBlob(encodedData, recordData.value.mimeType) - + const formData = new FormData(); formData.append("blobFile", blob); @@ -444,7 +449,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } viewDocument(file: any, url?: string) { - + if (file.type == "application/webtrix") { this.openViewDocumentModal(file); } @@ -595,7 +600,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { IsRequired: "true", } }); - + this.popoverController.dismiss(); if (window.innerWidth <= 1024) { const modal = await this.modalController.create({ @@ -629,7 +634,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { const blob = await base64.blob(); const formData = new FormData(); formData.append("blobFile", blob); - + this.wsChatMethodsService.getDmRoom(roomId).send({ file: { @@ -709,7 +714,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { resultType: CameraResultType.Base64, source: CameraSource.Photos }); - + //const imageData = await this.fileToBase64Service.convert(file) // @@ -746,17 +751,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { const file: any = await this.fileService.getFileFromDevice(types); - + if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { const encodedData = btoa(JSON.stringify(await this.getBase64(file))); const blob = this.base64toBlob(encodedData, file.type) - + const formData = new FormData(); formData.append('blobFile', blob); - + this.wsChatMethodsService.getDmRoom(roomId).send({ file: { @@ -772,7 +777,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { temporaryData: formData }); } else { - + } @@ -787,7 +792,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { resolve(reader.result) }; reader.onerror = function (error) { - + }; }); @@ -795,7 +800,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { async openChatOptions(ev?: any) { const roomId = this.roomId - + const popover = await this.popoverController.create({ component: ChatOptionsPopoverPage, @@ -810,7 +815,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { }); await popover.present(); popover.onDidDismiss().then(async (res) => { - + if (res['data'] == 'meeting') { this.bookMeeting(); } @@ -837,11 +842,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { this.sqlservice.getAllChatMSG(roomId).then((msg: any) => { - + let chatmsgArray = []; let array = [] msg.forEach(element => { - + let msgChat = { _id: element.Id, @@ -861,7 +866,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { }); - + }) } } @@ -943,27 +948,27 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } openFile(pdfString, filename, type) { - // const blob = this.b64toBlob(pdfString, type) - // let pathFile = '' - // const fileName = filename - // const contentFile = blob - // if (this.platform.is('ios')) { - // pathFile = this.file.documentsDirectory - // } else { - // pathFile = this.file.externalRootDirectory - // } - // - // - // - // this.file - // .writeFile(pathFile, fileName, contentFile, { replace: true }) - // .then(success => { - // this.fileOpener - // .open(pathFile + fileName, type) - // .then(() => - // .catch(e => - // }) - // .catch(e => + const blob = this.b64toBlob(pdfString, type) + let pathFile = '' + const fileName = filename + const contentFile = blob + if (this.platform.is('ios')) { + pathFile = this.file.documentsDirectory + } else { + pathFile = this.file.externalRootDirectory + } + + + + this.file + .writeFile(pathFile, fileName, contentFile, { replace: true }) + .then(success => { + this.fileOpener + .open(pathFile + fileName, type) + .then(() => console.log()) + .catch(e => console.error(e)) + }) + .catch(e => console.error(e)) } downloadFileFromBrowser(fileName: string, data: any): void { @@ -976,9 +981,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { async openPreview(msg) { - - if(msg.file.type === "application/webtrix") { + + if (msg.file.type === "application/webtrix") { this.viewDocument(msg.file, msg.attachments.image_url) } else { @@ -992,21 +997,38 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - this.downloadFileFromBrowser(msg.attachments[0].name, str) - /* const modal = await this.modalController.create({ - component: ViewMediaPage, - cssClass: 'modal modal-desktop', - componentProps: { - image: str, - type: msg.file.type, - username: msg.u.name, - _updatedAt: msg._updatedAt - } - }); - modal.present(); */ + if (msg.file.type == "application/img") { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + type: msg.file.type, + username: msg.u.name, + _updatedAt: msg._updatedAt + } + }); + modal.present(); + } else { + this.downloadFileFromBrowser(msg.attachments[0].name, str) + } } else { - this.openFile(str, msg.attachments[0].name, msg.file.type); + if (msg.file.type == "application/img") { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + type: msg.file.type, + username: msg.u.name, + _updatedAt: msg._updatedAt + } + }); + modal.present(); + } else { + this.openFile(str, msg.attachments[0].name, msg.file.type); + } } } @@ -1015,7 +1037,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } async audioPreview(msg) { - + if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') { this.downloadFileMsg(msg) } else { } diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index b1cf161c8..f5e2b4b96 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -35,6 +35,7 @@ import { File } from '@awesome-cordova-plugins/file/ngx'; import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorResponse } from '@angular/common/http'; +import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; /* @@ -1102,35 +1103,55 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe async openPreview(msg) { + if (msg.file.type === "application/webtrix") { this.viewDocument(msg.file, msg.attachments.image_url) } else { if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') { this.downloadFileMsg(msg) + //this.testDownlod(msg) } else { - var str = msg.attachments[0].image_url; str = str.substring(1, ((str.length) - 1)); if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - this.downloadFileFromBrowser(msg.attachments[0].name, str) - } else if (this.platform.is('tablet')) { - this.openFile(str, msg.attachments[0].name, msg.file.type); + + if (msg.file.type == "application/img") { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + type: msg.file.type, + username: msg.u.name, + _updatedAt: msg._updatedAt + } + }); + modal.present(); + } else { + this.downloadFileFromBrowser(msg.attachments[0].name, str) + } + + } else { + if (msg.file.type == "application/img") { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + type: msg.file.type, + username: msg.u.name, + _updatedAt: msg._updatedAt + } + }); + modal.present(); + } else { + this.openFile(str, msg.attachments[0].name, msg.file.type); + } } - /* const modal = await this.modalController.create({ - component: ViewMediaPage, - cssClass: 'modal modal-desktop', - componentProps: { - image: str, - type: msg.file.type, - username: msg.u.name, - _updatedAt: msg._updatedAt - } - }); - modal.present(); */ } } diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index cd3922145..80e84bbc2 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -34,6 +34,7 @@ import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorResponse } from '@angular/common/http'; import { Howl } from 'howler'; import { runInThisContext } from 'vm'; +import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; const IMAGE_DIR = 'stored-images'; @@ -1014,52 +1015,57 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } async openPreview(msg) { - - if(msg.file.type === "application/webtrix") { + + if (msg.file.type === "application/webtrix") { this.viewDocument(msg.file, msg.attachments.image_url) } else { if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') { this.downloadFileMsg(msg) + //this.testDownlod(msg) - - /* } else if (msg.file.type === "application/pdf") { - - - - const win = window.open("", "_blank"); - let html = ''; - - html += ''; - html += ''; - html += ' --> +
+
+
+ +
Correspondência por ler
+
+ +
+
+ + +
+
+
{{task.taskStartDate | date: 'dd-MM-yyyy'}}
+
{{task.taskStartDate | date: 'HH:mm'}}
+
+
+
{{ task.Subject }}
+
{{ task.Senders }}
+
+
+
+ +
+
+
+ + + diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index 0839556f0..1ccc7d645 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -56,7 +56,12 @@ logo
-
+
+

Presidente da República

+
+

GABINETE DIGITAL

+
+

Presidente da República

GABINETE DIGITAL

@@ -171,6 +176,6 @@
-
+
diff --git a/src/app/shared/header/header.page.scss b/src/app/shared/header/header.page.scss index 3265696a1..95d77069f 100644 --- a/src/app/shared/header/header.page.scss +++ b/src/app/shared/header/header.page.scss @@ -15,11 +15,11 @@ color: black; overflow: auto; - .logo-icon{ + .logo-icon { width: 25.33%; overflow: auto; - img{ + img { width: 100%; margin: 0px auto; } @@ -72,12 +72,12 @@ } } -.header-btns{ +.header-btns { justify-content: center; align-items: center; } -.div-profile{ +.div-profile { height: fit-content; font-size: 45px; justify-content: flex-end; @@ -103,7 +103,7 @@ position: absolute; /* changed */ top: 5px; /* changed */ right: 27px; /* changed */ -} + } .profile-text{ font-size: 20px; @@ -113,11 +113,11 @@ color: var(--profile-text-color); } } -.main-tab{ +.main-tab { //border: 1px solid red; } -.desktop{ +.desktop { display: none; } diff --git a/src/global.scss b/src/global.scss index 56e89de31..d19add06b 100644 --- a/src/global.scss +++ b/src/global.scss @@ -798,7 +798,7 @@ ion-content { @media only screen and (min-width: 1224px) { app-header .header-container{ - background: var(--header-container-background) !important; + // background: var(--header-container-background) !important; color: var(--headercolor); } app-events .init-event-header, @@ -822,7 +822,7 @@ ion-content { } -@media only screen and (min-width : 321px) { +@media only screen and (min-width : 1364px) { app-header .header-container{ background: var(--header-container-background) !important; color: var(--headercolor); From 1a42616790cd7d4197092eb9d7324238c1bad835 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 6 Jul 2022 17:11:03 +0100 Subject: [PATCH 4/6] improve --- src/app/shared/header/header.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index 1ccc7d645..7963303a0 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -58,7 +58,7 @@

Presidente da República

-
+

GABINETE DIGITAL

From 75609ae5b414720b4f4822be10abd67514e9fe14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 6 Jul 2022 17:50:42 +0100 Subject: [PATCH 5/6] create room bug solved on web --- src/app/pages/chat/messages/messages.page.ts | 1 + src/app/shared/chat/messages/messages.page.ts | 28 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 325f8f804..9299ace5c 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -162,6 +162,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } ngOnInit() { + this.wsChatMethodsService.getAllRooms(); this.chatService.refreshtoken(); this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 80e84bbc2..db221790e 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -99,6 +99,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy audioDuration = 0; audioTimer:any; @ViewChild('range', {static: false}) range: IonRange; + room: any = new Array(); + roomName: any; + isAdmin = false; + roomCountDownDate: string; constructor( public popoverController: PopoverController, @@ -128,6 +132,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } ngOnChanges(changes: SimpleChanges): void { + this.wsChatMethodsService.getAllRooms(); this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}) this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked @@ -164,9 +169,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy } ngOnInit() { + this.wsChatMethodsService.getAllRooms(); this.chatService.refreshtoken(); this.scrollToBottom(); - this.getChatMembers(); this.deleteRecording(); @@ -1122,6 +1127,27 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy },1000) } + async getRoomInfo() { + this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({}); + let room = await this.chatService.getRoomInfo(this.roomId).toPromise(); + // console.log('ROOM',room) + this.room = room['room']; + if (this.room.name) { + this.roomName = this.room.name.split('-').join(' '); + } + + + if(SessionStore.user.ChatData.data.userId == this.room.u._id){ + this.isAdmin = true + } else { + this.isAdmin = false + } + + if (this.room.customFields.countDownDate) { + this.roomCountDownDate = this.room.customFields.countDownDate; + } + } + } From 41a9299fbd2bb9ea6f11cbe3cca9bf657e5704b9 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 7 Jul 2022 11:38:48 +0100 Subject: [PATCH 6/6] hide event to approve --- src/app/pages/agenda/agenda.page.html | 2 +- src/app/pages/agenda/agenda.page.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index b62c42f52..cbc2cca9e 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -123,7 +123,7 @@ -