Commit 7f6e9790 by Torkel Ödegaard Committed by GitHub

Fixes typescript issues (#27565)

parent b37e132c
...@@ -6,7 +6,7 @@ import { DataQuery } from './datasource'; ...@@ -6,7 +6,7 @@ import { DataQuery } from './datasource';
*/ */
export interface DataLinkClickEvent<T = any> { export interface DataLinkClickEvent<T = any> {
origin: T; origin: T;
scopedVars: ScopedVars; scopedVars?: ScopedVars;
e?: any; // mouse|react event e?: any; // mouse|react event
} }
......
...@@ -283,7 +283,7 @@ export class LinkSrv implements LinkService { ...@@ -283,7 +283,7 @@ export class LinkSrv implements LinkService {
/** /**
* Returns LinkModel which is basically a DataLink with all values interpolated through the templateSrv. * Returns LinkModel which is basically a DataLink with all values interpolated through the templateSrv.
*/ */
getDataLinkUIModel = <T>(link: DataLink, scopedVars: ScopedVars, origin: T): LinkModel<T> => { getDataLinkUIModel = <T>(link: DataLink, scopedVars: ScopedVars | undefined, origin: T): LinkModel<T> => {
const params: KeyValue = {}; const params: KeyValue = {};
const timeRangeUrl = urlUtil.toUrlParams(this.timeSrv.timeRangeForUrl()); const timeRangeUrl = urlUtil.toUrlParams(this.timeSrv.timeRangeForUrl());
......
...@@ -9,8 +9,8 @@ export class TablePanelEditorCtrl { ...@@ -9,8 +9,8 @@ export class TablePanelEditorCtrl {
fontSizes: any; fontSizes: any;
addColumnSegment: any; addColumnSegment: any;
getColumnNames: any; getColumnNames: any;
canSetColumns: boolean; canSetColumns = false;
columnsHelpMessage: string; columnsHelpMessage = '';
/** @ngInject */ /** @ngInject */
constructor($scope: any, private uiSegmentSrv: any) { constructor($scope: any, private uiSegmentSrv: any) {
......
...@@ -477,7 +477,7 @@ describe('when rendering table with different patterns', () => { ...@@ -477,7 +477,7 @@ describe('when rendering table with different patterns', () => {
}); });
describe('when rendering cells with different alignment options', () => { describe('when rendering cells with different alignment options', () => {
const cases = [ const cases: Array<[string, boolean, string | null, string]> = [
//align, preserve fmt, color mode, expected //align, preserve fmt, color mode, expected
['', false, null, '<td>42</td>'], ['', false, null, '<td>42</td>'],
['invalid_option', false, null, '<td>42</td>'], ['invalid_option', false, null, '<td>42</td>'],
......
...@@ -25,7 +25,6 @@ export class DatasourceSrvMock { ...@@ -25,7 +25,6 @@ export class DatasourceSrvMock {
export class MockDataSourceApi extends DataSourceApi { export class MockDataSourceApi extends DataSourceApi {
result: DataQueryResponse = { data: [] }; result: DataQueryResponse = { data: [] };
queryResolver: Promise<DataQueryResponse>;
constructor(name?: string, result?: DataQueryResponse, meta?: any, private error: string | null = null) { constructor(name?: string, result?: DataQueryResponse, meta?: any, private error: string | null = null) {
super({ name: name ? name : 'MockDataSourceApi' } as DataSourceInstanceSettings); super({ name: name ? name : 'MockDataSourceApi' } as DataSourceInstanceSettings);
...@@ -37,10 +36,6 @@ export class MockDataSourceApi extends DataSourceApi { ...@@ -37,10 +36,6 @@ export class MockDataSourceApi extends DataSourceApi {
} }
query(request: DataQueryRequest): Promise<DataQueryResponse> { query(request: DataQueryRequest): Promise<DataQueryResponse> {
if (this.queryResolver) {
return this.queryResolver;
}
if (this.error) { if (this.error) {
return Promise.reject(this.error); return Promise.reject(this.error);
} }
......
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