pull/89995/head
Ryan McKinley 11 months ago
parent b25e735c02
commit a984a4e4f9
  1. 3
      pkg/tests/apis/dashboard/dashboards_test.go
  2. 2
      pkg/tests/apis/datasource/testdata_test.go
  3. 2
      pkg/tests/apis/playlist/playlist_test.go
  4. 2
      public/app/features/dashboard-scene/scene/DashboardScene.tsx
  5. 3
      public/app/features/dashboard-scene/settings/version-history/HistorySrv.ts
  6. 9
      public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx

@ -1,7 +1,6 @@
package dashboards package dashboards
import ( import (
"fmt"
"testing" "testing"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -48,7 +47,7 @@ func TestIntegrationDashboardsApp(t *testing.T) {
t.Run("Check discovery client", func(t *testing.T) { t.Run("Check discovery client", func(t *testing.T) {
disco := helper.GetGroupVersionInfoJSON("dashboard.grafana.app") disco := helper.GetGroupVersionInfoJSON("dashboard.grafana.app")
fmt.Printf("%s", string(disco)) // fmt.Printf("%s", disco)
require.JSONEq(t, `[ require.JSONEq(t, `[
{ {

@ -42,7 +42,7 @@ func TestIntegrationTestDatasource(t *testing.T) {
t.Run("Check discovery client", func(t *testing.T) { t.Run("Check discovery client", func(t *testing.T) {
disco := helper.GetGroupVersionInfoJSON("testdata.datasource.grafana.app") disco := helper.GetGroupVersionInfoJSON("testdata.datasource.grafana.app")
// fmt.Printf("%s", string(disco)) // fmt.Printf("%s", disco)
require.JSONEq(t, `[ require.JSONEq(t, `[
{ {

@ -47,7 +47,7 @@ func TestIntegrationPlaylist(t *testing.T) {
// The accepted verbs will change when dual write is enabled // The accepted verbs will change when dual write is enabled
disco := h.GetGroupVersionInfoJSON("playlist.grafana.app") disco := h.GetGroupVersionInfoJSON("playlist.grafana.app")
// fmt.Printf("%s", string(disco)) // fmt.Printf("%s", disco)
require.JSONEq(t, `[ require.JSONEq(t, `[
{ {
"version": "v0alpha1", "version": "v0alpha1",

@ -356,7 +356,7 @@ export class DashboardScene extends SceneObjectBase<DashboardSceneState> {
public onRestore = async (version: DecoratedRevisionModel): Promise<boolean> => { public onRestore = async (version: DecoratedRevisionModel): Promise<boolean> => {
const versionRsp = await getHistorySrv().restoreDashboard(version.uid, version.version); const versionRsp = await getHistorySrv().restoreDashboard(version.uid, version.version);
const rev = (versionRsp as SaveDashboardResponseDTO).version; const rev = (versionRsp as SaveDashboardResponseDTO).version;
if (!Number.isInteger(version)) { if (!Number.isInteger(version)) {
return false; return false;

@ -21,10 +21,9 @@ export type DecoratedRevisionModel = VersionModel & {
checked: boolean; checked: boolean;
createdDateString: string; createdDateString: string;
ageString: string; ageString: string;
data?: Dashboard data?: Dashboard;
}; };
export interface HistorySrv { export interface HistorySrv {
getHistoryList(dashboardUID: string, options: HistoryListOpts): Promise<VersionModel[]>; getHistoryList(dashboardUID: string, options: HistoryListOpts): Promise<VersionModel[]>;
getDashboardVersion(dashboardUID: string, version: number | string): Promise<Dashboard | {}>; // Just the spec (for now) getDashboardVersion(dashboardUID: string, version: number | string): Promise<Dashboard | {}>; // Just the spec (for now)

@ -3,11 +3,12 @@ import * as React from 'react';
import { Spinner, HorizontalGroup } from '@grafana/ui'; import { Spinner, HorizontalGroup } from '@grafana/ui';
import { Page } from 'app/core/components/Page/Page'; import { Page } from 'app/core/components/Page/Page';
import { VersionHistoryHeader, VersionsHistoryButtons } from 'app/features/dashboard-scene/settings/version-history';
import { import {
VersionHistoryHeader, DecoratedRevisionModel,
VersionsHistoryButtons, VersionModel,
} from 'app/features/dashboard-scene/settings/version-history'; getHistorySrv,
import { DecoratedRevisionModel, VersionModel, getHistorySrv } from 'app/features/dashboard-scene/settings/version-history/HistorySrv'; } from 'app/features/dashboard-scene/settings/version-history/HistorySrv';
import { VersionHistoryComparison } from '../VersionHistory/VersionHistoryComparison'; import { VersionHistoryComparison } from '../VersionHistory/VersionHistoryComparison';
import { VersionHistoryTable } from '../VersionHistory/VersionHistoryTable'; import { VersionHistoryTable } from '../VersionHistory/VersionHistoryTable';

Loading…
Cancel
Save