mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Set static value to const variable
This commit is contained in:
@@ -51,7 +51,6 @@ class OrganizationDetail extends Component {
|
|||||||
error: false
|
error: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this.showOverflowChipAfter = 5;
|
|
||||||
this.handleChipToggle = this.handleChipToggle.bind(this);
|
this.handleChipToggle = this.handleChipToggle.bind(this);
|
||||||
this.loadInstanceGroups = this.loadInstanceGroups.bind(this);
|
this.loadInstanceGroups = this.loadInstanceGroups.bind(this);
|
||||||
}
|
}
|
||||||
@@ -100,9 +99,10 @@ class OrganizationDetail extends Component {
|
|||||||
},
|
},
|
||||||
match
|
match
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
const showOverflowChipAfter = 5;
|
||||||
|
|
||||||
const instanceGroupChips = instanceGroups.slice(0, isToggleOpen
|
const instanceGroupChips = instanceGroups.slice(0, isToggleOpen
|
||||||
? instanceGroups.length : this.showOverflowChipAfter)
|
? instanceGroups.length : showOverflowChipAfter)
|
||||||
.map(instanceGroup => (
|
.map(instanceGroup => (
|
||||||
<BasicChip
|
<BasicChip
|
||||||
key={instanceGroup.id}
|
key={instanceGroup.id}
|
||||||
@@ -111,12 +111,12 @@ class OrganizationDetail extends Component {
|
|||||||
</BasicChip>
|
</BasicChip>
|
||||||
));
|
));
|
||||||
|
|
||||||
const overflowChip = (instanceGroups.length > this.showOverflowChipAfter) ? (
|
const overflowChip = (instanceGroups.length > showOverflowChipAfter) ? (
|
||||||
<BasicChip
|
<BasicChip
|
||||||
isOverflowChip
|
isOverflowChip
|
||||||
onToggle={this.handleChipToggle}
|
onToggle={this.handleChipToggle}
|
||||||
>
|
>
|
||||||
{isToggleOpen ? 'Show less' : `${(instanceGroups.length - this.showOverflowChipAfter).toString()} more`}
|
{isToggleOpen ? 'Show less' : `${(instanceGroups.length - showOverflowChipAfter).toString()} more`}
|
||||||
</BasicChip>
|
</BasicChip>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user