Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b8d82df9
Commit
b8d82df9
authored
Sep 03, 2018
by
Patrick O'Carroll
Committed by
Torkel Ödegaard
Sep 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added no-angle-bracket-type-assertion rule and updatet files to follow rule (#13115)
parent
7837ee44
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
49 additions
and
48 deletions
+49
-48
public/app/core/components/code_editor/code_editor.ts
+2
-2
public/app/core/config.ts
+1
-1
public/app/core/controllers/inspect_ctrl.ts
+1
-1
public/app/core/partials.ts
+1
-1
public/app/core/services/analytics.ts
+5
-5
public/app/core/specs/manage_dashboards.test.ts
+1
-1
public/app/core/specs/search.test.ts
+1
-1
public/app/features/dashboard/shareModalCtrl.ts
+2
-2
public/app/features/dashboard/specs/share_modal_ctrl.test.ts
+3
-3
public/app/features/templating/specs/variable_srv.test.ts
+2
-2
public/app/features/templating/specs/variable_srv_init.test.ts
+2
-2
public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts
+2
-2
public/app/plugins/datasource/elasticsearch/specs/datasource.test.ts
+2
-2
public/app/plugins/datasource/graphite/specs/query_ctrl.test.ts
+2
-2
public/app/plugins/datasource/influxdb/specs/query_ctrl.test.ts
+1
-1
public/app/plugins/datasource/mysql/specs/datasource.test.ts
+2
-2
public/app/plugins/datasource/opentsdb/specs/datasource.test.ts
+2
-2
public/app/plugins/datasource/opentsdb/specs/query_ctrl.test.ts
+2
-2
public/app/plugins/datasource/postgres/specs/datasource.test.ts
+2
-2
public/app/plugins/datasource/prometheus/specs/completer.test.ts
+1
-1
public/app/plugins/datasource/prometheus/specs/datasource.test.ts
+0
-0
public/app/plugins/panel/graph/specs/graph.test.ts
+3
-3
public/app/plugins/panel/graph/specs/graph_ctrl.test.ts
+1
-1
public/app/plugins/panel/heatmap/specs/heatmap_ctrl.test.ts
+1
-1
public/app/plugins/panel/singlestat/specs/singlestat.test.ts
+1
-1
public/test/index.ts
+1
-1
public/test/jest-setup.ts
+1
-1
public/test/jest-shim.ts
+2
-2
public/test/lib/common.ts
+1
-1
tslint.json
+1
-0
No files found.
public/app/core/components/code_editor/code_editor.ts
View file @
b8d82df9
...
@@ -84,7 +84,7 @@ function link(scope, elem, attrs) {
...
@@ -84,7 +84,7 @@ function link(scope, elem, attrs) {
// disable depreacation warning
// disable depreacation warning
codeEditor
.
$blockScrolling
=
Infinity
;
codeEditor
.
$blockScrolling
=
Infinity
;
// Padding hacks
// Padding hacks
(
<
any
>
codeEditor
.
renderer
).
setScrollMargin
(
15
,
15
);
(
codeEditor
.
renderer
as
any
).
setScrollMargin
(
15
,
15
);
codeEditor
.
renderer
.
setPadding
(
10
);
codeEditor
.
renderer
.
setPadding
(
10
);
setThemeMode
();
setThemeMode
();
...
@@ -152,7 +152,7 @@ function link(scope, elem, attrs) {
...
@@ -152,7 +152,7 @@ function link(scope, elem, attrs) {
if
(
scope
.
getCompleter
())
{
if
(
scope
.
getCompleter
())
{
// make copy of array as ace seems to share completers array between instances
// make copy of array as ace seems to share completers array between instances
const
anyEditor
=
<
any
>
codeEditor
;
const
anyEditor
=
codeEditor
as
any
;
anyEditor
.
completers
=
anyEditor
.
completers
.
slice
();
anyEditor
.
completers
=
anyEditor
.
completers
.
slice
();
anyEditor
.
completers
.
push
(
scope
.
getCompleter
());
anyEditor
.
completers
.
push
(
scope
.
getCompleter
());
}
}
...
...
public/app/core/config.ts
View file @
b8d82df9
...
@@ -51,7 +51,7 @@ export class Settings {
...
@@ -51,7 +51,7 @@ export class Settings {
}
}
}
}
const
bootData
=
(
<
any
>
window
).
grafanaBootData
||
{
settings
:
{}
};
const
bootData
=
(
window
as
any
).
grafanaBootData
||
{
settings
:
{}
};
const
options
=
bootData
.
settings
;
const
options
=
bootData
.
settings
;
options
.
bootData
=
bootData
;
options
.
bootData
=
bootData
;
...
...
public/app/core/controllers/inspect_ctrl.ts
View file @
b8d82df9
...
@@ -60,7 +60,7 @@ export class InspectCtrl {
...
@@ -60,7 +60,7 @@ export class InspectCtrl {
if
(
keyValue
[
1
].
length
>
0
)
{
if
(
keyValue
[
1
].
length
>
0
)
{
result
.
push
({
result
.
push
({
key
:
keyValue
[
0
],
key
:
keyValue
[
0
],
value
:
(
<
any
>
window
).
unescape
(
keyValue
[
1
]),
value
:
(
window
as
any
).
unescape
(
keyValue
[
1
]),
});
});
}
}
}
}
...
...
public/app/core/partials.ts
View file @
b8d82df9
let
templates
=
(
<
any
>
require
).
context
(
'../'
,
true
,
/
\.
html$/
);
let
templates
=
(
require
as
any
).
context
(
'../'
,
true
,
/
\.
html$/
);
templates
.
keys
().
forEach
(
function
(
key
)
{
templates
.
keys
().
forEach
(
function
(
key
)
{
templates
(
key
);
templates
(
key
);
});
});
public/app/core/services/analytics.ts
View file @
b8d82df9
...
@@ -12,13 +12,13 @@ export class Analytics {
...
@@ -12,13 +12,13 @@ export class Analytics {
dataType
:
'script'
,
dataType
:
'script'
,
cache
:
true
,
cache
:
true
,
});
});
const
ga
=
((
<
any
>
window
).
ga
=
const
ga
=
((
window
as
any
).
ga
=
(
<
any
>
window
).
ga
||
(
window
as
any
).
ga
||
function
()
{
function
()
{
(
ga
.
q
=
ga
.
q
||
[]).
push
(
arguments
);
(
ga
.
q
=
ga
.
q
||
[]).
push
(
arguments
);
});
});
ga
.
l
=
+
new
Date
();
ga
.
l
=
+
new
Date
();
ga
(
'create'
,
(
<
any
>
config
).
googleAnalyticsId
,
'auto'
);
ga
(
'create'
,
(
config
as
any
).
googleAnalyticsId
,
'auto'
);
ga
(
'set'
,
'anonymizeIp'
,
true
);
ga
(
'set'
,
'anonymizeIp'
,
true
);
return
ga
;
return
ga
;
}
}
...
@@ -26,7 +26,7 @@ export class Analytics {
...
@@ -26,7 +26,7 @@ export class Analytics {
init
()
{
init
()
{
this
.
$rootScope
.
$on
(
'$viewContentLoaded'
,
()
=>
{
this
.
$rootScope
.
$on
(
'$viewContentLoaded'
,
()
=>
{
const
track
=
{
page
:
this
.
$location
.
url
()
};
const
track
=
{
page
:
this
.
$location
.
url
()
};
const
ga
=
(
<
any
>
window
).
ga
||
this
.
gaInit
();
const
ga
=
(
window
as
any
).
ga
||
this
.
gaInit
();
ga
(
'set'
,
track
);
ga
(
'set'
,
track
);
ga
(
'send'
,
'pageview'
);
ga
(
'send'
,
'pageview'
);
});
});
...
@@ -35,7 +35,7 @@ export class Analytics {
...
@@ -35,7 +35,7 @@ export class Analytics {
/** @ngInject */
/** @ngInject */
function
startAnalytics
(
googleAnalyticsSrv
)
{
function
startAnalytics
(
googleAnalyticsSrv
)
{
if
((
<
any
>
config
).
googleAnalyticsId
)
{
if
((
config
as
any
).
googleAnalyticsId
)
{
googleAnalyticsSrv
.
init
();
googleAnalyticsSrv
.
init
();
}
}
}
}
...
...
public/app/core/specs/manage_dashboards.test.ts
View file @
b8d82df9
...
@@ -562,5 +562,5 @@ function createCtrlWithStubs(searchResponse: any, tags?: any) {
...
@@ -562,5 +562,5 @@ function createCtrlWithStubs(searchResponse: any, tags?: any) {
},
},
};
};
return
new
ManageDashboardsCtrl
({},
{
getNav
:
()
=>
{}
},
<
SearchSrv
>
searchSrvStub
,
{
isEditor
:
true
});
return
new
ManageDashboardsCtrl
({},
{
getNav
:
()
=>
{}
},
searchSrvStub
as
SearchSrv
,
{
isEditor
:
true
});
}
}
public/app/core/specs/search.test.ts
View file @
b8d82df9
...
@@ -12,7 +12,7 @@ describe('SearchCtrl', () => {
...
@@ -12,7 +12,7 @@ describe('SearchCtrl', () => {
search
:
(
options
:
any
)
=>
{},
search
:
(
options
:
any
)
=>
{},
getDashboardTags
:
()
=>
{},
getDashboardTags
:
()
=>
{},
};
};
const
ctrl
=
new
SearchCtrl
({
$on
:
()
=>
{}
},
{},
{},
<
SearchSrv
>
searchSrvStub
);
const
ctrl
=
new
SearchCtrl
({
$on
:
()
=>
{}
},
{},
{},
searchSrvStub
as
SearchSrv
);
describe
(
'Given an empty result'
,
()
=>
{
describe
(
'Given an empty result'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
...
public/app/features/dashboard/shareModalCtrl.ts
View file @
b8d82df9
...
@@ -94,11 +94,11 @@ export function ShareModalCtrl($scope, $rootScope, $location, $timeout, timeSrv,
...
@@ -94,11 +94,11 @@ export function ShareModalCtrl($scope, $rootScope, $location, $timeout, timeSrv,
const
utcOffset
=
'&tz=UTC'
+
encodeURIComponent
(
moment
().
format
(
'Z'
));
const
utcOffset
=
'&tz=UTC'
+
encodeURIComponent
(
moment
().
format
(
'Z'
));
// Older browser does not the internationalization API
// Older browser does not the internationalization API
if
(
!
(
<
any
>
window
).
Intl
)
{
if
(
!
(
window
as
any
).
Intl
)
{
return
utcOffset
;
return
utcOffset
;
}
}
const
dateFormat
=
(
<
any
>
window
).
Intl
.
DateTimeFormat
();
const
dateFormat
=
(
window
as
any
).
Intl
.
DateTimeFormat
();
if
(
!
dateFormat
.
resolvedOptions
)
{
if
(
!
dateFormat
.
resolvedOptions
)
{
return
utcOffset
;
return
utcOffset
;
}
}
...
...
public/app/features/dashboard/specs/share_modal_ctrl.test.ts
View file @
b8d82df9
...
@@ -4,7 +4,7 @@ import config from 'app/core/config';
...
@@ -4,7 +4,7 @@ import config from 'app/core/config';
import
{
LinkSrv
}
from
'app/features/panellinks/link_srv'
;
import
{
LinkSrv
}
from
'app/features/panellinks/link_srv'
;
describe
(
'ShareModalCtrl'
,
()
=>
{
describe
(
'ShareModalCtrl'
,
()
=>
{
const
ctx
=
<
any
>
{
const
ctx
=
{
timeSrv
:
{
timeSrv
:
{
timeRange
:
()
=>
{
timeRange
:
()
=>
{
return
{
from
:
new
Date
(
1000
),
to
:
new
Date
(
2000
)
};
return
{
from
:
new
Date
(
1000
),
to
:
new
Date
(
2000
)
};
...
@@ -26,9 +26,9 @@ describe('ShareModalCtrl', () => {
...
@@ -26,9 +26,9 @@ describe('ShareModalCtrl', () => {
templateSrv
:
{
templateSrv
:
{
fillVariableValuesForUrl
:
()
=>
{},
fillVariableValuesForUrl
:
()
=>
{},
},
},
};
}
as
any
;
(
<
any
>
window
).
Intl
.
DateTimeFormat
=
()
=>
{
(
window
as
any
).
Intl
.
DateTimeFormat
=
()
=>
{
return
{
return
{
resolvedOptions
:
()
=>
{
resolvedOptions
:
()
=>
{
return
{
timeZone
:
'UTC'
};
return
{
timeZone
:
'UTC'
};
...
...
public/app/features/templating/specs/variable_srv.test.ts
View file @
b8d82df9
...
@@ -4,7 +4,7 @@ import moment from 'moment';
...
@@ -4,7 +4,7 @@ import moment from 'moment';
import
$q
from
'q'
;
import
$q
from
'q'
;
describe
(
'VariableSrv'
,
function
(
this
:
any
)
{
describe
(
'VariableSrv'
,
function
(
this
:
any
)
{
const
ctx
=
<
any
>
{
const
ctx
=
{
datasourceSrv
:
{},
datasourceSrv
:
{},
timeSrv
:
{
timeSrv
:
{
timeRange
:
()
=>
{},
timeRange
:
()
=>
{},
...
@@ -29,7 +29,7 @@ describe('VariableSrv', function(this: any) {
...
@@ -29,7 +29,7 @@ describe('VariableSrv', function(this: any) {
$location
:
{
$location
:
{
search
:
()
=>
{},
search
:
()
=>
{},
},
},
};
}
as
any
;
function
describeUpdateVariable
(
desc
,
fn
)
{
function
describeUpdateVariable
(
desc
,
fn
)
{
describe
(
desc
,
()
=>
{
describe
(
desc
,
()
=>
{
...
...
public/app/features/templating/specs/variable_srv_init.test.ts
View file @
b8d82df9
...
@@ -17,12 +17,12 @@ describe('VariableSrv init', function(this: any) {
...
@@ -17,12 +17,12 @@ describe('VariableSrv init', function(this: any) {
}),
}),
};
};
const
$injector
=
<
any
>
{}
;
const
$injector
=
{}
as
any
;
const
$rootscope
=
{
const
$rootscope
=
{
$on
:
()
=>
{},
$on
:
()
=>
{},
};
};
let
ctx
=
<
any
>
{}
;
let
ctx
=
{}
as
any
;
function
describeInitScenario
(
desc
,
fn
)
{
function
describeInitScenario
(
desc
,
fn
)
{
describe
(
desc
,
()
=>
{
describe
(
desc
,
()
=>
{
...
...
public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts
View file @
b8d82df9
...
@@ -25,10 +25,10 @@ describe('CloudWatchDatasource', function() {
...
@@ -25,10 +25,10 @@ describe('CloudWatchDatasource', function() {
},
},
};
};
const
backendSrv
=
{};
const
backendSrv
=
{};
const
ctx
=
<
any
>
{
const
ctx
=
{
backendSrv
,
backendSrv
,
templateSrv
,
templateSrv
,
};
}
as
any
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ctx
.
ds
=
new
CloudWatchDatasource
(
instanceSettings
,
{},
backendSrv
,
templateSrv
,
timeSrv
);
ctx
.
ds
=
new
CloudWatchDatasource
(
instanceSettings
,
{},
backendSrv
,
templateSrv
,
timeSrv
);
...
...
public/app/plugins/datasource/elasticsearch/specs/datasource.test.ts
View file @
b8d82df9
...
@@ -33,10 +33,10 @@ describe('ElasticDatasource', function(this: any) {
...
@@ -33,10 +33,10 @@ describe('ElasticDatasource', function(this: any) {
}),
}),
};
};
const
ctx
=
<
any
>
{
const
ctx
=
{
$rootScope
,
$rootScope
,
backendSrv
,
backendSrv
,
};
}
as
any
;
function
createDatasource
(
instanceSettings
)
{
function
createDatasource
(
instanceSettings
)
{
instanceSettings
.
jsonData
=
instanceSettings
.
jsonData
||
{};
instanceSettings
.
jsonData
=
instanceSettings
.
jsonData
||
{};
...
...
public/app/plugins/datasource/graphite/specs/query_ctrl.test.ts
View file @
b8d82df9
...
@@ -3,7 +3,7 @@ import gfunc from '../gfunc';
...
@@ -3,7 +3,7 @@ import gfunc from '../gfunc';
import
{
GraphiteQueryCtrl
}
from
'../query_ctrl'
;
import
{
GraphiteQueryCtrl
}
from
'../query_ctrl'
;
describe
(
'GraphiteQueryCtrl'
,
()
=>
{
describe
(
'GraphiteQueryCtrl'
,
()
=>
{
const
ctx
=
<
any
>
{
const
ctx
=
{
datasource
:
{
datasource
:
{
metricFindQuery
:
jest
.
fn
(()
=>
Promise
.
resolve
([])),
metricFindQuery
:
jest
.
fn
(()
=>
Promise
.
resolve
([])),
getFuncDefs
:
jest
.
fn
(()
=>
Promise
.
resolve
(
gfunc
.
getFuncDefs
(
'1.0'
))),
getFuncDefs
:
jest
.
fn
(()
=>
Promise
.
resolve
(
gfunc
.
getFuncDefs
(
'1.0'
))),
...
@@ -15,7 +15,7 @@ describe('GraphiteQueryCtrl', () => {
...
@@ -15,7 +15,7 @@ describe('GraphiteQueryCtrl', () => {
panelCtrl
:
{
panelCtrl
:
{
refresh
:
jest
.
fn
(),
refresh
:
jest
.
fn
(),
},
},
};
}
as
any
;
ctx
.
panelCtrl
.
panel
=
{
ctx
.
panelCtrl
.
panel
=
{
targets
:
[
ctx
.
target
],
targets
:
[
ctx
.
target
],
...
...
public/app/plugins/datasource/influxdb/specs/query_ctrl.test.ts
View file @
b8d82df9
...
@@ -3,7 +3,7 @@ import { uiSegmentSrv } from 'app/core/services/segment_srv';
...
@@ -3,7 +3,7 @@ import { uiSegmentSrv } from 'app/core/services/segment_srv';
import
{
InfluxQueryCtrl
}
from
'../query_ctrl'
;
import
{
InfluxQueryCtrl
}
from
'../query_ctrl'
;
describe
(
'InfluxDBQueryCtrl'
,
()
=>
{
describe
(
'InfluxDBQueryCtrl'
,
()
=>
{
const
ctx
=
<
any
>
{}
;
const
ctx
=
{}
as
any
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
InfluxQueryCtrl
.
prototype
.
datasource
=
{
InfluxQueryCtrl
.
prototype
.
datasource
=
{
...
...
public/app/plugins/datasource/mysql/specs/datasource.test.ts
View file @
b8d82df9
...
@@ -9,9 +9,9 @@ describe('MySQLDatasource', function() {
...
@@ -9,9 +9,9 @@ describe('MySQLDatasource', function() {
replace
:
jest
.
fn
(
text
=>
text
),
replace
:
jest
.
fn
(
text
=>
text
),
};
};
const
ctx
=
<
any
>
{
const
ctx
=
{
backendSrv
,
backendSrv
,
};
}
as
any
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ctx
.
ds
=
new
MysqlDatasource
(
instanceSettings
,
backendSrv
,
{},
templateSrv
);
ctx
.
ds
=
new
MysqlDatasource
(
instanceSettings
,
backendSrv
,
{},
templateSrv
);
...
...
public/app/plugins/datasource/opentsdb/specs/datasource.test.ts
View file @
b8d82df9
...
@@ -2,13 +2,13 @@ import OpenTsDatasource from '../datasource';
...
@@ -2,13 +2,13 @@ import OpenTsDatasource from '../datasource';
import
$q
from
'q'
;
import
$q
from
'q'
;
describe
(
'opentsdb'
,
()
=>
{
describe
(
'opentsdb'
,
()
=>
{
const
ctx
=
<
any
>
{
const
ctx
=
{
backendSrv
:
{},
backendSrv
:
{},
ds
:
{},
ds
:
{},
templateSrv
:
{
templateSrv
:
{
replace
:
str
=>
str
,
replace
:
str
=>
str
,
},
},
};
}
as
any
;
const
instanceSettings
=
{
url
:
''
,
jsonData
:
{
tsdbVersion
:
1
}
};
const
instanceSettings
=
{
url
:
''
,
jsonData
:
{
tsdbVersion
:
1
}
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
...
...
public/app/plugins/datasource/opentsdb/specs/query_ctrl.test.ts
View file @
b8d82df9
import
{
OpenTsQueryCtrl
}
from
'../query_ctrl'
;
import
{
OpenTsQueryCtrl
}
from
'../query_ctrl'
;
describe
(
'OpenTsQueryCtrl'
,
()
=>
{
describe
(
'OpenTsQueryCtrl'
,
()
=>
{
const
ctx
=
<
any
>
{
const
ctx
=
{
target
:
{
target
:
''
},
target
:
{
target
:
''
},
datasource
:
{
datasource
:
{
tsdbVersion
:
''
,
tsdbVersion
:
''
,
getAggregators
:
()
=>
Promise
.
resolve
([]),
getAggregators
:
()
=>
Promise
.
resolve
([]),
getFilterTypes
:
()
=>
Promise
.
resolve
([]),
getFilterTypes
:
()
=>
Promise
.
resolve
([]),
},
},
};
}
as
any
;
ctx
.
panelCtrl
=
{
ctx
.
panelCtrl
=
{
panel
:
{
panel
:
{
...
...
public/app/plugins/datasource/postgres/specs/datasource.test.ts
View file @
b8d82df9
...
@@ -9,9 +9,9 @@ describe('PostgreSQLDatasource', function() {
...
@@ -9,9 +9,9 @@ describe('PostgreSQLDatasource', function() {
const
templateSrv
=
{
const
templateSrv
=
{
replace
:
jest
.
fn
(
text
=>
text
),
replace
:
jest
.
fn
(
text
=>
text
),
};
};
const
ctx
=
<
any
>
{
const
ctx
=
{
backendSrv
,
backendSrv
,
};
}
as
any
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ctx
.
ds
=
new
PostgresDatasource
(
instanceSettings
,
backendSrv
,
{},
templateSrv
);
ctx
.
ds
=
new
PostgresDatasource
(
instanceSettings
,
backendSrv
,
{},
templateSrv
);
...
...
public/app/plugins/datasource/prometheus/specs/completer.test.ts
View file @
b8d82df9
...
@@ -15,7 +15,7 @@ describe('Prometheus editor completer', function() {
...
@@ -15,7 +15,7 @@ describe('Prometheus editor completer', function() {
const
editor
=
{};
const
editor
=
{};
const
backendSrv
=
<
BackendSrv
>
{}
;
const
backendSrv
=
{}
as
BackendSrv
;
const
datasourceStub
=
new
PrometheusDatasource
({},
{},
backendSrv
,
{},
{});
const
datasourceStub
=
new
PrometheusDatasource
({},
{},
backendSrv
,
{},
{});
datasourceStub
.
performInstantQuery
=
jest
.
fn
(()
=>
datasourceStub
.
performInstantQuery
=
jest
.
fn
(()
=>
...
...
public/app/plugins/datasource/prometheus/specs/datasource.test.ts
View file @
b8d82df9
This diff is collapsed.
Click to expand it.
public/app/plugins/panel/graph/specs/graph.test.ts
View file @
b8d82df9
...
@@ -28,7 +28,7 @@ import moment from 'moment';
...
@@ -28,7 +28,7 @@ import moment from 'moment';
import
$
from
'jquery'
;
import
$
from
'jquery'
;
import
{
graphDirective
}
from
'../graph'
;
import
{
graphDirective
}
from
'../graph'
;
const
ctx
=
<
any
>
{}
;
const
ctx
=
{}
as
any
;
let
ctrl
;
let
ctrl
;
const
scope
=
{
const
scope
=
{
ctrl
:
{},
ctrl
:
{},
...
@@ -47,7 +47,7 @@ describe('grafanaGraph', function() {
...
@@ -47,7 +47,7 @@ describe('grafanaGraph', function() {
lightTheme
:
false
,
lightTheme
:
false
,
},
},
};
};
GraphCtrl
.
prototype
=
<
any
>
{
GraphCtrl
.
prototype
=
{
...
MetricsPanelCtrl
.
prototype
,
...
MetricsPanelCtrl
.
prototype
,
...
PanelCtrl
.
prototype
,
...
PanelCtrl
.
prototype
,
...
GraphCtrl
.
prototype
,
...
GraphCtrl
.
prototype
,
...
@@ -88,7 +88,7 @@ describe('grafanaGraph', function() {
...
@@ -88,7 +88,7 @@ describe('grafanaGraph', function() {
from
:
moment
([
2015
,
1
,
1
,
10
]),
from
:
moment
([
2015
,
1
,
1
,
10
]),
to
:
moment
([
2015
,
1
,
1
,
22
]),
to
:
moment
([
2015
,
1
,
1
,
22
]),
},
},
};
}
as
any
;
ctx
.
data
=
[];
ctx
.
data
=
[];
ctx
.
data
.
push
(
ctx
.
data
.
push
(
...
...
public/app/plugins/panel/graph/specs/graph_ctrl.test.ts
View file @
b8d82df9
...
@@ -30,7 +30,7 @@ describe('GraphCtrl', () => {
...
@@ -30,7 +30,7 @@ describe('GraphCtrl', () => {
},
},
};
};
const
ctx
=
<
any
>
{}
;
const
ctx
=
{}
as
any
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
ctx
.
ctrl
=
new
GraphCtrl
(
scope
,
injector
,
{});
ctx
.
ctrl
=
new
GraphCtrl
(
scope
,
injector
,
{});
...
...
public/app/plugins/panel/heatmap/specs/heatmap_ctrl.test.ts
View file @
b8d82df9
...
@@ -2,7 +2,7 @@ import moment from 'moment';
...
@@ -2,7 +2,7 @@ import moment from 'moment';
import
{
HeatmapCtrl
}
from
'../heatmap_ctrl'
;
import
{
HeatmapCtrl
}
from
'../heatmap_ctrl'
;
describe
(
'HeatmapCtrl'
,
function
()
{
describe
(
'HeatmapCtrl'
,
function
()
{
const
ctx
=
<
any
>
{}
;
const
ctx
=
{}
as
any
;
const
$injector
=
{
const
$injector
=
{
get
:
()
=>
{},
get
:
()
=>
{},
...
...
public/app/plugins/panel/singlestat/specs/singlestat.test.ts
View file @
b8d82df9
...
@@ -2,7 +2,7 @@ import { SingleStatCtrl } from '../module';
...
@@ -2,7 +2,7 @@ import { SingleStatCtrl } from '../module';
import
moment
from
'moment'
;
import
moment
from
'moment'
;
describe
(
'SingleStatCtrl'
,
function
()
{
describe
(
'SingleStatCtrl'
,
function
()
{
const
ctx
=
<
any
>
{}
;
const
ctx
=
{}
as
any
;
const
epoch
=
1505826363746
;
const
epoch
=
1505826363746
;
Date
.
now
=
()
=>
epoch
;
Date
.
now
=
()
=>
epoch
;
...
...
public/test/index.ts
View file @
b8d82df9
...
@@ -21,7 +21,7 @@ angular.module('grafana.directives', []);
...
@@ -21,7 +21,7 @@ angular.module('grafana.directives', []);
angular
.
module
(
'grafana.filters'
,
[]);
angular
.
module
(
'grafana.filters'
,
[]);
angular
.
module
(
'grafana.routes'
,
[
'ngRoute'
]);
angular
.
module
(
'grafana.routes'
,
[
'ngRoute'
]);
const
context
=
(
<
any
>
require
).
context
(
'../'
,
true
,
/specs
\.(
tsx
?
|js
)
/
);
const
context
=
(
require
as
any
).
context
(
'../'
,
true
,
/specs
\.(
tsx
?
|js
)
/
);
for
(
const
key
of
context
.
keys
())
{
for
(
const
key
of
context
.
keys
())
{
context
(
key
);
context
(
key
);
}
}
public/test/jest-setup.ts
View file @
b8d82df9
...
@@ -18,5 +18,5 @@ jest.mock('app/features/plugins/plugin_loader', () => ({}));
...
@@ -18,5 +18,5 @@ jest.mock('app/features/plugins/plugin_loader', () => ({}));
configure
({
adapter
:
new
Adapter
()
});
configure
({
adapter
:
new
Adapter
()
});
const
global
=
<
any
>
window
;
const
global
=
window
as
any
;
global
.
$
=
global
.
jQuery
=
$
;
global
.
$
=
global
.
jQuery
=
$
;
public/test/jest-shim.ts
View file @
b8d82df9
declare
var
global
:
NodeJS
.
Global
;
declare
var
global
:
NodeJS
.
Global
;
(
<
any
>
global
).
requestAnimationFrame
=
callback
=>
{
(
global
as
any
).
requestAnimationFrame
=
callback
=>
{
setTimeout
(
callback
,
0
);
setTimeout
(
callback
,
0
);
};
};
(
<
any
>
Promise
.
prototype
).
finally
=
function
(
onFinally
)
{
(
Promise
.
prototype
as
any
).
finally
=
function
(
onFinally
)
{
return
this
.
then
(
return
this
.
then
(
/* onFulfilled */
/* onFulfilled */
res
=>
Promise
.
resolve
(
onFinally
()).
then
(()
=>
res
),
res
=>
Promise
.
resolve
(
onFinally
()).
then
(()
=>
res
),
...
...
public/test/lib/common.ts
View file @
b8d82df9
const
_global
=
<
any
>
window
;
const
_global
=
window
as
any
;
const
beforeEach
=
_global
.
beforeEach
;
const
beforeEach
=
_global
.
beforeEach
;
const
afterEach
=
_global
.
afterEach
;
const
afterEach
=
_global
.
afterEach
;
const
before
=
_global
.
before
;
const
before
=
_global
.
before
;
...
...
tslint.json
View file @
b8d82df9
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"label-position"
:
true
,
"label-position"
:
true
,
"max-line-length"
:
[
true
,
150
],
"max-line-length"
:
[
true
,
150
],
"member-access"
:
[
true
,
"no-public"
],
"member-access"
:
[
true
,
"no-public"
],
"no-angle-bracket-type-assertion"
:
true
,
"no-arg"
:
true
,
"no-arg"
:
true
,
"no-bitwise"
:
false
,
"no-bitwise"
:
false
,
"no-console"
:
[
true
,
"debug"
,
"info"
,
"time"
,
"timeEnd"
,
"trace"
],
"no-console"
:
[
true
,
"debug"
,
"info"
,
"time"
,
"timeEnd"
,
"trace"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment