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] Adds icon to the Anomalies Table if detector has rules (elastic#…
…21135) (elastic#21142) * [ML] Adds icon to the Anomalies Table if detector has rules * [ML] Edit to tooltip message on anomalies table detetor rule icon
- Loading branch information
1 parent
340178a
commit 59b8c8e
Showing
5 changed files
with
73 additions
and
5 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
42 changes: 42 additions & 0 deletions
42
x-pack/plugins/ml/public/components/anomalies_table/detector_cell.js
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,42 @@ | ||
/* | ||
* 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 PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
import { | ||
EuiIcon, | ||
EuiToolTip | ||
} from '@elastic/eui'; | ||
|
||
/* | ||
* Component for rendering a detector cell in the anomalies table, displaying the | ||
* description of the detector, and an icon if rules have been configured for the detector. | ||
*/ | ||
export function DetectorCell({ detectorDescription, numberOfRules }) { | ||
let rulesIcon; | ||
if (numberOfRules !== undefined && numberOfRules > 0) { | ||
rulesIcon = ( | ||
<EuiToolTip content="rules have been configured for this detector"> | ||
<EuiIcon | ||
type="controlsHorizontal" | ||
className="detector-rules-icon" | ||
/> | ||
</EuiToolTip> | ||
); | ||
} | ||
return ( | ||
<React.Fragment> | ||
{detectorDescription} | ||
{rulesIcon} | ||
</React.Fragment> | ||
); | ||
} | ||
DetectorCell.propTypes = { | ||
detectorDescription: PropTypes.string.isRequired, | ||
numberOfRules: PropTypes.number | ||
}; |
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