Chore: some type fixes (#69860)

* some type fixes

* restore empty object

* undo 1 fix for now

* commit betterer update

* explicitly type slug and uid as string | undefined
This commit is contained in:
Ashley Harrison
2023-06-20 17:13:49 +01:00
committed by GitHub
parent c07d3c7bdd
commit 13e3308959
17 changed files with 91 additions and 141 deletions

View File

@@ -2,7 +2,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { PanelPlugin } from '@grafana/data';
import { AngularComponent } from '@grafana/runtime';
import { Dashboard, defaultDashboard } from '@grafana/schema';
import { defaultDashboard } from '@grafana/schema';
import { processAclItems } from 'app/core/utils/acl';
import { DashboardAclDTO, DashboardInitError, DashboardInitPhase, DashboardState } from 'app/types';
@@ -38,10 +38,8 @@ const dashboardSlice = createSlice({
state.initPhase = DashboardInitPhase.Failed;
state.initError = action.payload;
state.getModel = () => {
// TODO this is a type conflict,
// we need to fix the defaultDashboard init type when generated by cue
return new DashboardModel(
{ ...(defaultDashboard as Dashboard), title: 'Dashboard init failed' },
{ ...defaultDashboard, title: 'Dashboard init failed' },
{ canSave: false, canEdit: false }
);
};