-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[8.11] [Security Solution] Adds feature flag to enable/disable ESQL in timeline (#174029) #174112
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ import { useDispatch } from 'react-redux'; | |
import styled from 'styled-components'; | ||
|
||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; | ||
import { useKibana } from '../../../../common/lib/kibana'; | ||
import { useAssistantTelemetry } from '../../../../assistant/use_assistant_telemetry'; | ||
import { useConversationStore } from '../../../../assistant/use_conversation_store'; | ||
import { useAssistantAvailability } from '../../../../assistant/use_assistant_availability'; | ||
|
@@ -132,6 +134,7 @@ const ActiveTimelineTab = memo<ActiveTimelineTabProps>( | |
setConversationId, | ||
showTimeline, | ||
}) => { | ||
const isEsqlSettingEnabled = useKibana().services.configSettings.ESQLEnabled; | ||
const { hasAssistantPrivilege } = useAssistantAvailability(); | ||
const getTab = useCallback( | ||
(tab: TimelineTabs) => { | ||
|
@@ -179,12 +182,14 @@ const ActiveTimelineTab = memo<ActiveTimelineTabProps>( | |
timelineId={timelineId} | ||
/> | ||
</HideShowContainer> | ||
<HideShowContainer | ||
$isVisible={TimelineTabs.esql === activeTimelineTab} | ||
data-test-subj={`timeline-tab-content-${TimelineTabs.esql}`} | ||
> | ||
<EsqlTab timelineId={timelineId} /> | ||
</HideShowContainer> | ||
{showTimeline && isEsqlSettingEnabled && activeTimelineTab === TimelineTabs.esql && ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this conditional goes away entirely as well since not already in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This conditional is now the same as https://github.com/elastic/kibana/pull/173640/files#diff-c9eb10e636b9cedb21368945df018d08cb60b87ccf469be22cbab0abd7ae5ed3R182, which should merge first and be an empty change here. |
||
<HideShowContainer | ||
$isVisible={true} | ||
data-test-subj={`timeline-tab-content-${TimelineTabs.esql}`} | ||
> | ||
<EsqlTab timelineId={timelineId} /> | ||
</HideShowContainer> | ||
)} | ||
<HideShowContainer | ||
$isVisible={TimelineTabs.pinned === activeTimelineTab} | ||
data-test-subj={`timeline-tab-content-${TimelineTabs.pinned}`} | ||
|
@@ -281,6 +286,8 @@ const TabsContentComponent: React.FC<BasicTimelineTab> = ({ | |
sessionViewConfig, | ||
timelineDescription, | ||
}) => { | ||
const isEsqlTabInTimelineDisabled = useIsExperimentalFeatureEnabled('timelineEsqlTabDisabled'); | ||
const isEsqlSettingEnabled = useKibana().services.configSettings.ESQLEnabled; | ||
spong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const { hasAssistantPrivilege } = useAssistantAvailability(); | ||
const dispatch = useDispatch(); | ||
const getActiveTab = useMemo(() => getActiveTabSelector(), []); | ||
|
@@ -394,26 +401,28 @@ const TabsContentComponent: React.FC<BasicTimelineTab> = ({ | |
<span>{i18n.QUERY_TAB}</span> | ||
{showTimeline && <TimelineEventsCountBadge />} | ||
</StyledEuiTab> | ||
<StyledEuiTab | ||
data-test-subj={`timelineTabs-${TimelineTabs.esql}`} | ||
onClick={setEsqlAsActiveTab} | ||
isSelected={activeTab === TimelineTabs.esql} | ||
disabled={false} | ||
key={TimelineTabs.esql} | ||
> | ||
<span>{i18n.DISCOVER_ESQL_IN_TIMELINE_TAB}</span> | ||
<StyledEuiBetaBadge | ||
label={DISCOVER_ESQL_IN_TIMELINE_TECHNICAL_PREVIEW} | ||
size="s" | ||
iconType="beaker" | ||
tooltipContent={ | ||
<FormattedMessage | ||
id="xpack.securitySolution.timeline.tabs.discoverEsqlInTimeline.technicalPreviewTooltip" | ||
defaultMessage="This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features." | ||
/> | ||
} | ||
/> | ||
</StyledEuiTab> | ||
{!isEsqlTabInTimelineDisabled && isEsqlSettingEnabled && ( | ||
<StyledEuiTab | ||
data-test-subj={`timelineTabs-${TimelineTabs.esql}`} | ||
onClick={setEsqlAsActiveTab} | ||
isSelected={activeTab === TimelineTabs.esql} | ||
disabled={false} | ||
key={TimelineTabs.esql} | ||
> | ||
<span>{i18n.DISCOVER_ESQL_IN_TIMELINE_TAB}</span> | ||
<StyledEuiBetaBadge | ||
label={DISCOVER_ESQL_IN_TIMELINE_TECHNICAL_PREVIEW} | ||
size="s" | ||
iconType="beaker" | ||
tooltipContent={ | ||
<FormattedMessage | ||
id="xpack.securitySolution.timeline.tabs.discoverEsqlInTimeline.technicalPreviewTooltip" | ||
defaultMessage="This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features." | ||
/> | ||
} | ||
/> | ||
</StyledEuiTab> | ||
)} | ||
{timelineType === TimelineType.default && ( | ||
<StyledEuiTab | ||
data-test-subj={`timelineTabs-${TimelineTabs.eql}`} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@logeekal, based on the note in #173640, I think we need to remove all occurrences of
isEsqlSettingEnabled
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spong, Conditional render should same as here without
isEsqlSettingEnabled
. Does that make sense?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thank you!
Here is the updated conditional without
isEsqlSettingEnabled
:https://github.com/elastic/kibana/pull/174112/files#diff-c9eb10e636b9cedb21368945df018d08cb60b87ccf469be22cbab0abd7ae5ed3R401