Skip to content

Commit

Permalink
[Cloud Security] Fix installing agent-based CSP integrations not disp…
Browse files Browse the repository at this point in the history
…laying Add Agent flyout (#212702)

(cherry picked from commit 42e0941)
  • Loading branch information
seanrathier committed Feb 28, 2025
1 parent 9f219c9 commit 71641d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
useIntegrationsStateContext,
useGetSettingsQuery,
} from '../../../../hooks';
import { useAgentless } from '../../../../../fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology';
import { INTEGRATIONS_ROUTING_PATHS } from '../../../../constants';
import { ExperimentalFeaturesService } from '../../../../services';
import {
Expand Down Expand Up @@ -136,6 +137,7 @@ export function Detail() {
const { getHref, getPath } = useLink();
const history = useHistory();
const { pathname, search, hash } = useLocation();
const { isAgentlessIntegration } = useAgentless();
const queryParams = useMemo(() => new URLSearchParams(search), [search]);
const integration = useMemo(() => queryParams.get('integration'), [queryParams]);
const prerelease = useMemo(() => Boolean(queryParams.get('prerelease')), [queryParams]);
Expand Down Expand Up @@ -416,6 +418,7 @@ export function Detail() {
isFirstTimeAgentUser,
isGuidedOnboardingActive,
pkgkey,
isAgentlessIntegration: isAgentlessIntegration(packageInfo || undefined),
});

/** Users from Security Solution onboarding page will have onboardingLink and onboardingAppId in the query params
Expand Down Expand Up @@ -444,12 +447,14 @@ export function Detail() {
hash,
history,
integration,
isAgentlessIntegration,
isCloud,
isExperimentalAddIntegrationPageEnabled,
isFirstTimeAgentUser,
isGuidedOnboardingActive,
onboardingAppId,
onboardingLink,
packageInfo,
pathname,
pkgkey,
search,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface GetInstallPkgRouteOptionsParams {
isExperimentalAddIntegrationPageEnabled: boolean;
isFirstTimeAgentUser: boolean;
isGuidedOnboardingActive: boolean;
isAgentlessIntegration?: boolean;
}

export type InstallPkgRouteOptions = [
Expand All @@ -52,6 +53,7 @@ export const getInstallPkgRouteOptions = ({
isCloud,
isExperimentalAddIntegrationPageEnabled,
isGuidedOnboardingActive,
isAgentlessIntegration,
}: GetInstallPkgRouteOptionsParams): InstallPkgRouteOptions => {
const integrationOpts: { integration?: string } = integration ? { integration } : {};
const packageExemptFromStepsLayout = isPackageExemptFromStepsLayout(pkgkey);
Expand Down Expand Up @@ -102,7 +104,7 @@ export const getInstallPkgRouteOptions = ({
}

const state: CreatePackagePolicyRouteState = {
onSaveNavigateTo: redirectToPath,
onSaveNavigateTo: !isAgentlessIntegration ? redirectToPath : undefined,
onSaveQueryParams,
onCancelNavigateTo: [
INTEGRATIONS_PLUGIN_ID,
Expand Down

0 comments on commit 71641d3

Please sign in to comment.