mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.8`: - [[ML] Hiding pattern analysis button for non-time series data (#160051)](https://github.com/elastic/kibana/pull/160051) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"James Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2023-06-21T13:15:59Z","message":"[ML] Hiding pattern analysis button for non-time series data (#160051)\n\nThe `Run pattern analysis` button should only be available for time\r\nseries data.\r\nThis PR adds an additional check using the dataview's `isTimeBased`\r\nmethod.","sha":"bdf910ed50e1535ef99578a8a08b639835da3add","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:ML/AIOps","v8.9.0","v8.8.2"],"number":160051,"url":"https://github.com/elastic/kibana/pull/160051","mergeCommit":{"message":"[ML] Hiding pattern analysis button for non-time series data (#160051)\n\nThe `Run pattern analysis` button should only be available for time\r\nseries data.\r\nThis PR adds an additional check using the dataview's `isTimeBased`\r\nmethod.","sha":"bdf910ed50e1535ef99578a8a08b639835da3add"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160051","number":160051,"mergeCommit":{"message":"[ML] Hiding pattern analysis button for non-time series data (#160051)\n\nThe `Run pattern analysis` button should only be available for time\r\nseries data.\r\nThis PR adds an additional check using the dataview's `isTimeBased`\r\nmethod.","sha":"bdf910ed50e1535ef99578a8a08b639835da3add"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: James Gowdy <jgowdy@elastic.co>
This commit is contained in:
parent
e2c3c9a301
commit
7b648585e0
2 changed files with 7 additions and 2 deletions
|
@ -51,7 +51,7 @@ const action: Action = {
|
|||
execute: () => Promise.resolve(),
|
||||
};
|
||||
|
||||
const dataViewMock = { id: '1', toSpec: () => ({}) } as DataView;
|
||||
const dataViewMock = { id: '1', toSpec: () => ({}), isTimeBased: () => true } as DataView;
|
||||
|
||||
describe('categorize_trigger_utils', () => {
|
||||
afterEach(() => {
|
||||
|
|
|
@ -46,7 +46,12 @@ export async function canCategorize(
|
|||
field: DataViewField,
|
||||
dataView: DataView | undefined
|
||||
): Promise<boolean> {
|
||||
if (field.name === '_id' || !dataView?.id || !field.esTypes?.includes('text')) {
|
||||
if (
|
||||
field.name === '_id' ||
|
||||
!dataView?.id ||
|
||||
!dataView.isTimeBased() ||
|
||||
!field.esTypes?.includes('text')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue