Skip to content

Commit

Permalink
Conditionally place deprecated annotation on select list value itself
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Aug 23, 2016
1 parent 3d39623 commit d78eb51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ui/public/agg_types/buckets/terms.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Notifier from 'ui/notify/notifier';
import { get } from 'lodash';

define(function (require) {
return function TermsAggDefinition(Private) {
Expand All @@ -8,7 +8,6 @@ define(function (require) {
let AggConfig = Private(require('ui/Vis/AggConfig'));
let Schemas = Private(require('ui/Vis/Schemas'));
let createFilter = Private(require('ui/agg_types/buckets/create_filter/terms'));
const notify = new Notifier();

let orderAggSchema = (new Schemas([
{
Expand Down Expand Up @@ -96,6 +95,14 @@ define(function (require) {
let orderBy = params.orderBy;
let paramDef = agg.type.params.byName.orderAgg;

const orderAgg = agg.params.orderAgg || aggs.getResponseAggById(agg.params.orderBy);
const orderParamDef = agg.type.params.byName.order;
if (get(orderAgg, 'type.name') === 'count') {
orderParamDef.options.byVal.asc.display = 'Ascending [DEPRECATED]';
} else {
orderParamDef.options.byVal.asc.display = 'Ascending';
}

// setup the initial value of orderBy
if (!orderBy && prevOrderBy === INIT) {
// abort until we get the responseValueAggs
Expand Down

0 comments on commit d78eb51

Please sign in to comment.