mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
serializing url
This commit is contained in:
@@ -8,10 +8,11 @@ import { ExpedienteTaskPipe } from './expediente-task.pipe';
|
|||||||
import { ParticipantsPipe } from './participants.pipe';
|
import { ParticipantsPipe } from './participants.pipe';
|
||||||
import { SafehtmlPipe } from './safehtml.pipe';
|
import { SafehtmlPipe } from './safehtml.pipe';
|
||||||
import { EventoApprovePipe } from './evento-approve.pipe';
|
import { EventoApprovePipe } from './evento-approve.pipe';
|
||||||
|
import { SafePipe } from './safe.pipe';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe, ExpedienteTaskPipe, ParticipantsPipe, SafehtmlPipe, EventoApprovePipe],
|
declarations: [FilterPipe, SearchDocumentPipe, CustomTaskPipe, EventPipe, PublicationPipe, ExpedienteTaskPipe, ParticipantsPipe, SafehtmlPipe, EventoApprovePipe, SafePipe],
|
||||||
exports: [FilterPipe, SafehtmlPipe],
|
exports: [FilterPipe, SafehtmlPipe],
|
||||||
imports: []
|
imports: []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { SafePipe } from './safe.pipe';
|
||||||
|
|
||||||
|
describe('SafePipe', () => {
|
||||||
|
it('create an instance', () => {
|
||||||
|
const pipe = new SafePipe();
|
||||||
|
expect(pipe).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
@Pipe({
|
||||||
|
name: 'safe'
|
||||||
|
})
|
||||||
|
export class SafePipe implements PipeTransform {
|
||||||
|
constructor(private sanitizer: DomSanitizer) { }
|
||||||
|
|
||||||
|
transform(url: string): SafeUrl {
|
||||||
|
return this.sanitizer.bypassSecurityTrustUrl(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -66,8 +66,6 @@
|
|||||||
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.Base64">
|
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.Base64">
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { ok, err, Result } from 'neverthrow';
|
import { ok, err, Result } from 'neverthrow';
|
||||||
import { ObjectMergeNotification } from 'src/app/services/socket-connection-mcr.service';
|
import { ObjectMergeNotification } from 'src/app/services/socket-connection-mcr.service';
|
||||||
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
|
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
|
||||||
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
|
||||||
const objectMergeNotification = new ObjectMergeNotification()
|
const objectMergeNotification = new ObjectMergeNotification()
|
||||||
|
|
||||||
@@ -16,7 +17,12 @@ export type IOUploadError = "noConnection" | "slow"
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class UploadStreamingService {
|
export class UploadStreamingService {
|
||||||
constructor( private CMAPIService: CMAPIService,) { }
|
constructor(
|
||||||
|
private CMAPIService: CMAPIService,
|
||||||
|
private sanitizer: DomSanitizer
|
||||||
|
) {
|
||||||
|
window["sanitizer"] = this.sanitizer
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class UploadFileUseCase {
|
class UploadFileUseCase {
|
||||||
@@ -109,6 +115,8 @@ export class PublicationAttachmentEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fixFileBase64() {
|
fixFileBase64() {
|
||||||
|
//const sanitizer : DomSanitizer = window["sanitizer"]
|
||||||
|
|
||||||
if(this.FileType == 'image' ) {
|
if(this.FileType == 'image' ) {
|
||||||
if(!this.Base64.startsWith('data:')) {
|
if(!this.Base64.startsWith('data:')) {
|
||||||
this.url = 'data:image/jpg;base64,' + this.Base64
|
this.url = 'data:image/jpg;base64,' + this.Base64
|
||||||
|
|||||||
Reference in New Issue
Block a user