Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Graph] Fix default drilldown link on index pattern switch #34251

Merged
merged 2 commits into from
Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -571,7 +571,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 @@ -659,6 +659,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 @@ -688,7 +691,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