diff --git a/src/kibana/plugins/dashboard/components/panel/lib/search.js b/src/kibana/plugins/dashboard/components/panel/lib/search.js index d5a147c187e66..cf7dc1a8647c5 100644 --- a/src/kibana/plugins/dashboard/components/panel/lib/search.js +++ b/src/kibana/plugins/dashboard/components/panel/lib/search.js @@ -17,7 +17,7 @@ define(function (require) { return { savedObj: savedSearch, panel: panel, - edit: '#discover' + editUrl: savedSearches.urlFor(panel.id) }; }); }; diff --git a/src/kibana/plugins/dashboard/components/panel/lib/visualization.js b/src/kibana/plugins/dashboard/components/panel/lib/visualization.js index 38f18ef7af678..12bce66c1b50a 100644 --- a/src/kibana/plugins/dashboard/components/panel/lib/visualization.js +++ b/src/kibana/plugins/dashboard/components/panel/lib/visualization.js @@ -13,7 +13,7 @@ define(function (require) { return { savedObj: savedVis, panel: panel, - edit: '#visualize/edit' + editUrl: savedVisualizations.urlFor(panel.id) }; }); }; diff --git a/src/kibana/plugins/dashboard/components/panel/panel.html b/src/kibana/plugins/dashboard/components/panel/panel.html index 5abb8b64aca67..9e2f1b4ad40f3 100644 --- a/src/kibana/plugins/dashboard/components/panel/panel.html +++ b/src/kibana/plugins/dashboard/components/panel/panel.html @@ -2,8 +2,12 @@
{{savedObj.title}}
- - + + + + + +
@@ -26,4 +30,4 @@ class="panel-content" filter="filter"> - \ No newline at end of file + diff --git a/src/kibana/plugins/dashboard/components/panel/panel.js b/src/kibana/plugins/dashboard/components/panel/panel.js index d663a8eaae591..ae03ab2e090a4 100644 --- a/src/kibana/plugins/dashboard/components/panel/panel.js +++ b/src/kibana/plugins/dashboard/components/panel/panel.js @@ -37,7 +37,7 @@ define(function (require) { loadPanel($scope.panel, $scope).then(function (panelConfig) { // These could be done in loadPanel, putting them here to make them more explicit $scope.savedObj = panelConfig.savedObj; - $scope.edit = panelConfig.edit; + $scope.editUrl = panelConfig.editUrl; $scope.$on('$destroy', panelConfig.savedObj.destroy); $scope.filter = function (field, value, operator) { @@ -50,11 +50,15 @@ define(function (require) { // If the savedObjectType matches the panel type, this means the object itself has been deleted, // so we shouldn't even have an edit link. If they don't match, it means something else is wrong // with the object (but the object still exists), so we link to the object editor instead. - var objectHasBeenDeleted = e.savedObjectType === $scope.panel.type; - if (!objectHasBeenDeleted) { - var service = _.find(services, {type: $scope.panel.type}); - $scope.edit = '#settings/objects/' + (service && service.name); - } + var objectItselfDeleted = e.savedObjectType === $scope.panel.type; + if (objectItselfDeleted) return; + + var type = $scope.panel.type; + var id = $scope.panel.id; + var service = _.find(services, { type: type }); + if (!service) return; + + $scope.editUrl = '#settings/objects/' + service.name + '/' + id + '?notFound=' + e.savedObjectType; }); });