diff --git a/src/app/modals/chat-options-features/chat-options-features.page.html b/src/app/modals/chat-options-features/chat-options-features.page.html index 40c40b512..75ac2594a 100644 --- a/src/app/modals/chat-options-features/chat-options-features.page.html +++ b/src/app/modals/chat-options-features/chat-options-features.page.html @@ -7,7 +7,7 @@
- +
diff --git a/src/app/services/chat.service.ts b/src/app/services/chat.service.ts index 3a26458bf..612975aaf 100644 --- a/src/app/services/chat.service.ts +++ b/src/app/services/chat.service.ts @@ -129,6 +129,14 @@ export class ChatService { return this.http.post(environment.apiChatUrl+'chat.sendMessage', body, opts); } + uploadFile(formData:any, rid:string){ + let url = environment.apiChatUrl+'rooms.upload/'+rid; + let opts = { + headers: this.headers, + } + return this.http.post(url, formData, opts); + } + deleteMessage(body:any){ let opts = { headers: this.headers, diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 63f84472e..95f02e6b5 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -21,6 +21,8 @@ export class FileService { documents:SearchList[] = []; showLoader: boolean; + files: Set; + constructor( private camera: Camera, private fileLoaderService: FileLoaderService, @@ -160,33 +162,12 @@ export class FileService { console.log(file); - const imageData = await this.fileToBase64Service.convert(file) - this.capturedImage = imageData; - this.capturedImageTitle = file.name; + const formData = new FormData(); + formData.append('file', file, file.name); - let body = { - "message": - { - "rid": roomId, - "msg": "", - "attachments": [{ - "title": this.capturedImageTitle, - "text": "", - "title_link": this.capturedImage, - "title_link_download": true, - "message_link": this.capturedImage, - "type": "file" - }], - "file":{ - "name": this.capturedImageTitle, - "type": "application/pdf", - } - } - } - - this.chatService.sendMessage(body).subscribe(res=> { + this.chatService.uploadFile(formData, roomId).subscribe(res=> { + console.log(res); loader.remove(); - //console.log(res); },(error) => { loader.remove(); }); diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 4d6b615d8..051d6a75d 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -127,9 +127,31 @@
-
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 fb6883e1f..c75285e1f 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -632,6 +632,26 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe modal.onDidDismiss(); } + takePicture(){ + this.fileService.addCameraPictureToChat(this.roomId); + } + addImage(){ + this.fileService.addPictureToChat(this.roomId); + } + addFile(){ + this.fileService.addDocumentToChat(this.roomId); + } + addFileWebtrix(){ + this.fileService.addDocGestaoDocumentalToChat(this.roomId); + } + bookMeeting(){ + let data = { + roomId: this.roomId, + members: this.members + } + this.openNewEventPage.emit(data); + } + async _openChatOptions() { const enterAnimation = (baseEl: any) => { diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index e8691256f..a26012f2e 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -99,9 +99,33 @@
-
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 05c97f4d4..cab59831e 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -379,6 +379,28 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy + takePicture(){ + this.fileService.addCameraPictureToChat(this.roomId); + } + addImage(){ + this.fileService.addPictureToChat(this.roomId); + } + addFile(){ + this.fileService.addDocumentToChat(this.roomId); + } + addFileWebtrix(){ + this.fileService.addDocGestaoDocumentalToChat(this.roomId); + } + bookMeeting(){ + let data = { + roomId: this.roomId, + members: this.members + } + this.openNewEventPage.emit(data); + } + + + async _openChatOptions() { const enterAnimation = (baseEl: any) => { diff --git a/src/global.scss b/src/global.scss index 061cc4197..60b71dcf2 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1180,6 +1180,19 @@ ngx-mat-datetime-content{ padding: 0 5px 0 5px; } +.fab-list{ + overflow: auto; + + .fab-list-btn{ + position: relative; + float: left; + border: 1px solid blue; + } + .fab-list-text{ + border-radius: 15px; + } +} + @media only screen and (min-width: 665px) { .loading-blocker {