fix(table): minor fix to table panel and transform time series to aggregations

This commit is contained in:
Torkel Ödegaard 2015-12-04 12:15:42 +01:00
parent e9e6ac64bd
commit 002455da07

View File

@ -45,8 +45,13 @@ export class TablePanelEditorCtrl {
};
$scope.addColumn = function() {
$scope.panel.columns.push({text: $scope.addColumnSegment.value, value: $scope.addColumnSegment.value});
$scope.render();
var columns = transformers[$scope.panel.transform].getColumns($scope.dataRaw);
var column = _.findWhere(columns, {text: $scope.addColumnSegment.value});
if (column) {
$scope.panel.columns.push(column);
$scope.render();
}
var plusButton = uiSegmentSrv.newPlusButton();
$scope.addColumnSegment.html = plusButton.html;