Skip to content

Commit

Permalink
fix #1133 configured the Catalog plugin to display the first page of …
Browse files Browse the repository at this point in the history
…an empty search
  • Loading branch information
saidaipparla committed Oct 17, 2016
1 parent 61f5eb4 commit 64541e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 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 @@ -17,8 +17,10 @@ const RecordGrid = require('./RecordGrid');

const Catalog = React.createClass({
propTypes: {
active: React.PropTypes.bool,
formats: React.PropTypes.array,
format: React.PropTypes.string,
searchOnStarup: React.PropTypes.bool,
onSearch: React.PropTypes.func,
onChangeFormat: React.PropTypes.func,
onLayerAdd: React.PropTypes.func,
Expand Down Expand Up @@ -69,7 +71,9 @@ const Catalog = React.createClass({
};
},
componentDidMount() {
this.refs.searchText.getInputDOMNode().focus();
if (this.props.searchOnStarup) {
this.props.onSearch(this.props.format, this.getCatalogUrl(), 1, this.props.pageSize, "");
}
},
componentWillReceiveProps(nextProps) {
if (nextProps !== this.props) {
Expand Down
1 change: 1 addition & 0 deletions web/client/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@
"showGetCapLinks": false,
"addAuthentication": false,
"wrap": true,
"searchOnStarup": true,
"wrapWithPanel": false,
"closeGlyph": "1-close",
"initialCatalogURL": {
Expand Down
3 changes: 2 additions & 1 deletion web/client/plugins/MetadataExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const MetadataExplorerComponent = React.createClass({
propTypes: {
id: React.PropTypes.string,
active: React.PropTypes.bool,
searchOnStarup: React.PropTypes.bool,
formats: React.PropTypes.array,
wrap: React.PropTypes.bool,
wrapWithPanel: React.PropTypes.bool,
Expand Down Expand Up @@ -75,7 +76,7 @@ const MetadataExplorerComponent = React.createClass({
};
},
render() {
const panel = <div role="body" className="modal_window"><Catalog {...this.props}/></div>;
const panel = <div role="body" className="modal_window"><Catalog searchOnStarup={this.props.searchOnStarup} active={this.props.active} {...this.props}/></div>;
if (this.props.wrap) {
if (this.props.active) {
if (this.props.wrapWithPanel) {
Expand Down

0 comments on commit 64541e6

Please sign in to comment.