[lens] [ES|QL] - Remove drill-down capabilities on ES|QL charts / panels (#176741)

Closes https://github.com/elastic/kibana/issues/176245

### test instructions
1. install web logs sample data
2. create new dashboard
3. click "Add panel" -> "ES|QL".
4. Set ESQL to `from kibana_sample_data_logs | stats count() by
machine.os`. Click "Run".
5. Open context menu and verify "Create drilldown" action is not
available.
<img width="400" alt="Screenshot 2024-02-12 at 11 46 29 AM"
src="bc99b116-7fe1-4334-bf4c-d0d02595f42d">
6. Create regular lens panel. Verify "Create drilldown" action is
available in context menu.
<img width="400" alt="Screenshot 2024-02-12 at 11 46 42 AM"
src="fb87d06c-6cbe-479b-9acd-f6463ca54e87">
This commit is contained in:
Nathan Reese 2024-02-13 07:26:29 -07:00 committed by GitHub
parent 831cfd21ef
commit d11b73d55a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -914,6 +914,12 @@ export class Embeddable
savedObjectId: (input as LensByReferenceInput)?.savedObjectId,
};
if (this.isTextBasedLanguage()) {
this.updateInput({
disabledActions: ['OPEN_FLYOUT_ADD_DRILLDOWN'],
});
}
try {
const { ast, indexPatterns, indexPatternRefs, activeVisualizationState } =
await getExpressionFromDocument(this.savedVis, this.deps.documentToExpression);