mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tslint: tslint to const fixes part3 (#13036)
This commit is contained in:
@@ -64,7 +64,7 @@ export class VariableEditorCtrl {
|
||||
return false;
|
||||
}
|
||||
|
||||
var sameName = _.find($scope.variables, { name: $scope.current.name });
|
||||
const sameName = _.find($scope.variables, { name: $scope.current.name });
|
||||
if (sameName && sameName !== $scope.current) {
|
||||
appEvents.emit('alert-warning', ['Validation', 'Variable with the same name already exists']);
|
||||
return false;
|
||||
@@ -114,7 +114,7 @@ export class VariableEditorCtrl {
|
||||
};
|
||||
|
||||
$scope.duplicate = function(variable) {
|
||||
var clone = _.cloneDeep(variable.getSaveModel());
|
||||
const clone = _.cloneDeep(variable.getSaveModel());
|
||||
$scope.current = variableSrv.createVariableFromModel(clone);
|
||||
$scope.current.name = 'copy_of_' + variable.name;
|
||||
variableSrv.addVariable($scope.current);
|
||||
@@ -148,7 +148,7 @@ export class VariableEditorCtrl {
|
||||
};
|
||||
|
||||
$scope.typeChanged = function() {
|
||||
var old = $scope.current;
|
||||
const old = $scope.current;
|
||||
$scope.current = variableSrv.createVariableFromModel({
|
||||
type: $scope.current.type,
|
||||
});
|
||||
@@ -156,7 +156,7 @@ export class VariableEditorCtrl {
|
||||
$scope.current.hide = old.hide;
|
||||
$scope.current.label = old.label;
|
||||
|
||||
var oldIndex = _.indexOf(this.variables, old);
|
||||
const oldIndex = _.indexOf(this.variables, old);
|
||||
if (oldIndex !== -1) {
|
||||
this.variables[oldIndex] = $scope.current;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user