mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix: Use SPA Dataset link in Chart and Dashboard (#20941)
* Use SPA Dataset link in Chart and Dashboard * Validate datasourceUrl * Show datasourceName when datasourceUrl is undefined
This commit is contained in:
parent
bce32af19b
commit
96a63bcbfe
@ -29,6 +29,7 @@ import { t, isFeatureEnabled, FeatureFlag, css } from '@superset-ui/core';
|
|||||||
import ImageLoader from 'src/components/ListViewCard/ImageLoader';
|
import ImageLoader from 'src/components/ListViewCard/ImageLoader';
|
||||||
import { usePluginContext } from 'src/components/DynamicPlugins';
|
import { usePluginContext } from 'src/components/DynamicPlugins';
|
||||||
import { Tooltip } from 'src/components/Tooltip';
|
import { Tooltip } from 'src/components/Tooltip';
|
||||||
|
import { GenericLink } from 'src/components/GenericLink/GenericLink';
|
||||||
import { Theme } from '@emotion/react';
|
import { Theme } from '@emotion/react';
|
||||||
|
|
||||||
const FALLBACK_THUMBNAIL_URL = '/static/assets/images/chart-card-fallback.svg';
|
const FALLBACK_THUMBNAIL_URL = '/static/assets/images/chart-card-fallback.svg';
|
||||||
@ -264,7 +265,15 @@ const AddSliceCard: React.FC<{
|
|||||||
<MetadataItem label={t('Viz type')} value={vizName} />
|
<MetadataItem label={t('Viz type')} value={vizName} />
|
||||||
<MetadataItem
|
<MetadataItem
|
||||||
label={t('Dataset')}
|
label={t('Dataset')}
|
||||||
value={<a href={datasourceUrl}>{datasourceName}</a>}
|
value={
|
||||||
|
datasourceUrl ? (
|
||||||
|
<GenericLink to={datasourceUrl}>
|
||||||
|
{datasourceName}
|
||||||
|
</GenericLink>
|
||||||
|
) : (
|
||||||
|
datasourceName
|
||||||
|
)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<MetadataItem label={t('Modified')} value={lastModified} />
|
<MetadataItem label={t('Modified')} value={lastModified} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,6 +61,7 @@ import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils';
|
|||||||
import setupPlugins from 'src/setup/setupPlugins';
|
import setupPlugins from 'src/setup/setupPlugins';
|
||||||
import InfoTooltip from 'src/components/InfoTooltip';
|
import InfoTooltip from 'src/components/InfoTooltip';
|
||||||
import CertifiedBadge from 'src/components/CertifiedBadge';
|
import CertifiedBadge from 'src/components/CertifiedBadge';
|
||||||
|
import { GenericLink } from 'src/components/GenericLink/GenericLink';
|
||||||
import ChartCard from './ChartCard';
|
import ChartCard from './ChartCard';
|
||||||
|
|
||||||
const FlexRowContainer = styled.div`
|
const FlexRowContainer = styled.div`
|
||||||
@ -310,7 +311,7 @@ function ChartList(props: ChartListProps) {
|
|||||||
datasource_url: dsUrl,
|
datasource_url: dsUrl,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}: any) => <a href={dsUrl}>{dsNameTxt}</a>,
|
}: any) => <GenericLink to={dsUrl}>{dsNameTxt}</GenericLink>,
|
||||||
Header: t('Dataset'),
|
Header: t('Dataset'),
|
||||||
accessor: 'datasource_id',
|
accessor: 'datasource_id',
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user