Skip to content

Commit

Permalink
[Security Solution] - Rename esql setting (elastic#182432)
Browse files Browse the repository at this point in the history
## Summary

Follow up to this PR: elastic#181616
Renaming `discover:enableEsql` to `enableESQL` according to this change:
elastic#182074
  • Loading branch information
michaelolo24 authored and yuliacech committed May 3, 2024
1 parent 9a149d6 commit db57ca5
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit db57ca5

Please sign in to comment.