From 67d63cea14db2581132f39ed741bd3ce83926047 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 27 Jun 2025 01:26:06 +0200 Subject: [PATCH 1/4] Fix applies_to rendering --- .../Components/ApplicableToComponent.cshtml | 24 +++++++------------ tests/authoring/Inline/AppliesToRole.fs | 5 +++- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml b/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml index fc4fd0197..e0c239d5f 100644 --- a/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml +++ b/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml @@ -145,14 +145,7 @@ var lifecycleClass = applicability.GetLifeCycleName().ToLowerInvariant().Replace(" ", "-"); - @if (name == "Elastic Stack") - { - @badgeText - } - else - { @name - } @if (applicability.Lifecycle != ProductLifecycle.GenerallyAvailable && badgeText == name) { @@ -160,17 +153,16 @@ } @if (applicability.Version is not null and not AllVersions) { - if (name == "Elastic Stack") - { - if (applicability.Version <= currentStackVersion) + + @if (applicability.Version <= currentStackVersion) + { + @applicability.Version + } + else { - @applicability.Version + @badgeText } - } - else - { - @applicability.Version - } + } diff --git a/tests/authoring/Inline/AppliesToRole.fs b/tests/authoring/Inline/AppliesToRole.fs index d911e533c..6ee92351d 100644 --- a/tests/authoring/Inline/AppliesToRole.fs +++ b/tests/authoring/Inline/AppliesToRole.fs @@ -31,8 +31,11 @@ This is an inline {applies_to}`stack: preview 9.1` element.

This is an inline - Planned + Elastic Stack + + Planned + From 884dc570be8e35da59b82d59264f8772aa0ebd2f Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 27 Jun 2025 01:29:50 +0200 Subject: [PATCH 2/4] Only do it for 'Elastic Stack' for now --- docs/testing/req.md | 1 - .../Myst/Components/ApplicableToComponent.cshtml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/testing/req.md b/docs/testing/req.md index a96c80e2f..cce8b81cb 100644 --- a/docs/testing/req.md +++ b/docs/testing/req.md @@ -30,7 +30,6 @@ Current version: **9.0.0** | `` {applies_to}`stack: removed 9.0` `` | {applies_to}`stack: removed 9.0` | | `` {applies_to}`stack: removed 9.1` `` | {applies_to}`stack: removed 9.1` | | `` {applies_to}`stack: ` `` | {applies_to}`stack: ` | - {applies_to}`stack: deprecated 9.1, removed 9.4` diff --git a/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml b/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml index e0c239d5f..3a3bdbc06 100644 --- a/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml +++ b/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml @@ -154,7 +154,7 @@ @if (applicability.Version is not null and not AllVersions) { - @if (applicability.Version <= currentStackVersion) + @if (name != "Elastic Stack" || applicability.Version <= currentStackVersion) { @applicability.Version } From fe145571d4c7dfaf9a615d112cd2dd22042ca21d Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 27 Jun 2025 01:39:42 +0200 Subject: [PATCH 3/4] Adjust rendering style --- docs/testing/req.md | 1 + .../Myst/Components/ApplicableToComponent.cshtml | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/testing/req.md b/docs/testing/req.md index cce8b81cb..a96c80e2f 100644 --- a/docs/testing/req.md +++ b/docs/testing/req.md @@ -30,6 +30,7 @@ Current version: **9.0.0** | `` {applies_to}`stack: removed 9.0` `` | {applies_to}`stack: removed 9.0` | | `` {applies_to}`stack: removed 9.1` `` | {applies_to}`stack: removed 9.1` | | `` {applies_to}`stack: ` `` | {applies_to}`stack: ` | + {applies_to}`stack: deprecated 9.1, removed 9.4` diff --git a/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml b/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml index 3a3bdbc06..96e7bbc61 100644 --- a/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml +++ b/src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml @@ -153,16 +153,18 @@ } @if (applicability.Version is not null and not AllVersions) { - @if (name != "Elastic Stack" || applicability.Version <= currentStackVersion) { - @applicability.Version + + @applicability.Version + } else { - @badgeText + + @badgeText + } - } From da6ccaa95f02c2cd0854018a8b878b0335568b30 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 27 Jun 2025 10:50:48 +0200 Subject: [PATCH 4/4] fix test --- tests/authoring/Inline/AppliesToRole.fs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/authoring/Inline/AppliesToRole.fs b/tests/authoring/Inline/AppliesToRole.fs index 6ee92351d..b5fcb830a 100644 --- a/tests/authoring/Inline/AppliesToRole.fs +++ b/tests/authoring/Inline/AppliesToRole.fs @@ -29,18 +29,17 @@ This is an inline {applies_to}`stack: preview 9.1` element. let ``validate HTML: generates link and alt attr`` () = markdown |> convertsToHtml """

This is an inline - - - Elastic Stack - - - Planned - - - - - element. -

+ + + Elastic Stack + + + Planned + + + + + element.

"""