[Security Solution][Detection Engine] removes feature flag for AI assistant on rule create form in 8.15 (#188294)

## Summary

- removes feature flag `AIAssistantOnRuleCreationFormEnabled` for 8.15
ESS release
This commit is contained in:
Vitalii Dmyterko 2024-07-16 09:38:26 +01:00 committed by GitHub
parent fa883058cc
commit 42d76f9f1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 30 deletions

View file

@ -153,11 +153,6 @@ export const allowedExperimentalValues = Object.freeze({
*/
protectionUpdatesEnabled: true,
/**
* Enables AI assistant on rule creation form when query has error
*/
AIAssistantOnRuleCreationFormEnabled: false,
/**
* Disables the timeline save tour.
* This flag is used to disable the tour in cypress tests.

View file

@ -25,7 +25,6 @@ import {
createIndexPatternField,
getSelectToggleButtonForName,
} from '../../../rule_creation/components/required_fields/required_fields.test';
import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
// Mocks integrations
jest.mock('../../../fleet_integrations/api');
@ -49,11 +48,6 @@ jest.mock('../ai_assistant', () => {
};
});
jest.mock('../../../../common/hooks/use_experimental_features', () => ({
useIsExperimentalFeatureEnabled: jest.fn(),
}));
const useIsExperimentalFeatureEnabledMock = useIsExperimentalFeatureEnabled as jest.Mock;
const mockRedirectLegacyUrl = jest.fn();
const mockGetLegacyUrlConflict = jest.fn();
jest.mock('../../../../common/lib/kibana', () => {
@ -631,9 +625,6 @@ describe('StepDefineRule', () => {
});
describe('AI assistant', () => {
beforeEach(() => {
useIsExperimentalFeatureEnabledMock.mockReturnValue(true);
});
it('renders assistant when query is not valid', () => {
render(<TestForm formProps={{ isQueryBarValid: false, ruleType: 'query' }} />, {
wrapper: TestProviders,
@ -642,16 +633,6 @@ describe('StepDefineRule', () => {
expect(screen.getByTestId('ai-assistant')).toBeInTheDocument();
});
it('does not render assistant when feature flag is disabled', () => {
useIsExperimentalFeatureEnabledMock.mockReturnValue(false);
render(<TestForm formProps={{ isQueryBarValid: false, ruleType: 'query' }} />, {
wrapper: TestProviders,
});
expect(screen.queryByTestId('ai-assistant')).toBe(null);
});
it('does not render assistant when query is valid', () => {
render(<TestForm formProps={{ isQueryBarValid: true, ruleType: 'query' }} />, {
wrapper: TestProviders,

View file

@ -54,7 +54,6 @@ import { MlJobSelect } from '../../../rule_creation/components/ml_job_select';
import { PickTimeline } from '../../../rule_creation/components/pick_timeline';
import { StepContentWrapper } from '../../../rule_creation/components/step_content_wrapper';
import { ThresholdInput } from '../threshold_input';
import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
import { SuppressionInfoIcon } from '../suppression_info_icon';
import { EsqlInfoIcon } from '../../../rule_creation/components/esql_info_icon';
import {
@ -217,10 +216,6 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
const isThresholdRule = getIsThresholdRule(ruleType);
const alertSuppressionUpsellingMessage = useUpsellingMessage('alert_suppression_rule_form');
const isAIAssistantEnabled = useIsExperimentalFeatureEnabled(
'AIAssistantOnRuleCreationFormEnabled'
);
const { getFields, reset, setFieldValue } = form;
const setRuleTypeCallback = useSetFieldValueWithCallback({
@ -953,7 +948,7 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
</>
</RuleTypeEuiFormRow>
{isAIAssistantEnabled && !isMlRule(ruleType) && !isQueryBarValid && (
{!isMlRule(ruleType) && !isQueryBarValid && (
<AiAssistant getFields={form.getFields} language={queryBar?.query?.language} />
)}