diff --git a/docs/user/dashboard/dashboard.asciidoc b/docs/user/dashboard/dashboard.asciidoc index 89fa564b0ac7..070d511ed807 100644 --- a/docs/user/dashboard/dashboard.asciidoc +++ b/docs/user/dashboard/dashboard.asciidoc @@ -290,6 +290,13 @@ To add a panel to another dashboard, copy the panel. View the underlying documents in a panel, or in a data series. +. In kibana.yml, add the following: ++ +["source","yml"] +----------- +xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled: true +----------- + TIP: *Explore underlying data* is supported only for visualization panels with a single index pattern. To view the underlying documents in the panel: diff --git a/x-pack/plugins/discover_enhanced/common/config.ts b/x-pack/plugins/discover_enhanced/common/config.ts index f8de31aed719..26b4cc6520c1 100644 --- a/x-pack/plugins/discover_enhanced/common/config.ts +++ b/x-pack/plugins/discover_enhanced/common/config.ts @@ -6,5 +6,8 @@ */ export interface Config { - actions: { exploreDataInChart: { enabled: boolean } }; + actions: { + exploreDataInChart: { enabled: boolean }; + exploreDataInContextMenu: { enabled: boolean }; + }; } diff --git a/x-pack/plugins/discover_enhanced/public/plugin.ts b/x-pack/plugins/discover_enhanced/public/plugin.ts index a5425307aec6..60f242d682ff 100644 --- a/x-pack/plugins/discover_enhanced/public/plugin.ts +++ b/x-pack/plugins/discover_enhanced/public/plugin.ts @@ -56,8 +56,10 @@ export class DiscoverEnhancedPlugin if (isSharePluginInstalled) { const params = { start }; - const exploreDataAction = new ExploreDataContextMenuAction(params); - uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, exploreDataAction); + if (this.config.actions.exploreDataInContextMenu.enabled) { + const exploreDataAction = new ExploreDataContextMenuAction(params); + uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, exploreDataAction); + } if (this.config.actions.exploreDataInChart.enabled) { const exploreDataChartAction = new ExploreDataChartAction(params); diff --git a/x-pack/plugins/discover_enhanced/server/config.ts b/x-pack/plugins/discover_enhanced/server/config.ts index f57b162dc5b4..95ac46a662ea 100644 --- a/x-pack/plugins/discover_enhanced/server/config.ts +++ b/x-pack/plugins/discover_enhanced/server/config.ts @@ -13,6 +13,9 @@ export const configSchema = schema.object({ exploreDataInChart: schema.object({ enabled: schema.boolean({ defaultValue: false }), }), + exploreDataInContextMenu: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), }), }); diff --git a/x-pack/test/functional/apps/dashboard/drilldowns/index.ts b/x-pack/test/functional/apps/dashboard/drilldowns/index.ts index a88389f2498d..fa24a4ba6a19 100644 --- a/x-pack/test/functional/apps/dashboard/drilldowns/index.ts +++ b/x-pack/test/functional/apps/dashboard/drilldowns/index.ts @@ -26,6 +26,8 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) { loadTestFile(require.resolve('./dashboard_to_dashboard_drilldown')); loadTestFile(require.resolve('./dashboard_to_url_drilldown')); + // Requires xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled + // setting set in kibana.yml to work (not enabled by default) loadTestFile(require.resolve('./explore_data_panel_action')); // Disabled for now as it requires xpack.discoverEnhanced.actions.exploreDataInChart.enabled diff --git a/x-pack/test/functional/apps/lens/dashboard.ts b/x-pack/test/functional/apps/lens/dashboard.ts index 1490abb320ca..9998f1dd4cdc 100644 --- a/x-pack/test/functional/apps/lens/dashboard.ts +++ b/x-pack/test/functional/apps/lens/dashboard.ts @@ -86,6 +86,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(hasIpFilter).to.be(true); }); + // Requires xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled + // setting set in kibana.yml to work (not enabled by default) it('should be able to drill down to discover', async () => { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 0b22ab920287..f171e247472f 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -90,6 +90,7 @@ export default async function ({ readConfigFile }) { '--usageCollection.maximumWaitTimeForAllCollectorsInS=1', '--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions '--xpack.encryptedSavedObjects.encryptionKey="DkdXazszSCYexXqz4YktBGHCRkV6hyNK"', + '--xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled=true', '--timelion.ui.enabled=true', '--savedObjects.maxImportPayloadBytes=10485760', // for OSS test management/_import_objects ],