From 8fdb79ea8cac7686688c430ae128efc14386c69d Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Sun, 12 Jul 2020 17:02:36 -0700 Subject: [PATCH] Really fix types --- .../services/has_invalid_but_required_var.ts | 3 +- .../edit_package_config_page/index.tsx | 41 ++++++++++--------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts index a3a13a9d70764..f632d40a05621 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts @@ -17,7 +17,8 @@ export const hasInvalidButRequiredVar = ( registryVars.find( (registryVar) => registryVar.required && - (!packageConfigVars[registryVar.name] || + (!packageConfigVars || + !packageConfigVars[registryVar.name] || validatePackageConfigConfig(packageConfigVars[registryVar.name], registryVar)?.length) ) ) diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx index a832169e39ca3..f4411a6057a15 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx @@ -278,27 +278,28 @@ export const EditPackageConfigPage: React.FunctionComponent = () => { }; const configurePackage = useMemo( - () => ( - <> - + () => + agentConfig && packageInfo ? ( + <> + - - - ), + + + ) : null, [ agentConfig, formState,