From 1f383bbb7c07e5b5e2f7892731bb0c68fc79e749 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 14 Jan 2021 00:24:40 -0500 Subject: [PATCH 1/5] Clarity of error vs problem --- .../src/components/KubernetesContent/ErrorPanel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx index 85060fc11b..650e6ddff1 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx @@ -52,8 +52,8 @@ export const ErrorPanel = ({ clustersWithErrors, }: ErrorPanelProps) => ( {clustersWithErrors && (
Errors: {clustersWithErrorsToErrorMessage(clustersWithErrors)}
From bfa6e1ad0a150e08b2da0217e3a98c38ebf00aee Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 14 Jan 2021 00:25:30 -0500 Subject: [PATCH 2/5] Change grid to add spacing for ErrorPanel --- .../KubernetesContent/KubernetesContent.tsx | 88 ++++++++++--------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx index 293e7a4833..39e73782f1 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx @@ -106,51 +106,55 @@ export const KubernetesContent = ({ entity }: KubernetesContentProps) => { return ( - - {kubernetesObjects === undefined && error === undefined && ( - - )} + {kubernetesObjects === undefined && error === undefined && } - {/* errors retrieved from the kubernetes clusters */} - {clustersWithErrors.length > 0 && ( - - )} + {/* errors retrieved from the kubernetes clusters */} + {clustersWithErrors.length > 0 && ( + + + + + + )} - {/* other errors */} - {error !== undefined && ( - - )} + {/* other errors */} + {error !== undefined && ( + + + + + + )} - {kubernetesObjects && ( - <> - - - - - - - - Your Clusters - - - {kubernetesObjects?.items.map((item, i) => ( - - - - ))} - - - )} - + {kubernetesObjects && ( + + + + + + + + + Your Clusters + + + {kubernetesObjects?.items.map((item, i) => ( + + + + ))} + + + )} ); From 3f54eab6051ff93064a1b85431784e66d0ac2249 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 14 Jan 2021 00:26:46 -0500 Subject: [PATCH 3/5] Compress no error display --- .../src/components/ErrorReporting/ErrorReporting.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx b/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx index c986c0158d..8243d48263 100644 --- a/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx +++ b/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx @@ -113,17 +113,17 @@ export const ErrorEmptyState = () => { return ( - + Nice! There are no errors to report! - + EmptyState Date: Thu, 14 Jan 2021 00:27:55 -0500 Subject: [PATCH 4/5] Add changeset --- .changeset/giant-geckos-tickle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/giant-geckos-tickle.md diff --git a/.changeset/giant-geckos-tickle.md b/.changeset/giant-geckos-tickle.md new file mode 100644 index 0000000000..a31ebafa55 --- /dev/null +++ b/.changeset/giant-geckos-tickle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kubernetes': patch +--- + +Minor updates to display of errors From 3e4da2518bd035d526cd02ffc0c4a1a9fa8c3288 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 14 Jan 2021 00:58:23 -0500 Subject: [PATCH 5/5] Align tests --- .../src/components/KubernetesContent/ErrorPanel.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.test.tsx b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.test.tsx index 6fa6b3114c..8dff742502 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.test.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.test.tsx @@ -33,7 +33,7 @@ describe('ErrorPanel', () => { // title expect( getByText( - 'There was an error retrieving some Kubernetes resources for the entity: THIS_ENTITY', + 'There was a problem retrieving some Kubernetes resources for the entity: THIS_ENTITY. This could mean that the Error Reporting card is not completely accurate.', ), ).toBeInTheDocument(); @@ -67,7 +67,7 @@ describe('ErrorPanel', () => { // title expect( getByText( - 'There was an error retrieving some Kubernetes resources for the entity: THIS_ENTITY', + 'There was a problem retrieving some Kubernetes resources for the entity: THIS_ENTITY. This could mean that the Error Reporting card is not completely accurate.', ), ).toBeInTheDocument();