mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:09:03 +08:00
Dashboard: Disable creating library panels for provisioned dashboards (#102308)
This commit is contained in:
@ -219,6 +219,7 @@ export function ToolbarActions({ dashboard }: Props) {
|
||||
dashboard.onShowAddLibraryPanelDrawer();
|
||||
DashboardInteractions.toolbarAddButtonClicked({ item: 'add_library_panel' });
|
||||
}}
|
||||
disabled={dashboard.isManaged()}
|
||||
/>
|
||||
<Menu.Item
|
||||
key="add-row"
|
||||
|
@ -52,6 +52,7 @@ const DashboardEmpty = ({ dashboard, canCreate }: Props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const isProvisioned = dashboard instanceof DashboardScene && dashboard.isManaged();
|
||||
return (
|
||||
<Stack alignItems="center" justifyContent="center">
|
||||
<div className={styles.wrapper}>
|
||||
@ -100,7 +101,7 @@ const DashboardEmpty = ({ dashboard, canCreate }: Props) => {
|
||||
fill="outline"
|
||||
data-testid={selectors.pages.AddDashboard.itemButton('Add a panel from the panel library button')}
|
||||
onClick={onAddLibraryPanel}
|
||||
disabled={!canCreate}
|
||||
disabled={!canCreate || isProvisioned}
|
||||
>
|
||||
<Trans i18nKey="dashboard.empty.add-library-panel-button">Add library panel</Trans>
|
||||
</Button>
|
||||
|
Reference in New Issue
Block a user