fix(ui/labels): update empty state for no labels (#12521)

pull/12527/head^2
Delmer 2019-03-12 13:13:53 -04:00 committed by GitHub
parent 493f6dac58
commit b5c08294b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -85,7 +85,8 @@ class InlineLabelsEditor extends Component<Props, State> {
const {labels, selectedLabels} = this.props
const {searchTerm, isPopoverVisible, selectedItemID} = this.state
const labelsUsed = labels.length === selectedLabels.length
const labelsUsed =
labels.length > 0 && labels.length === selectedLabels.length
if (isPopoverVisible) {
return (

View File

@ -46,6 +46,7 @@ class InlineLabelsList extends Component<Props> {
onUpdateSelectedItem,
selectedItemID,
allLabelsUsed,
searchTerm,
} = this.props
if (filteredLabels.length) {
@ -70,6 +71,14 @@ class InlineLabelsList extends Component<Props> {
</EmptyState>
)
}
if (!searchTerm) {
return (
<EmptyState size={ComponentSize.Small}>
<EmptyState.Text text="Type to create your first label" />
</EmptyState>
)
}
}
private get createNewLabelButton(): JSX.Element {