Skip to content

Commit

Permalink
[Fleet] Remove adopted showDevToolRequest feature flag (elastic#204586)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored and viduni94 committed Jan 23, 2025
1 parent f85b5fe commit 1160632
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 51 deletions.
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/common/experimental_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type ExperimentalFeatures = typeof allowedExperimentalValues;
const _allowedExperimentalValues = {
createPackagePolicyMultiPageLayout: true,
packageVerification: true,
showDevtoolsRequest: true,
diagnosticFileUploadEnabled: true,
displayAgentMetrics: true,
showIntegrationsSubcategories: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { i18n } from '@kbn/i18n';
import { omit } from 'lodash';
import { set } from '@kbn/safer-lodash-set';

import { ExperimentalFeaturesService } from '../../../../../services';
import {
generateCreatePackagePolicyDevToolsRequest,
generateCreateAgentPolicyDevToolsRequest,
Expand Down Expand Up @@ -39,12 +38,7 @@ export function useDevToolsRequest({
packageInfo?: PackageInfo;
packagePolicyId?: string;
}) {
const { showDevtoolsRequest: isShowDevtoolRequestExperimentEnabled } =
ExperimentalFeaturesService.get();

const showDevtoolsRequest =
!HIDDEN_API_REFERENCE_PACKAGES.includes(packageInfo?.name ?? '') &&
isShowDevtoolRequestExperimentEnabled;
const showDevtoolsRequest = !HIDDEN_API_REFERENCE_PACKAGES.includes(packageInfo?.name ?? '');

const [devtoolRequest, devtoolRequestDescription] = useMemo(() => {
if (selectedPolicyTab === SelectedPolicyTab.NEW) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
ConfirmDeployAgentPolicyModal,
} from '../../../components';
import { DevtoolsRequestFlyoutButton } from '../../../../../components';
import { ExperimentalFeaturesService } from '../../../../../services';
import { generateUpdateAgentPolicyDevToolsRequest } from '../../../services';
import { UNKNOWN_SPACE } from '../../../../../../../../common/constants';

Expand Down Expand Up @@ -155,7 +154,6 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>(
setIsLoading(false);
};

const { showDevtoolsRequest } = ExperimentalFeaturesService.get();
const devtoolRequest = useMemo(
() =>
generateUpdateAgentPolicyDevToolsRequest(
Expand Down Expand Up @@ -235,28 +233,26 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>(
/>
</EuiButtonEmpty>
</EuiFlexItem>
{showDevtoolsRequest ? (
<EuiFlexItem grow={false}>
<DevtoolsRequestFlyoutButton
isDisabled={
isLoading ||
Object.keys(validation).length > 0 ||
hasAdvancedSettingsErrors ||
hasInvalidSpaceError
<EuiFlexItem grow={false}>
<DevtoolsRequestFlyoutButton
isDisabled={
isLoading ||
Object.keys(validation).length > 0 ||
hasAdvancedSettingsErrors ||
hasInvalidSpaceError
}
btnProps={{
color: 'text',
}}
description={i18n.translate(
'xpack.fleet.editAgentPolicy.devtoolsRequestDescription',
{
defaultMessage: 'This Kibana request updates an agent policy.',
}
btnProps={{
color: 'text',
}}
description={i18n.translate(
'xpack.fleet.editAgentPolicy.devtoolsRequestDescription',
{
defaultMessage: 'This Kibana request updates an agent policy.',
}
)}
request={devtoolRequest}
/>
</EuiFlexItem>
) : null}
)}
request={devtoolRequest}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
onClick={onSubmit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { useAuthz, useStartServices, sendCreateAgentPolicy } from '../../../../h
import { AgentPolicyForm, agentPolicyFormValidation } from '../../components';
import { DevtoolsRequestFlyoutButton } from '../../../../components';
import { generateCreateAgentPolicyDevToolsRequest } from '../../services';
import { ExperimentalFeaturesService } from '../../../../services';
import { generateNewAgentPolicyWithDefaults } from '../../../../../../../common/services/generate_new_agent_policy';

const FlyoutWithHigherZIndex = styled(EuiFlyout)`
Expand Down Expand Up @@ -109,7 +108,6 @@ export const CreateAgentPolicyFlyout: React.FunctionComponent<Props> = ({
/>
</EuiFlyoutBody>
);
const { showDevtoolsRequest } = ExperimentalFeaturesService.get();
const agentPolicyContent = useMemo(
() => generateCreateAgentPolicyDevToolsRequest(agentPolicy, withSysMonitoring),
[agentPolicy, withSysMonitoring]
Expand All @@ -128,25 +126,23 @@ export const CreateAgentPolicyFlyout: React.FunctionComponent<Props> = ({
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="none">
{showDevtoolsRequest ? (
<EuiFlexItem grow={false}>
<DevtoolsRequestFlyoutButton
isDisabled={
isLoading ||
Object.keys(validation).length > 0 ||
hasAdvancedSettingsErrors ||
hasInvalidSpaceError
<EuiFlexItem grow={false}>
<DevtoolsRequestFlyoutButton
isDisabled={
isLoading ||
Object.keys(validation).length > 0 ||
hasAdvancedSettingsErrors ||
hasInvalidSpaceError
}
description={i18n.translate(
'xpack.fleet.createAgentPolicy.devtoolsRequestDescription',
{
defaultMessage: 'This Kibana request creates a new agent policy.',
}
description={i18n.translate(
'xpack.fleet.createAgentPolicy.devtoolsRequestDescription',
{
defaultMessage: 'This Kibana request creates a new agent policy.',
}
)}
request={agentPolicyContent}
/>
</EuiFlexItem>
) : null}
)}
request={agentPolicyContent}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
fill
Expand Down

0 comments on commit 1160632

Please sign in to comment.