Skip to content

Commit f5cb51e

Browse files
committed
update applies_to render order
Signed-off-by: bmorelli25 <[email protected]>
1 parent 0d4a3e7 commit f5cb51e

File tree

2 files changed

+104
-81
lines changed

2 files changed

+104
-81
lines changed

src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,6 @@
1818
appliesTo.Stack
1919
)
2020
}
21-
@if (appliesTo.Deployment is not null)
22-
{
23-
if (appliesTo.Deployment.Ece is not null)
24-
{
25-
@RenderProduct("ECE",
26-
"Elastic&nbsp;Cloud&nbsp;Enterprise",
27-
VersioningSystemId.Ece,
28-
appliesTo.Deployment.Ece
29-
)
30-
}
31-
32-
if (appliesTo.Deployment.Eck is not null)
33-
{
34-
@RenderProduct(
35-
"ECK",
36-
"Elastic&nbsp;Cloud&nbsp;on&nbsp;Kubernetes",
37-
VersioningSystemId.Eck,
38-
appliesTo.Deployment.Eck
39-
)
40-
}
41-
42-
if (appliesTo.Deployment.Ess is not null)
43-
{
44-
@RenderProduct(
45-
"ECH",
46-
"Elastic&nbsp;Cloud&nbsp;Hosted",
47-
VersioningSystemId.Ess,
48-
appliesTo.Deployment.Ess
49-
)
50-
}
51-
52-
if (appliesTo.Deployment.Self is not null)
53-
{
54-
@RenderProduct(
55-
"Self-Managed",
56-
"Self-managed Elastic&nbsp;deployments",
57-
VersioningSystemId.Self,
58-
appliesTo.Deployment.Self
59-
)
60-
}
61-
}
6221
@if (appliesTo.Serverless is not null)
6322
{
6423
if (appliesTo.Serverless.AllProjects is not null)
@@ -103,9 +62,46 @@
10362
}
10463
}
10564
}
106-
@if (appliesTo.Product is not null)
65+
@if (appliesTo.Deployment is not null)
10766
{
108-
@RenderProduct("", "", VersioningSystemId.All, appliesTo.Product)
67+
if (appliesTo.Deployment.Ece is not null)
68+
{
69+
@RenderProduct("ECE",
70+
"Elastic&nbsp;Cloud&nbsp;Enterprise",
71+
VersioningSystemId.Ece,
72+
appliesTo.Deployment.Ece
73+
)
74+
}
75+
76+
if (appliesTo.Deployment.Eck is not null)
77+
{
78+
@RenderProduct(
79+
"ECK",
80+
"Elastic&nbsp;Cloud&nbsp;on&nbsp;Kubernetes",
81+
VersioningSystemId.Eck,
82+
appliesTo.Deployment.Eck
83+
)
84+
}
85+
86+
if (appliesTo.Deployment.Ess is not null)
87+
{
88+
@RenderProduct(
89+
"ECH",
90+
"Elastic&nbsp;Cloud&nbsp;Hosted",
91+
VersioningSystemId.Ess,
92+
appliesTo.Deployment.Ess
93+
)
94+
}
95+
96+
if (appliesTo.Deployment.Self is not null)
97+
{
98+
@RenderProduct(
99+
"Self-Managed",
100+
"Self-managed Elastic&nbsp;deployments",
101+
VersioningSystemId.Self,
102+
appliesTo.Deployment.Self
103+
)
104+
}
109105
}
110106
@if (appliesTo.ProductApplicability is not null)
111107
{
@@ -120,101 +116,105 @@
120116
@RenderProduct("Curator", "Curator", VersioningSystemId.Curator, pa.Curator)
121117
}
122118

