diff --git a/x-pack/plugins/fleet/common/settings/agent_policy_settings.ts b/x-pack/plugins/fleet/common/settings/agent_policy_settings.ts index 9d23f948da3e6e..26d828acde9e17 100644 --- a/x-pack/plugins/fleet/common/settings/agent_policy_settings.ts +++ b/x-pack/plugins/fleet/common/settings/agent_policy_settings.ts @@ -137,12 +137,13 @@ export const AGENT_POLICY_ADVANCED_SETTINGS: SettingsConfig[] = [ description: i18n.translate( 'xpack.fleet.settings.agentPolicyAdvanced.agentLoggingLevelDescription', { - defaultMessage: 'Set the Agent log level. The default log level is "info".', + defaultMessage: + 'Sets the log level for all the agents on the policy. The default log level is "info"', } ), api_field: { name: 'agent_logging_level', }, - schema: z.nativeEnum(agentLoggingLevels), + schema: z.nativeEnum(agentLoggingLevels).default(agentLoggingLevels.Info), }, ]; diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/index.tsx index ce725773a462f1..292e308ad578f9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/index.tsx @@ -66,16 +66,18 @@ settingComponentRegistry.set(ZodFirstPartyTypeKind.ZodNativeEnum, (settingsConfi ( + renderItem={({ fieldKey, fieldValue, handleChange }: any) => ( ({ - text: level, - value: coercedSchema.enum[level], - }))} + options={Object.entries(settingsConfig.schema._def.innerType._def.values).map( + ([key, value]) => ({ + text: key, + value: value as string, + }) + )} /> )} /> diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/settings_field_wrapper.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/settings_field_wrapper.tsx index a19c8e67c1080c..6f92966c914706 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/settings_field_wrapper.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/form_settings/settings_field_wrapper.tsx @@ -76,9 +76,11 @@ export const SettingsFieldWrapper: React.FC<{ description={ <> {settingsConfig.description}.{' '} - - Learn more. - + {settingsConfig.learnMoreLink && ( + + Learn more. + + )} } >