Skip to content

Commit

Permalink
5.6.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Greenberg authored and Jason Greenberg committed Nov 16, 2017
1 parent 0428078 commit 2a623cf
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.10.2
6.11.5
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* Nov 16 2017
* Versions
* 5.6.4
* Changes
* Support changes in Index Pattern service

* Jul 10 2017
* Versions
* 5.5.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transform_vis",
"version": "5.5.0",
"version": "5.6.4",
"description": "Transform Visualization",
"main": "index.js",
"kibana": {
Expand Down
24 changes: 17 additions & 7 deletions public/transform_vis_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { uiModules } from 'ui/modules';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter'
import { dashboardContextProvider } from 'plugins/kibana/dashboard/dashboard_context'
import { SavedObjectsClientProvider } from 'ui/saved_objects';

import chrome from 'ui/chrome';

const Mustache = require('mustache');
Expand Down Expand Up @@ -39,14 +41,15 @@ module.controller('TransformVisController', function ($scope, $sce, Private, tim
$scope.search = function () {

const context = dashboardContext();
const index = $scope.vis.params.outputs.indexpattern;

// This is part of what should be a wider config validation
if (!(typeof index === 'string' || index instanceof String)) {
if ($scope.vis.indexPattern === undefined || $scope.vis.indexPattern.id === undefined) {
$scope.setDisplay('<div style="text-align: center;"><i>No Index Pattern</i></div>');
return;
}

}

const index = $scope.vis.indexPattern.title;

if ($scope.vis.indexPattern && $scope.vis.indexPattern.timeFieldName) {
const timefilterdsl = {range: {}};
timefilterdsl.range[$scope.vis.indexPattern.timeFieldName] = {gte: timefilter.time.from, lte: timefilter.time.to};
Expand Down Expand Up @@ -109,14 +112,21 @@ module.controller('TransformVisController', function ($scope, $sce, Private, tim

});

module.controller('TransformVisEditorController', function ($scope, indexPatterns) {
module.controller('TransformVisEditorController', function ($scope, Private, indexPatterns) {

$scope.options = chrome.getInjected('transformVisOptions');

indexPatterns.getIds().then(function (list) {
$scope.indexPatternOptions = list;
const savedObjectsClient = Private(SavedObjectsClientProvider);

const patterns = savedObjectsClient.find({
type: 'index-pattern',
fields: ['title'],
perPage: 10000
}).then(response => {
$scope.indexPatternOptions = response.savedObjects;
});


$scope.$watch('vis.params.outputs.indexpattern', function () {
indexPatterns.get($scope.vis.params.outputs.indexpattern).then(function (indexPattern) {
$scope.savedVis.searchSource.set('index', indexPattern);
Expand Down
2 changes: 1 addition & 1 deletion public/transform_vis_params.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<label> Index Pattern </label>
<select name="indexPattern" class="form-control ng-pristine ng-untouched"
ng-model="$parent.vis.params.outputs.indexpattern" required
ng-options="option as option for option in indexPatternOptions"></select>
ng-options="option.id as option.attributes.title for option in indexPatternOptions"></select>
</div>

<div class="form-group">
Expand Down

0 comments on commit 2a623cf

Please sign in to comment.