From 3fb15e62420575e8bd062398f1f62454c8c96700 Mon Sep 17 00:00:00 2001 From: erik_ritter Date: Thu, 7 Oct 2021 16:24:39 -0700 Subject: [PATCH] fix: error alert levels again --- .../ErrorMessage/BasicErrorAlert.tsx | 9 ++++--- .../components/ErrorMessage/ErrorAlert.tsx | 27 ++++++------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx index ffc120d87aaf9..fdc61b889153c 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx @@ -51,17 +51,18 @@ interface BasicErrorAlertProps { export default function BasicErrorAlert({ body, - level, + level = 'error', title, }: BasicErrorAlertProps) { const theme = useTheme(); + const iconColor = theme.colors[level].base; return ( - {!level || level === 'error' ? ( - + {level === 'error' ? ( + ) : ( - + )} {title} diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx index f47fc7fe2b60f..3340c8ad6d3e7 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx @@ -92,7 +92,7 @@ interface ErrorAlertProps { export default function ErrorAlert({ body, copyText, - level, + level = 'error', source = 'dashboard', subtitle, title, @@ -103,21 +103,16 @@ export default function ErrorAlert({ const [isBodyExpanded, setIsBodyExpanded] = useState(false); const isExpandable = ['explore', 'sqllab'].includes(source); + const iconColor = theme.colors[level].base; return (
- {!level || level === 'error' ? ( - + {level === 'error' ? ( + ) : ( - + )} {title} @@ -171,16 +166,10 @@ export default function ErrorAlert({ onHide={() => setIsModalOpen(false)} title={
- {!level || level === 'error' ? ( - + {level === 'error' ? ( + ) : ( - + )}
{title}