Schema: Improve Dashboard kind docs and remove deprecated props (#69359)

Remove unused properties: 
  * `FieldColorModeId.PaletteSaturated`: It doesn't exist and it is not a valid palette.
  * `VariableModel.rootStateKey`: It is not persisted in the DB, so it shouldn't be in the schema. It is a property only used in the frontend to store the Redux store key.
  * `VariableModel.error`: It is not persisted in the DB, so it shouldn't be in the schema. It is a property only used in the frontend to store fetching errors.
  * `Panel.thresholds`: old property only existing in previous versions of the dashboard schema.
  * `Panel.timeRegions`: old property only existing in previous versions of the dashboard schema.
This commit is contained in:
Ivan Ortega Alba
2023-06-06 14:28:10 +02:00
committed by GitHub
parent ae0f94e616
commit 819041c732
8 changed files with 1422 additions and 806 deletions

View File

@@ -88,8 +88,8 @@ describe('DashboardModel', () => {
},
{
type: 'singlestat',
legend: true,
// @ts-expect-error
legend: true,
thresholds: '10,20,30',
colors: ['#FF0000', 'green', 'orange'],
aliasYAxis: { test: 2 },
@@ -665,16 +665,16 @@ describe('DashboardModel', () => {
model = new DashboardModel({
templating: {
list: [
// @ts-expect-error
{
// @ts-expect-error
multi: false,
current: {
value: ['value'],
text: ['text'],
},
},
// @ts-expect-error
{
// @ts-expect-error
multi: true,
current: {
value: ['value'],
@@ -724,8 +724,8 @@ describe('DashboardModel', () => {
},
{
type: 'query',
// @ts-expect-error
current: {
// @ts-expect-error
tags: [
{
selected: true,
@@ -888,52 +888,52 @@ describe('DashboardModel', () => {
model = new DashboardModel({
templating: {
list: [
// @ts-expect-error
{
type: 'query',
hide: VariableHide.dontHide,
datasource: null,
// @ts-expect-error
allFormat: '',
},
// @ts-expect-error
{
type: 'query',
hide: VariableHide.hideLabel,
datasource: null,
// @ts-expect-error
allFormat: '',
},
// @ts-expect-error
{
type: 'query',
hide: VariableHide.hideVariable,
datasource: null,
// @ts-expect-error
allFormat: '',
},
// @ts-expect-error
{
type: 'constant',
hide: VariableHide.dontHide,
query: 'default value',
// @ts-expect-error
current: { selected: true, text: 'A', value: 'B' },
options: [{ selected: true, text: 'A', value: 'B' }],
datasource: null,
allFormat: '',
},
// @ts-expect-error
{
type: 'constant',
hide: VariableHide.hideLabel,
query: 'default value',
// @ts-expect-error
current: { selected: true, text: 'A', value: 'B' },
options: [{ selected: true, text: 'A', value: 'B' }],
datasource: null,
allFormat: '',
},
// @ts-expect-error
{
type: 'constant',
hide: VariableHide.hideVariable,
query: 'default value',
// @ts-expect-error
current: { selected: true, text: 'A', value: 'B' },
options: [{ selected: true, text: 'A', value: 'B' }],
datasource: null,
@@ -995,96 +995,96 @@ describe('DashboardModel', () => {
model = new DashboardModel({
templating: {
list: [
// @ts-expect-error
{
type: 'query',
name: 'variable_with_never_refresh_with_options',
// @ts-expect-error
options: [{ text: 'A', value: 'A' }],
refresh: 0,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_never_refresh_without_options',
// @ts-expect-error
options: [],
refresh: 0,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_dashboard_refresh_with_options',
// @ts-expect-error
options: [{ text: 'A', value: 'A' }],
refresh: 1,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_dashboard_refresh_without_options',
// @ts-expect-error
options: [],
refresh: 1,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_timerange_refresh_with_options',
// @ts-expect-error
options: [{ text: 'A', value: 'A' }],
refresh: 2,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_timerange_refresh_without_options',
// @ts-expect-error
options: [],
refresh: 2,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_no_refresh_with_options',
// @ts-expect-error
options: [{ text: 'A', value: 'A' }],
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_no_refresh_without_options',
// @ts-expect-error
options: [],
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_unknown_refresh_with_options',
// @ts-expect-error
options: [{ text: 'A', value: 'A' }],
refresh: 2001,
},
// @ts-expect-error
{
type: 'query',
name: 'variable_with_unknown_refresh_without_options',
// @ts-expect-error
options: [],
refresh: 2001,
},
// @ts-expect-error
{
type: 'custom',
name: 'custom',
// @ts-expect-error
options: [{ text: 'custom', value: 'custom' }],
},
// @ts-expect-error
{
type: 'textbox',
name: 'textbox',
// @ts-expect-error
options: [{ text: 'Hello', value: 'World' }],
},
// @ts-expect-error
{
type: 'datasource',
name: 'datasource',
// @ts-expect-error
options: [{ text: 'ds', value: 'ds' }], // fake example doesn't exist
},
// @ts-expect-error
{
type: 'interval',
name: 'interval',
// @ts-expect-error
options: [{ text: '1m', value: '1m' }],
},
],
@@ -1334,8 +1334,8 @@ describe('DashboardModel', () => {
panels: [
{
type: 'singlestat',
legend: true,
// @ts-expect-error
legend: true,
thresholds: '10,20,30',
colors: ['#FF0000', 'green', 'orange'],
aliasYAxis: { test: 2 },
@@ -1396,8 +1396,8 @@ describe('DashboardModel', () => {
panels: [
{
type: 'singlestat',
legend: true,
// @ts-expect-error
legend: true,
thresholds: '10,20,30',
colors: ['#FF0000', 'green', 'orange'],
aliasYAxis: { test: 2 },
@@ -2004,10 +2004,10 @@ describe('DashboardModel', () => {
model = new DashboardModel({
templating: {
list: [
// @ts-expect-error
{
type: 'query',
name: 'var',
// @ts-expect-error
options: [{ text: 'A', value: 'A' }],
refresh: 0,
datasource: null,