several improvements

This commit is contained in:
tiago.kayaya
2021-09-21 14:05:59 +01:00
parent afb7c42e9f
commit 2e209711bb
22 changed files with 603 additions and 74 deletions
@@ -39,6 +39,23 @@
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments">
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
<div>
<div class="file d-flex">
<ion-thumbnail *ngIf="file.thumb_url" slot="start">
<img src="{{file.thumb_url}}" alt="image">
</ion-thumbnail>
<!-- <canvas id="pdf_canvas"></canvas> -->
<ion-label class="file-details">
<h3 (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">{{file.title}}</h3>
<p *ngIf="file.text">{{file.text}}</p>
</ion-label>
</div>
</div>
</div>
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
@@ -13,6 +13,7 @@ import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/ch
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
import { TimeService } from 'src/app/services/functions/time.service';
import { FileService } from 'src/app/services/functions/file.service';
@Component({
selector: 'app-messages',
@@ -61,6 +62,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private toastService: ToastService,
private route: Router,
private timeService: TimeService,
private fileService: FileService,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
@@ -191,6 +193,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
}
viewDocument(url:string){
this.fileService.viewDocumentByUrl(url);
}
getChatMembers() {
console.log(this.roomId);
@@ -350,6 +356,20 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
this.openNewEventPage.emit(data);
}
else if(res['data'] == 'add-picture'){
this.fileService.addPictureToChat(this.roomId);
//this.loadPicture();
}
else if(res['data'] == 'add-document'){
this.fileService.addDocumentToChat(this.roomId);
//this.loadDocument();
}
else if(res['data'] == 'documentoGestaoDocumental'){
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
this.showLoader = false;
//this.addDocGestaoDocumental();
}
});
}