diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorInput.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorInput.tsx index c67407f2e44..b2e0774032e 100644 --- a/packages/grafana-ui/src/components/ColorPicker/ColorInput.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/ColorInput.tsx @@ -1,8 +1,10 @@ import React from 'react'; -import { ColorPickerProps } from './ColorPickerPopover'; import tinycolor from 'tinycolor2'; import debounce from 'lodash/debounce'; +import { ColorPickerProps } from './ColorPickerPopover'; +import { Input } from '../Input/Input'; + interface ColorInputState { previousColor: string; value: string; @@ -84,7 +86,7 @@ class ColorInput extends React.PureComponent { flexGrow: 1, }} > - + ); diff --git a/packages/grafana-ui/src/components/Input/Input.tsx b/packages/grafana-ui/src/components/Input/Input.tsx index f5f59e265c0..b9b4e186ef2 100644 --- a/packages/grafana-ui/src/components/Input/Input.tsx +++ b/packages/grafana-ui/src/components/Input/Input.tsx @@ -72,7 +72,7 @@ export class Input extends PureComponent { const inputElementProps = this.populateEventPropsWithStatus(restProps, validationEvents); return ( -
+
{error && !hideErrorMessage && {error}}
diff --git a/packages/grafana-ui/src/components/Input/__snapshots__/Input.test.tsx.snap b/packages/grafana-ui/src/components/Input/__snapshots__/Input.test.tsx.snap index 249d6b0be8d..a79fc828de6 100644 --- a/packages/grafana-ui/src/components/Input/__snapshots__/Input.test.tsx.snap +++ b/packages/grafana-ui/src/components/Input/__snapshots__/Input.test.tsx.snap @@ -1,9 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Input renders correctly 1`] = ` -
+
diff --git a/packages/grafana-ui/src/components/Switch/Switch.tsx b/packages/grafana-ui/src/components/Switch/Switch.tsx index e2a25682519..4f534c97a3a 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.tsx @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react'; import uniqueId from 'lodash/uniqueId'; +import { Input } from '@grafana/ui'; export interface Props { label: string; @@ -38,7 +39,7 @@ export class Switch extends PureComponent { diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx index daecff37dc8..12206b6f8bf 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx @@ -1,7 +1,7 @@ import React, { PureComponent, ChangeEvent } from 'react'; import { Threshold } from '../../types'; import { ColorPicker } from '..'; -import { PanelOptionsGroup } from '..'; +import { Input, PanelOptionsGroup } from '..'; import { colors } from '../../utils'; import { ThemeContext } from '../../themes'; import { getColorFromHexRgbOrName } from '../../utils'; @@ -176,16 +176,16 @@ export class ThresholdsEditor extends PureComponent {
{threshold.index === 0 && (
- +
)} {threshold.index > 0 && ( <>
- this.onChangeThresholdValue(event, threshold)} + onChange={(event: ChangeEvent) => this.onChangeThresholdValue(event, threshold)} value={threshold.value} onBlur={this.onBlur} readOnly={threshold.index === 0} diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap b/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap index 939f26b4dd8..275651687d5 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap +++ b/packages/grafana-ui/src/components/ThresholdsEditor/__snapshots__/ThresholdsEditor.test.tsx.snap @@ -459,11 +459,21 @@ exports[`Render should render with base threshold 1`] = `
- + > +
+ +
+
diff --git a/packages/grafana-ui/src/components/ValueMappingsEditor/MappingRow.tsx b/packages/grafana-ui/src/components/ValueMappingsEditor/MappingRow.tsx index f5cfdfe6cbf..bb1a662c678 100644 --- a/packages/grafana-ui/src/components/ValueMappingsEditor/MappingRow.tsx +++ b/packages/grafana-ui/src/components/ValueMappingsEditor/MappingRow.tsx @@ -1,9 +1,8 @@ import React, { ChangeEvent, PureComponent } from 'react'; +import { FormField, FormLabel, Input, Select } from '..'; + import { MappingType, ValueMapping } from '../../types'; -import { Select } from '../Select/Select'; -import { FormField } from '../FormField/FormField'; -import { FormLabel } from '../FormLabel/FormLabel'; export interface Props { valueMapping: ValueMapping; @@ -81,7 +80,7 @@ export default class MappingRow extends PureComponent { />
Text - { />
Text - {
Key name - Key name - = ({ label, placeholder, name, value, o return (
{label} - = ({ dataSourceName, isDefault, onDefaultChange, > Name - Name - From:
- To:
- {
- Name - Name - = ({ onSubmit, onOrgNameChange, orgName }) => {
Organization name - { - onOrgNameChange(event.target.value); - }} + onChange={(event: ChangeEvent) => onOrgNameChange(event.target.value)} value={orgName} />
diff --git a/public/app/features/org/__snapshots__/OrgProfile.test.tsx.snap b/public/app/features/org/__snapshots__/OrgProfile.test.tsx.snap index b67966df83b..4a9ba6addf3 100644 --- a/public/app/features/org/__snapshots__/OrgProfile.test.tsx.snap +++ b/public/app/features/org/__snapshots__/OrgProfile.test.tsx.snap @@ -23,7 +23,7 @@ exports[`Render should render component 1`] = ` > Organization name - {
Add External Group
- {
Name - { Email - - - Name - Email - { @@ -19,12 +20,12 @@ export default class DefaultVariableQueryEditor extends PureComponent Query - this.handleChange(e)} - onBlur={e => this.handleBlur(e)} + onChange={this.handleChange} + onBlur={this.handleBlur} placeholder="metric name or tags query" required /> diff --git a/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx b/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx index 64bd6ebe28d..4acc2ecf1a7 100644 --- a/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx +++ b/public/app/plugins/datasource/stackdriver/components/AliasBy.tsx @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { debounce } from 'lodash'; +import { Input } from '@grafana/ui'; export interface Props { onChange: (alignmentPeriod) => void; @@ -40,7 +41,7 @@ export class AliasBy extends Component {
- +
diff --git a/public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx b/public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx index f3264176a83..a00aa44559c 100644 --- a/public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx +++ b/public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import _ from 'lodash'; +import { Input } from '@grafana/ui'; import { TemplateSrv } from 'app/features/templating/template_srv'; @@ -91,7 +91,7 @@ export class AnnotationQueryEditor extends React.Component {
Title - {
Text - { return (
Project - +
); } diff --git a/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap b/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap index 8ab8bbfc83b..9d573dc6365 100644 --- a/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap +++ b/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap @@ -398,12 +398,14 @@ Array [ > Alias By - +
+ +
Project - +
+ +