diff --git a/kibana-reports/public/components/context_menu/context_menu.js b/kibana-reports/public/components/context_menu/context_menu.js index b46049c5..960e933d 100644 --- a/kibana-reports/public/components/context_menu/context_menu.js +++ b/kibana-reports/public/components/context_menu/context_menu.js @@ -156,7 +156,7 @@ $(function () { // eslint-disable-next-line no-unsanitized/property reportPopover.innerHTML = isDiscover() ? popoverMenuDiscover(getUuidFromUrl()) - : popoverMenu(); + : popoverMenu(getUuidFromUrl()); popoverScreen[0].appendChild(reportPopover.children[0]); $('#reportPopover').show(); } catch (e) { diff --git a/kibana-reports/public/components/context_menu/context_menu_ui.js b/kibana-reports/public/components/context_menu/context_menu_ui.js index 184f7639..766c658b 100644 --- a/kibana-reports/public/components/context_menu/context_menu_ui.js +++ b/kibana-reports/public/components/context_menu/context_menu_ui.js @@ -21,10 +21,18 @@ export const getMenuItem = (name) => { `; }; -export const popoverMenu = () => { +export const popoverMenu = (savedObjectAvailable) => { + const buttonClass = savedObjectAvailable + ? 'euiContextMenuItem' + : 'euiContextMenuItem euiContextMenuItem-isDisabled'; + const button = savedObjectAvailable ? 'button' : 'button disabled'; + const popoverHeight = savedObjectAvailable ? '395px' : '380px'; + const message = savedObjectAvailable + ? `Files can take a minute or two to generate depending on the size of your source data.` + : `Save this Visualization/Dashboard to enable PDF/PNG reports.`; + const arrowRight = '100px'; const popoverRight = '77px'; - const popoverHeight = '395px'; return `