diff --git a/src/core_plugins/kibana/public/dashboard/index.html b/src/core_plugins/kibana/public/dashboard/index.html index e1b29a59c5c7b..85bbc8b692603 100644 --- a/src/core_plugins/kibana/public/dashboard/index.html +++ b/src/core_plugins/kibana/public/dashboard/index.html @@ -18,7 +18,7 @@
diff --git a/src/ui/public/chrome/api/controls.js b/src/ui/public/chrome/api/controls.js index 93408b9c682d4..9c8031d2875c6 100644 --- a/src/ui/public/chrome/api/controls.js +++ b/src/ui/public/chrome/api/controls.js @@ -29,4 +29,21 @@ module.exports = function (chrome, internals) { if (_.isUndefined(internals.visible)) return def; return internals.visible; }; + + /** + * @param {boolean} showSearch - should the chrome Search Bar be displayed + * @return {chrome} + */ + chrome.setShowSearch = function (showSearch) { + internals.showSearch = Boolean(showSearch); + return chrome; + }; + + /** + * @return {boolean} - Show Search Bar state of the chrome + */ + chrome.getShowSearch = function () { + if (_.isUndefined(internals.showSearch)) return true; + return internals.showSearch; + }; }; diff --git a/src/ui/public/chrome/directives/kbn_chrome.js b/src/ui/public/chrome/directives/kbn_chrome.js index 1b191dda6809a..f37e106ac3da4 100644 --- a/src/ui/public/chrome/directives/kbn_chrome.js +++ b/src/ui/public/chrome/directives/kbn_chrome.js @@ -37,6 +37,9 @@ export default function (chrome, internals) { // are we showing the embedded version of the chrome? internals.setVisibleDefault(!$location.search().embed); + if ($location.search().embed) { + chrome.setShowSearch($location.search().showSearch); + } // listen for route changes, propogate to tabs const onRouteChange = function () { diff --git a/src/ui/public/kbn_top_nav/kbn_top_nav.html b/src/ui/public/kbn_top_nav/kbn_top_nav.html index 5ec6577c825d6..796aaa66bfd63 100644 --- a/src/ui/public/kbn_top_nav/kbn_top_nav.html +++ b/src/ui/public/kbn_top_nav/kbn_top_nav.html @@ -4,7 +4,7 @@ data-test-subj="top-nav" > -
+
{ - const embedQueryParam = '?embed=true'; + let embedQueryParam = '?embed=true'; + if (this.showSearch) embedQueryParam += '&showSearch=true'; const urlHasQueryString = url.indexOf('?') !== -1; if (urlHasQueryString) { return url.replace('?', `${embedQueryParam}&`); @@ -115,6 +116,7 @@ app.directive('share', function (Private) { shortSnapshotIframe: false, }; }; + this.updateUrls = updateUrls; // When the URL changes, update the links in the UI. $scope.$watch(() => $location.absUrl(), () => { diff --git a/src/ui/public/share/views/share.html b/src/ui/public/share/views/share.html index f43efa2d511a0..31efca77e9103 100644 --- a/src/ui/public/share/views/share.html +++ b/src/ui/public/share/views/share.html @@ -36,6 +36,13 @@
+
+ +
+
+
+ +
+