more lint

This commit is contained in:
Ryan McKinley 2024-07-01 17:03:23 -07:00
parent b25e735c02
commit a984a4e4f9
6 changed files with 10 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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