mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fixe chat message
This commit is contained in:
@@ -16,6 +16,7 @@ export class MessageModel extends models.Model {
|
||||
_updatedAt = models.IntegerField()
|
||||
messageSend = models.BooleanField()
|
||||
offline = models.BooleanField()
|
||||
hasFile = models.BooleanField({blank:true})
|
||||
viewed = ArrayField({blank:true})
|
||||
received = ArrayField({blank:true})
|
||||
localReference = models.CharField({blank:true, unique: true})
|
||||
@@ -23,14 +24,16 @@ export class MessageModel extends models.Model {
|
||||
file = JsonField({blank:true})
|
||||
|
||||
async getAttachments() {
|
||||
const _attachments = await attachments.filter({id: this['id']})
|
||||
return _attachments
|
||||
console.log('this[id]', this['id'])
|
||||
const _attachments = await attachments.filter({messageId: this['id']}).execute()
|
||||
return _attachments[0]
|
||||
}
|
||||
}
|
||||
|
||||
export class attachments extends models.Model {
|
||||
message = models.OneToOneField({model:MessageModel})
|
||||
attachments = ArrayField({default:[]})
|
||||
messageId = models.IntegerField()
|
||||
attachments = ArrayField({blank:true})
|
||||
file = JsonField({blank:true})
|
||||
}
|
||||
|
||||
export class DeleteMessageModel extends models.Model {
|
||||
|
||||
@@ -90,6 +90,10 @@ export interface Message {
|
||||
received: string[],
|
||||
delate: boolean,
|
||||
delateRequest: boolean
|
||||
attachmentsModelData: {
|
||||
fileBase64: string
|
||||
}
|
||||
hasFile: boolean
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -114,11 +114,15 @@
|
||||
<div (click)="openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
<ion-label>{{file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-label>{{ file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
|
||||
@@ -16,7 +16,6 @@ import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { FileType } from 'src/app/models/fileType';
|
||||
import { Storage } from '@ionic/storage';
|
||||
@@ -463,32 +462,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
contentType = contentType || '';
|
||||
var sliceSize = 1024;
|
||||
var byteCharacters = atob(base64Data);
|
||||
var bytesLength = byteCharacters.length;
|
||||
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||
var byteArrays = new Array(slicesCount);
|
||||
|
||||
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||
var begin = sliceIndex * sliceSize;
|
||||
var end = Math.min(begin + sliceSize, bytesLength);
|
||||
|
||||
var bytes = new Array(end - begin);
|
||||
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||
}
|
||||
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||
}
|
||||
return new Blob(byteArrays, { type: contentType });
|
||||
}
|
||||
|
||||
async sendAudio(fileName) {
|
||||
|
||||
const roomId = this.roomId
|
||||
let audioFile;
|
||||
this.storage.get('recordData').then((recordData) => {
|
||||
this.storage.get('recordData').then(async (recordData) => {
|
||||
|
||||
audioFile = recordData;
|
||||
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||
@@ -500,7 +479,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
@@ -516,7 +495,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
@@ -670,7 +652,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"title": capturedImageTitle,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -740,7 +725,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
@@ -757,7 +742,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
@@ -864,65 +852,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
/* async actionSheet() {
|
||||
const actionSheet = await this.actionSheetController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
buttons: [{
|
||||
text: 'Sair do grupo',
|
||||
handler: () => {
|
||||
|
||||
}
|
||||
}, {
|
||||
text: 'Alterar nome do grupo1',
|
||||
handler: () => {
|
||||
|
||||
this.openChangeGroupName()
|
||||
}
|
||||
}, {
|
||||
text: 'Apagar o grupo',
|
||||
handler: () => {
|
||||
|
||||
}
|
||||
},
|
||||
]
|
||||
});
|
||||
await actionSheet.present();
|
||||
}
|
||||
*/
|
||||
|
||||
// getRoomMessageDB(roomId) {
|
||||
// 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,
|
||||
// attachments: this.isJson(element.Attachments),
|
||||
// channels: this.isJson(element.Channels),
|
||||
// file: this.isJson(element.File),
|
||||
// mentions: this.isJson(element.Mentions),
|
||||
// msg: element.Msg,
|
||||
// rid: element.Rid,
|
||||
// ts: element.Ts,
|
||||
// u: this.isJson(element.U),
|
||||
// _updatedAt: element.UpdatedAt,
|
||||
// image_url: this.isJson(element.image_url)
|
||||
// }
|
||||
|
||||
// chatmsgArray.push(msgChat)
|
||||
// });
|
||||
|
||||
// // this.messages = chatmsgArray;
|
||||
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
isJson(str) {
|
||||
try {
|
||||
JSON.parse(str);
|
||||
|
||||
@@ -114,11 +114,14 @@
|
||||
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
<ion-label>{{file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-label>{{ file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -401,31 +401,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
})
|
||||
} */
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
contentType = contentType || '';
|
||||
var sliceSize = 1024;
|
||||
var byteCharacters = atob(base64Data);
|
||||
var bytesLength = byteCharacters.length;
|
||||
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||
var byteArrays = new Array(slicesCount);
|
||||
|
||||
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||
var begin = sliceIndex * sliceSize;
|
||||
var end = Math.min(begin + sliceSize, bytesLength);
|
||||
|
||||
var bytes = new Array(end - begin);
|
||||
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||
}
|
||||
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||
}
|
||||
return new Blob(byteArrays, { type: contentType });
|
||||
}
|
||||
|
||||
async sendAudio(fileName) {
|
||||
const roomId = this.roomId
|
||||
let audioFile;
|
||||
this.storage.get('recordData').then((recordData) => {
|
||||
this.storage.get('recordData').then(async (recordData) => {
|
||||
|
||||
audioFile = recordData;
|
||||
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||
@@ -439,7 +418,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
@@ -455,7 +434,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
@@ -658,14 +640,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
|
||||
const blob = this.dataURItoBlob('data:image/jpeg;base64,' + file.base64String)
|
||||
console.log('data:image/jpeg;base64,' + file.base64String)
|
||||
const base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
|
||||
const blob = this.dataURItoBlob(base64)
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
// console.log('capturedImage', capturedImage);
|
||||
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
@@ -676,7 +656,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
@@ -789,7 +773,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"title": file.path,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -813,7 +800,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
@@ -831,7 +818,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
|
||||
@@ -166,7 +166,9 @@ export class AuthService {
|
||||
|
||||
return true
|
||||
} catch(e) {
|
||||
window['e'] = e
|
||||
console.error('BeforesendAtachment', e)
|
||||
message.uploadingFile = false
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -183,7 +185,9 @@ export class AuthService {
|
||||
return true
|
||||
|
||||
} catch(e) {
|
||||
window['e'] = e
|
||||
console.error('BeforesendAtachment', e)
|
||||
message.uploadingFile = false
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -211,9 +215,6 @@ export class AuthService {
|
||||
type: message.file.type
|
||||
}
|
||||
|
||||
await this.storage.set(message.file.guid, downloadFile).then(() => {
|
||||
//
|
||||
});
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -6,7 +6,7 @@ import { NfService } from 'src/app/services/chat/nf.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
import { ChatMethodsService } from './chat-methods.service';
|
||||
import { MessageModel } from '../../models/beast-orm';
|
||||
import { MessageModel, attachments } from '../../models/beast-orm';
|
||||
import { AESEncrypt } from '../aesencrypt.service';
|
||||
import { HttpEventType } from '@angular/common/http';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
@@ -40,7 +40,7 @@ export class MessageService {
|
||||
file
|
||||
attachments
|
||||
displayType = ''
|
||||
temporaryData: any = {}
|
||||
temporaryData: any
|
||||
hasFile = false
|
||||
hasSendAttachment = false
|
||||
sendAttempt = 0
|
||||
@@ -64,7 +64,9 @@ export class MessageService {
|
||||
manualRetry = false
|
||||
origin: 'history' | 'stream' | 'local'
|
||||
|
||||
rowInstance: MessageModel
|
||||
messageModelInstance: MessageModel
|
||||
attachmentsModelData: any
|
||||
|
||||
|
||||
constructor(
|
||||
private NfService: NfService,
|
||||
@@ -77,7 +79,7 @@ export class MessageService {
|
||||
private notificationService: NotificationsService) {
|
||||
}
|
||||
|
||||
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin }:Message) {
|
||||
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin, attachmentsModelData, hasFile = false }:Message) {
|
||||
|
||||
this.channels = channels || []
|
||||
this.mentions = mentions || []
|
||||
@@ -96,6 +98,7 @@ export class MessageService {
|
||||
this.delateRequest = delateRequest
|
||||
this.sendAttempt = 0
|
||||
this.origin = origin
|
||||
this.attachmentsModelData = attachmentsModelData
|
||||
|
||||
if(this.attachments?.length >= 1 && attachments?.length >= 1) {
|
||||
this.attachments[0] = Object.assign(this.attachments[0], attachments[0])
|
||||
@@ -112,12 +115,10 @@ export class MessageService {
|
||||
this.messageSend = true
|
||||
}
|
||||
|
||||
if (this.file) {
|
||||
if(this.file.type) {
|
||||
if(typeof(this.file.type) == 'string') {
|
||||
this.hasFile = true
|
||||
}
|
||||
}
|
||||
this.hasFile = hasFile
|
||||
|
||||
if (this.instanceHasAttachment && !this.hasFile) {
|
||||
this.hasFile = true
|
||||
}
|
||||
|
||||
if(this.hasFile) {
|
||||
@@ -201,6 +202,7 @@ export class MessageService {
|
||||
|
||||
} else {
|
||||
|
||||
console.log('send', this)
|
||||
let uploadSuccessfully = await this.sendRequestAttachment()
|
||||
|
||||
if(uploadSuccessfully) {
|
||||
@@ -247,24 +249,35 @@ export class MessageService {
|
||||
functionTimer = null;
|
||||
|
||||
async sendRequestAttachment() {
|
||||
|
||||
this.uploadingFile = true
|
||||
|
||||
let uploadSuccessfully = false
|
||||
if(!this.instanceHasAttachmentBase64 && !this.temporaryData) {
|
||||
try {
|
||||
await this.getFileFromDB()
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
if(!this.instanceHasTemporaryData) {
|
||||
|
||||
await this.generateTemporaryData()
|
||||
}
|
||||
|
||||
if(this.hasSendAttachment == false) {
|
||||
try {
|
||||
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
|
||||
this.UploadAttachmentsTemp++
|
||||
this.uploadingFile = false
|
||||
|
||||
this.manualRetry = false
|
||||
this.errorUploadingAttachment = false
|
||||
this.hasSendAttachment = true
|
||||
this.temporaryData = {}
|
||||
} catch (error) {
|
||||
this.uploadingFile = false
|
||||
|
||||
this.errorUploadingAttachment = true
|
||||
this.UploadAttachmentsTemp++
|
||||
console.error('beforeSendAttachment error:', error)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -411,6 +424,7 @@ export class MessageService {
|
||||
|
||||
// save the changes to the storage
|
||||
this.saveChanges()
|
||||
this.addFileToDb()
|
||||
this.downloadLoader = false;
|
||||
this.downloadAttachments = true
|
||||
this.downloadAttachmentsTemp++;
|
||||
@@ -461,11 +475,11 @@ export class MessageService {
|
||||
|
||||
async delateDB() {
|
||||
|
||||
if(!this.rowInstance) {
|
||||
this.rowInstance = await this.getRowInstance()
|
||||
if(!this.messageModelInstance) {
|
||||
this.messageModelInstance = await this.getRowInstance()
|
||||
}
|
||||
|
||||
await this.rowInstance.delete()
|
||||
await this.messageModelInstance.delete()
|
||||
}
|
||||
|
||||
|
||||
@@ -489,6 +503,7 @@ export class MessageService {
|
||||
u: this.u,
|
||||
_id: this._id,
|
||||
id: this.id,
|
||||
hasFile: this.hasFile,
|
||||
origin: this.origin,
|
||||
_updatedAt: this._updatedAt,
|
||||
messageSend: this.messageSend,
|
||||
@@ -509,10 +524,18 @@ export class MessageService {
|
||||
this.addToDb = true
|
||||
const message = this.getChatObj()
|
||||
|
||||
if(this.instanceHasAttachment) {
|
||||
this.hasFile = true
|
||||
}
|
||||
|
||||
delete message.id
|
||||
const createdMessage = await MessageModel.create(message)
|
||||
|
||||
this.rowInstance = createdMessage
|
||||
if(this.instanceHasAttachment) {
|
||||
this.addFileToDb()
|
||||
}
|
||||
|
||||
this.messageModelInstance = createdMessage
|
||||
this.id = createdMessage.id
|
||||
|
||||
if(this.earlySave) {
|
||||
@@ -521,6 +544,96 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
async addFileToDb() {
|
||||
|
||||
if(!this.messageModelInstance) {
|
||||
this.messageModelInstance = await this.getRowInstance()
|
||||
}
|
||||
|
||||
|
||||
const createdMessage: any = this.messageModelInstance
|
||||
try {
|
||||
|
||||
let file = {}
|
||||
|
||||
if(this.attachmentsModelData) {
|
||||
file = {image_url: this.attachmentsModelData?.fileBase64}
|
||||
}
|
||||
|
||||
await attachments.create({messageId: createdMessage.id, attachments: this.attachments, file: Object.assign(this.file, file) })
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
async getFileFromDB() {
|
||||
|
||||
if(!this.messageModelInstance) {
|
||||
this.messageModelInstance = await this.getRowInstance()
|
||||
}
|
||||
|
||||
|
||||
const data = await this.messageModelInstance.getAttachments()
|
||||
|
||||
console.log('data', data);
|
||||
|
||||
this.attachments = data.attachments
|
||||
this.file = data.file
|
||||
}
|
||||
|
||||
async generateTemporaryData () {
|
||||
const blob: any = await this.base64StringToBlob(this.file.image_url)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
this.temporaryData = formData
|
||||
}
|
||||
|
||||
|
||||
get instanceHasAttachment() {
|
||||
if (this.file) {
|
||||
if(this.file.type) {
|
||||
if(typeof(this.file.type) == 'string') {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
get instanceHasAttachmentBase64() {
|
||||
if (this.file) {
|
||||
if(this.file.type) {
|
||||
if(this.file?.image_url) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
get instanceHasTemporaryData() {
|
||||
if (!this.temporaryData) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
base64StringToBlob(base64Data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
fetch(base64Data)
|
||||
.then(res => resolve(res.blob()))
|
||||
.then(console.log)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
async getRowInstance () {
|
||||
|
||||
@@ -547,11 +660,11 @@ export class MessageService {
|
||||
|
||||
async saveChanges() {
|
||||
|
||||
if(!this.rowInstance) {
|
||||
this.rowInstance = await this.getRowInstance()
|
||||
if(!this.messageModelInstance) {
|
||||
this.messageModelInstance = await this.getRowInstance()
|
||||
}
|
||||
|
||||
if(this.save && this.rowInstance) {
|
||||
if(this.save && this.messageModelInstance) {
|
||||
const message = this.getChatObj()
|
||||
|
||||
if(!message.id) {
|
||||
@@ -560,11 +673,11 @@ export class MessageService {
|
||||
|
||||
for( const [name, value] of Object.entries(message)) {
|
||||
try {
|
||||
this.rowInstance[name] = value
|
||||
this.messageModelInstance[name] = value
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
await this.rowInstance.save()
|
||||
await this.messageModelInstance.save()
|
||||
|
||||
} else {
|
||||
this.earlySave = true
|
||||
|
||||
@@ -564,7 +564,7 @@ export class RoomService {
|
||||
/**
|
||||
* @description sen text message
|
||||
*/
|
||||
async send({file = null, attachments = null, temporaryData = {}}) {
|
||||
async send({file = null, attachments = null, temporaryData = {}, attachmentsModelData = {}}) {
|
||||
|
||||
const localReference = uuidv4();
|
||||
|
||||
@@ -575,9 +575,13 @@ export class RoomService {
|
||||
file,
|
||||
temporaryData,
|
||||
localReference,
|
||||
origin: 'local'
|
||||
origin: 'local',
|
||||
attachmentsModelData
|
||||
}
|
||||
|
||||
|
||||
console.log('offlineChatMessage', offlineChatMessage)
|
||||
|
||||
this.message= ''
|
||||
|
||||
const message: MessageService = await this.prepareCreate({message:offlineChatMessage, save: environment.chatOffline})
|
||||
@@ -705,12 +709,14 @@ export class RoomService {
|
||||
const wewMessage = await this.simplePrepareMessage(ChatMessage)
|
||||
wewMessage.from = 'Offline'
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
wewMessage.messageModelInstance = ChatMessage
|
||||
|
||||
if(wewMessage.offline == false) {
|
||||
|
||||
const message = await this.prepareCreate({message:ChatMessage})
|
||||
message.from = 'Offline'
|
||||
message.loadHistory = this.hasLoadHistory
|
||||
wewMessage.messageModelInstance = ChatMessage
|
||||
message?.decryptMessage()
|
||||
|
||||
} else {
|
||||
@@ -719,11 +725,11 @@ export class RoomService {
|
||||
|
||||
offlineMessage.from = 'Offline'
|
||||
offlineMessage.loadHistory = this.hasLoadHistory
|
||||
wewMessage.messageModelInstance = ChatMessage
|
||||
this.registerSendMessage(offlineMessage)
|
||||
offlineMessage?.decryptMessage()
|
||||
offlineMessage.send()
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(wewMessage.delate && !wewMessage.offline && !wewMessage.delateRequest) {
|
||||
|
||||
@@ -169,9 +169,85 @@ export class FileService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
getFileFromDeviceBase64(types: typeof FileType[]) {
|
||||
const input = this.fileLoaderService.createInput({
|
||||
accept: types
|
||||
})
|
||||
|
||||
return new Promise((resolve, reject)=>{
|
||||
input.onchange = async () => {
|
||||
const file = this.fileLoaderService.getFirstFile(input)
|
||||
|
||||
resolve(await this.getBase64(file));
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = function () {
|
||||
resolve(reader.result)
|
||||
};
|
||||
reader.onerror = function (error) {
|
||||
console.log('Error: ', error);
|
||||
};
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
viewDocumentByUrl(url) {
|
||||
const browser = this.iab.create(url,"_parent");
|
||||
browser.show();
|
||||
}
|
||||
|
||||
|
||||
blobToBase64 = blob => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(blob);
|
||||
return new Promise(resolve => {
|
||||
reader.onloadend = () => {
|
||||
resolve(reader.result);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
contentType = contentType || '';
|
||||
var sliceSize = 1024;
|
||||
var byteCharacters = atob(base64Data);
|
||||
var bytesLength = byteCharacters.length;
|
||||
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||
var byteArrays = new Array(slicesCount);
|
||||
|
||||
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||
var begin = sliceIndex * sliceSize;
|
||||
var end = Math.min(begin + sliceSize, bytesLength);
|
||||
|
||||
var bytes = new Array(end - begin);
|
||||
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||
}
|
||||
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||
}
|
||||
return new Blob(byteArrays, { type: contentType });
|
||||
}
|
||||
|
||||
|
||||
base64StringToBlob(base64Data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
fetch(base64Data)
|
||||
.then(res => resolve(res.blob()))
|
||||
.then(console.log)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -120,11 +120,14 @@
|
||||
<div (click)="openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
<ion-label>{{file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-label>{{ file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
|
||||
@@ -424,31 +424,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
contentType = contentType || '';
|
||||
var sliceSize = 1024;
|
||||
var byteCharacters = atob(base64Data);
|
||||
var bytesLength = byteCharacters.length;
|
||||
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||
var byteArrays = new Array(slicesCount);
|
||||
|
||||
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||
var begin = sliceIndex * sliceSize;
|
||||
var end = Math.min(begin + sliceSize, bytesLength);
|
||||
|
||||
var bytes = new Array(end - begin);
|
||||
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||
}
|
||||
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||
}
|
||||
return new Blob(byteArrays, { type: contentType });
|
||||
}
|
||||
|
||||
async sendAudio(fileName) {
|
||||
const roomId = this.roomId
|
||||
let audioFile;
|
||||
this.storage.get('recordData').then((recordData) => {
|
||||
this.storage.get('recordData').then(async (recordData) => {
|
||||
|
||||
audioFile = recordData;
|
||||
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||
@@ -461,7 +441,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
@@ -477,7 +457,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
@@ -748,7 +731,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
"image_url": 'data:image/jpeg;base64,' + file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -776,7 +762,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -864,7 +853,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
"image_url": 'data:image/jpeg;base64,' + file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -882,7 +874,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
@@ -900,7 +892,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
@@ -122,10 +122,11 @@
|
||||
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
|
||||
<ion-label>{{ file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -411,7 +411,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
async sendAudio(fileName) {
|
||||
const roomId = this.roomId
|
||||
let audioFile;
|
||||
this.storage.get('recordData').then((recordData) => {
|
||||
this.storage.get('recordData').then(async (recordData) => {
|
||||
|
||||
audioFile = recordData;
|
||||
|
||||
@@ -423,7 +423,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
@@ -439,7 +439,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
@@ -451,27 +454,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.ChatSystemService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
contentType = contentType || '';
|
||||
var sliceSize = 1024;
|
||||
var byteCharacters = atob(base64Data);
|
||||
var bytesLength = byteCharacters.length;
|
||||
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||
var byteArrays = new Array(slicesCount);
|
||||
|
||||
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||
var begin = sliceIndex * sliceSize;
|
||||
var end = Math.min(begin + sliceSize, bytesLength);
|
||||
|
||||
var bytes = new Array(end - begin);
|
||||
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||
}
|
||||
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||
}
|
||||
return new Blob(byteArrays, { type: contentType });
|
||||
}
|
||||
|
||||
|
||||
async openViewDocumentModal(file: any) {
|
||||
let task = {
|
||||
@@ -661,7 +643,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
|
||||
const blob = this.dataURItoBlob('data:image/jpeg;base64,' + file.base64String)
|
||||
const base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
const blob = this.dataURItoBlob(base64)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
@@ -678,7 +661,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
//"image_url": 'data:image/jpeg;base64,' + file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -710,7 +696,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
"image_url": capturedImage,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -778,6 +767,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//
|
||||
|
||||
|
||||
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
|
||||
const blob = await response.blob();
|
||||
|
||||
@@ -795,7 +785,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
//"image_url": 'data:image/jpeg;base64,' + file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
}],
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -814,7 +807,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
@@ -832,7 +825,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: await this.fileService.blobToBase64(blob),
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
@@ -87,7 +87,12 @@
|
||||
Diplomas por validar
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="assinados">
|
||||
Diplomas assinados PR
|
||||
<span *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">
|
||||
Diplomas assinados PR
|
||||
</span>
|
||||
<span *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">
|
||||
Diplomas
|
||||
</span>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "2c28e37a4",
|
||||
"SHA": "2c28e37a4b09610c5e3ab7da7d1c887065ab91b6",
|
||||
"shortSHA": "8c02c5abb",
|
||||
"SHA": "8c02c5abb8e15fb6d0dfa2e119ec8005953ae968",
|
||||
"branch": "feature/gabinete-search",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Fri Jun 23 12:14:24 2023 +0100'",
|
||||
"lastCommitMessage": "change words to english",
|
||||
"lastCommitNumber": "5020",
|
||||
"lastCommitTime": "'Fri Jun 23 13:56:34 2023 +0100'",
|
||||
"lastCommitMessage": "rename",
|
||||
"lastCommitNumber": "5021",
|
||||
"change": "",
|
||||
"changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/domain/process/DiplomaGenerate.ts\n\tmodified: src/app/domain/process/DiplomaSignPr.ts\n\tmodified: src/app/domain/process/DiplomaToSign.ts\n\tmodified: src/app/domain/process/DiplomasValidate.ts\n\tmodified: src/app/domain/process/DispatchDomain.ts\n\tmodified: src/app/domain/process/DispatchPrDomain.ts\n\tmodified: src/app/domain/process/Expediente.ts\n\tmodified: src/app/domain/process/GenericBehaviorTaskActions.ts\n\tmodified: src/app/domain/process/RequestsForDeferment.ts",
|
||||
"changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/models/beast-orm.ts\n\tmodified: src/app/models/chatMethod.ts\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/chat/messages/messages.page.html\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/chat/room.service.ts\n\tmodified: src/app/services/functions/file.service.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.html\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.html\n\tmodified: src/app/shared/chat/messages/messages.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas/diplomas.page.html",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user