mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Hide labels for platforms with no hosts. (#1998)
Rather than displaying 0 hosts for each of the platforms, remove the platform listing. The platforms will appear once they have a host.
This commit is contained in:
parent
c8229cc0d6
commit
4135ad7d3f
1 changed files with 4 additions and 2 deletions
|
|
@ -41,7 +41,9 @@ class HostSidePanel extends Component {
|
|||
const { onFilterLabels } = this;
|
||||
const allHostLabels = filter(labels, { type: 'all' });
|
||||
const hostStatusLabels = filter(labels, { type: 'status' });
|
||||
const hostPlatformLabels = filter(labels, { type: 'platform' });
|
||||
const hostPlatformLabels = filter(labels, (label) => {
|
||||
return label.type === 'platform' && label.count > 0;
|
||||
});
|
||||
const customLabels = filter(labels, (label) => {
|
||||
const lowerDisplayText = label.display_text.toLowerCase();
|
||||
|
||||
|
|
@ -78,7 +80,7 @@ class HostSidePanel extends Component {
|
|||
selectedLabel={selectedLabel}
|
||||
type="platform"
|
||||
/>
|
||||
<hr className={`${baseClass}__hr`} />
|
||||
{hostPlatformLabels.length > 0 && <hr className={`${baseClass}__hr`} />}
|
||||
<div className={`${baseClass}__panel-group-item`}>
|
||||
<Icon name="label" />
|
||||
<span className="title">LABELS</span>
|
||||
|
|
|
|||
Loading…
Reference in a new issue