diff --git a/cccs-build/superset/Dockerfile b/cccs-build/superset/Dockerfile index a6cf5ff126497..054263233c76d 100644 --- a/cccs-build/superset/Dockerfile +++ b/cccs-build/superset/Dockerfile @@ -3,6 +3,7 @@ ARG VAULT_CA_CONTAINER=uchimera.azurecr.io/cccs/hogwarts/vault-ca:master_2921_22 FROM $VAULT_CA_CONTAINER AS vault_ca FROM uchimera.azurecr.io/cccs/superset-base:cccs-2.0_20220808144709_b4476 + USER root COPY *requirements.txt /tmp/ diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts b/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts index f6362c356d789..3c21546f95c8a 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/plugin/transformProps.ts @@ -318,22 +318,24 @@ export default function transformProps(chartProps: CccsGridChartProps) { params.node ? params.node.rowIndex + 1 : null, } as any); } - let parsed_jump_action_configs = {} - jump_action_configs?.forEach( (e: any) => - { + const parsed_jump_action_configs = {}; + jump_action_configs?.forEach((e: any) => { if (e.dashboardID in parsed_jump_action_configs) { - parsed_jump_action_configs[e.dashboardID] = parsed_jump_action_configs[e.dashboardID].concat({ + parsed_jump_action_configs[e.dashboardID] = parsed_jump_action_configs[ + e.dashboardID + ].concat({ advancedDataType: e.advancedDataType, nativefilters: e.filters, - name: e.dashBoardName - }) - } - else { - parsed_jump_action_configs[e.dashboardID] = [{ - advancedDataType: e.advancedDataType, - nativefilters: e.filters, - name: e.dashBoardName - }] + name: e.dashBoardName, + }); + } else { + parsed_jump_action_configs[e.dashboardID] = [ + { + advancedDataType: e.advancedDataType, + nativefilters: e.filters, + name: e.dashBoardName, + }, + ]; } }); @@ -357,6 +359,6 @@ export default function transformProps(chartProps: CccsGridChartProps) { column_state, agGridLicenseKey, datasetColumns: columns, - jumpActionConfigs: parsed_jump_action_configs + jumpActionConfigs: parsed_jump_action_configs, }; } diff --git a/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/types.ts b/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/types.ts index a4754380c79df..4dc11b0fd7fe7 100644 --- a/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/types.ts +++ b/superset-frontend/src/cccs-viz/plugins/plugin-chart-cccs-grid/src/types.ts @@ -88,7 +88,7 @@ export interface CccsGridTransformedProps extends CccsGridStylesProps { // add typing here for the props you pass in from transformProps.ts! agGridLicenseKey: string; datasetColumns: Column[]; - jumpActionConfigs?: any[] + jumpActionConfigs?: any[]; } export type EventHandlers = Record; diff --git a/superset-frontend/src/dashboard/components/Header/Header.test.tsx b/superset-frontend/src/dashboard/components/Header/Header.test.tsx index 4f8bf64f68cdb..79ae0a48652b6 100644 --- a/superset-frontend/src/dashboard/components/Header/Header.test.tsx +++ b/superset-frontend/src/dashboard/components/Header/Header.test.tsx @@ -349,3 +349,9 @@ test('should render an extension component if one is supplied', () => { screen.getByText('dashboard.nav.right extension component'), ).toBeInTheDocument(); }); + +test('should show datahub link', async () => { + const mockedProps = createProps(); + setup(mockedProps); + expect(screen.getByTestId('datahub_link')).toBeInTheDocument(); +}); diff --git a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.test.tsx b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.test.tsx index 4bf678247efb0..abef281bc2a13 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.test.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.test.tsx @@ -233,6 +233,36 @@ describe('DatasetList', () => { it('renders a SubMenu with no tabs', () => { expect(wrapper.find(SubMenu).props().tabs).toBeUndefined(); }); + + it('renders datahub link when urn is defined', async () => { + await waitForComponentToPaint(wrapper); + expect( + wrapper + .find('[data-test="cell-text"]') + .filterWhere( + e => + e.childAt(0).props().cell.column.id === 'datahub_link' && + e.childAt(0).props().cell.row.index === 0, + ) + .childAt(0) + .children(), + ).toHaveLength(1); + }); + + it('does not render datahub link when urn is undefined', async () => { + await waitForComponentToPaint(wrapper); + expect( + wrapper + .find('[data-test="cell-text"]') + .filterWhere( + e => + e.childAt(0).props().cell.column.id === 'datahub_link' && + e.childAt(0).props().cell.row.index === 1, + ) + .childAt(0) + .children(), + ).toHaveLength(0); + }); }); jest.mock('react-router-dom', () => ({ diff --git a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx index 958fafb2d9004..6bbbf6f40f642 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/DatasetList.tsx @@ -59,6 +59,7 @@ import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags'; import WarningIconWithTooltip from 'src/components/WarningIconWithTooltip'; import { isUserAdmin } from 'src/dashboard/util/permissionUtils'; import { GenericLink } from 'src/components/GenericLink/GenericLink'; +import { datahubUrl } from 'src/preamble'; import { PAGE_SIZE,