From a16873f1a11c7c499edf4aab4e80dfec1d5c798d Mon Sep 17 00:00:00 2001 From: Pipicz Petra Date: Mon, 20 Jul 2026 16:41:55 +0200 Subject: [PATCH] feat(generated-contents): add condition: if tags or date are not available, the chips not appear --- .../content-card/content-card.component.html | 6 +- .../content-hero/content-hero.component.html | 56 +++++++++++-------- .../pages/list-page/list-page.component.html | 32 ++++++----- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/projects/demo/src/app/components/content-card/content-card.component.html b/projects/demo/src/app/components/content-card/content-card.component.html index 8e95fcaf..500fe733 100644 --- a/projects/demo/src/app/components/content-card/content-card.component.html +++ b/projects/demo/src/app/components/content-card/content-card.component.html @@ -10,7 +10,7 @@ @if (data.image?.imageUrl) {
@if (data.image?.state) { - + } - @if (data.date || data.tags) { + @if (data.date || (data.tags?.length ?? 0) > 0) {
@@ -62,7 +62,7 @@

{{ data. @if (data.description) {
} diff --git a/projects/demo/src/app/components/content-hero/content-hero.component.html b/projects/demo/src/app/components/content-hero/content-hero.component.html index 3d148bde..c705f5f5 100644 --- a/projects/demo/src/app/components/content-hero/content-hero.component.html +++ b/projects/demo/src/app/components/content-hero/content-hero.component.html @@ -7,40 +7,52 @@

- -
- - - {{ heroData().date }} - - @for (tag of heroData().tags; track $index) { - - {{ typeof tag === "string" ? tag : tag.title }} +
+ @if (heroData().date || (heroData().tags?.length ?? 0) > 0) { + + + {{ heroData().date }} - } - + @for (tag of heroData().tags; track $index) { + + {{ typeof tag === "string" ? tag : tag.title }} + + } + + }

{{ heroData().title }}

- -
-
-
- - - + @if (heroData().writtenBy) { +
+
+
+ + + -
- {{ heroData().writtenBy }} +
+ {{ heroData().writtenBy }} +
- -
+ }
diff --git a/projects/demo/src/app/pages/list-page/list-page.component.html b/projects/demo/src/app/pages/list-page/list-page.component.html index c1160569..f52a0820 100644 --- a/projects/demo/src/app/pages/list-page/list-page.component.html +++ b/projects/demo/src/app/pages/list-page/list-page.component.html @@ -1,23 +1,25 @@
-
- - - @for (tag of availableTags(); track tag) { - - } - -
+ @for (tag of availableTags(); track tag) { + + } + +
+ }
@for (contentData of paginatedContentDatas(); track $index) {