Skip to content

Commit

Permalink
fix default drilldown link index pattern switch (#34251)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Apr 15, 2019
1 parent d830aaf commit ed5ba0e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x-pack/plugins/graph/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private

if ($scope.urlTemplates.indexOf($scope.newUrlTemplate.templateBeingEdited) >= 0) {
//patch any existing object
Object.assign($scope.newUrlTemplate.templateBeingEdited, $scope.newUrlTemplate);
Object.assign($scope.newUrlTemplate.templateBeingEdited, $scope.newUrlTemplate, { isDefault: false });
return;
}
}
Expand Down Expand Up @@ -660,6 +660,9 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
$scope.workspace = gws.createWorkspace(options);
$scope.detail = null;

// filter out default url templates because they will get re-added
$scope.urlTemplates = $scope.urlTemplates.filter(template => !template.isDefault);

if ($scope.urlTemplates.length === 0) {
// url templates specified by users can include the `{{gquery}}` tag and
// will have the elasticsearch query for the graph nodes injected there
Expand Down Expand Up @@ -689,7 +692,8 @@ app.controller('graphuiPlugin', function ($scope, $route, $http, kbnUrl, Private
description: i18n('xpack.graph.settings.drillDowns.defaultUrlTemplateTitle', {
defaultMessage: 'Raw documents',
}),
encoder: $scope.outlinkEncoders[0]
encoder: $scope.outlinkEncoders[0],
isDefault: true
});
}
}
Expand Down

0 comments on commit ed5ba0e

Please sign in to comment.