mirror of
https://github.com/grafana/grafana.git
synced 2026-03-13 15:29:48 +08:00
DashboardEmpty: Disable import dashboard function when a new dashboard is git provisioned (#113122)
DashboardEmpty: Disable import dashboard function when a new dashboar is git provisioned
This commit is contained in:
@@ -73,8 +73,9 @@ export const useOnAddLibraryPanel = ({ dashboard, canCreate, isReadOnlyRepo }: H
|
||||
};
|
||||
|
||||
export const useOnImportDashboard = ({ dashboard, canCreate, isReadOnlyRepo }: HookProps) => {
|
||||
const isProvisioned = dashboard instanceof DashboardScene && dashboard.isManagedRepository();
|
||||
return useMemo(() => {
|
||||
if (!canCreate || isReadOnlyRepo) {
|
||||
if (!canCreate || isProvisioned || isReadOnlyRepo) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -82,5 +83,5 @@ export const useOnImportDashboard = ({ dashboard, canCreate, isReadOnlyRepo }: H
|
||||
DashboardInteractions.emptyDashboardButtonClicked({ item: 'import_dashboard' });
|
||||
onImportDashboardImpl();
|
||||
};
|
||||
}, [canCreate, isReadOnlyRepo]);
|
||||
}, [canCreate, isReadOnlyRepo, isProvisioned]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user