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