mirror of
https://github.com/apache/superset.git
synced 2026-05-07 17:04:58 +00:00
chore: refactor Alert-related components (#31858)
This commit is contained in:
committed by
GitHub
parent
5fe6ef268e
commit
6eb87e04c0
@@ -455,7 +455,7 @@ test('should show missing params state', () => {
|
||||
expect(screen.getByText(/missing url parameters/i)).toBeVisible();
|
||||
expect(
|
||||
screen.getByText(
|
||||
/the url is missing the dataset_id or slice_id parameters\./i,
|
||||
/the url is missing the dataset_id or slice_id parameters/i,
|
||||
),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -430,17 +430,10 @@ class DatasourceControl extends PureComponent {
|
||||
<div className="error-alert">
|
||||
<ErrorAlert
|
||||
level="warning"
|
||||
title={t('Missing URL parameters')}
|
||||
source="explore"
|
||||
subtitle={
|
||||
<>
|
||||
<p>
|
||||
{t(
|
||||
'The URL is missing the dataset_id or slice_id parameters.',
|
||||
)}
|
||||
</p>
|
||||
</>
|
||||
}
|
||||
errorType={t('Missing URL parameters')}
|
||||
description={t(
|
||||
'The URL is missing the dataset_id or slice_id parameters.',
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -448,25 +441,18 @@ class DatasourceControl extends PureComponent {
|
||||
<div className="error-alert">
|
||||
<ErrorAlert
|
||||
level="warning"
|
||||
title={t('Missing dataset')}
|
||||
source="explore"
|
||||
subtitle={
|
||||
errorType={t('Missing dataset')}
|
||||
description={
|
||||
<>
|
||||
<p>
|
||||
{t(
|
||||
'The dataset linked to this chart may have been deleted.',
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
<Button
|
||||
buttonStyle="primary"
|
||||
onClick={() =>
|
||||
this.handleMenuItemClick({ key: CHANGE_DATASET })
|
||||
}
|
||||
>
|
||||
{t('Swap dataset')}
|
||||
</Button>
|
||||
</p>
|
||||
{t('The dataset linked to this chart may have been deleted.')}
|
||||
<Button
|
||||
buttonStyle="primary"
|
||||
onClick={() =>
|
||||
this.handleMenuItemClick({ key: CHANGE_DATASET })
|
||||
}
|
||||
>
|
||||
{t('Swap dataset')}
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user