tslint: more const fixes (#13035)

This commit is contained in:
Torkel Ödegaard
2018-08-26 20:19:23 +02:00
committed by GitHub
parent 314b645857
commit 35c00891e7
32 changed files with 120 additions and 123 deletions

View File

@@ -22,7 +22,7 @@ export class PlaylistEditCtrl {
this.isNew = $route.current.params.id;
if ($route.current.params.id) {
var playlistId = $route.current.params.id;
const playlistId = $route.current.params.id;
backendSrv.get('/api/playlists/' + playlistId).then(result => {
this.playlist = result;
@@ -69,7 +69,7 @@ export class PlaylistEditCtrl {
}
addTagPlaylistItem(tag) {
var playlistItem: any = {
const playlistItem: any = {
value: tag.term,
type: 'dashboard_by_tag',
order: this.playlistItems.length + 1,
@@ -124,8 +124,8 @@ export class PlaylistEditCtrl {
}
movePlaylistItem(playlistItem, offset) {
var currentPosition = this.playlistItems.indexOf(playlistItem);
var newPosition = currentPosition + offset;
const currentPosition = this.playlistItems.indexOf(playlistItem);
const newPosition = currentPosition + offset;
if (newPosition >= 0 && newPosition < this.playlistItems.length) {
this.playlistItems.splice(currentPosition, 1);

View File

@@ -19,7 +19,7 @@ export class PlaylistSearchCtrl {
searchDashboards() {
this.tagsMode = false;
var prom: any = {};
const prom: any = {};
prom.promise = this.backendSrv.search(this.query).then(result => {
return {
@@ -50,7 +50,7 @@ export class PlaylistSearchCtrl {
}
getTags() {
var prom: any = {};
const prom: any = {};
prom.promise = this.backendSrv.get('/api/dashboards/tags').then(result => {
return {
dashboardResult: [],

View File

@@ -16,14 +16,14 @@ class PlaylistSrv {
next() {
this.$timeout.cancel(this.cancelPromise);
var playedAllDashboards = this.index > this.dashboards.length - 1;
const playedAllDashboards = this.index > this.dashboards.length - 1;
if (playedAllDashboards) {
window.location.href = this.getUrlWithKioskMode();
return;
}
var dash = this.dashboards[this.index];
const dash = this.dashboards[this.index];
this.$location.url('dashboard/' + dash.uri);
this.index++;