fix: database modal crashed when use SQLAlchemy URI string (#21342)

Co-authored-by: smileydev <47900232+prosdev0107@users.noreply.github.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
This commit is contained in:
Yongjie Zhao
2022-09-06 22:16:33 +08:00
committed by GitHub
parent 29c233fc92
commit d130b4a24f
4 changed files with 51 additions and 13 deletions

View File

@@ -87,6 +87,7 @@ interface ErrorAlertProps {
source?: ErrorSource;
subtitle: ReactNode;
title: ReactNode;
description?: string;
}
export default function ErrorAlert({
@@ -96,6 +97,7 @@ export default function ErrorAlert({
source = 'dashboard',
subtitle,
title,
description,
}: ErrorAlertProps) {
const theme = useTheme();
@@ -116,7 +118,7 @@ export default function ErrorAlert({
)}
<strong>{title}</strong>
</LeftSideContent>
{!isExpandable && (
{!isExpandable && !description && (
<span
role="button"
tabIndex={0}
@@ -127,6 +129,21 @@ export default function ErrorAlert({
</span>
)}
</div>
{description && (
<div className="error-body">
<p>{description}</p>
{!isExpandable && (
<span
role="button"
tabIndex={0}
className="link"
onClick={() => setIsModalOpen(true)}
>
{t('See more')}
</span>
)}
</div>
)}
{isExpandable ? (
<div className="error-body">
<p>{subtitle}</p>