Storage: fix creating a new dashboard with dashboardsFromStorage feature flag enabled

This commit is contained in:
Artur Wierzbicki 2022-08-25 22:04:09 +04:00 committed by GitHub
parent 3f0636083d
commit 5c0bf2ba39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ import { useDashboardSave } from './useDashboardSave';
export const SaveDashboardDrawer = ({ dashboard, onDismiss, onSaveSuccess, isCopy }: SaveDashboardModalProps) => { export const SaveDashboardDrawer = ({ dashboard, onDismiss, onSaveSuccess, isCopy }: SaveDashboardModalProps) => {
const [options, setOptions] = useState<SaveDashboardOptions>({}); const [options, setOptions] = useState<SaveDashboardOptions>({});
const isFromStorage = config.featureToggles.dashboardsFromStorage && dashboard.uid.indexOf('/') > 0; const isFromStorage = config.featureToggles.dashboardsFromStorage && dashboard.uid?.indexOf('/') > 0;
const isProvisioned = dashboard.meta.provisioned && !isFromStorage; const isProvisioned = dashboard.meta.provisioned && !isFromStorage;
const isNew = dashboard.version === 0 && !isFromStorage; const isNew = dashboard.version === 0 && !isFromStorage;