fix: [Rules > Rule detail][AXE-CORE]: Interactive controls must not be nested (#177278)

Closes: https://github.com/elastic/security-team/issues/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](4fa51c27-eb82-46d3-a071-5d29e944aa5e)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Alexey Antonov 2024-02-22 11:02:30 +02:00 committed by GitHub
parent 45ce4c3f31
commit 03a737266f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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';
@ -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>