mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-31 12:52:13 +00:00
fix(embed): hide chart & dashboard previews if not for looker (#8307)
This commit is contained in:
parent
d075bb4824
commit
c9e4be5dab
@ -25,6 +25,7 @@ import { capitalizeFirstLetterOnly } from '../../shared/textUtil';
|
||||
import DataProductSection from '../shared/containers/profile/sidebar/DataProduct/DataProductSection';
|
||||
import { getDataProduct } from '../shared/utils';
|
||||
import EmbeddedProfile from '../shared/embed/EmbeddedProfile';
|
||||
import { LOOKER_URN } from '../../ingest/source/builder/constants';
|
||||
|
||||
/**
|
||||
* Definition of the DataHub Chart entity.
|
||||
@ -99,8 +100,10 @@ export class ChartEntity implements Entity<Chart> {
|
||||
name: 'Preview',
|
||||
component: EmbedTab,
|
||||
display: {
|
||||
visible: (_, chart: GetChartQuery) => !!chart?.chart?.embed?.renderUrl,
|
||||
enabled: (_, chart: GetChartQuery) => !!chart?.chart?.embed?.renderUrl,
|
||||
visible: (_, chart: GetChartQuery) =>
|
||||
!!chart?.chart?.embed?.renderUrl && chart?.chart?.platform.urn === LOOKER_URN,
|
||||
enabled: (_, chart: GetChartQuery) =>
|
||||
!!chart?.chart?.embed?.renderUrl && chart?.chart?.platform.urn === LOOKER_URN,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ import { EmbedTab } from '../shared/tabs/Embed/EmbedTab';
|
||||
import EmbeddedProfile from '../shared/embed/EmbeddedProfile';
|
||||
import DataProductSection from '../shared/containers/profile/sidebar/DataProduct/DataProductSection';
|
||||
import { getDataProduct } from '../shared/utils';
|
||||
import { LOOKER_URN } from '../../ingest/source/builder/constants';
|
||||
|
||||
/**
|
||||
* Definition of the DataHub Dashboard entity.
|
||||
@ -113,8 +114,12 @@ export class DashboardEntity implements Entity<Dashboard> {
|
||||
name: 'Preview',
|
||||
component: EmbedTab,
|
||||
display: {
|
||||
visible: (_, dashboard: GetDashboardQuery) => !!dashboard?.dashboard?.embed?.renderUrl,
|
||||
enabled: (_, dashboard: GetDashboardQuery) => !!dashboard?.dashboard?.embed?.renderUrl,
|
||||
visible: (_, dashboard: GetDashboardQuery) =>
|
||||
!!dashboard?.dashboard?.embed?.renderUrl &&
|
||||
dashboard?.dashboard?.platform.urn === LOOKER_URN,
|
||||
enabled: (_, dashboard: GetDashboardQuery) =>
|
||||
!!dashboard?.dashboard?.embed?.renderUrl &&
|
||||
dashboard?.dashboard?.platform.urn === LOOKER_URN,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user