forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Show better file structure finder explanations (elastic#62316)
* [ML] Show better file structure finder explanations * more typescript changes * changing function format * fixing some types * fixing translation id * fix boom error reporting * changes based on review Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
d44699e
commit 6c6e812
Showing
43 changed files
with
609 additions
and
268 deletions.
There are no files selected for viewing
This file contains 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 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 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
File renamed without changes.
This file contains 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 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
File renamed without changes.
This file contains 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
File renamed without changes.
82 changes: 82 additions & 0 deletions
82
...pplication/datavisualizer/file_based/components/explanation_flyout/explanation_flyout.tsx
This file contains 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,82 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { FC } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { | ||
EuiFlyout, | ||
EuiFlyoutFooter, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiFlyoutHeader, | ||
EuiButtonEmpty, | ||
EuiTitle, | ||
EuiFlyoutBody, | ||
EuiSpacer, | ||
EuiText, | ||
EuiSubSteps, | ||
} from '@elastic/eui'; | ||
import { FindFileStructureResponse } from '../../../../../../common/types/file_datavisualizer'; | ||
|
||
interface Props { | ||
results: FindFileStructureResponse; | ||
closeFlyout(): void; | ||
} | ||
export const ExplanationFlyout: FC<Props> = ({ results, closeFlyout }) => { | ||
const explanation = results.explanation!; | ||
return ( | ||
<EuiFlyout onClose={closeFlyout} hideCloseButton size={'m'}> | ||
<EuiFlyoutHeader hasBorder> | ||
<EuiTitle size="m"> | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.ml.fileDatavisualizer.explanationFlyout.title" | ||
defaultMessage="Analysis explanation" | ||
/> | ||
</h2> | ||
</EuiTitle> | ||
</EuiFlyoutHeader> | ||
<EuiFlyoutBody> | ||
<Content explanation={explanation} /> | ||
</EuiFlyoutBody> | ||
<EuiFlyoutFooter> | ||
<EuiFlexGroup justifyContent="spaceBetween"> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty iconType="cross" onClick={closeFlyout} flush="left"> | ||
<FormattedMessage | ||
id="xpack.ml.fileDatavisualizer.explanationFlyout.closeButton" | ||
defaultMessage="Close" | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlyoutFooter> | ||
</EuiFlyout> | ||
); | ||
}; | ||
|
||
const Content: FC<{ explanation: string[] }> = ({ explanation }) => ( | ||
<> | ||
<EuiText size={'s'}> | ||
<FormattedMessage | ||
id="xpack.ml.fileDatavisualizer.explanationFlyout.content" | ||
defaultMessage="The logical steps that have produced the analysis results." | ||
/> | ||
|
||
<EuiSpacer size="l" /> | ||
<EuiSubSteps> | ||
<ul style={{ wordBreak: 'break-word' }}> | ||
{explanation.map((e, i) => ( | ||
<li key={i}> | ||
{e} | ||
<EuiSpacer size="s" /> | ||
</li> | ||
))} | ||
</ul> | ||
</EuiSubSteps> | ||
</EuiText> | ||
</> | ||
); |
This file contains 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 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
File renamed without changes.
Oops, something went wrong.