Skip to content

Commit

Permalink
fix: [Rules > Rule detail][AXE-CORE]: Interactive controls must not b…
Browse files Browse the repository at this point in the history
…e nested (elastic#177278)

Closes: elastic/security-team#8617

# Description 

The [axe browser plugin](https://deque.com/axe) is reporting a nested
button (interactive control)in the Rule detail view for toggling the
Elastic AI assistant. This PR address that issue by removing extra
`EuiButton` wrapping

# Screens 


![image](https://github.com/elastic/kibana/assets/20072247/4fa51c27-eb82-46d3-a071-5d29e944aa5e)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and fkanout committed Mar 4, 2024
1 parent 5bd106c commit 3b8f5b9
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useCallback } from 'react';

import { EuiButton, EuiCallOut, EuiCodeBlock } from '@elastic/eui';
import { EuiCallOut, EuiCodeBlock } from '@elastic/eui';

import { NewChat } from '@kbn/elastic-assistant';
import { FormattedDate } from '../../../../common/components/formatted_date';
Expand Down Expand Up @@ -76,19 +76,17 @@ const RuleStatusFailedCallOutComponent: React.FC<RuleStatusFailedCallOutProps> =
{message}
</EuiCodeBlock>
{hasAssistantPrivilege && (
<EuiButton color={color} size="s">
<NewChat
category="detection-rules"
color={color}
conversationId={i18nAssistant.DETECTION_RULES_CONVERSATION_ID}
description={i18n.ASK_ASSISTANT_DESCRIPTION}
getPromptContext={getPromptContext}
suggestedUserPrompt={i18n.ASK_ASSISTANT_USER_PROMPT}
tooltip={i18n.ASK_ASSISTANT_TOOLTIP}
>
{i18n.ASK_ASSISTANT_ERROR_BUTTON}
</NewChat>
</EuiButton>
<NewChat
category="detection-rules"
color={color}
conversationId={i18nAssistant.DETECTION_RULES_CONVERSATION_ID}
description={i18n.ASK_ASSISTANT_DESCRIPTION}
getPromptContext={getPromptContext}
suggestedUserPrompt={i18n.ASK_ASSISTANT_USER_PROMPT}
tooltip={i18n.ASK_ASSISTANT_TOOLTIP}
>
{i18n.ASK_ASSISTANT_ERROR_BUTTON}
</NewChat>
)}
</EuiCallOut>
</div>
Expand Down

0 comments on commit 3b8f5b9

Please sign in to comment.