From d6774dbb6c3ee864558568a17b3aa768a7ef495c Mon Sep 17 00:00:00 2001 From: operramon <52449656+operramon@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:19:14 +0100 Subject: [PATCH] [sc-8799] Format summary displayed in resource preview (#1314) * [sc-8799] Format summary displayed in resource preview * Improvement --- .../lib/resources/edit-resource/preview/preview.component.html | 2 +- .../lib/resources/edit-resource/preview/preview.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/common/src/lib/resources/edit-resource/preview/preview.component.html b/libs/common/src/lib/resources/edit-resource/preview/preview.component.html index 875dd0a3f..ed303be15 100644 --- a/libs/common/src/lib/resources/edit-resource/preview/preview.component.html +++ b/libs/common/src/lib/resources/edit-resource/preview/preview.component.html @@ -44,7 +44,7 @@

{{ resource.title }}

{{ 'resource.summary' | translate }}
-

{{ resource.summary || '–' }}

+

{{ 'resource.thumbnail.label' | translate }}
diff --git a/libs/common/src/lib/resources/edit-resource/preview/preview.component.ts b/libs/common/src/lib/resources/edit-resource/preview/preview.component.ts index b4b0e5de7..f01f69ae2 100644 --- a/libs/common/src/lib/resources/edit-resource/preview/preview.component.ts +++ b/libs/common/src/lib/resources/edit-resource/preview/preview.component.ts @@ -83,6 +83,7 @@ export class PreviewComponent implements OnInit, OnDestroy { ); extraMetadata = this.resource.pipe(map((resource) => JSON.stringify(resource.extra?.metadata, null, 2))); extraMetadataFullscreen = false; + summary = this.resource.pipe(map((resource) => (resource.summary || '').replace(/\n/g, '
'))); private _noField = new ReplaySubject(1); noField: Observable = this._noField.asObservable();