mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
merge
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
>
|
||||
|
||||
<div class="attach-title-item">
|
||||
{{LoadedDocument.Assunto}}
|
||||
{{LoadedDocument.Assunto || 'Sem título'}}
|
||||
</div>
|
||||
<div class="d-flex justify-between" style="justify-content: space-between">
|
||||
<span class="span-left">{{ LoadedDocument.Sender }}</span>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let attachment of loadedAttachments">
|
||||
<ion-label>
|
||||
<h4 class="attach-title-item">{{attachment.Description}}</h4>
|
||||
<h4 class="attach-title-item">{{attachment.Description || 'Sem título'}}</h4>
|
||||
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd-MM-yyyy' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<ion-item *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" class="ion-no-margin ion-no-padding">
|
||||
<ion-label class="width-100 d-flex " (click)="docIndex(i);LoadDocumentDetails()">
|
||||
<p class="flex-grow-1" >
|
||||
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
|
||||
<span class="attach-title-item d-block">{{attach.SourceName || 'Sem título'}}</span>
|
||||
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
<div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}} flex-column" >
|
||||
|
||||
<div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
|
||||
<span >Hoje, </span> {{ timelineDate }}
|
||||
<span >Hoje, </span> {{ todayDateFormat() }}
|
||||
</div>
|
||||
|
||||
<div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" >
|
||||
|
||||
@@ -62,6 +62,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
contacts: EventPerson[]
|
||||
|
||||
todayDateFormated: string;
|
||||
|
||||
setView(view: CalendarView) {
|
||||
this.view = view;
|
||||
}
|
||||
@@ -1206,6 +1208,11 @@ export class AgendaPage implements OnInit {
|
||||
return true
|
||||
}
|
||||
|
||||
todayDateFormat() {
|
||||
this.todayDateFormated = momentG(new Date(), 'dd MMMM');
|
||||
return this.todayDateFormated;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function endOfMonth(myDate) {
|
||||
|
||||
@@ -95,7 +95,8 @@
|
||||
<ion-item *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" class="ion-no-margin ion-no-padding">
|
||||
<ion-label class="width-100 d-flex " (click)="docIndex(i);LoadDocumentDetails()">
|
||||
<p class="flex-grow-1" >
|
||||
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
|
||||
<span class="attach-title-item d-block">{{attach.SourceName || 'Sem título'}}</span>
|
||||
|
||||
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ export class ViewEventPage implements OnInit {
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
|
||||
console.log('Loaded Event', res)
|
||||
res = this.dateService.fixDate(res as any)
|
||||
this.loadedEvent = res;
|
||||
this.setTimeZone()
|
||||
@@ -217,7 +218,7 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
if(this.CalendarId) {
|
||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||
|
||||
console.log('Loaded Event', res)
|
||||
/* const div = document.createElement("div")
|
||||
div.innerHTML = res.Body.Text
|
||||
res.Body.Text = div.innerText */
|
||||
|
||||
@@ -1151,7 +1151,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async openFile(pdfString, filename, type) {
|
||||
const modal = await this.modalController.create({
|
||||
/* const modal = await this.modalController.create({
|
||||
component: ViewDocumentSecondOptionsPage,
|
||||
componentProps: {
|
||||
fileUrl: pdfString,
|
||||
@@ -1159,8 +1159,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
/* const blob = this.b64toBlob(pdfString, type)
|
||||
await modal.present(); */
|
||||
const blob = this.b64toBlob(pdfString, type)
|
||||
let pathFile = ''
|
||||
const fileName = filename
|
||||
const contentFile = blob
|
||||
@@ -1170,17 +1170,23 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
pathFile = this.file.externalRootDirectory
|
||||
}
|
||||
|
||||
console.log('file data', pdfString)
|
||||
console.log(pathFile)
|
||||
|
||||
let removePre = this.removeTextBeforeSlash(pdfString,',')
|
||||
console.log('file data remove ', removePre)
|
||||
|
||||
await Filesystem.writeFile({
|
||||
path: fileName,
|
||||
data: pdfString,
|
||||
directory: Directory.Data,
|
||||
data: removePre,
|
||||
directory: Directory.Cache,
|
||||
}).then((dir) => {
|
||||
console.log('DIR ', dir)
|
||||
this.fileOpener
|
||||
.open(dir.uri, type)
|
||||
.then(() => console.log())
|
||||
.catch(e => console.error(e))
|
||||
}); */
|
||||
});
|
||||
}
|
||||
|
||||
downloadFileMsg(msg: MessageService) {
|
||||
@@ -1317,6 +1323,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
reject(error);
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
removeTextBeforeSlash(inputString, controlString) {
|
||||
if (inputString.includes(controlString)) {
|
||||
const parts = inputString.split(controlString);
|
||||
return parts.length > 1 ? parts[1] : inputString;
|
||||
} else {
|
||||
return inputString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -848,7 +848,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
console.log('ios add file ')
|
||||
|
||||
const resultt = await FilePicker.pickFiles({
|
||||
types: ['application/pdf'],
|
||||
types: ['application/pdf', 'application/doc', 'application/docx','application/xls', 'application/xlsx', 'application/ppt',
|
||||
'application/pptx', 'application/txt'],
|
||||
multiple: false,
|
||||
readData: true,
|
||||
});
|
||||
@@ -856,6 +857,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
console.log('RESULT', resultt.files[0].data)
|
||||
|
||||
const blobb = this.fileService.base64toBlob(resultt.files[0].data, resultt.files[0].mimeType)
|
||||
const blob = new Blob([resultt.files[0].data], {type: resultt.files[0].mimeType});
|
||||
|
||||
const formDataa = new FormData();
|
||||
formDataa.append('blobFile', blobb);
|
||||
@@ -1109,7 +1111,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
console.log('url while open ',pdfString)
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
/* const modal = await this.modalController.create({
|
||||
component: ViewDocumentSecondOptionsPage,
|
||||
componentProps: {
|
||||
fileUrl: pdfString,
|
||||
@@ -1119,6 +1121,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
await modal.present();
|
||||
/*
|
||||
await modal.present(); */
|
||||
|
||||
var blob = new Blob([pdfString], { type: 'application/pdf' });
|
||||
|
||||
console.log('blob blob', blob)
|
||||
@@ -1147,7 +1151,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
path: fileName,
|
||||
data: removePre,
|
||||
directory: Directory.Cache,
|
||||
encoding: Encoding.UTF8
|
||||
}).then((dir) => {
|
||||
console.log('DIR ', dir)
|
||||
this.fileOpener
|
||||
@@ -1156,7 +1159,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
.catch(e => console.error(e))
|
||||
}).catch((error) => {
|
||||
console.log('error writing the file', error)
|
||||
}); */
|
||||
});
|
||||
}
|
||||
|
||||
removeTextBeforeSlash(inputString, controlString) {
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@
|
||||
(click)="viewDocument(document.SourceId, document.ApplicationId)"
|
||||
class="width-100 d-block list">
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.SourceName}}</span>
|
||||
<span class="attach-title-item">{{document.SourceName || 'Sem título'}}</span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 8"> Correspondencia </span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 386"> AccoesPresidenciais </span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 361 "> ArquivoDespachoElect </span>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
*ngFor="let attachment of loadedAttachments"
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
<ion-label>
|
||||
<p class="attach-title-item d-block">{{attachment.Description}}</p>
|
||||
<p class="attach-title-item d-block">{{attachment.Description || 'Sem título'}}</p>
|
||||
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right">{{ attachment.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
@@ -209,36 +209,31 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;
|
||||
this.capturedImageTitle = 'foto';
|
||||
if (this.fileSizeToMB(capturedImage.base64String.length) <= 20) {
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
this.capturedImage,
|
||||
800, // maxWidth
|
||||
800, // maxHeight
|
||||
0.9 // quality
|
||||
).then((picture) => {
|
||||
console.log('take picture', this.removeTextBeforeSlash(picture, ','),)
|
||||
this.filecontent = true;
|
||||
this.photoOrVideo = false;
|
||||
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: this.removeTextBeforeSlash(picture, ','),
|
||||
extension: capturedImage.format,
|
||||
OriginalFileName: "image",
|
||||
FileType: 'image'
|
||||
}
|
||||
)
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
this.capturedImage,
|
||||
800, // maxWidth
|
||||
800, // maxHeight
|
||||
0.9 // quality
|
||||
).then((picture) => {
|
||||
console.log('take picture', this.removeTextBeforeSlash(picture, ','),)
|
||||
this.filecontent = true;
|
||||
this.photoOrVideo = false;
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: this.removeTextBeforeSlash(picture, ','),
|
||||
extension: capturedImage.format,
|
||||
OriginalFileName: "image",
|
||||
FileType: 'image'
|
||||
}
|
||||
)
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
if (this.PublicationFromMvService.form.Files.length === 0)
|
||||
this.filesSizeSum = 0
|
||||
});
|
||||
|
||||
this.httpErrorHandle.validationMessagge('filessize');
|
||||
}
|
||||
}
|
||||
|
||||
async laodPicture() {
|
||||
@@ -271,26 +266,19 @@ export class NewPublicationPage implements OnInit {
|
||||
console.log('video record', data)
|
||||
data.forEach(async element => {
|
||||
this.filesSizeSum = this.filesSizeSum + element.size
|
||||
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
||||
|
||||
try {
|
||||
if (this.platform.is('ios')) {
|
||||
this.recordevideoIos(element.fullPath, element)
|
||||
} else {
|
||||
this.recordVideoAndroid(element.fullPath, element)
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Unable to write file', e);
|
||||
}
|
||||
|
||||
// element.size
|
||||
try {
|
||||
if (this.platform.is('ios')) {
|
||||
this.recordevideoIos(element.fullPath, element)
|
||||
} else {
|
||||
if (this.PublicationFromMvService.form.Files.length === 0)
|
||||
this.filesSizeSum = 0
|
||||
|
||||
this.httpErrorHandle.validationMessagge('filessize')
|
||||
this.recordVideoAndroid(element.fullPath, element)
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Unable to write file', e);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('record video error: ', error)
|
||||
@@ -616,41 +604,41 @@ export class NewPublicationPage implements OnInit {
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image' || this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||
let resultUrl = decodeURIComponent(element.url);
|
||||
|
||||
if(this.platform.is('ios')) {
|
||||
if (this.platform.is('ios')) {
|
||||
const stringGerada = this.gerarStringAleatoria();
|
||||
console.log(stringGerada);
|
||||
this.shareContentIso(resultUrl,FileExtension,stringGerada)
|
||||
console.log(stringGerada);
|
||||
this.shareContentIso(resultUrl, FileExtension, stringGerada)
|
||||
} else {
|
||||
this.shareContentAndroid(resultUrl,FileExtension)
|
||||
this.shareContentAndroid(resultUrl, FileExtension)
|
||||
}
|
||||
|
||||
/*
|
||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||
let fileObject;
|
||||
try {
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||
fileObject = {
|
||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
/*
|
||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||
let fileObject;
|
||||
try {
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||
fileObject = {
|
||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
|
||||
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||
fileObject = {
|
||||
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||
fileObject = {
|
||||
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
|
||||
}
|
||||
console.log('shared base', content.data)
|
||||
}
|
||||
console.log('shared base', content.data)
|
||||
|
||||
this.seletedContent.push(fileObject)
|
||||
} catch (error) {
|
||||
console.log('error shared filesystem', error)
|
||||
}
|
||||
this.seletedContent.push(fileObject)
|
||||
} catch (error) {
|
||||
console.log('error shared filesystem', error)
|
||||
}
|
||||
|
||||
}) */
|
||||
}) */
|
||||
} else {
|
||||
this.httpErrorHandle.validationMessagge('filetype');
|
||||
}
|
||||
@@ -768,7 +756,7 @@ console.log(stringGerada);
|
||||
|
||||
}
|
||||
|
||||
loadVideoAndroid(resultUrl,element) {
|
||||
loadVideoAndroid(resultUrl, element) {
|
||||
Filesystem.readFile({ path: resultUrl })
|
||||
|
||||
.then(async (content) => {
|
||||
@@ -809,7 +797,7 @@ console.log(stringGerada);
|
||||
|
||||
}
|
||||
|
||||
gerarStringAleatoria() {
|
||||
gerarStringAleatoria() {
|
||||
const caracteres = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
let stringAleatoria = '';
|
||||
|
||||
@@ -821,7 +809,7 @@ console.log(stringGerada);
|
||||
return stringAleatoria;
|
||||
}
|
||||
|
||||
async shareContentIso(fullPath,FileExtension,filename) {
|
||||
async shareContentIso(fullPath, FileExtension, filename) {
|
||||
try {
|
||||
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||
@@ -829,11 +817,11 @@ console.log(stringGerada);
|
||||
Filesystem.readFile({ path: fullPath }).then(async (content) => {
|
||||
let fileObject;
|
||||
try {
|
||||
fileObject = {
|
||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
fileObject = {
|
||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
console.log('shared base', content.data)
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(fileObject)
|
||||
@@ -848,13 +836,13 @@ console.log(stringGerada);
|
||||
path: '',
|
||||
});
|
||||
|
||||
let fileObject ={};
|
||||
this.videoconvertService.convertVideo(fullPath,directory.uri,filename,'mp4').then(async () => {
|
||||
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4`})
|
||||
let fileObject = {};
|
||||
this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => {
|
||||
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` })
|
||||
|
||||
.then(async (content) => {
|
||||
console.log(content.data)
|
||||
this.filecontent = true;
|
||||
.then(async (content) => {
|
||||
console.log(content.data)
|
||||
this.filecontent = true;
|
||||
/* fileObject = {
|
||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: 'mp4',
|
||||
@@ -883,26 +871,27 @@ console.log(stringGerada);
|
||||
console.log('delete file',value)
|
||||
fileObject ={};
|
||||
})
|
||||
})
|
||||
.catch((erro) => console.error('read converted video erro ', erro));
|
||||
.catch((erro) => console.error('read converted video erro ', erro));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.log('record video ios erro, ', error)
|
||||
console.log('record video ios erro, ', error)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shareContentAndroid(resultUrl,FileExtension) {
|
||||
|
||||
shareContentAndroid(resultUrl, FileExtension) {
|
||||
|
||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||
let fileObject;
|
||||
try {
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||
fileObject = {
|
||||
FileBase64: 'data:image/jpeg;base64,' +this.removeTextBeforeSlash(content.data, ','),
|
||||
FileBase64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
src="{{'data:image/jpg;base64,' + files.FileBase64}}">
|
||||
|
||||
<video *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
|
||||
webkit-playsinline="webkit-playsinline" (play)="StopvideoService.registerVideoWithEvent($event)" >
|
||||
playsinline webkit-playsinline="webkit-playsinline" (play)="StopvideoService.registerVideoWithEvent($event)" >
|
||||
<source [src]="files.FileBase64" type="video/mp4">
|
||||
</video>
|
||||
|
||||
|
||||
+20
-2
@@ -56,14 +56,32 @@ ion-toolbar {
|
||||
|
||||
.post-img {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
height: 100%;
|
||||
|
||||
max-height: 400px;
|
||||
min-height: 350px;
|
||||
min-width: 350px;
|
||||
margin: 0 auto;
|
||||
border-radius: 0px !important;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.post-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 400px;
|
||||
min-height: 350px;
|
||||
min-width: 350px;
|
||||
margin: 0 auto;
|
||||
border-radius: 0px !important;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
height: 420px;
|
||||
}
|
||||
.post-img img {
|
||||
height: 100%;
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
[lazyLoad]="'data:image/jpg;base64,' + files.FileBase64">
|
||||
|
||||
<video #videoElement [appVisibility]="onVisibilityChange" *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
|
||||
webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)" (click)="preventVideoPlay($event)">
|
||||
<source [src]="files.FileBase64" type="video/mp4">
|
||||
playsinline webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)" (click)="preventVideoPlay($event)">
|
||||
<source [src]="files.FileBase64" type="video/mp4" >
|
||||
</video>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -446,6 +446,8 @@ export class MessageService {
|
||||
|
||||
this.downloadLoader = true;
|
||||
let downloadFile = "";
|
||||
let downloadUrl = "";
|
||||
|
||||
this.AttachmentsService.downloadFile(this.file.guid).subscribe(async (event) => {
|
||||
|
||||
console.log('download file',event)
|
||||
@@ -456,10 +458,10 @@ export class MessageService {
|
||||
if (this.file.type == "application/img") {
|
||||
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||
} else if (this.file.type != "application/img") {
|
||||
downloadFile = event.url
|
||||
/*
|
||||
let */
|
||||
/* downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); */
|
||||
|
||||
|
||||
downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||
downloadUrl = event.url
|
||||
console.log('downloaded file', downloadFile)
|
||||
console.log('event body downloaded file', event.url)
|
||||
|
||||
@@ -471,7 +473,8 @@ export class MessageService {
|
||||
title: this.attachments[0].title,
|
||||
title_link: downloadFile,
|
||||
title_link_download: this.attachments[0].title_link_download,
|
||||
ts: this.attachments[0].ts
|
||||
ts: this.attachments[0].ts,
|
||||
attachmentsUrl: downloadUrl
|
||||
}
|
||||
|
||||
// save the changes to the storage
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
*ngFor="let attachment of loadedAttachments"
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
<ion-label>
|
||||
<p class="attach-title-item d-block">{{attachment.Description}}</p>
|
||||
<p class="attach-title-item d-block">{{attachment.Description || 'Sem título'}}</p>
|
||||
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right">{{ attachment.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
class="ion-no-margin ion-no-padding pa-0">
|
||||
<ion-label class="width-100 d-flex align-center">
|
||||
<p class="flex-grow-1 cursor-pointer" (click)="docIndex(i);LoadDocumentDetails()">
|
||||
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
|
||||
<span class="attach-title-item d-block">{{attach.SourceName || 'Sem título'}}</span>
|
||||
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -889,7 +889,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
fileBase64 = await this._getBase64(file)
|
||||
|
||||
formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
formData.append('blobFile', file);
|
||||
}
|
||||
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
@@ -1023,11 +1023,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
|
||||
downloadFileFromBrowser(fileName: string, data: any): void {
|
||||
const linkSource = data;
|
||||
const downloadLink = document.createElement("a");
|
||||
downloadLink.href = linkSource;
|
||||
downloadLink.download = fileName;
|
||||
downloadLink.click();
|
||||
const link = document.createElement("a")
|
||||
link.href = `data:${data.type}';base64,${data.image_url}`;
|
||||
link.download = fileName
|
||||
link.click()
|
||||
|
||||
link.remove()
|
||||
}
|
||||
|
||||
b64toBlob(b64Data, contentType) {
|
||||
@@ -1109,10 +1110,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].title, msg.attachments[0])
|
||||
}
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
||||
this.openFile(msg.attachments.image_url, msg.attachments[0].title, msg.file.type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
import { ChangeDetectorRef } from '@angular/core';
|
||||
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
@@ -702,7 +703,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
|
||||
console.log('FILE CHAT',file)
|
||||
console.log('FILE CHAT', file)
|
||||
|
||||
const imageBase64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
const blob = this.dataURItoBlob(imageBase64)
|
||||
@@ -851,7 +852,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
file.type == 'application/xls' || file.type == 'application/xlsx' || file.type == 'application/ppt' ||
|
||||
file.type == 'application/pptx' || file.type == 'application/txt') {
|
||||
|
||||
console.log('FILE', file)
|
||||
console.log('FILE rigth?', file)
|
||||
|
||||
const fileName = file.name
|
||||
|
||||
@@ -876,12 +877,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
/* console.log('add file', fileBase64) */
|
||||
|
||||
} else {
|
||||
console.log('encode data', encodedData)
|
||||
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
fileBase64 = await this._getBase64(file)
|
||||
|
||||
formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
formData.append('blobFile', file);
|
||||
}
|
||||
|
||||
|
||||
@@ -1082,11 +1084,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
downloadFileFromBrowser(fileName: string, data: any): void {
|
||||
const linkSource = data;
|
||||
const downloadLink = document.createElement("a");
|
||||
downloadLink.href = linkSource;
|
||||
downloadLink.download = fileName;
|
||||
downloadLink.click();
|
||||
|
||||
const link = document.createElement("a")
|
||||
link.href = `data:${data.type}';base64,${data.image_url}`;
|
||||
link.download = fileName
|
||||
link.click()
|
||||
|
||||
link.remove()
|
||||
}
|
||||
|
||||
viewDocument(file: any, url?: string) {
|
||||
@@ -1154,12 +1158,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].title, msg.attachments[0],)
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
||||
this.openFile(msg.attachments[0].image_url, msg.attachments[0].title, msg.file.type);
|
||||
// this.downloadFileFromBrowser("file", str)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { HeaderSettingsService } from "src/app/services/header-settings.service"
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { object } from 'zod';
|
||||
import { element } from 'protractor';
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-details',
|
||||
@@ -28,7 +32,8 @@ export class TaskDetailsPage implements OnInit {
|
||||
@Output() viewDocument = new EventEmitter<any>();
|
||||
|
||||
selectedIndex = 0
|
||||
dropButton = true
|
||||
dropButton = true
|
||||
loggeduser: LoginUserRespose;
|
||||
constructor(
|
||||
public ThemeService: ThemeService,
|
||||
public DeviceService: DeviceService,
|
||||
@@ -38,14 +43,19 @@ export class TaskDetailsPage implements OnInit {
|
||||
private HeaderSettingsService: HeaderSettingsService
|
||||
) {
|
||||
this.DeviceService.isDesktop();
|
||||
this.loggeduser = SessionStore.user
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
window['TaskDetailsPage-openExpedientActionsModal']= (taskAction, Document) => {
|
||||
|
||||
this.filterCoverPage();
|
||||
|
||||
window['TaskDetailsPage-openExpedientActionsModal'] = (taskAction, Document) => {
|
||||
this.openExpedientActionsModal(taskAction, Document)
|
||||
}
|
||||
|
||||
window['TaskDetailsPage-openBookMeetingModal']= (Document) => {
|
||||
window['TaskDetailsPage-openBookMeetingModal'] = (Document) => {
|
||||
this.openBookMeetingModal(Document)
|
||||
}
|
||||
}
|
||||
@@ -67,12 +77,12 @@ export class TaskDetailsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async openExpedientActionsModal( taskAction: any, Document) {
|
||||
async openExpedientActionsModal(taskAction: any, Document) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
// check passing
|
||||
@@ -84,7 +94,7 @@ export class TaskDetailsPage implements OnInit {
|
||||
task: this.fulltask, // check
|
||||
document: Document, // nope
|
||||
aplicationId: Document.ApplicationId || Document.ApplicationID, // check
|
||||
applicationId: Document.ApplicationId || Document.ApplicationID,
|
||||
applicationId: Document.ApplicationId || Document.ApplicationID,
|
||||
docId: Document.docId || Document.DocId,
|
||||
createProcessFromFile: true,
|
||||
},
|
||||
@@ -92,7 +102,7 @@ export class TaskDetailsPage implements OnInit {
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then(
|
||||
async(res) => {}
|
||||
async (res) => { }
|
||||
, (error) => {
|
||||
console.log(error)
|
||||
}
|
||||
@@ -105,9 +115,9 @@ export class TaskDetailsPage implements OnInit {
|
||||
async openBookMeetingModal(Document) {
|
||||
//console.log('this.Document----------', this.Document)
|
||||
let classs;
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
|
||||
@@ -139,4 +149,17 @@ export class TaskDetailsPage implements OnInit {
|
||||
onOndestroy() {
|
||||
this.HeaderSettingsService.hideHeader == false
|
||||
}
|
||||
|
||||
filterCoverPage() {
|
||||
/* Method that filter the cover page of PR expediente */
|
||||
if (this.loggeduser.Profile == 'PR' && this.task.WorkflowName == "Expediente") {
|
||||
try {
|
||||
console.log('Merge array 1', this.mergedArray)
|
||||
this.mergedArray = this.mergedArray.filter(element => element!.DocTypeId != 99999992);
|
||||
console.log('Merge array 2', this.mergedArray)
|
||||
} catch (error) {
|
||||
console.info('error filtering cover page', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
" >
|
||||
{{ PublicationHolderService.count }}%
|
||||
<span style="padding-right: 7px" *ngIf="PublicationHolderService.PublicationFormMV?.[0]?.retry" (click)="PublicationHolderService.PublicationFormMV?.[0]?.retryFunction()" ><ion-icon src="assets/images/retry-svgrepo-com.svg" > </ion-icon></span>
|
||||
<span *ngIf="!PublicationHolderService.PublicationFormMV?.[0]?.retry">{{ PublicationHolderService.count }}%</span>
|
||||
<span style="padding-right: 12px" *ngIf="PublicationHolderService.PublicationFormMV?.[0]?.retry" (click)="PublicationHolderService.PublicationFormMV?.[0]?.retryFunction()" ><ion-icon src="assets/images/retry-svgrepo-com.svg" > </ion-icon></span>
|
||||
<span style="padding-right: 7px" *ngIf="PublicationHolderService.PublicationFormMV?.[0]?.retry" (click)="PublicationHolderService.remove(PublicationHolderService.PublicationFormMV?.[0]?.id)">X</span>
|
||||
</div>
|
||||
<!-- <div *ngIf="this.NotificationHolderService.notificationList.length > 0" class="icon-badge">{{NotificationHolderService.notificationList.length}}</div> -->
|
||||
@@ -175,8 +175,8 @@
|
||||
<div class="header-btns d-flex">
|
||||
|
||||
<div *ngIf="PublicationHolderService.count != 0" style="color: black" >
|
||||
{{ PublicationHolderService.count }}%
|
||||
<span style="padding-right: 7px" *ngIf="PublicationHolderService.PublicationFormMV?.[0]?.retry" (click)="PublicationHolderService.PublicationFormMV?.[0]?.retryFunction()" ><ion-icon src="assets/images/retry-svgrepo-com.svg" > </ion-icon></span>
|
||||
<span *ngIf="!PublicationHolderService.PublicationFormMV?.[0]?.retry">{{ PublicationHolderService.count }}%</span>
|
||||
<span style="padding-right: 12px" *ngIf="PublicationHolderService.PublicationFormMV?.[0]?.retry" (click)="PublicationHolderService.PublicationFormMV?.[0]?.retryFunction()" ><ion-icon src="assets/images/retry-svgrepo-com.svg" > </ion-icon></span>
|
||||
<span style="padding-right: 7px" *ngIf="PublicationHolderService.PublicationFormMV?.[0]?.retry" (click)="PublicationHolderService.remove(PublicationHolderService.PublicationFormMV?.[0]?.id)">X</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<swiper-container [config]="swiperThumbsConfig" [modules]="swiperModules" [speed]=400 navigation="true" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||
<swiper-slide *ngFor="let files of publication.Files let k = index" class="centered-slide">
|
||||
<div class="cool">
|
||||
<div (click)="viewPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||
<div >
|
||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img cursor-pointer"
|
||||
[lazyLoad]="'data:image/jpg;base64,' + files.FileBase64">
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
|
||||
export const environment: Environment = DevDev;
|
||||
export const environment: Environment = oaprProd;
|
||||
|
||||
@@ -4,4 +4,4 @@ import { environment as oaprDev } from './suport/oapr'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
|
||||
export const environment: Environment = DevDev
|
||||
export const environment: Environment = oaprDev
|
||||
|
||||
Reference in New Issue
Block a user