Skip to content

Commit

Permalink
[8.11] [ML] Disable anomaly detection job creation from ES|QL lens vi…
Browse files Browse the repository at this point in the history
…sualizations (#170711) (#170835)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[ML] Disable anomaly detection job creation from ES|QL lens
visualizations (#170711)](#170711)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-08T09:37:10Z","message":"[ML]
Disable anomaly detection job creation from ES|QL lens visualizations
(#170711)\n\nFixes
https://github.com/elastic/kibana/issues/170670\r\n\r\nWe currently do
not support ES|QL in anomaly detection jobs.\r\n\r\nAn ES|QL Lens vis
cannot have mixed layers, as in one layer using ES|QL\r\nand another
using DSL, therefore we need to completely disable the ML\r\naction item
in the menu.\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"c1681c8d49304f324895acbe73323ffacad3fcbc","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:Anomaly
Detection","v8.12.0","v8.11.1"],"number":170711,"url":"https://github.com/elastic/kibana/pull/170711","mergeCommit":{"message":"[ML]
Disable anomaly detection job creation from ES|QL lens visualizations
(#170711)\n\nFixes
https://github.com/elastic/kibana/issues/170670\r\n\r\nWe currently do
not support ES|QL in anomaly detection jobs.\r\n\r\nAn ES|QL Lens vis
cannot have mixed layers, as in one layer using ES|QL\r\nand another
using DSL, therefore we need to completely disable the ML\r\naction item
in the menu.\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"c1681c8d49304f324895acbe73323ffacad3fcbc"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170711","number":170711,"mergeCommit":{"message":"[ML]
Disable anomaly detection job creation from ES|QL lens visualizations
(#170711)\n\nFixes
https://github.com/elastic/kibana/issues/170670\r\n\r\nWe currently do
not support ES|QL in anomaly detection jobs.\r\n\r\nAn ES|QL Lens vis
cannot have mixed layers, as in one layer using ES|QL\r\nand another
using DSL, therefore we need to completely disable the ML\r\naction item
in the menu.\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"c1681c8d49304f324895acbe73323ffacad3fcbc"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: James Gowdy <[email protected]>
  • Loading branch information
kibanamachine and jgowdyelastic authored Nov 8, 2023
1 parent 809bffa commit f0a4ac0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ export async function getVisTypeFactory(lens: LensPublicStart) {
export async function isCompatibleVisualizationType(chartInfo: ChartInfo) {
return (
chartInfo.visualizationType === COMPATIBLE_VISUALIZATION &&
// @ts-expect-error esql is missing in the type
chartInfo.query.esql === undefined &&
chartInfo.layers.some((l) => l.layerType === layerTypes.DATA && l.dataView !== undefined)
);
}
Expand Down

0 comments on commit f0a4ac0

Please sign in to comment.