Skip to content

Commit

Permalink
Merge pull request #1 from offtherailz/mbarto-migrate_react_bootstrap
Browse files Browse the repository at this point in the history
Fixed catalog and workspace input
  • Loading branch information
mbarto authored Feb 27, 2017
2 parents e8580a1 + 700a2be commit ad8aef7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion web/client/components/catalog/Catalog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ const Catalog = React.createClass({
});
}
},
onSearchTextChange(event) {
this.setState({searchText: event.target.value});
},
onKeyDown(event) {
if (event.keyCode === 13) {
this.search();
Expand Down Expand Up @@ -195,6 +198,7 @@ const Catalog = React.createClass({
textOverflow: "ellipsis"
}}
placeholder={LocaleUtils.getMessageById(this.context.messages, "catalog.textSearchPlaceholder")}
onChange={this.onSearchTextChange}
onKeyDown={this.onKeyDown}/></FormGroup>);
return (
<div>
Expand All @@ -215,7 +219,7 @@ const Catalog = React.createClass({
);
},
search() {
this.props.onSearch(this.props.format, this.getCatalogUrl(), 1, this.props.pageSize, this.refs.searchText.getValue());
this.props.onSearch(this.props.format, this.getCatalogUrl(), 1, this.props.pageSize, this.state && this.state.searchText);
this.setState({
loading: true
});
Expand Down
8 changes: 4 additions & 4 deletions web/client/components/manager/importer/Workspace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ module.exports = React.createClass({
// should not contain spaces
return name.indexOf(" ") < 0 && name.length > 0;
},
validate() {
let name = this.refs.workspaceNewName.getValue();
validate(e) {
let name = e.target.value;
let valid = this.isValid(name);
this.setState({valid});
this.setState({valid, name});
},
createWorkspace() {
let name = this.refs.workspaceNewName.getValue();
let name = this.state && this.state.name;
let valid = this.isValid(name);
if (name && valid) {
this.props.createWorkspace(name, this.props.datastoreTemplates);
Expand Down

0 comments on commit ad8aef7

Please sign in to comment.