diff --git a/ui/app/components/clients/history.js b/ui/app/components/clients/history.js index 94c6761ad..0d543913b 100644 --- a/ui/app/components/clients/history.js +++ b/ui/app/components/clients/history.js @@ -8,6 +8,8 @@ export default class HistoryComponent extends Component { @tracked selectedNamespace = null; + @tracked barChartSelection = false; + // Determine if we have client count data based on the current tab, // since model is slightly different for current month vs history api get hasClientData() { @@ -106,11 +108,17 @@ export default class HistoryComponent extends Component { // In case of search select component, value returned is an array if (Array.isArray(value)) { this.selectedNamespace = this.getNamespace(value[0]); + this.barChartSelection = false; } else if (typeof value === 'object') { // While D3 bar selection returns an object this.selectedNamespace = this.getNamespace(value.label); - } else { - this.selectedNamespace = null; + this.barChartSelection = true; } } + + @action + resetData() { + this.barChartSelection = false; + this.selectedNamespace = null; + } } diff --git a/ui/app/templates/components/clients/history.hbs b/ui/app/templates/components/clients/history.hbs index 0199ed7f4..dfbfda7d4 100644 --- a/ui/app/templates/components/clients/history.hbs +++ b/ui/app/templates/components/clients/history.hbs @@ -132,7 +132,7 @@ {{#if this.showGraphs}} -
+
- Single namespace +
    +
  • +
    + {{or this.selectedNamespace.namespace_path 'root'}} +
    +
    + +
    +
  • +
+ {{else}} + - {{#if this.selectedNamespace}} -
-
- -
+ {{/if}} + {{#if this.selectedNamespace}} +
+
+
-
-
- -
-
- -
+
+
+
+
- {{else}} - - {{/if}} +
+ +
+
+ {{else}} + + {{/if}}
diff --git a/ui/lib/core/addon/components/search-select.js b/ui/lib/core/addon/components/search-select.js index ede02da56..903bf09bf 100644 --- a/ui/lib/core/addon/components/search-select.js +++ b/ui/lib/core/addon/components/search-select.js @@ -71,7 +71,6 @@ export default Component.extend({ return option.id; }); this.set('allOptions', allOptions); // used by filter-wildcard helper - let formattedOptions = this.selectedOptions.map(option => { let matchingOption = options.findBy('id', option); options.removeObject(matchingOption);