Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master'
Browse files Browse the repository at this point in the history
* grafana/master:
  added rule prefer const to tslint (grafana#13071)
  dep ensure (grafana#13074)
  changed var to const 2 (grafana#13068)
  changed var to const (grafana#13061)
  update latest.json to latest stable version
  docs: corrected docs description for setting
  changelog: add notes about 4.6.4 and 5.2.3 releases
  • Loading branch information
ryantxu committed Aug 30, 2018
2 parents 8cfad74 + 0dc8949 commit 048fd87
Show file tree
Hide file tree
Showing 121 changed files with 983 additions and 1,025 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ These are new features that's still being worked on and are in an experimental p

* **Frontend**: Convert all Frontend Karma tests to Jest tests [#12224](https://github.com/grafana/grafana/issues/12224)

# 5.2.3 (2018-08-29)

### Important fix for LDAP & OAuth login vulnerability

See [security announcement](https://community.grafana.com/t/grafana-5-2-3-and-4-6-4-security-update/10050) for details.

# 5.2.2 (2018-07-25)

### Minor
Expand Down Expand Up @@ -441,6 +447,12 @@ The following properties have been deprecated and will be removed in a future re
- `uri` property in `GET /api/search` -> Use new `url` or `uid` property instead
- `meta.slug` property in `GET /api/dashboards/uid/:uid` and `GET /api/dashboards/db/:slug` -> Use new `meta.url` or `dashboard.uid` property instead

# 4.6.4 (2018-08-29)

### Important fix for LDAP & OAuth login vulnerability

See [security announcement](https://community.grafana.com/t/grafana-5-2-3-and-4-6-4-security-update/10050) for details.

# 4.6.3 (2017-12-14)

## Fixes
Expand Down
8 changes: 1 addition & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/sources/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ The number of days the keep me logged in / remember me cookie lasts.

### secret_key

Used for signing keep me logged in / remember me cookies.
Used for signing some datasource settings like secrets and passwords. Cannot be changed without requiring an update
to datasource settings to re-encode them.

### disable_gravatar

Expand Down
4 changes: 2 additions & 2 deletions latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"stable": "5.2.0",
"testing": "5.2.0"
"stable": "5.2.3",
"testing": "5.2.3"
}
2 changes: 1 addition & 1 deletion public/app/core/app_events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Emitter } from './utils/emitter';

var appEvents = new Emitter();
const appEvents = new Emitter();
export default appEvents;
4 changes: 2 additions & 2 deletions public/app/core/components/code_editor/code_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ function link(scope, elem, attrs) {
if (scope.codeEditorFocus) {
setTimeout(function() {
textarea.focus();
var domEl = textarea[0];
const domEl = textarea[0];
if (domEl.setSelectionRange) {
var pos = textarea.val().length * 2;
const pos = textarea.val().length * 2;
domEl.setSelectionRange(pos, pos);
}
}, 100);
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/dashboard_selector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import coreModule from 'app/core/core_module';

var template = `
const template = `
<select class="gf-form-input" ng-model="ctrl.model" ng-options="f.value as f.text for f in ctrl.options"></select>
`;

Expand Down
14 changes: 7 additions & 7 deletions public/app/core/components/grafana_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class GrafanaCtrl {
};

$rootScope.onAppEvent = function(name, callback, localScope) {
var unbind = $rootScope.$on(name, callback);
const unbind = $rootScope.$on(name, callback);
var callerScope = this;
if (callerScope.$id === 1 && !localScope) {
console.log('warning rootScope onAppEvent called without localscope');
Expand All @@ -76,7 +76,7 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop
controller: GrafanaCtrl,
link: (scope, elem) => {
var sidemenuOpen;
var body = $('body');
const body = $('body');

// see https://github.com/zenorocha/clipboard.js/issues/155
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
Expand Down Expand Up @@ -153,7 +153,7 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop
// handle in active view state class
var lastActivity = new Date().getTime();
var activeUser = true;
var inActiveTimeLimit = 60 * 1000;
const inActiveTimeLimit = 60 * 1000;
var sidemenuHidden = false;

function checkForInActiveUser() {
Expand Down Expand Up @@ -215,16 +215,16 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop

// handle document clicks that should hide things
body.click(function(evt) {
var target = $(evt.target);
const target = $(evt.target);
if (target.parents().length === 0) {
return;
}

// for stuff that animates, slides out etc, clicking it needs to
// hide it right away
var clickAutoHide = target.closest('[data-click-hide]');
const clickAutoHide = target.closest('[data-click-hide]');
if (clickAutoHide.length) {
var clickAutoHideParent = clickAutoHide.parent();
const clickAutoHideParent = clickAutoHide.parent();
clickAutoHide.detach();
setTimeout(function() {
clickAutoHideParent.append(clickAutoHide);
Expand All @@ -245,7 +245,7 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop
}

// hide popovers
var popover = elem.find('.popover');
const popover = elem.find('.popover');
if (popover.length > 0 && target.parents('.graph-legend').length === 0) {
popover.hide();
}
Expand Down
4 changes: 2 additions & 2 deletions public/app/core/components/json_explorer/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function escapeString(str: string): string {
* Determines if a value is an object
*/
export function isObject(value: any): boolean {
var type = typeof value;
const type = typeof value;
return !!value && type === 'object';
}

Expand Down Expand Up @@ -55,7 +55,7 @@ export function getType(object: Object): string {
* Generates inline preview for a JavaScript object based on a value
*/
export function getValuePreview(object: Object, value: string): string {
var type = getType(object);
const type = getType(object);

if (type === 'null' || type === 'undefined') {
return type;
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/json_explorer/json_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export class JsonExplorer {
const objectWrapperSpan = createElement('span');

// get constructor name and append it to wrapper span
var constructorName = createElement('span', 'constructor-name', this.constructorName);
const constructorName = createElement('span', 'constructor-name', this.constructorName);
objectWrapperSpan.appendChild(constructorName);

// if it's an array append the array specific elements like brackets and length
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/jsontree/jsontree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ coreModule.directive('jsonTree', [
rootName: '@',
},
link: function(scope, elem) {
var jsonExp = new JsonExplorer(scope.object, 3, {
const jsonExp = new JsonExplorer(scope.object, 3, {
animateOpen: true,
});

Expand Down
4 changes: 2 additions & 2 deletions public/app/core/components/layout_selector/layout_selector.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import store from 'app/core/store';
import coreModule from 'app/core/core_module';

var template = `
const template = `
<div class="layout-selector">
<button ng-click="ctrl.listView()" ng-class="{active: ctrl.mode === 'list'}">
<i class="fa fa-list"></i>
Expand Down Expand Up @@ -51,7 +51,7 @@ export function layoutMode($rootScope) {
restrict: 'A',
scope: {},
link: function(scope, elem) {
var layout = store.get('grafana.list.layout.mode') || 'grid';
const layout = store.get('grafana.list.layout.mode') || 'grid';
var className = 'card-list-layout-' + layout;
elem.addClass(className);

Expand Down
6 changes: 3 additions & 3 deletions public/app/core/components/query_part/query_part.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export class QueryPart {
}

export function functionRenderer(part, innerExpr) {
var str = part.def.type + '(';
var parameters = _.map(part.params, (value, index) => {
var paramType = part.def.params[index];
const str = part.def.type + '(';
const parameters = _.map(part.params, (value, index) => {
const paramType = part.def.params[index];
if (paramType.type === 'time') {
if (value === 'auto') {
value = '$__interval';
Expand Down
38 changes: 19 additions & 19 deletions public/app/core/components/query_part/query_part_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _ from 'lodash';
import $ from 'jquery';
import coreModule from 'app/core/core_module';

var template = `
const template = `
<div class="dropdown cascade-open">
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.def.type}}</a>
<span>(</span><span class="query-part-parameters"></span><span>)</span>
Expand All @@ -15,7 +15,7 @@ var template = `

/** @ngInject */
export function queryPartEditorDirective($compile, templateSrv) {
var paramTemplate = '<input type="text" class="hide input-mini tight-form-func-param"></input>';
const paramTemplate = '<input type="text" class="hide input-mini tight-form-func-param"></input>';

return {
restrict: 'E',
Expand All @@ -26,17 +26,17 @@ export function queryPartEditorDirective($compile, templateSrv) {
debounce: '@',
},
link: function postLink($scope, elem) {
var part = $scope.part;
var partDef = part.def;
var $paramsContainer = elem.find('.query-part-parameters');
var debounceLookup = $scope.debounce;
const part = $scope.part;
const partDef = part.def;
const $paramsContainer = elem.find('.query-part-parameters');
const debounceLookup = $scope.debounce;

$scope.partActions = [];

function clickFuncParam(paramIndex) {
/*jshint validthis:true */
var $link = $(this);
var $input = $link.next();
const $link = $(this);
const $input = $link.next();

$input.val(part.params[paramIndex]);
$input.css('width', $link.width() + 16 + 'px');
Expand All @@ -46,7 +46,7 @@ export function queryPartEditorDirective($compile, templateSrv) {
$input.focus();
$input.select();

var typeahead = $input.data('typeahead');
const typeahead = $input.data('typeahead');
if (typeahead) {
$input.val('');
typeahead.lookup();
Expand All @@ -55,9 +55,9 @@ export function queryPartEditorDirective($compile, templateSrv) {

function inputBlur(paramIndex) {
/*jshint validthis:true */
var $input = $(this);
var $link = $input.prev();
var newValue = $input.val();
const $input = $(this);
const $link = $input.prev();
const newValue = $input.val();

if (newValue !== '' || part.def.params[paramIndex].optional) {
$link.html(templateSrv.highlightVariablesAsHtml(newValue));
Expand Down Expand Up @@ -89,7 +89,7 @@ export function queryPartEditorDirective($compile, templateSrv) {
return;
}

var typeaheadSource = function(query, callback) {
const typeaheadSource = function(query, callback) {
if (param.options) {
var options = param.options;
if (param.type === 'int') {
Expand All @@ -102,7 +102,7 @@ export function queryPartEditorDirective($compile, templateSrv) {

$scope.$apply(function() {
$scope.handleEvent({ $event: { name: 'get-param-options' } }).then(function(result) {
var dynamicOptions = _.map(result, function(op) {
const dynamicOptions = _.map(result, function(op) {
return op.value;
});
callback(dynamicOptions);
Expand All @@ -124,10 +124,10 @@ export function queryPartEditorDirective($compile, templateSrv) {
},
});

var typeahead = $input.data('typeahead');
const typeahead = $input.data('typeahead');
typeahead.lookup = function() {
this.query = this.$element.val() || '';
var items = this.source(this.query, $.proxy(this.process, this));
const items = this.source(this.query, $.proxy(this.process, this));
return items ? this.process(items) : items;
};

Expand Down Expand Up @@ -156,9 +156,9 @@ export function queryPartEditorDirective($compile, templateSrv) {
$('<span>, </span>').appendTo($paramsContainer);
}

var paramValue = templateSrv.highlightVariablesAsHtml(part.params[index]);
var $paramLink = $('<a class="graphite-func-param-link pointer">' + paramValue + '</a>');
var $input = $(paramTemplate);
const paramValue = templateSrv.highlightVariablesAsHtml(part.params[index]);
const $paramLink = $('<a class="graphite-func-param-link pointer">' + paramValue + '</a>');
const $input = $(paramTemplate);

$paramLink.appendTo($paramsContainer);
$input.appendTo($paramsContainer);
Expand Down
4 changes: 2 additions & 2 deletions public/app/core/components/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class SearchCtrl {

searchDashboards() {
this.currentSearchId = this.currentSearchId + 1;
var localSearchId = this.currentSearchId;
const localSearchId = this.currentSearchId;

return this.searchSrv.search(this.query).then(results => {
if (localSearchId < this.currentSearchId) {
Expand All @@ -172,7 +172,7 @@ export class SearchCtrl {
}

queryHasNoFilters() {
var query = this.query;
const query = this.query;
return query.query === '' && query.starred === false && query.tag.length === 0;
}

Expand Down
4 changes: 2 additions & 2 deletions public/app/core/components/sidemenu/sidemenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export function sideMenuDirective() {
link: function(scope, elem) {
// hack to hide dropdown menu
elem.on('click.dropdown', '.dropdown-menu a', function(evt) {
var menu = $(evt.target).parents('.dropdown-menu');
var parent = menu.parent();
const menu = $(evt.target).parents('.dropdown-menu');
const parent = menu.parent();
menu.detach();

setTimeout(function() {
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/switch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import coreModule from 'app/core/core_module';

var template = `
const template = `
<label for="check-{{ctrl.id}}" class="gf-form-label {{ctrl.labelClass}} pointer" ng-show="ctrl.label">
{{ctrl.label}}
<info-popover mode="right-normal" ng-if="ctrl.tooltip" position="top center">
Expand Down
4 changes: 2 additions & 2 deletions public/app/core/directives/give_focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ coreModule.directive('giveFocus', function() {
}
setTimeout(function() {
element.focus();
var domEl = element[0];
const domEl = element[0];
if (domEl.setSelectionRange) {
var pos = element.val().length * 2;
const pos = element.val().length * 2;
domEl.setSelectionRange(pos, pos);
}
}, 200);
Expand Down
Loading

0 comments on commit 048fd87

Please sign in to comment.