Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] - Rename esql setting #182432

Merged
merged 3 commits into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
*/

import { useMemo } from 'react';
import { ENABLE_ESQL } from '@kbn/esql-utils';
import { useKibana } from '../../lib/kibana';
import { useIsExperimentalFeatureEnabled } from '../use_experimental_features';

/**
* This hook combines the checks for esql availability within the security solution
* If the advanced setting is disabled, ESQL will not be accessible in the UI for any new timeline or new rule creation workflows
* The feature flags are still available to provide users an escape hatch in case of any esql related performance issues
*/
export const useEsqlAvailability = () => {
const { uiSettings } = useKibana().services;
const isEsqlAdvancedSettingEnabled = uiSettings?.get('discover:enableESQL');
const isEsqlAdvancedSettingEnabled = uiSettings?.get(ENABLE_ESQL);
const isEsqlRuleTypeEnabled =
!useIsExperimentalFeatureEnabled('esqlRulesDisabled') && isEsqlAdvancedSettingEnabled;
const isESQLTabInTimelineEnabled =
Expand Down