Skip to content
Merged
Show file tree
Hide file tree
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 @@ -49,6 +49,7 @@ import {
useGetSettingsQuery,
} from '../../../../hooks';
import { useAgentless } from '../../../../../fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology';
import { isOnlyAgentlessIntegration } from '../../../../../../../common/services/agentless_policy_helper';
import { INTEGRATIONS_ROUTING_PATHS } from '../../../../constants';
import { useGetPackageInfoByKeyQuery, useLink, useAgentPolicyContext } from '../../../../hooks';
import { ExperimentalFeaturesService, pkgKeyFromPackageInfo } from '../../../../services';
Expand Down Expand Up @@ -436,6 +437,11 @@ export function Detail() {
integration ?? undefined
);

const isAgentlessByDefault =
agentlessStatus.isAgentless &&
(isOnlyAgentlessIntegration(packageInfo ?? undefined, integration ?? undefined) ||
agentlessStatus.isDefaultDeploymentMode);

const defaultNavigateOptions: InstallPkgRouteOptions = getInstallPkgRouteOptions({
agentPolicyId: agentPolicyIdFromContext,
currentPath,
Expand All @@ -445,7 +451,7 @@ export function Detail() {
pkgkey,
prerelease,
isAgentlessIntegration: agentlessStatus.isAgentless,
isAgentlessDefault: agentlessStatus.isDefaultDeploymentMode,
isAgentlessByDefault,
});

/** Users from Security and Observability Solution onboarding pages will have returnAppId and returnPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ describe('getInstallPkgRouteOptions', () => {
expect(getInstallPkgRouteOptions(opts)[1]).toMatchObject(expectedOptions);
});

it('should not use multi-page layout if isAgentlessDefault is true', () => {
it('should not use multi-page layout if isAgentlessByDefault is true', () => {
const opts = {
currentPath: 'currentPath',
integration: 'myintegration',
pkgkey: 'myintegration-1.0.0',
isFirstTimeAgentUser: true,
isCloud: true,
isExperimentalAddIntegrationPageEnabled: true,
isAgentlessDefault: true,
isAgentlessByDefault: true,
};

const expectedOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface GetInstallPkgRouteOptionsParams {
isCloud: boolean;
isFirstTimeAgentUser: boolean;
isAgentlessIntegration?: boolean;
isAgentlessDefault?: boolean;
isAgentlessByDefault?: boolean;
prerelease?: boolean;
}

Expand All @@ -53,13 +53,16 @@ export const getInstallPkgRouteOptions = ({
isFirstTimeAgentUser,
isCloud,
isAgentlessIntegration,
isAgentlessDefault,
isAgentlessByDefault,
prerelease,
}: GetInstallPkgRouteOptionsParams): InstallPkgRouteOptions => {
const integrationOpts: { integration?: string } = integration ? { integration } : {};
const packageExemptFromStepsLayout = isPackageExemptFromStepsLayout(pkgkey);
// Multi-page layout leads with "Install Elastic Agent" — not applicable when
// agentless is the effective default for this integration (agentless-only or
// agentless marked as default).
const useMultiPageLayout =
isCloud && isFirstTimeAgentUser && !packageExemptFromStepsLayout && !isAgentlessDefault;
isCloud && isFirstTimeAgentUser && !packageExemptFromStepsLayout && !isAgentlessByDefault;
const path = pagePathGetters.add_integration_to_policy({
pkgkey,
useMultiPageLayout,
Expand Down
Loading