mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] AIOps: Enable event_generating_elements_should_be_instrumented
eslint rule. (#167317)
Implements #153108. This enables the `@kbn/telemetry/event_generating_elements_should_be_instrumented` eslint rule for the `aiops` plugin to enforce `data-test-subj` attributes on actionable EUI components so they are auto-instrumented by telemetry. The ids were first auto-created using `node scripts/eslint --fix x-pack/plugins/aiops` and then adapted.
This commit is contained in:
parent
8a2701cf21
commit
adc9ab9c52
9 changed files with 26 additions and 3 deletions
|
@ -908,6 +908,7 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
files: [
|
||||
'x-pack/plugins/aiops/**/*.{js,mjs,ts,tsx}',
|
||||
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
|
||||
'x-pack/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}',
|
||||
'x-pack/plugins/infra/**/*.{js,mjs,ts,tsx}',
|
||||
|
|
|
@ -356,6 +356,7 @@ const FieldPanel: FC<FieldPanelProps> = ({
|
|||
<EuiSpacer size={'m'} />
|
||||
|
||||
<EuiButton
|
||||
data-test-subj="aiopsChangePointDetectionSubmitDashboardAttachButton"
|
||||
fill
|
||||
type={'submit'}
|
||||
fullWidth
|
||||
|
@ -441,6 +442,7 @@ const FieldPanel: FC<FieldPanelProps> = ({
|
|||
<EuiFlexGroup alignItems={'center'} gutterSize={'s'}>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonIcon
|
||||
data-test-subj="aiopsChangePointDetectionExpandConfigButton"
|
||||
iconType={isExpanded ? 'arrowDown' : 'arrowRight'}
|
||||
onClick={setIsExpanded.bind(null, (prevState) => !prevState)}
|
||||
aria-label={i18n.translate('xpack.aiops.changePointDetection.expandConfigLabel', {
|
||||
|
@ -480,6 +482,7 @@ const FieldPanel: FC<FieldPanelProps> = ({
|
|||
id={`panelContextMenu_${panelIndex}`}
|
||||
button={
|
||||
<EuiButtonIcon
|
||||
data-test-subj="aiopsChangePointDetectionContextMenuButton"
|
||||
aria-label={i18n.translate(
|
||||
'xpack.aiops.changePointDetection.configActionsLabel',
|
||||
{
|
||||
|
|
|
@ -42,6 +42,7 @@ export const MaxSeriesControl: FC<{
|
|||
label={inline ? undefined : label}
|
||||
>
|
||||
<EuiFieldNumber
|
||||
data-test-subj="aiopsMaxSeriesControlFieldNumber"
|
||||
disabled={disabled}
|
||||
prepend={inline ? label : undefined}
|
||||
append={
|
||||
|
|
|
@ -51,6 +51,7 @@ export const TableHeader: FC<Props> = ({
|
|||
<>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
data-test-subj="aiopsLogPatternAnalysisOpenInDiscoverIncludeButton"
|
||||
size="s"
|
||||
onClick={() => openInDiscover(QUERY_MODE.INCLUDE)}
|
||||
iconType="plusInCircle"
|
||||
|
@ -61,6 +62,7 @@ export const TableHeader: FC<Props> = ({
|
|||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty
|
||||
data-test-subj="aiopsLogPatternAnalysisOpenInDiscoverExcludeButton"
|
||||
size="s"
|
||||
onClick={() => openInDiscover(QUERY_MODE.EXCLUDE)}
|
||||
iconType="minusInCircle"
|
||||
|
|
|
@ -43,7 +43,12 @@ export const LoadingCategorization: FC<Props> = ({ onClose }) => (
|
|||
<EuiFlexItem>
|
||||
<EuiFlexGroup justifyContent="spaceAround">
|
||||
<EuiFlexItem grow={false} css={{ textAlign: 'center' }}>
|
||||
<EuiButton onClick={() => onClose()}>Cancel</EuiButton>
|
||||
<EuiButton
|
||||
data-test-subj="aiopsLoadingCategorizationCancelButton"
|
||||
onClick={() => onClose()}
|
||||
>
|
||||
Cancel
|
||||
</EuiButton>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
|
|
|
@ -324,7 +324,12 @@ export const LogCategorizationPage: FC = () => {
|
|||
/>
|
||||
</EuiButton>
|
||||
) : (
|
||||
<EuiButton onClick={() => cancelRequest()}>Cancel</EuiButton>
|
||||
<EuiButton
|
||||
data-test-subj="aiopsLogCategorizationPageCancelButton"
|
||||
onClick={() => cancelRequest()}
|
||||
>
|
||||
Cancel
|
||||
</EuiButton>
|
||||
)}
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem />
|
||||
|
|
|
@ -92,6 +92,7 @@ export const RandomSamplerRangeSlider = ({
|
|||
data-test-subj="dvRandomSamplerProbabilityRange"
|
||||
append={
|
||||
<EuiButton
|
||||
data-test-subj="aiopsRandomSamplerRangeSliderApplyButton"
|
||||
disabled={isInvalidSamplingProbabilityInput}
|
||||
onClick={() => {
|
||||
if (setSamplingProbability && isDefined(samplingProbabilityInput)) {
|
||||
|
|
|
@ -118,6 +118,7 @@ export const SamplingMenu: FC<Props> = ({ randomSampler, reload }) => {
|
|||
id="aiopsSamplingOptions"
|
||||
button={
|
||||
<EuiButtonEmpty
|
||||
data-test-subj="aiopsLogPatternAnalysisShowSamplingOptionsButton"
|
||||
onClick={() => setShowSamplingOptionsPopover(!showSamplingOptionsPopover)}
|
||||
iconSide="right"
|
||||
iconType="arrowDown"
|
||||
|
|
|
@ -409,7 +409,11 @@ export const LogRateAnalysisResults: FC<LogRateAnalysisResultsProps> = ({
|
|||
)}
|
||||
{overrides !== undefined ? (
|
||||
<p>
|
||||
<EuiButton size="s" onClick={() => startHandler(true)}>
|
||||
<EuiButton
|
||||
data-test-subj="aiopsLogRateAnalysisResultsTryToContinueAnalysisButton"
|
||||
size="s"
|
||||
onClick={() => startHandler(true)}
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.aiops.logRateAnalysis.page.tryToContinueAnalysisButtonText"
|
||||
defaultMessage="Try to continue analysis"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue