Skip to content
Snippets Groups Projects
Commit 3b2dadcf authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix misc React warnings

parent 00f38b5b
Branches
Tags
No related merge requests found
......@@ -85,7 +85,7 @@ export default class Column extends Component {
return (
<li className="mt1 mb3">
<div>
<Input style={{minWidth: 420}} className="AdminInput TableEditor-field-name float-left bordered inline-block rounded text-bold" type="text" value={this.props.field.display_name} onBlurChange={this.onNameChange}/>
<Input style={{minWidth: 420}} className="AdminInput TableEditor-field-name float-left bordered inline-block rounded text-bold" type="text" value={this.props.field.display_name || ""} onBlurChange={this.onNameChange}/>
<div className="clearfix">
<div className="flex flex-full">
<div className="flex-full px1">
......@@ -111,7 +111,7 @@ export default class Column extends Component {
</div>
</div>
<div className="MetadataTable-title flex flex-column flex-full bordered rounded mt1 mr1">
<Input className="AdminInput TableEditor-field-description" type="text" value={this.props.field.description} onBlurChange={this.onDescriptionChange} placeholder="No column description yet" />
<Input className="AdminInput TableEditor-field-description" type="text" value={this.props.field.description || ""} onBlurChange={this.onDescriptionChange} placeholder="No column description yet" />
</div>
</li>
)
......
......@@ -12,7 +12,7 @@ export default class MetadataSchemaList extends Component {
super(props, context);
this.state = {
searchText: null,
searchText: "",
searchRegex: null
};
......
......@@ -86,8 +86,8 @@ export default class MetadataTable extends Component {
return (
<div className="MetadataTable px3 flex-full">
<div className="MetadataTable-title flex flex-column bordered rounded">
<Input className="AdminInput TableEditor-table-name text-bold border-bottom rounded-top" type="text" value={tableMetadata.display_name} onBlurChange={this.onNameChange}/>
<Input className="AdminInput TableEditor-table-description rounded-bottom" type="text" value={tableMetadata.description} onBlurChange={this.onDescriptionChange} placeholder="No table description yet" />
<Input className="AdminInput TableEditor-table-name text-bold border-bottom rounded-top" type="text" value={tableMetadata.display_name || ""} onBlurChange={this.onNameChange}/>
<Input className="AdminInput TableEditor-table-description rounded-bottom" type="text" value={tableMetadata.description || ""} onBlurChange={this.onDescriptionChange} placeholder="No table description yet" />
</div>
<div className="MetadataTable-header flex align-center py2 text-grey-3">
<span className="mx1 text-uppercase">Visibility</span>
......
......@@ -13,7 +13,7 @@ export default class MetadataTableList extends Component {
super(props, context);
this.state = {
searchText: null,
searchText: "",
searchRegex: null
};
......
......@@ -3,7 +3,7 @@ import cx from "classnames";
class EditBar extends Component {
static propTypes = {
title: PropTypes.string.isRequires,
title: PropTypes.string.isRequired,
subtitle: PropTypes.string,
buttons: PropTypes.oneOfType([
PropTypes.element,
......
......@@ -69,15 +69,15 @@ export default class Header extends Component {
if (this.props.isEditingInfo) {
titleAndDescription = (
<div className="Header-title flex flex-column flex-full bordered rounded my1">
<Input className="AdminInput text-bold border-bottom rounded-top h3" type="text" value={this.props.item.name} onChange={this.setItemAttribute.bind(this, "name")}/>
<Input className="AdminInput rounded-bottom h4" type="text" value={this.props.item.description} onChange={this.setItemAttribute.bind(this, "description")} placeholder="No description yet" />
<Input className="AdminInput text-bold border-bottom rounded-top h3" type="text" value={this.props.item.name || ""} onChange={this.setItemAttribute.bind(this, "name")}/>
<Input className="AdminInput rounded-bottom h4" type="text" value={this.props.item.description || ""} onChange={this.setItemAttribute.bind(this, "description")} placeholder="No description yet" />
</div>
);
} else {
if (this.props.item && this.props.item.id != null) {
titleAndDescription = (
<TitleAndDescription
title={this.props.item.name}
title={this.props.item.name}
description={this.props.item.description}
/>
);
......
import React, { Component, PropTypes } from "react";
import _ from "underscore";
export default class Input extends Component {
constructor(props, context) {
super(props, context);
......@@ -38,6 +40,7 @@ export default class Input extends Component {
}
render() {
return <input {...this.props} value={this.state.value} onBlur={this.onBlur} onChange={this.onChange} />
let props = _.omit(this.props, "onBlurChange", "value", "onBlur", "onChange");
return <input {...props} value={this.state.value} onBlur={this.onBlur} onChange={this.onChange} />
}
}
......@@ -53,12 +53,12 @@ export default class DateMonthYearWidget extends Component {
<div className="flex">
<ol className="flex flex-column">
{ _.range(0,6).map(m =>
<Month month={m} selected={m === month} onClick={() => this.setState({ month: m }, onClose)} />
<Month key={m} month={m} selected={m === month} onClick={() => this.setState({ month: m }, onClose)} />
)}
</ol>
<ol className="flex flex-column">
{ _.range(6,12).map(m =>
<Month month={m} selected={m === month} onClick={() => this.setState({ month: m }, onClose)} />
<Month key={m} month={m} selected={m === month} onClick={() => this.setState({ month: m }, onClose)} />
)}
</ol>
</div>
......
......@@ -125,7 +125,7 @@ export default class TagEditorParam extends Component {
placeholder="Select…"
>
{databaseFields && databaseFields.map(field =>
<Option value={field.id} name={field.name}>
<Option key={field.id} value={field.id} name={field.name}>
<div className="cursor-pointer">
<div className="h6 text-bold text-uppercase text-grey-2">{dabaseHasSchemas && (field.schema + " > ")}{field.table_name}</div>
<div className="h4 text-bold text-default">{field.name}</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment