diff --git a/packages/grafana-schema/src/schema/dashboard/v2alpha0/dashboard.schema.cue b/packages/grafana-schema/src/schema/dashboard/v2alpha0/dashboard.schema.cue index f66aae29893..d153d6beeb0 100644 --- a/packages/grafana-schema/src/schema/dashboard/v2alpha0/dashboard.schema.cue +++ b/packages/grafana-schema/src/schema/dashboard/v2alpha0/dashboard.schema.cue @@ -49,9 +49,6 @@ DashboardV2Spec: { layout: GridLayoutKind - // Version of the JSON schema, incremented each time a Grafana update brings - // changes to said schema. - schemaVersion: uint16 | *39 // Plugins only. The version of the dashboard installed together with the plugin. // This is used to determine if the dashboard should be updated when the plugin is updated. diff --git a/packages/grafana-schema/src/schema/dashboard/v2alpha0/examples.ts b/packages/grafana-schema/src/schema/dashboard/v2alpha0/examples.ts index dbb3b97a5b8..c031ed9e6ef 100644 --- a/packages/grafana-schema/src/schema/dashboard/v2alpha0/examples.ts +++ b/packages/grafana-schema/src/schema/dashboard/v2alpha0/examples.ts @@ -8,7 +8,6 @@ export const handyTestingSchema: DashboardV2Spec = { liveNow: false, preload: false, editable: true, - schemaVersion: 40, tags: ['tag1', 'tag2'], timeSettings: { autoRefresh: '5s', diff --git a/packages/grafana-schema/src/schema/dashboard/v2alpha0/types.gen.ts b/packages/grafana-schema/src/schema/dashboard/v2alpha0/types.gen.ts index 70c9f1a0b84..8d960e9affb 100644 --- a/packages/grafana-schema/src/schema/dashboard/v2alpha0/types.gen.ts +++ b/packages/grafana-schema/src/schema/dashboard/v2alpha0/types.gen.ts @@ -34,9 +34,6 @@ export interface DashboardV2Spec { elements: Record; annotations: AnnotationQueryKind[]; layout: GridLayoutKind; - // Version of the JSON schema, incremented each time a Grafana update brings - // changes to said schema. - schemaVersion: number; // Plugins only. The version of the dashboard installed together with the plugin. // This is used to determine if the dashboard should be updated when the plugin is updated. revision?: number; @@ -54,7 +51,6 @@ export const defaultDashboardV2Spec = (): DashboardV2Spec => ({ elements: {}, annotations: [], layout: defaultGridLayoutKind(), - schemaVersion: 39, }); // Supported dashboard elements diff --git a/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.test.ts b/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.test.ts index 7fda8ec9119..6d20e16ed27 100644 --- a/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.test.ts +++ b/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.test.ts @@ -682,7 +682,6 @@ function setupV2(spec?: Partial) { spec: { ...defaultDashboardV2Spec(), title: 'hello', - schemaVersion: 30, timeSettings: { ...defaultTimeSettingsSpec(), autoRefresh: '10s', diff --git a/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts b/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts index e1db84138dd..bd3c106b106 100644 --- a/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts +++ b/public/app/features/dashboard-scene/serialization/DashboardSceneSerializer.ts @@ -179,7 +179,7 @@ export class V2DashboardSerializer if (this.initialSaveModel) { return { - schemaVersion: this.initialSaveModel.schemaVersion, + schemaVersion: 40, uid: s.state.uid, title: this.initialSaveModel.title, panels_count: panelPluginIds.length || 0, diff --git a/public/app/features/dashboard-scene/serialization/__snapshots__/transformSceneToSaveModelSchemaV2.test.ts.snap b/public/app/features/dashboard-scene/serialization/__snapshots__/transformSceneToSaveModelSchemaV2.test.ts.snap index e03f5c91ab8..dcd651aa5f7 100644 --- a/public/app/features/dashboard-scene/serialization/__snapshots__/transformSceneToSaveModelSchemaV2.test.ts.snap +++ b/public/app/features/dashboard-scene/serialization/__snapshots__/transformSceneToSaveModelSchemaV2.test.ts.snap @@ -126,7 +126,6 @@ exports[`transformSceneToSaveModelSchemaV2 should transform scene to save model ], "liveNow": true, "preload": true, - "schemaVersion": 40, "tags": [ "tag1", "tag2", diff --git a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts index 141c71e1c4c..7352a995547 100644 --- a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts +++ b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.ts @@ -11,7 +11,6 @@ import { VizPanel, } from '@grafana/scenes'; import { DataSourceRef } from '@grafana/schema'; -import { DASHBOARD_SCHEMA_VERSION } from 'app/features/dashboard/state/DashboardMigrator'; import { DashboardV2Spec, @@ -83,7 +82,6 @@ export function transformSceneToSaveModelSchemaV2(scene: DashboardScene, isSnaps editable: oldDash.editable, links: oldDash.links, tags: oldDash.tags, - schemaVersion: DASHBOARD_SCHEMA_VERSION, // EOF dashboard settings // time settings diff --git a/public/app/features/dashboard/api/ResponseTransformers.test.ts b/public/app/features/dashboard/api/ResponseTransformers.test.ts index d2d80c5cc58..a0ec37d375c 100644 --- a/public/app/features/dashboard/api/ResponseTransformers.test.ts +++ b/public/app/features/dashboard/api/ResponseTransformers.test.ts @@ -367,7 +367,6 @@ describe('ResponseTransformers', () => { expect(spec.title).toBe(dashboardV1.title); expect(spec.description).toBe(dashboardV1.description); expect(spec.tags).toEqual(dashboardV1.tags); - expect(spec.schemaVersion).toBe(dashboardV1.schemaVersion); expect(spec.cursorSync).toBe('Off'); // Assuming transformCursorSynctoEnum(0) returns 'Off' expect(spec.preload).toBe(dashboardV1.preload); expect(spec.liveNow).toBe(dashboardV1.liveNow); @@ -516,7 +515,6 @@ describe('ResponseTransformers', () => { title: 'Dashboard Title', description: 'Dashboard Description', tags: ['tag1', 'tag2'], - schemaVersion: 1, cursorSync: 'Off', preload: true, liveNow: false, @@ -596,7 +594,7 @@ describe('ResponseTransformers', () => { expect(dashboard.title).toBe(dashboardV2.spec.title); expect(dashboard.description).toBe(dashboardV2.spec.description); expect(dashboard.tags).toEqual(dashboardV2.spec.tags); - expect(dashboard.schemaVersion).toBe(dashboardV2.spec.schemaVersion); + expect(dashboard.schemaVersion).toBe(40); // expect(dashboard.graphTooltip).toBe(0); // Assuming transformCursorSynctoEnum('Off') returns 0 expect(dashboard.preload).toBe(dashboardV2.spec.preload); expect(dashboard.liveNow).toBe(dashboardV2.spec.liveNow); diff --git a/public/app/features/dashboard/api/ResponseTransformers.ts b/public/app/features/dashboard/api/ResponseTransformers.ts index 6a03130fb29..50fd9939fe9 100644 --- a/public/app/features/dashboard/api/ResponseTransformers.ts +++ b/public/app/features/dashboard/api/ResponseTransformers.ts @@ -117,7 +117,6 @@ export function ensureV2Response( title: dashboard.title, description: dashboard.description, tags: dashboard.tags ?? [], - schemaVersion: dashboard.schemaVersion, cursorSync: transformCursorSynctoEnum(dashboard.graphTooltip), preload: dashboard.preload || dashboardDefaults.preload, liveNow: dashboard.liveNow, @@ -202,7 +201,7 @@ export function ensureV1Response( title: spec.title, description: spec.description, tags: spec.tags, - schemaVersion: spec.schemaVersion, + schemaVersion: 40, graphTooltip: transformCursorSyncV2ToV1(spec.cursorSync), preload: spec.preload, liveNow: spec.liveNow,