浏览代码

Some cleanup

Simon Podlipsky 7 年之前
父节点
当前提交
c39dc1fb15

+ 1 - 1
public/app/features/datasources/settings/BasicSettings.tsx

@@ -16,7 +16,7 @@ const BasicSettings: SFC<Props> = ({ dataSourceName, isDefault, onDefaultChange,
         <div className="gf-form max-width-30" style={{ marginRight: '3px' }}>
           <Label
             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.'
             }
           >

+ 1 - 1
public/app/features/datasources/settings/__snapshots__/BasicSettings.test.tsx.snap

@@ -16,7 +16,7 @@ exports[`Render should render component 1`] = `
       }
     >
       <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
       </Component>

+ 0 - 1
public/app/features/explore/LogLabels.tsx

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

+ 1 - 1
public/app/features/explore/Typeahead.tsx

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

+ 0 - 3
public/app/features/panel/metrics_tab.ts

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

+ 1 - 1
public/app/plugins/datasource/influxdb/datasource.ts

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

+ 0 - 1
public/app/plugins/datasource/loki/components/LokiQueryField.tsx

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

+ 0 - 1
public/app/plugins/datasource/stackdriver/datasource.ts

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

+ 0 - 1
public/app/plugins/datasource/stackdriver/query_ctrl.ts

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

+ 2 - 5
public/app/plugins/panel/heatmap/rendering.ts

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

+ 1 - 1
public/emails/invited_to_org.html

@@ -1,5 +1,5 @@
 <!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>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta name="viewport" content="width=device-width" />

+ 1 - 1
public/emails/new_user_invite.html

@@ -1,5 +1,5 @@
 <!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>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta name="viewport" content="width=device-width" />

+ 1 - 3
scripts/webpack/webpack.common.js

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

+ 0 - 1
scripts/webpack/webpack.prod.js

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