mirror of
https://github.com/apache/superset.git
synced 2026-04-27 03:55:47 +00:00
fix: error alert levels again (#17027)
This commit is contained in:
@@ -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 (
|
||||
<ErrorAlertDiv level={level} role="alert">
|
||||
<div className="top-row">
|
||||
<LeftSideContent>
|
||||
{!level || level === 'error' ? (
|
||||
<Icons.ErrorSolid
|
||||
className="icon"
|
||||
iconColor={theme.colors.error.base}
|
||||
/>
|
||||
{level === 'error' ? (
|
||||
<Icons.ErrorSolid className="icon" iconColor={iconColor} />
|
||||
) : (
|
||||
<Icons.WarningSolid
|
||||
className="icon"
|
||||
iconColor={theme.colors[level].base}
|
||||
/>
|
||||
<Icons.WarningSolid className="icon" iconColor={iconColor} />
|
||||
)}
|
||||
<strong>{title}</strong>
|
||||
</LeftSideContent>
|
||||
@@ -171,16 +166,10 @@ export default function ErrorAlert({
|
||||
onHide={() => setIsModalOpen(false)}
|
||||
title={
|
||||
<div className="header">
|
||||
{!level || level === 'error' ? (
|
||||
<Icons.ErrorSolid
|
||||
className="icon"
|
||||
iconColor={theme.colors.error.base}
|
||||
/>
|
||||
{level === 'error' ? (
|
||||
<Icons.ErrorSolid className="icon" iconColor={iconColor} />
|
||||
) : (
|
||||
<Icons.WarningSolid
|
||||
className="icon"
|
||||
iconColor={theme.colors[level].base}
|
||||
/>
|
||||
<Icons.WarningSolid className="icon" iconColor={iconColor} />
|
||||
)}
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user