mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(docs-infra): display value type in CLI pages (#63211)
The value type was not being displayed when a value had an enum, which was misleading. This change ensures the value type is always shown, so users know whether to expect a single value or an array of values. PR Close #63211
This commit is contained in:
committed by
Kristiyan Kostadinov
parent
c714426963
commit
c7440dddef
@@ -24,14 +24,16 @@ export function CliCard(props: {card: CliCardRenderable}) {
|
||||
{item.aliases?.map((alias) => (
|
||||
<div class="docs-reference-option-aliases">
|
||||
<span>Alias</span>
|
||||
<code>{alias} </code>
|
||||
<code>{alias}</code>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div dangerouslySetInnerHTML={{__html: item.description}}></div>
|
||||
</div>
|
||||
<div class="docs-reference-type-and-default">
|
||||
{/* Display the enum values if there are some, else the type expected for the option */}
|
||||
{/* Display the type expected for the option and the enum values if there are some. */}
|
||||
<span>Value Type</span>
|
||||
<code>{item.type}</code>
|
||||
{item.enum ? (
|
||||
<>
|
||||
<span>Allowed Values</span>
|
||||
@@ -45,10 +47,7 @@ export function CliCard(props: {card: CliCardRenderable}) {
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span>Value Type</span>
|
||||
<code>{item.type}</code>
|
||||
</>
|
||||
<></>
|
||||
)}
|
||||
{/* Default Value */}
|
||||
{item.default !== undefined ? <span>Default</span> : <></>}
|
||||
|
||||
Reference in New Issue
Block a user