From 3638a74e8b1573204fd8c81117fa43b87245532e Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 16 Oct 2020 12:33:56 -0400 Subject: [PATCH 1/4] Add code to display/hide UX section when appropriate. --- .../observability/public/pages/overview/data_sections.tsx | 2 +- x-pack/plugins/observability/public/pages/overview/index.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability/public/pages/overview/data_sections.tsx b/x-pack/plugins/observability/public/pages/overview/data_sections.tsx index dfb335902b7b8..9318489085d75 100644 --- a/x-pack/plugins/observability/public/pages/overview/data_sections.tsx +++ b/x-pack/plugins/observability/public/pages/overview/data_sections.tsx @@ -64,7 +64,7 @@ export function DataSections({ bucketSize, hasData, absoluteTime, relativeTime } /> )} - {hasData?.ux && ( + {hasData?.ux?.hasData && ( { if (id === 'alert') { return alertStatus !== FETCH_STATUS.FAILURE && !alerts.length; + } else if (id === 'ux') { + return !hasData[id]?.hasData; } return !hasData[id]; }); From ff8471527cad4826af4b0f8a926f83f1c63f4ed7 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 19 Oct 2020 19:11:41 -0400 Subject: [PATCH 2/4] Suppress errors with link to dedicated issue. --- .../observability/public/pages/overview/data_sections.tsx | 1 + x-pack/plugins/observability/public/pages/overview/index.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/x-pack/plugins/observability/public/pages/overview/data_sections.tsx b/x-pack/plugins/observability/public/pages/overview/data_sections.tsx index 9318489085d75..d58443d382596 100644 --- a/x-pack/plugins/observability/public/pages/overview/data_sections.tsx +++ b/x-pack/plugins/observability/public/pages/overview/data_sections.tsx @@ -64,6 +64,7 @@ export function DataSections({ bucketSize, hasData, absoluteTime, relativeTime } /> )} + {/* @ts-ignore see https://github.com/elastic/kibana/issues/81081 */} {hasData?.ux?.hasData && ( Date: Mon, 19 Oct 2020 19:15:35 -0400 Subject: [PATCH 3/4] Fix typo in call to action. --- .../observability/public/pages/overview/empty_section.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability/public/pages/overview/empty_section.ts b/x-pack/plugins/observability/public/pages/overview/empty_section.ts index 5b13f2bcbbbd7..e13efbb8ffdd2 100644 --- a/x-pack/plugins/observability/public/pages/overview/empty_section.ts +++ b/x-pack/plugins/observability/public/pages/overview/empty_section.ts @@ -80,7 +80,7 @@ export const getEmptySections = ({ core }: { core: AppMountContext['core'] }): I 'Performance is a distribution. Measure the experiences of all visitors to your web application and understand how to improve the experience for everyone.', }), linkTitle: i18n.translate('xpack.observability.emptySection.apps.ux.link', { - defaultMessage: 'Install Rum Agent', + defaultMessage: 'Install RUM Agent', }), href: core.http.basePath.prepend('/app/home#/tutorial/apm'), }, From 5e8b5d9087802abdf72b26d4b253b5dfb71a51a5 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 20 Oct 2020 10:42:53 -0400 Subject: [PATCH 4/4] Remove type error suppression. --- .../observability/public/pages/overview/data_sections.tsx | 3 +-- x-pack/plugins/observability/public/pages/overview/index.tsx | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/observability/public/pages/overview/data_sections.tsx b/x-pack/plugins/observability/public/pages/overview/data_sections.tsx index d58443d382596..2d3142d4e5804 100644 --- a/x-pack/plugins/observability/public/pages/overview/data_sections.tsx +++ b/x-pack/plugins/observability/public/pages/overview/data_sections.tsx @@ -64,8 +64,7 @@ export function DataSections({ bucketSize, hasData, absoluteTime, relativeTime } /> )} - {/* @ts-ignore see https://github.com/elastic/kibana/issues/81081 */} - {hasData?.ux?.hasData && ( + {(hasData.ux as UXHasDataResponse).hasData && ( ; @@ -89,8 +89,7 @@ export function OverviewPage({ routeParams }: Props) { if (id === 'alert') { return alertStatus !== FETCH_STATUS.FAILURE && !alerts.length; } else if (id === 'ux') { - // @ts-ignore see https://github.com/elastic/kibana/issues/81081 - return !hasData[id]?.hasData; + return !(hasData[id] as UXHasDataResponse).hasData; } return !hasData[id]; });