mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard schema: Review and mature refresh property (#62104)
* Review and mature refresh property * Update type * Update report
This commit is contained in:
@@ -8,7 +8,6 @@ import { hasChanges, ignoreChanges } from './DashboardPrompt';
|
||||
|
||||
function getDefaultDashboardModel() {
|
||||
return createDashboardModelFixture({
|
||||
refresh: false,
|
||||
panels: [
|
||||
createPanelJSONFixture({
|
||||
id: 1,
|
||||
@@ -56,7 +55,7 @@ describe('DashboardPrompt', () => {
|
||||
it('Should ignore a lot of changes', () => {
|
||||
const { original, dash } = getTestContext();
|
||||
dash.time = { from: '1h' };
|
||||
dash.refresh = true;
|
||||
dash.refresh = '30s';
|
||||
dash.schemaVersion = 10;
|
||||
expect(hasChanges(dash, original)).toBe(false);
|
||||
});
|
||||
|
||||
@@ -178,7 +178,7 @@ function cleanDashboardFromIgnoredChanges(dashData: Dashboard) {
|
||||
|
||||
// ignore time and refresh
|
||||
dash.time = 0;
|
||||
dash.refresh = 0;
|
||||
dash.refresh = '';
|
||||
dash.schemaVersion = 0;
|
||||
dash.timezone = 0;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export class DashboardModel implements TimeModel {
|
||||
templating: { list: any[] };
|
||||
private originalTemplating: any;
|
||||
annotations: { list: AnnotationQuery[] };
|
||||
refresh: any;
|
||||
refresh: string;
|
||||
snapshot: any;
|
||||
schemaVersion: number;
|
||||
version: number;
|
||||
@@ -145,7 +145,7 @@ export class DashboardModel implements TimeModel {
|
||||
this.liveNow = Boolean(data.liveNow);
|
||||
this.templating = this.ensureListExist(data.templating);
|
||||
this.annotations = this.ensureListExist(data.annotations);
|
||||
this.refresh = data.refresh;
|
||||
this.refresh = data.refresh || '';
|
||||
this.snapshot = data.snapshot;
|
||||
this.schemaVersion = data.schemaVersion ?? 0;
|
||||
this.fiscalYearStartMonth = data.fiscalYearStartMonth ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user