mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
some changes
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<div class="attach-title-item">
|
<div class="attach-title-item">
|
||||||
{{LoadedDocument.Assunto}}
|
{{LoadedDocument.Assunto || 'Sem título'}}
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-between" style="justify-content: space-between">
|
<div class="d-flex justify-between" style="justify-content: space-between">
|
||||||
<span class="span-left">{{ LoadedDocument.Sender }}</span>
|
<span class="span-left">{{ LoadedDocument.Sender }}</span>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item *ngFor="let attachment of loadedAttachments">
|
<ion-item *ngFor="let attachment of loadedAttachments">
|
||||||
<ion-label>
|
<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>
|
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd-MM-yyyy' }}</span></p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</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-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()">
|
<ion-label class="width-100 d-flex " (click)="docIndex(i);LoadDocumentDetails()">
|
||||||
<p class="flex-grow-1" >
|
<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>
|
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -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-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()">
|
<ion-label class="width-100 d-flex " (click)="docIndex(i);LoadDocumentDetails()">
|
||||||
<p class="flex-grow-1" >
|
<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>
|
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||||
|
|
||||||
|
console.log('Loaded Event', res)
|
||||||
res = this.dateService.fixDate(res as any)
|
res = this.dateService.fixDate(res as any)
|
||||||
this.loadedEvent = res;
|
this.loadedEvent = res;
|
||||||
this.setTimeZone()
|
this.setTimeZone()
|
||||||
@@ -217,7 +218,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
if(this.CalendarId) {
|
if(this.CalendarId) {
|
||||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||||
|
console.log('Loaded Event', res)
|
||||||
/* const div = document.createElement("div")
|
/* const div = document.createElement("div")
|
||||||
div.innerHTML = res.Body.Text
|
div.innerHTML = res.Body.Text
|
||||||
res.Body.Text = div.innerText */
|
res.Body.Text = div.innerText */
|
||||||
|
|||||||
+1
-1
@@ -96,7 +96,7 @@
|
|||||||
(click)="viewDocument(document.SourceId, document.ApplicationId)"
|
(click)="viewDocument(document.SourceId, document.ApplicationId)"
|
||||||
class="width-100 d-block list">
|
class="width-100 d-block list">
|
||||||
<p class="d-flex ion-justify-content-between">
|
<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 == 8"> Correspondencia </span>
|
||||||
<span class="app-name" *ngIf="document.ApplicationId == 386"> AccoesPresidenciais </span>
|
<span class="app-name" *ngIf="document.ApplicationId == 386"> AccoesPresidenciais </span>
|
||||||
<span class="app-name" *ngIf="document.ApplicationId == 361 "> ArquivoDespachoElect </span>
|
<span class="app-name" *ngIf="document.ApplicationId == 361 "> ArquivoDespachoElect </span>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
*ngFor="let attachment of loadedAttachments"
|
*ngFor="let attachment of loadedAttachments"
|
||||||
(click)="viewDocument(attachment.DocId, attachment)">
|
(click)="viewDocument(attachment.DocId, attachment)">
|
||||||
<ion-label>
|
<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>
|
<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-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;
|
this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;
|
||||||
this.capturedImageTitle = 'foto';
|
this.capturedImageTitle = 'foto';
|
||||||
if (this.fileSizeToMB(capturedImage.base64String.length) <= 20) {
|
if (this.canAddFile(this.fileSizeToMB(capturedImage.base64String.length))) {
|
||||||
const compressedImage = await this.compressImageBase64(
|
const compressedImage = await this.compressImageBase64(
|
||||||
this.capturedImage,
|
this.capturedImage,
|
||||||
800, // maxWidth
|
800, // maxWidth
|
||||||
@@ -207,7 +207,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
let fileObject = {
|
let fileObject = {
|
||||||
FileBase64: this.removeTextBeforeSlash(picture, ','),
|
FileBase64: this.removeTextBeforeSlash(picture, ','),
|
||||||
FileExtension: capturedImage.format,
|
FileExtension: capturedImage.format,
|
||||||
OriginalFileName: 'image'
|
OriginalFileName: 'image',
|
||||||
|
FileSize: this.fileSizeToMB(capturedImage.base64String.length)
|
||||||
}
|
}
|
||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
|
|
||||||
@@ -251,13 +252,13 @@ export class NewPublicationPage implements OnInit {
|
|||||||
console.log('video record', data)
|
console.log('video record', data)
|
||||||
data.forEach(async element => {
|
data.forEach(async element => {
|
||||||
this.filesSizeSum = this.filesSizeSum + element.size
|
this.filesSizeSum = this.filesSizeSum + element.size
|
||||||
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
if (this.canAddFile(this.fileSizeToMB(element.size))) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.platform.is('ios')) {
|
if (this.platform.is('ios')) {
|
||||||
this.recordevideoIos(element.fullPath)
|
this.recordevideoIos(element.fullPath,element.size)
|
||||||
} else {
|
} else {
|
||||||
this.recordVideoAndroid(element.fullPath)
|
this.recordVideoAndroid(element.fullPath,element.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -278,16 +279,16 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadVideo() {
|
async loadVideo() {
|
||||||
const result = await FilePicker.pickMedia ({ multiple: true, });
|
const result = await FilePicker.pickMedia({ multiple: true, });
|
||||||
console.log(result.files)
|
console.log(result.files)
|
||||||
result.files.forEach(async element => {
|
result.files.forEach(async element => {
|
||||||
this.filesSizeSum = this.filesSizeSum + element.size
|
this.filesSizeSum = this.filesSizeSum + element.size
|
||||||
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
if (this.canAddFile( this.fileSizeToMB(element.size))) {
|
||||||
console.log('pass size verificartion')
|
console.log('pass size verificartion')
|
||||||
if (this.checkFileType.checkFileType(element.mimeType) == 'video' && this.platform.is('ios')) {
|
if (this.checkFileType.checkFileType(element.mimeType) == 'video' && this.platform.is('ios')) {
|
||||||
let resultUrl = decodeURIComponent(element.path); console.log('pass type verification ', resultUrl)
|
let resultUrl = decodeURIComponent(element.path); console.log('pass type verification ', resultUrl)
|
||||||
try {
|
try {
|
||||||
this.recordevideoIos(resultUrl)
|
this.recordevideoIos(resultUrl,element.size)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('upload video error: ', error)
|
console.log('upload video error: ', error)
|
||||||
}
|
}
|
||||||
@@ -295,7 +296,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
let resultUrl = decodeURIComponent(element.path);
|
let resultUrl = decodeURIComponent(element.path);
|
||||||
console.log('pass type verification ', resultUrl)
|
console.log('pass type verification ', resultUrl)
|
||||||
try {
|
try {
|
||||||
this.loadVideoAndroid(resultUrl,element)
|
this.loadVideoAndroid(resultUrl, element)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('upload video error: ', error)
|
console.log('upload video error: ', error)
|
||||||
}
|
}
|
||||||
@@ -527,9 +528,9 @@ export class NewPublicationPage implements OnInit {
|
|||||||
window["sharedContent"] = null
|
window["sharedContent"] = null
|
||||||
window["openFolder"] = true
|
window["openFolder"] = true
|
||||||
|
|
||||||
if(window.innerWidth <= 700) {
|
if (window.innerWidth <= 700) {
|
||||||
this.router.navigate(['/home/publications', this.folderId]);
|
this.router.navigate(['/home/publications', this.folderId]);
|
||||||
} else if(window.innerWidth >= 701){
|
} else if (window.innerWidth >= 701) {
|
||||||
let navigationExtras: NavigationExtras = { queryParams: { "folderId": this.folderId, } };
|
let navigationExtras: NavigationExtras = { queryParams: { "folderId": this.folderId, } };
|
||||||
this.router.navigate(['/home/publications']);
|
this.router.navigate(['/home/publications']);
|
||||||
}
|
}
|
||||||
@@ -744,15 +745,15 @@ export class NewPublicationPage implements OnInit {
|
|||||||
if (this.checkFileType.checkFileType(FileExtension) == 'image' || this.checkFileType.checkFileType(FileExtension) == 'video') {
|
if (this.checkFileType.checkFileType(FileExtension) == 'image' || this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||||
let resultUrl = decodeURIComponent(element.url);
|
let resultUrl = decodeURIComponent(element.url);
|
||||||
|
|
||||||
if(this.platform.is('ios')) {
|
if (this.platform.is('ios')) {
|
||||||
const stringGerada = this.gerarStringAleatoria();
|
const stringGerada = this.gerarStringAleatoria();
|
||||||
console.log(stringGerada);
|
console.log(stringGerada);
|
||||||
this.shareContentIso(resultUrl,FileExtension,stringGerada)
|
this.shareContentIso(resultUrl, FileExtension, stringGerada)
|
||||||
} else {
|
} else {
|
||||||
this.shareContentAndroid(resultUrl,FileExtension)
|
this.shareContentAndroid(resultUrl, FileExtension)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||||
let fileObject;
|
let fileObject;
|
||||||
try {
|
try {
|
||||||
@@ -806,7 +807,7 @@ console.log(stringGerada);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async recordevideoIos(fullPath) {
|
async recordevideoIos(fullPath,size) {
|
||||||
console.log('fullpath', fullPath)
|
console.log('fullpath', fullPath)
|
||||||
try {
|
try {
|
||||||
const directory = await Filesystem.getUri({
|
const directory = await Filesystem.getUri({
|
||||||
@@ -815,24 +816,25 @@ console.log(stringGerada);
|
|||||||
});
|
});
|
||||||
|
|
||||||
const stringGerada = this.gerarStringAleatoria();
|
const stringGerada = this.gerarStringAleatoria();
|
||||||
console.log(stringGerada);
|
console.log(stringGerada);
|
||||||
let fileObject ={};
|
let fileObject = {};
|
||||||
this.videoconvertService.convertVideo(fullPath,directory.uri,stringGerada,'mp4').then(async () => {
|
this.videoconvertService.convertVideo(fullPath, directory.uri, stringGerada, 'mp4').then(async () => {
|
||||||
await Filesystem.readFile({ path: `${directory.uri}${stringGerada}.mp4`})
|
await Filesystem.readFile({ path: `${directory.uri}${stringGerada}.mp4` })
|
||||||
|
|
||||||
.then(async (content) => {
|
.then(async (content) => {
|
||||||
this.filecontent = true;
|
this.filecontent = true;
|
||||||
fileObject = {}
|
fileObject = {}
|
||||||
console.log('First clean',fileObject)
|
console.log('First clean', fileObject)
|
||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: 'data:video/mp4;base64,' + content.data,
|
FileBase64: 'data:video/mp4;base64,' + content.data,
|
||||||
FileExtension: 'mp4',
|
FileExtension: 'mp4',
|
||||||
OriginalFileName: stringGerada
|
OriginalFileName: stringGerada,
|
||||||
|
FileSize: this.fileSizeToMB(size)
|
||||||
}
|
}
|
||||||
console.log('what do we have',fileObject)
|
console.log('what do we have', fileObject)
|
||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
console.log('file object 1',fileObject)
|
console.log('file object 1', fileObject)
|
||||||
fileObject ={};
|
fileObject = {};
|
||||||
const deleteSecretFile = async () => {
|
const deleteSecretFile = async () => {
|
||||||
await Filesystem.deleteFile({
|
await Filesystem.deleteFile({
|
||||||
path: `${stringGerada}.mp4`,
|
path: `${stringGerada}.mp4`,
|
||||||
@@ -840,9 +842,9 @@ console.log(stringGerada);
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
await deleteSecretFile().then((value) => {
|
await deleteSecretFile().then((value) => {
|
||||||
console.log('delete file',value)
|
console.log('delete file', value)
|
||||||
fileObject ={};
|
fileObject = {};
|
||||||
console.log('file object 2',fileObject)
|
console.log('file object 2', fileObject)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((erro) => console.error('read converted video erro ', erro));
|
.catch((erro) => console.error('read converted video erro ', erro));
|
||||||
@@ -854,7 +856,7 @@ console.log(stringGerada);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async recordVideoAndroid(fullPath) {
|
async recordVideoAndroid(fullPath,size) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const savedFile = await Filesystem.copy({
|
const savedFile = await Filesystem.copy({
|
||||||
@@ -870,11 +872,12 @@ console.log(stringGerada);
|
|||||||
let fileObject = {
|
let fileObject = {
|
||||||
FileBase64: 'data:video/mp4;base64,' + content.data,
|
FileBase64: 'data:video/mp4;base64,' + content.data,
|
||||||
FileExtension: 'mp4',
|
FileExtension: 'mp4',
|
||||||
OriginalFileName: 'video'
|
OriginalFileName: 'video',
|
||||||
|
FileSize: this.fileSizeToMB(size)
|
||||||
}
|
}
|
||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
})
|
})
|
||||||
.catch((error) => console.error('reade converted video erro ',error));
|
.catch((error) => console.error('reade converted video erro ', error));
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('record video android erro ', error)
|
console.log('record video android erro ', error)
|
||||||
@@ -885,7 +888,7 @@ console.log(stringGerada);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadVideoAndroid(resultUrl,element) {
|
loadVideoAndroid(resultUrl, element) {
|
||||||
Filesystem.readFile({ path: resultUrl })
|
Filesystem.readFile({ path: resultUrl })
|
||||||
|
|
||||||
.then(async (content) => {
|
.then(async (content) => {
|
||||||
@@ -896,13 +899,15 @@ console.log(stringGerada);
|
|||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: 'data:video/mp4;base64,' + content.data,
|
FileBase64: 'data:video/mp4;base64,' + content.data,
|
||||||
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
||||||
OriginalFileName: 'video'
|
OriginalFileName: 'video',
|
||||||
|
FileSize:element.size
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: 'data:image/jpeg;base64,' + content.data,
|
FileBase64: 'data:image/jpeg;base64,' + content.data,
|
||||||
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
||||||
OriginalFileName: 'image'
|
OriginalFileName: 'image',
|
||||||
|
FileSize: this.fileSizeToMB(element.size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -924,7 +929,7 @@ console.log(stringGerada);
|
|||||||
return stringAleatoria;
|
return stringAleatoria;
|
||||||
}
|
}
|
||||||
|
|
||||||
async shareContentIso(fullPath,FileExtension,filename) {
|
async shareContentIso(fullPath, FileExtension, filename) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||||
@@ -951,9 +956,9 @@ console.log(stringGerada);
|
|||||||
path: '',
|
path: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
let fileObject ={};
|
let fileObject = {};
|
||||||
this.videoconvertService.convertVideo(fullPath,directory.uri,filename,'mp4').then(async () => {
|
this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => {
|
||||||
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4`})
|
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` })
|
||||||
|
|
||||||
.then(async (content) => {
|
.then(async (content) => {
|
||||||
console.log(content.data)
|
console.log(content.data)
|
||||||
@@ -969,7 +974,7 @@ console.log(stringGerada);
|
|||||||
OriginalFileName: 'shared',
|
OriginalFileName: 'shared',
|
||||||
}
|
}
|
||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
fileObject ={};
|
fileObject = {};
|
||||||
const deleteSecretFile = async () => {
|
const deleteSecretFile = async () => {
|
||||||
await Filesystem.deleteFile({
|
await Filesystem.deleteFile({
|
||||||
path: `${filename}.mp4`,
|
path: `${filename}.mp4`,
|
||||||
@@ -977,8 +982,8 @@ console.log(stringGerada);
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
deleteSecretFile().then((value) => {
|
deleteSecretFile().then((value) => {
|
||||||
console.log('delete file',value)
|
console.log('delete file', value)
|
||||||
fileObject ={};
|
fileObject = {};
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((erro) => console.error('read converted video erro ', erro));
|
.catch((erro) => console.error('read converted video erro ', erro));
|
||||||
@@ -992,14 +997,14 @@ console.log(stringGerada);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shareContentAndroid(resultUrl,FileExtension) {
|
shareContentAndroid(resultUrl, FileExtension) {
|
||||||
|
|
||||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||||
let fileObject;
|
let fileObject;
|
||||||
try {
|
try {
|
||||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: 'data:image/jpeg;base64,' +this.removeTextBeforeSlash(content.data, ','),
|
FileBase64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||||
FileExtension: FileExtension,
|
FileExtension: FileExtension,
|
||||||
OriginalFileName: 'shared',
|
OriginalFileName: 'shared',
|
||||||
}
|
}
|
||||||
@@ -1023,5 +1028,28 @@ console.log(stringGerada);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canAddFile(fileToAddsize) {
|
||||||
|
console.log('File size to add', fileToAddsize)
|
||||||
|
console.log(this.seletedContent)
|
||||||
|
// Calculate the total size of files in the list
|
||||||
|
var totalSize = this.seletedContent.reduce((total, {FileSize}) => total + FileSize, 0);
|
||||||
|
console.log('Totoal size',totalSize)
|
||||||
|
console.log('fileAddsize',fileToAddsize)
|
||||||
|
// Check if adding the file would exceed the individual file size limit (20 MB)
|
||||||
|
if (fileToAddsize >= 20) {
|
||||||
|
console.log("File size exceeds individual file size limit (20 MB)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if adding the file would exceed the total size limit (20 MB)
|
||||||
|
|
||||||
|
if (totalSize + fileToAddsize >= 20) {
|
||||||
|
console.log("Total file size exceeds total size limit (20 MB)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// If neither condition is met, it's safe to add the file
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
*ngFor="let attachment of loadedAttachments"
|
*ngFor="let attachment of loadedAttachments"
|
||||||
(click)="viewDocument(attachment.DocId, attachment)">
|
(click)="viewDocument(attachment.DocId, attachment)">
|
||||||
<ion-label>
|
<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>
|
<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-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
class="ion-no-margin ion-no-padding pa-0">
|
class="ion-no-margin ion-no-padding pa-0">
|
||||||
<ion-label class="width-100 d-flex align-center">
|
<ion-label class="width-100 d-flex align-center">
|
||||||
<p class="flex-grow-1 cursor-pointer" (click)="docIndex(i);LoadDocumentDetails()">
|
<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>
|
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user