Commit 3f7aaedd by Hugo Häggmark Committed by Torkel Ödegaard

Chore: Remove implicit anys for DashboardModel and tests (#16553)

Progress: #14714
parent c17226af
// @ts-ignore
import _ from 'lodash'; import _ from 'lodash';
import { DashboardModel } from '../state/DashboardModel'; import { DashboardModel } from '../state/DashboardModel';
import { PanelModel } from '../state/PanelModel'; import { PanelModel } from '../state/PanelModel';
...@@ -6,7 +7,7 @@ jest.mock('app/core/services/context_srv', () => ({})); ...@@ -6,7 +7,7 @@ jest.mock('app/core/services/context_srv', () => ({}));
describe('DashboardModel', () => { describe('DashboardModel', () => {
describe('when creating new dashboard model defaults only', () => { describe('when creating new dashboard model defaults only', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({}, {}); model = new DashboardModel({}, {});
...@@ -27,7 +28,7 @@ describe('DashboardModel', () => { ...@@ -27,7 +28,7 @@ describe('DashboardModel', () => {
}); });
describe('when getting next panel id', () => { describe('when getting next panel id', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ model = new DashboardModel({
...@@ -69,7 +70,7 @@ describe('DashboardModel', () => { ...@@ -69,7 +70,7 @@ describe('DashboardModel', () => {
}); });
describe('row and panel manipulation', () => { describe('row and panel manipulation', () => {
let dashboard; let dashboard: DashboardModel;
beforeEach(() => { beforeEach(() => {
dashboard = new DashboardModel({}); dashboard = new DashboardModel({});
...@@ -112,7 +113,7 @@ describe('DashboardModel', () => { ...@@ -112,7 +113,7 @@ describe('DashboardModel', () => {
}); });
describe('Given editable false dashboard', () => { describe('Given editable false dashboard', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ editable: false }); model = new DashboardModel({ editable: false });
...@@ -130,8 +131,8 @@ describe('DashboardModel', () => { ...@@ -130,8 +131,8 @@ describe('DashboardModel', () => {
}); });
describe('when loading dashboard with old influxdb query schema', () => { describe('when loading dashboard with old influxdb query schema', () => {
let model; let model: DashboardModel;
let target; let target: any;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ model = new DashboardModel({
...@@ -197,7 +198,7 @@ describe('DashboardModel', () => { ...@@ -197,7 +198,7 @@ describe('DashboardModel', () => {
}); });
describe('when creating dashboard model with missing list for annoations or templating', () => { describe('when creating dashboard model with missing list for annoations or templating', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ model = new DashboardModel({
...@@ -222,7 +223,7 @@ describe('DashboardModel', () => { ...@@ -222,7 +223,7 @@ describe('DashboardModel', () => {
}); });
describe('Formatting epoch timestamp when timezone is set as utc', () => { describe('Formatting epoch timestamp when timezone is set as utc', () => {
let dashboard; let dashboard: DashboardModel;
beforeEach(() => { beforeEach(() => {
dashboard = new DashboardModel({ timezone: 'utc' }); dashboard = new DashboardModel({ timezone: 'utc' });
...@@ -242,7 +243,7 @@ describe('DashboardModel', () => { ...@@ -242,7 +243,7 @@ describe('DashboardModel', () => {
}); });
describe('updateSubmenuVisibility with empty lists', () => { describe('updateSubmenuVisibility with empty lists', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({}); model = new DashboardModel({});
...@@ -255,7 +256,7 @@ describe('DashboardModel', () => { ...@@ -255,7 +256,7 @@ describe('DashboardModel', () => {
}); });
describe('updateSubmenuVisibility with annotation', () => { describe('updateSubmenuVisibility with annotation', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ model = new DashboardModel({
...@@ -272,7 +273,7 @@ describe('DashboardModel', () => { ...@@ -272,7 +273,7 @@ describe('DashboardModel', () => {
}); });
describe('updateSubmenuVisibility with template var', () => { describe('updateSubmenuVisibility with template var', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ model = new DashboardModel({
...@@ -289,7 +290,7 @@ describe('DashboardModel', () => { ...@@ -289,7 +290,7 @@ describe('DashboardModel', () => {
}); });
describe('updateSubmenuVisibility with hidden template var', () => { describe('updateSubmenuVisibility with hidden template var', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
model = new DashboardModel({ model = new DashboardModel({
...@@ -306,7 +307,7 @@ describe('DashboardModel', () => { ...@@ -306,7 +307,7 @@ describe('DashboardModel', () => {
}); });
describe('updateSubmenuVisibility with hidden annotation toggle', () => { describe('updateSubmenuVisibility with hidden annotation toggle', () => {
let dashboard; let dashboard: DashboardModel;
beforeEach(() => { beforeEach(() => {
dashboard = new DashboardModel({ dashboard = new DashboardModel({
...@@ -323,7 +324,7 @@ describe('DashboardModel', () => { ...@@ -323,7 +324,7 @@ describe('DashboardModel', () => {
}); });
describe('When collapsing row', () => { describe('When collapsing row', () => {
let dashboard; let dashboard: DashboardModel;
beforeEach(() => { beforeEach(() => {
dashboard = new DashboardModel({ dashboard = new DashboardModel({
...@@ -365,7 +366,7 @@ describe('DashboardModel', () => { ...@@ -365,7 +366,7 @@ describe('DashboardModel', () => {
}); });
describe('When expanding row', () => { describe('When expanding row', () => {
let dashboard; let dashboard: DashboardModel;
beforeEach(() => { beforeEach(() => {
dashboard = new DashboardModel({ dashboard = new DashboardModel({
...@@ -637,7 +638,7 @@ describe('DashboardModel', () => { ...@@ -637,7 +638,7 @@ describe('DashboardModel', () => {
}); });
describe('Given a dashboard with one panel legend on and two off', () => { describe('Given a dashboard with one panel legend on and two off', () => {
let model; let model: DashboardModel;
beforeEach(() => { beforeEach(() => {
const data = { const data = {
......
...@@ -15,6 +15,7 @@ export interface DashboardDTO { ...@@ -15,6 +15,7 @@ export interface DashboardDTO {
export interface DashboardMeta { export interface DashboardMeta {
canSave?: boolean; canSave?: boolean;
canEdit?: boolean; canEdit?: boolean;
canDelete?: boolean;
canShare?: boolean; canShare?: boolean;
canStar?: boolean; canStar?: boolean;
canAdmin?: boolean; canAdmin?: boolean;
...@@ -25,7 +26,7 @@ export interface DashboardMeta { ...@@ -25,7 +26,7 @@ export interface DashboardMeta {
canMakeEditable?: boolean; canMakeEditable?: boolean;
submenuEnabled?: boolean; submenuEnabled?: boolean;
provisioned?: boolean; provisioned?: boolean;
focusPanelId?: boolean; focusPanelId?: number;
isStarred?: boolean; isStarred?: boolean;
showSettings?: boolean; showSettings?: boolean;
expires?: string; expires?: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment