1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

fix: should handle zero variants

This commit is contained in:
Ivar Conradi Østhus 2020-06-04 15:06:44 +02:00
parent 7c0bb12799
commit 735b11297c
2 changed files with 7 additions and 43 deletions

View File

@ -177,27 +177,9 @@ exports[`renders correctly with without variants 1`] = `
</code>
method in the Client SDK.
</p>
<table
className="mdl-data-table mdl-shadow--2dp variantTable"
>
<thead>
<tr>
<th>
Variant name
</th>
<th
className="labels"
/>
<th>
Weight
</th>
<th
className="actions"
/>
</tr>
</thead>
<tbody />
</table>
<p>
No variants defined.
</p>
<br />
<p>
<a
@ -234,27 +216,9 @@ exports[`renders correctly with without variants and no permissions 1`] = `
</code>
method in the Client SDK.
</p>
<table
className="mdl-data-table mdl-shadow--2dp variantTable"
>
<thead>
<tr>
<th>
Variant name
</th>
<th
className="labels"
/>
<th>
Weight
</th>
<th
className="actions"
/>
</tr>
</thead>
<tbody />
</table>
<p>
No variants defined.
</p>
<br />
</section>
`;

View File

@ -88,7 +88,7 @@ class UpdateVariantComponent extends Component {
<code style={{ color: 'navy' }}>getVariant()</code> method in the Client SDK.
</p>
{this.renderVariants(variants)}
{variants.length > 0 ? this.renderVariants(variants) : <p>No variants defined.</p>}
<br />
{this.props.hasPermission(UPDATE_FEATURE) ? (
<p>