From 7a1d31952f733644c82570e20c8aef11f3aeed8d Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Wed, 23 Aug 2023 10:15:00 +0200 Subject: [PATCH] (feat): make abstract links as hyperlinks --- .../lib/metadata-info/linkify.directive.ts | 11 ++- .../metadata-info.component.html | 44 +++--------- .../metadata-info.component.spec.ts | 71 ++++++++++++++++++- .../metadata-info/metadata-info.component.ts | 7 ++ 4 files changed, 90 insertions(+), 43 deletions(-) diff --git a/libs/ui/elements/src/lib/metadata-info/linkify.directive.ts b/libs/ui/elements/src/lib/metadata-info/linkify.directive.ts index 3ef699bad1..e213400499 100644 --- a/libs/ui/elements/src/lib/metadata-info/linkify.directive.ts +++ b/libs/ui/elements/src/lib/metadata-info/linkify.directive.ts @@ -1,16 +1,13 @@ /* eslint-disable @angular-eslint/directive-selector */ -import { Directive, ElementRef, Renderer2, OnInit } from '@angular/core' +import { Directive, ElementRef, Renderer2, AfterViewInit } from '@angular/core' @Directive({ selector: '[gnUiLinkify]', }) -export class GnUiLinkifyDirective implements OnInit { +export class GnUiLinkifyDirective implements AfterViewInit { constructor(private el: ElementRef, private renderer: Renderer2) {} - - ngOnInit() { - setTimeout(() => { - this.processLinks() - }, 0) + ngAfterViewInit() { + this.processLinks() } private processLinks() { 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 fe1fb2cf6a..49ee82ace6 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 @@ -1,15 +1,9 @@ - + record.metadata.about - + @@ -18,26 +12,16 @@ record.metadata.keywords
+
record.metadata.about
{{ metadata.lineage }}
record.metadata.updatedOn
@@ -58,10 +42,7 @@
record.metadata.sheet