-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ML] Adds action to add log rate analysis to a case #201549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d98e6ae
add attachment to a case
rbrtj 6983e2e
disable cases action when no results && fix open in log pattern action
rbrtj 7c159cb
update tests
rbrtj 165760d
Merge branch 'main' into log-rate-analysis-cases-attachment
rbrtj 5094b7c
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine 6596fce
fix types
rbrtj 31a3be7
update aiops bundle size limit
rbrtj d4c36b3
make attachments tests more data agnostic
rbrtj 114c9ce
update registered persistable state attachment types
rbrtj f126a00
update cases attachment removal message
rbrtj 99cca0b
disable action after hitting reset fix && different messages for disa…
rbrtj 0713825
hide analysis control buttons in cases embeddable
rbrtj 25cfeff
Merge branch 'main' into log-rate-analysis-cases-attachment
rbrtj 7fec42e
update aiops bundle size limit
rbrtj a16acf2
move log rate cases functional test to a separate file
rbrtj 33d5e29
add dots to disabled button messages
rbrtj 829d037
Merge branch 'main' into log-rate-analysis-cases-attachment
rbrtj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
x-pack/plugins/aiops/public/cases/log_rate_analysis_attachment.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { memoize } from 'lodash'; | ||
| import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; | ||
| import type { PersistableStateAttachmentViewProps } from '@kbn/cases-plugin/public/client/attachment_framework/types'; | ||
| import { FIELD_FORMAT_IDS } from '@kbn/field-formats-plugin/common'; | ||
| import { FormattedMessage } from '@kbn/i18n-react'; | ||
| import { EuiDescriptionList } from '@elastic/eui'; | ||
| import type { | ||
| LogRateAnalysisEmbeddableWrapper, | ||
| LogRateAnalysisEmbeddableWrapperProps, | ||
| } from '../shared_components/log_rate_analysis_embeddable_wrapper'; | ||
|
|
||
| export const initComponent = memoize( | ||
| (fieldFormats: FieldFormatsStart, LogRateAnalysisComponent: LogRateAnalysisEmbeddableWrapper) => { | ||
| return React.memo((props: PersistableStateAttachmentViewProps) => { | ||
| const { persistableStateAttachmentState } = props; | ||
| const dataFormatter = fieldFormats.deserialize({ | ||
| id: FIELD_FORMAT_IDS.DATE, | ||
| }); | ||
| const inputProps = | ||
| persistableStateAttachmentState as unknown as LogRateAnalysisEmbeddableWrapperProps; | ||
|
|
||
| const listItems = [ | ||
| { | ||
| title: ( | ||
| <FormattedMessage | ||
| id="xpack.aiops.logRateAnalysis.cases.timeRangeLabel" | ||
| defaultMessage="Time range" | ||
| /> | ||
| ), | ||
| description: `${dataFormatter.convert( | ||
| inputProps.timeRange.from | ||
| )} - ${dataFormatter.convert(inputProps.timeRange.to)}`, | ||
| }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <> | ||
| <EuiDescriptionList compressed type={'inline'} listItems={listItems} /> | ||
| <LogRateAnalysisComponent {...inputProps} embeddingOrigin={'cases'} /> | ||
| </> | ||
| ); | ||
| }); | ||
| } | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.