mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
pull from developer
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<div hidden class="right">
|
||||
<button class="btn-no-color" (click)="_openMessagesOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,14 +51,32 @@
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="msg.alias == 'documento'">
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
||||
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
||||
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
|
||||
</mat-menu>
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <ion-label>{{msg.msg}}</ion-label> -->
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
<div *ngFor="let file of msg.attachments">
|
||||
|
||||
<div (click)="downloadFileMsg(msg)">
|
||||
<div (click)="downloadFileMsg(msg)" dfsdvsvs>
|
||||
<!-- <img *ngIf="file.image_url" src="{{file.image_url}}" alt="image" (click)="imageSize(file.image_url)"> -->
|
||||
<img src={{msg.image_url}} alt="image">
|
||||
<!-- <div (click)="openPreview(msg)">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image"> -->
|
||||
</div>
|
||||
<!-- <div *ngIf="msg.file.type">
|
||||
<div *ngIf="msg.file">
|
||||
<div class="file">
|
||||
<div (click)="viewDocument(msg, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||
<span *ngIf="msg.file.type">
|
||||
@@ -78,14 +96,15 @@
|
||||
<span *ngIf="msg.file.type != 'application/webtrix'">{{msg.file.type.replace('application/','').toUpperCase()}}</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="msg.file" class="info-meeting">
|
||||
<div *ngIf="msg.file.type == 'application/meeting'">
|
||||
<div *ngIf="msg.file" >
|
||||
<div class="info-meeting" *ngIf="msg.file.type == 'application/meeting'">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
||||
|
||||
@@ -261,7 +261,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
|
||||
getMessageDB() {
|
||||
this.storageservice.get('chatmsg').then((msg) => {
|
||||
this.storage.get('chatmsg').then((msg) => {
|
||||
console.log('FROM DB WEB', msg)
|
||||
let msgArray = [];
|
||||
msgArray = msg;
|
||||
@@ -276,7 +276,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
let image;
|
||||
if (typeof element.file != 'undefined') {
|
||||
if (typeof element.file.guid != 'undefined') {
|
||||
let imageguid = this.storageservice.get(element.file.guid);
|
||||
let imageguid = this.storage.get(element.file.guid);
|
||||
if (imageguid) {
|
||||
image = imageguid;
|
||||
console.log('IMAGE STORAGE', image)
|
||||
@@ -315,10 +315,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
});
|
||||
console.log('Web TRANSFORM MSG', mgsArray)
|
||||
this.storageservice.remove('chatmsg').then(() => {
|
||||
this.storage.remove('chatmsg').then(() => {
|
||||
console.log('MSG REMOVE FROM STORAGE')
|
||||
});
|
||||
this.storageservice.store('chatmsg', mgsArray).then(() => {
|
||||
this.storage.set('chatmsg', mgsArray).then(() => {
|
||||
console.log('MSG SAVED ON STORAGE')
|
||||
this.getMessageDB();
|
||||
});
|
||||
@@ -380,7 +380,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
console.log('GET FILE WEB', foo)
|
||||
});
|
||||
|
||||
this.storageservice.get('chatmsg').then(async (msg) => {
|
||||
this.storage.get('chatmsg').then(async (msg) => {
|
||||
let msgArray = [];
|
||||
msgArray = msg;
|
||||
msgArray.filter(data => data._id != this.roomId);
|
||||
@@ -411,8 +411,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
}
|
||||
});
|
||||
await this.storageservice.remove('chatmsg');
|
||||
await this.storageservice.store('chatmsg', newmgsArray);
|
||||
await this.storage.remove('chatmsg');
|
||||
await this.storage.set('chatmsg', newmgsArray);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -797,7 +797,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
console.log('TRY ARRAY BUFFER NAME', name);
|
||||
console.log('TRY ARRAY BUFFER', this.downloadFile);
|
||||
|
||||
this.storageservice.store(msg.file.guid, this.downloadFile);
|
||||
this.storage.set(msg.file.guid, this.downloadFile);
|
||||
|
||||
await Filesystem.writeFile({
|
||||
path: `${IMAGE_DIR}/${name}`,
|
||||
|
||||
Reference in New Issue
Block a user