mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
improve keys
This commit is contained in:
parent
02b8406118
commit
72950bcbaa
@ -11,7 +11,12 @@ class SelectedStrategies extends React.Component {
|
|||||||
|
|
||||||
renderName (strategy) {
|
renderName (strategy) {
|
||||||
const parameters = strategy.parameters || {};
|
const parameters = strategy.parameters || {};
|
||||||
const params = Object.keys(parameters)
|
const keys = Object.keys(parameters);
|
||||||
|
if (keys.length === 0) {
|
||||||
|
return <span>{strategy.name}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const params = keys
|
||||||
.map(param => `${param}="${strategy.parameters[param]}"`)
|
.map(param => `${param}="${strategy.parameters[param]}"`)
|
||||||
.join('; ');
|
.join('; ');
|
||||||
return <span>{strategy.name} ({params})</span>;
|
return <span>{strategy.name} ({params})</span>;
|
||||||
@ -21,7 +26,7 @@ class SelectedStrategies extends React.Component {
|
|||||||
const removeStrategy = this.props.removeStrategy;
|
const removeStrategy = this.props.removeStrategy;
|
||||||
const configuredStrategies = this.props.configuredStrategies.map((s, index) => (
|
const configuredStrategies = this.props.configuredStrategies.map((s, index) => (
|
||||||
<Chip
|
<Chip
|
||||||
style={{ marginRight: '10px' }}
|
style={{ marginRight: '10px', marginBottom: '10px' }}
|
||||||
key={`${index}-${s.name}`}
|
key={`${index}-${s.name}`}
|
||||||
deletable
|
deletable
|
||||||
onDeleteClick={() => removeStrategy(s)}
|
onDeleteClick={() => removeStrategy(s)}
|
||||||
|
Loading…
Reference in New Issue
Block a user