From 9ed8265c1ef23a6d14daf3cf8d8ce33f0b100f11 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Mon, 1 Apr 2013 16:52:18 -0700 Subject: [PATCH] Fixed sort order of numeric fields --- common/lib/shared.js | 11 ++++++++--- js/app.js | 3 +++ panels/fields/editor.html | 2 +- panels/map/module.js | 1 + panels/table/module.js | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/common/lib/shared.js b/common/lib/shared.js index 511449b15fb..5dbc38dbe00 100644 --- a/common/lib/shared.js +++ b/common/lib/shared.js @@ -270,10 +270,15 @@ function flatten_json(object,root,array) { var obj = object[index] var rootname = root.length == 0 ? index : root + '.' + index; if(typeof obj == 'object' ) { - if(_.isArray(obj)) - array[rootname] = typeof obj === 'undefined' ? null : obj.join(','); - else + if(_.isArray(obj)) { + if(obj.length === 1 && _.isNumber(obj[0])) { + array[rootname] = parseFloat(obj[0]); + } else { + array[rootname] = typeof obj === 'undefined' ? null : obj.join(','); + } + } else { flatten_json(obj,rootname,array) + } } else { array[rootname] = typeof obj === 'undefined' ? null : obj; } diff --git a/js/app.js b/js/app.js index 063f494e3fb..81f4c9a8843 100644 --- a/js/app.js +++ b/js/app.js @@ -54,6 +54,9 @@ labjs.wait(function(){ .when('/dashboard/:type/:id', { templateUrl: 'partials/dashboard.html' }) + .when('/dashboard/:type/:id/:params', { + templateUrl: 'partials/dashboard.html' + }) .otherwise({ redirectTo: 'dashboard' }); diff --git a/panels/fields/editor.html b/panels/fields/editor.html index 7666d542adb..cea7c968beb 100644 --- a/panels/fields/editor.html +++ b/panels/fields/editor.html @@ -6,5 +6,5 @@
Font Size
- +
diff --git a/panels/map/module.js b/panels/map/module.js index 806302e69f4..daf96634828 100644 --- a/panels/map/module.js +++ b/panels/map/module.js @@ -10,6 +10,7 @@ angular.module('kibana.map', []) exclude : [], spyable : true, group : "default", + index_limit : 0 } _.defaults($scope.panel,_d) diff --git a/panels/table/module.js b/panels/table/module.js index 5957397bf3e..f801e4d32ec 100644 --- a/panels/table/module.js +++ b/panels/table/module.js @@ -128,7 +128,7 @@ angular.module('kibana.table', []) $scope.data = _.sortBy($scope.data, function(v){ return v[$scope.panel.sort[0]] }); - + // Reverse if needed if($scope.panel.sort[1] == 'desc') $scope.data.reverse();