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:
Yunwen Zheng
2025-10-29 12:14:57 -04:00
committed by GitHub
parent 269c145051
commit ec6e516e28

View File

@@ -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]);
};