Some cleanup

This commit is contained in:
Simon Podlipsky
2019-01-05 15:19:54 +01:00
parent 2de57f095c
commit c39dc1fb15
14 changed files with 9 additions and 22 deletions

View File

@ -16,7 +16,7 @@ const BasicSettings: SFC<Props> = ({ dataSourceName, isDefault, onDefaultChange,
<div className="gf-form max-width-30" style={{ marginRight: '3px' }}> <div className="gf-form max-width-30" style={{ marginRight: '3px' }}>
<Label <Label
tooltip={ tooltip={
'The name is used when you select the data source in panels. The Default data source is' + 'The name is used when you select the data source in panels. The Default data source is ' +
'preselected in new panels.' 'preselected in new panels.'
} }
> >

View File

@ -16,7 +16,7 @@ exports[`Render should render component 1`] = `
} }
> >
<Component <Component
tooltip="The name is used when you select the data source in panels. The Default data source ispreselected in new panels." tooltip="The name is used when you select the data source in panels. The Default data source is preselected in new panels."
> >
Name Name
</Component> </Component>

View File

@ -1,4 +1,3 @@
import _ from 'lodash';
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';

View File

@ -55,7 +55,7 @@ class TypeaheadItem extends React.PureComponent<TypeaheadItemProps> {
interface TypeaheadGroupProps { interface TypeaheadGroupProps {
items: CompletionItem[]; items: CompletionItem[];
label: string; label: string;
onClickItem: (CompletionItem) => void; onClickItem: (suggestion: CompletionItem) => void;
selected: CompletionItem; selected: CompletionItem;
prefix?: string; prefix?: string;
} }

View File

@ -1,6 +1,3 @@
// Libraries
import _ from 'lodash';
// Services & utils // Services & utils
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import { Emitter } from 'app/core/utils/emitter'; import { Emitter } from 'app/core/utils/emitter';

View File

@ -308,7 +308,7 @@ export default class InfluxDatasource {
return 'now()'; return 'now()';
} }
const parts = /^now-(\d+)([d|h|m|s])$/.exec(date); const parts = /^now-(\d+)([dhms])$/.exec(date);
if (parts) { if (parts) {
const amount = parseInt(parts[1], 10); const amount = parseInt(parts[1], 10);
const unit = parts[2]; const unit = parts[2];

View File

@ -1,4 +1,3 @@
import _ from 'lodash';
import React from 'react'; import React from 'react';
import Cascader from 'rc-cascader'; import Cascader from 'rc-cascader';
import PluginPrism from 'slate-prism'; import PluginPrism from 'slate-prism';

View File

@ -16,7 +16,6 @@ export default class StackdriverDatasource {
constructor(instanceSettings, private backendSrv, private templateSrv, private timeSrv) { constructor(instanceSettings, private backendSrv, private templateSrv, private timeSrv) {
this.baseUrl = `/stackdriver/`; this.baseUrl = `/stackdriver/`;
this.url = instanceSettings.url; this.url = instanceSettings.url;
this.doRequest = this.doRequest;
this.id = instanceSettings.id; this.id = instanceSettings.id;
this.projectName = instanceSettings.jsonData.defaultProject || ''; this.projectName = instanceSettings.jsonData.defaultProject || '';
this.authenticationType = instanceSettings.jsonData.authenticationType || 'jwt'; this.authenticationType = instanceSettings.jsonData.authenticationType || 'jwt';

View File

@ -88,7 +88,6 @@ export class StackdriverQueryCtrl extends QueryCtrl {
try { try {
jsonBody = JSON.parse(queryRes.error); jsonBody = JSON.parse(queryRes.error);
} catch { } catch {
this.lastQueryError = queryRes.error;
} }
this.lastQueryError = jsonBody.error.message; this.lastQueryError = jsonBody.error.message;

View File

@ -251,7 +251,6 @@ export class HeatmapRenderer {
if (tickInterval === 0) { if (tickInterval === 0) {
yMax = max * this.dataRangeWidingFactor; yMax = max * this.dataRangeWidingFactor;
yMin = min - min * (this.dataRangeWidingFactor - 1); yMin = min - min * (this.dataRangeWidingFactor - 1);
tickInterval = (yMax - yMin) / 2;
} else { } else {
yMax = Math.ceil((max + yWiding) / tickInterval) * tickInterval; yMax = Math.ceil((max + yWiding) / tickInterval) * tickInterval;
yMin = Math.floor((min - yWiding) / tickInterval) * tickInterval; yMin = Math.floor((min - yWiding) / tickInterval) * tickInterval;
@ -389,9 +388,7 @@ export class HeatmapRenderer {
// Adjust data range to log base // Adjust data range to log base
adjustLogRange(min, max, logBase) { adjustLogRange(min, max, logBase) {
let yMin, yMax; let yMin = this.data.heatmapStats.minLog;
yMin = this.data.heatmapStats.minLog;
if (this.data.heatmapStats.minLog > 1 || !this.data.heatmapStats.minLog) { if (this.data.heatmapStats.minLog > 1 || !this.data.heatmapStats.minLog) {
yMin = 1; yMin = 1;
} else { } else {
@ -399,7 +396,7 @@ export class HeatmapRenderer {
} }
// Adjust max Y value to log base // Adjust max Y value to log base
yMax = this.adjustLogMax(this.data.heatmapStats.max, logBase); const yMax = this.adjustLogMax(this.data.heatmapStats.max, logBase);
return { yMin, yMax }; return { yMin, yMax };
} }

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />

View File

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />

View File

@ -3,9 +3,6 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = { module.exports = {
target: 'web', target: 'web',
stats: {
children: false
},
entry: { entry: {
app: './public/app/index.ts', app: './public/app/index.ts',
}, },
@ -25,6 +22,7 @@ module.exports = {
], ],
}, },
stats: { stats: {
children: false,
warningsFilter: /export .* was not found in/ warningsFilter: /export .* was not found in/
}, },
node: { node: {

View File

@ -3,7 +3,6 @@
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
const webpack = require('webpack');
const path = require('path'); const path = require('path');
const ngAnnotatePlugin = require('ng-annotate-webpack-plugin'); const ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");