ShareModal: Remove PublicDashboard tab when share panel (#86946)

This commit is contained in:
Juan Cabanas 2024-04-26 11:34:55 -03:00 committed by GitHub
parent 45effc48d9
commit 85c23eed38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 11 deletions

View File

@ -77,10 +77,10 @@ export class ShareModal extends SceneObjectBase<ShareModalState> implements Moda
if (!panelRef) {
tabs.push(...customDashboardTabs.map((Tab) => new Tab({ dashboardRef, modalRef })));
}
if (isPublicDashboardsEnabled()) {
tabs.push(new SharePublicDashboardTab({ dashboardRef, modalRef }));
if (isPublicDashboardsEnabled()) {
tabs.push(new SharePublicDashboardTab({ dashboardRef, modalRef }));
}
}
this.setState({ tabs });

View File

@ -55,14 +55,14 @@ function getTabs(canEditDashboard: boolean, panel?: PanelModel, activeTab?: stri
component: ShareExport,
});
tabs.push(...customDashboardTabs);
}
if (isPublicDashboardsEnabled()) {
tabs.push({
label: t('share-modal.tab-title.public-dashboard-title', 'Public dashboard'),
value: shareDashboardType.publicDashboard,
component: SharePublicDashboard,
});
if (isPublicDashboardsEnabled()) {
tabs.push({
label: t('share-modal.tab-title.public-dashboard-title', 'Public dashboard'),
value: shareDashboardType.publicDashboard,
component: SharePublicDashboard,
});
}
}
const at = tabs.find((t) => t.value === activeTab);

View File

@ -56,7 +56,6 @@ export const renderSharePublicDashboard = async (
const newProps = Object.assign(
{
panel: mockPanel,
dashboard: mockDashboard,
onDismiss: () => {},
},