---------

**Commit 1:**
Conditionally show Visualize button based on aggregatable status

* Original sha: 76c2687e86
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-14T22:23:37Z

**Commit 2:**
Switch to ng-show so controller can maintain reference to Visualize button and remove it upon toggle

* Original sha: 9da6ddfd16
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-17T17:21:11Z

**Commit 3:**
Add visualizable flag to field object

* Original sha: 75a2f2356d
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-17T17:39:13Z
This commit is contained in:
Elastic Jasper 2016-10-17 17:03:22 -04:00
parent 4b1a5ae7c5
commit e2b87a0c6a
2 changed files with 7 additions and 2 deletions

View file

@ -44,6 +44,7 @@
<a
ng-href="{{vizLocation(field)}}"
ng-show="field.visualizable"
class="sidebar-item-button primary">
Visualize
<span class="discover-field-vis-warning" ng-show="warnings.length" tooltip="{{warnings.join(' ')}}">

View file

@ -42,6 +42,9 @@ export default function FieldObjectProvider(Private, shortDotsFilter, $rootScope
let scripted = !!spec.scripted;
let sortable = spec.name === '_score' || ((indexed || scripted) && type.sortable);
let filterable = spec.name === '_id' || scripted || (indexed && type.filterable);
let searchable = !!spec.searchable || scripted;
let aggregatable = !!spec.aggregatable || scripted;
let visualizable = aggregatable;
obj.fact('name');
obj.fact('type');
@ -58,13 +61,14 @@ export default function FieldObjectProvider(Private, shortDotsFilter, $rootScope
obj.fact('doc_values', !!spec.doc_values);
// stats
obj.fact('searchable', !!spec.searchable || scripted);
obj.fact('aggregatable', !!spec.aggregatable || scripted);
obj.fact('searchable', searchable);
obj.fact('aggregatable', aggregatable);
// usage flags, read-only and won't be saved
obj.comp('format', format);
obj.comp('sortable', sortable);
obj.comp('filterable', filterable);
obj.comp('visualizable', visualizable);
// computed values
obj.comp('indexPattern', indexPattern);