diff --git a/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html b/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html index d34373ba16..95ea0aa6a2 100644 --- a/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +++ b/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html @@ -8,7 +8,7 @@

diff --git a/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html b/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html index 200d78db49..42a706a54b 100644 --- a/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html +++ b/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html @@ -12,7 +12,7 @@ alt="thumbnail" loading="lazy" (load)="setObjectFit()" - [src]="imgUrl | safe: 'url'" + [src]="imgUrl" (error)="useFallback()" /> diff --git a/libs/util/shared/src/index.ts b/libs/util/shared/src/index.ts index d61403168d..7fa55edceb 100644 --- a/libs/util/shared/src/index.ts +++ b/libs/util/shared/src/index.ts @@ -2,3 +2,4 @@ export * from './lib/util-shared.module' export * from './lib/services' export * from './lib/utils/' export * from './lib/links' +export * from './lib/image-fallback.directive' diff --git a/libs/util/shared/src/lib/pipes/SafePipe.ts b/libs/util/shared/src/lib/pipes/SafePipe.ts deleted file mode 100644 index 82244ad345..0000000000 --- a/libs/util/shared/src/lib/pipes/SafePipe.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core' -import { - DomSanitizer, - SafeHtml, - SafeStyle, - SafeScript, - SafeUrl, - SafeResourceUrl, -} from '@angular/platform-browser' - -@Pipe({ - name: 'safe', -}) -export class SafePipe implements PipeTransform { - constructor(protected sanitizer: DomSanitizer) {} - - public transform( - value: any, - type: string - ): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl { - switch (type) { - case 'html': - return this.sanitizer.bypassSecurityTrustHtml(value) - case 'style': - return this.sanitizer.bypassSecurityTrustStyle(value) - case 'script': - return this.sanitizer.bypassSecurityTrustScript(value) - case 'url': - return this.sanitizer.bypassSecurityTrustUrl(value) - case 'resourceUrl': - return this.sanitizer.bypassSecurityTrustResourceUrl(value) - default: - throw new Error(`Invalid safe type specified: ${type}`) - } - } -} diff --git a/libs/util/shared/src/lib/util-shared.module.ts b/libs/util/shared/src/lib/util-shared.module.ts index cd2e1233b2..5f64ef44fc 100644 --- a/libs/util/shared/src/lib/util-shared.module.ts +++ b/libs/util/shared/src/lib/util-shared.module.ts @@ -1,11 +1,10 @@ import { NgModule } from '@angular/core' -import { SafePipe } from './pipes/SafePipe' import { CommonModule } from '@angular/common' import { ImageFallbackDirective } from './image-fallback.directive' @NgModule({ - declarations: [SafePipe, ImageFallbackDirective], + declarations: [ImageFallbackDirective], imports: [CommonModule], - exports: [SafePipe, ImageFallbackDirective], + exports: [ImageFallbackDirective], }) export class UtilSharedModule {}