123-
if (pa.ApmAgentAndroid is not null)
119+
if (pa.EdotAndroid is not null)
124120
{
125-
@RenderProduct("APM Agent Android", "Application&nbsp;Performance&nbsp;Monitoring Agent for Android", VersioningSystemId.ApmAgentAndroid, pa.ApmAgentAndroid)
121+
@RenderProduct("EDOT Android", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Android", VersioningSystemId.EdotAndroid, pa.EdotAndroid)
126122
}
127123

128-
if (pa.ApmAgentDotnet is not null)
124+
if (pa.EdotCfAws is not null)
129125
{
130-
@RenderProduct("APM Agent .NET", "Application&nbsp;Performance&nbsp;Monitoring Agent for .NET", VersioningSystemId.ApmAgentDotnet, pa.ApmAgentDotnet)
126+
@RenderProduct("EDOT CF AWS", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Cloud&nbsp;Forwarder for AWS", VersioningSystemId.EdotCfAws, pa.EdotCfAws)
131127
}
132128

133-
if (pa.ApmAgentGo is not null)
129+
if (pa.EdotCollector is not null)
134130
{
135-
@RenderProduct("APM Agent Go", "Application&nbsp;Performance&nbsp;Monitoring Agent for Go", VersioningSystemId.ApmAgentGo, pa.ApmAgentGo)
131+
@RenderProduct("EDOT Collector", "Elastic Distribution of OpenTelemetry Collector", VersioningSystemId.EdotCollector, pa.EdotCollector)
136132
}
137133

138-
if (pa.ApmAgentIos is not null)
134+
if (pa.EdotDotnet is not null)
139135
{
140-
@RenderProduct("APM Agent iOS", "Application&nbsp;Performance&nbsp;Monitoring Agent for iOS", VersioningSystemId.ApmAgentIos, pa.ApmAgentIos)
136+
@RenderProduct("EDOT .NET", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;.NET", VersioningSystemId.EdotDotnet, pa.EdotDotnet)
141137
}
142138

143-
if (pa.ApmAgentJava is not null)
139+
if (pa.EdotIos is not null)
144140
{
145-
@RenderProduct("APM Agent Java", "Application&nbsp;Performance&nbsp;Monitoring Agent for Java", VersioningSystemId.ApmAgentJava, pa.ApmAgentJava)
141+
@RenderProduct("EDOT iOS", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;iOS", VersioningSystemId.EdotIos, pa.EdotIos)
146142
}
147143

148-
if (pa.ApmAgentNode is not null)
144+
if (pa.EdotJava is not null)
149145
{
150-
@RenderProduct("APM Agent Node.js", "Application&nbsp;Performance&nbsp;Monitoring Agent for Node.js", VersioningSystemId.ApmAgentNode, pa.ApmAgentNode)
146+
@RenderProduct("EDOT Java", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Java", VersioningSystemId.EdotJava, pa.EdotJava)
151147
}
152148

153-
if (pa.ApmAgentPhp is not null)
149+
if (pa.EdotNode is not null)
154150
{
155-
@RenderProduct("APM Agent PHP", "Application&nbsp;Performance&nbsp;Monitoring Agent for PHP", VersioningSystemId.ApmAgentPhp, pa.ApmAgentPhp)
151+
@RenderProduct("EDOT Node.js", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Node.js", VersioningSystemId.EdotNode, pa.EdotNode)
156152
}
157153

158-
if (pa.ApmAgentPython is not null)
154+
if (pa.EdotPhp is not null)
159155
{
160-
@RenderProduct("APM Agent Python", "Application&nbsp;Performance&nbsp;Monitoring Agent for Python", VersioningSystemId.ApmAgentPython, pa.ApmAgentPython)
156+
@RenderProduct("EDOT PHP", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;PHP", VersioningSystemId.ApmAgentPhp, pa.EdotPhp)
161157
}
162158

163-
if (pa.ApmAgentRuby is not null)
159+
if (pa.EdotPython is not null)
164160
{
165-
@RenderProduct("APM Agent Ruby", "Application&nbsp;Performance&nbsp;Monitoring Agent for Ruby", VersioningSystemId.ApmAgentRuby, pa.ApmAgentRuby)
161+
@RenderProduct("EDOT Python", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Python", VersioningSystemId.EdotPython, pa.EdotPython)
166162
}
167163

168-
if (pa.ApmAgentRum is not null)
164+
if (pa.ApmAgentAndroid is not null)
169165
{
170-
@RenderProduct("APM Agent RUM", "Application&nbsp;Performance&nbsp;Monitoring Agent for Real&nbsp;User&nbsp;Monitoring", VersioningSystemId.ApmAgentRum, pa.ApmAgentRum)
166+
@RenderProduct("APM Agent Android", "Application&nbsp;Performance&nbsp;Monitoring Agent for Android", VersioningSystemId.ApmAgentAndroid, pa.ApmAgentAndroid)
171167
}
172168

173-
if (pa.EdotIos is not null)
169+
if (pa.ApmAgentDotnet is not null)
174170
{
175-
@RenderProduct("EDOT iOS", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;iOS", VersioningSystemId.EdotIos, pa.EdotIos)
171+
@RenderProduct("APM Agent .NET", "Application&nbsp;Performance&nbsp;Monitoring Agent for .NET", VersioningSystemId.ApmAgentDotnet, pa.ApmAgentDotnet)
176172
}
177173

178-
if (pa.EdotAndroid is not null)
174+
if (pa.ApmAgentGo is not null)
179175
{
180-
@RenderProduct("EDOT Android", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Android", VersioningSystemId.EdotAndroid, pa.EdotAndroid)
176+
@RenderProduct("APM Agent Go", "Application&nbsp;Performance&nbsp;Monitoring Agent for Go", VersioningSystemId.ApmAgentGo, pa.ApmAgentGo)
181177
}
182178

183-
if (pa.EdotDotnet is not null)
179+
if (pa.ApmAgentIos is not null)
184180
{
185-
@RenderProduct("EDOT .NET", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;.NET", VersioningSystemId.EdotDotnet, pa.EdotDotnet)
181+
@RenderProduct("APM Agent iOS", "Application&nbsp;Performance&nbsp;Monitoring Agent for iOS", VersioningSystemId.ApmAgentIos, pa.ApmAgentIos)
186182
}
187183

188-
if (pa.EdotJava is not null)
184+
if (pa.ApmAgentJava is not null)
189185
{
190-
@RenderProduct("EDOT Java", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Java", VersioningSystemId.EdotJava, pa.EdotJava)
186+
@RenderProduct("APM Agent Java", "Application&nbsp;Performance&nbsp;Monitoring Agent for Java", VersioningSystemId.ApmAgentJava, pa.ApmAgentJava)
191187
}
192188

193-
if (pa.EdotNode is not null)
189+
if (pa.ApmAgentNode is not null)
194190
{
195-
@RenderProduct("EDOT Node.js", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Node.js", VersioningSystemId.EdotNode, pa.EdotNode)
191+
@RenderProduct("APM Agent Node.js", "Application&nbsp;Performance&nbsp;Monitoring Agent for Node.js", VersioningSystemId.ApmAgentNode, pa.ApmAgentNode)
196192
}
197193

198-
if (pa.EdotPhp is not null)
194+
if (pa.ApmAgentPhp is not null)
199195
{
200-
@RenderProduct("EDOT PHP", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;PHP", VersioningSystemId.ApmAgentPhp, pa.EdotPhp)
196+
@RenderProduct("APM Agent PHP", "Application&nbsp;Performance&nbsp;Monitoring Agent for PHP", VersioningSystemId.ApmAgentPhp, pa.ApmAgentPhp)
201197
}
202198

203-
if (pa.EdotPython is not null)
199+
if (pa.ApmAgentPython is not null)
204200
{
205-
@RenderProduct("EDOT Python", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Python", VersioningSystemId.EdotPython, pa.EdotPython)
201+
@RenderProduct("APM Agent Python", "Application&nbsp;Performance&nbsp;Monitoring Agent for Python", VersioningSystemId.ApmAgentPython, pa.ApmAgentPython)
206202
}
207203

208-
if (pa.EdotCfAws is not null)
204+
if (pa.ApmAgentRuby is not null)
209205
{
210-
@RenderProduct("EDOT CF AWS", "Elastic&nbsp;Distribution of OpenTelemetry&nbsp;Cloud&nbsp;Forwarder for AWS", VersioningSystemId.EdotCfAws, pa.EdotCfAws)
206+
@RenderProduct("APM Agent Ruby", "Application&nbsp;Performance&nbsp;Monitoring Agent for Ruby", VersioningSystemId.ApmAgentRuby, pa.ApmAgentRuby)
211207
}
212208

213-
if (pa.EdotCollector is not null)
209+
if (pa.ApmAgentRum is not null)
214210
{
215-
@RenderProduct("EDOT Collector", "Elastic Distribution of OpenTelemetry Collector", VersioningSystemId.EdotCollector, pa.EdotCollector)
211+
@RenderProduct("APM Agent RUM", "Application&nbsp;Performance&nbsp;Monitoring Agent for Real&nbsp;User&nbsp;Monitoring", VersioningSystemId.ApmAgentRum, pa.ApmAgentRum)
216212
}
217213
}
214+
@if (appliesTo.Product is not null)
215+
{
216+
@RenderProduct("", "", VersioningSystemId.All, appliesTo.Product)
217+
}
218218

219219
@functions {
220220

tests/authoring/Applicability/AppliesToFrontMatter.fs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,26 @@ applies_to:
212212
[<Fact>]
213213
let ``does not render label`` () =
214214
markdown |> appliesTo (Unchecked.defaultof<ApplicableTo>)
215+
216+
type ``parses applies_to with multiple categories in any order`` () =
217+
static let markdown = frontMatter """
218+
applies_to:
219+
product: ga
220+
deployment:
221+
eck: ga 9.0
222+
serverless:
223+
security: ga 9.0.0
224+
stack: ga 9.1
225+
"""
226+
[<Fact>]
227+
let ``parses all categories regardless of YAML order`` () =
228+
markdown |> appliesTo (ApplicableTo(
229+
Stack=AppliesCollection.op_Explicit "ga 9.1",
230+
Serverless=ServerlessProjectApplicability(
231+
Security=AppliesCollection.op_Explicit "ga 9.0.0"
232+
),
233+
Deployment=DeploymentApplicability(
234+
Eck=AppliesCollection.op_Explicit "ga 9.0"
235+
),
236+
Product=AppliesCollection.op_Explicit "ga"
237+
))

0 commit comments

Comments
 (0)