mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: should handle zero variants
This commit is contained in:
		
							parent
							
								
									7c0bb12799
								
							
						
					
					
						commit
						735b11297c
					
				@ -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>
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user