Disable context menu "Explore underlying data" by default (#98039)

This commit is contained in:
Joe Reuter 2021-04-26 13:20:43 +02:00 committed by GitHub
parent 23e7b7fe88
commit deb62d4479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 3 deletions

View file

@ -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:

View file

@ -6,5 +6,8 @@
*/
export interface Config {
actions: { exploreDataInChart: { enabled: boolean } };
actions: {
exploreDataInChart: { enabled: boolean };
exploreDataInContextMenu: { enabled: boolean };
};
}

View file

@ -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);

View file

@ -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 }),
}),
}),
});

View file

@ -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

View file

@ -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();

View file

@ -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
],