Skip to content
Snippets Groups Projects
Unverified Commit b48e3077 authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

remove dead search bar (#29455)

parent bfc51d2a
Branches
Tags
No related merge requests found
import React from "react";
import PropTypes from "prop-types";
import { t } from "ttag";
export default class SearchBar extends React.Component {
constructor(props, context) {
super(props, context);
this.handleInputChange = this.handleInputChange.bind(this);
this.filterTextInput = React.createRef();
}
static propTypes = {
filter: PropTypes.string.isRequired,
onFilter: PropTypes.func.isRequired,
};
handleInputChange() {
this.props.onFilter(this.filterTextInput.current.value);
}
render() {
return (
<input
className="SearchBar"
type="text"
ref={this.filterTextInput}
value={this.props.filter}
placeholder={t`Search for`}
onChange={this.handleInputChange}
/>
);
}
}
......@@ -7,7 +7,6 @@ import _ from "underscore";
import cx from "classnames";
import Popover from "metabase/components/Popover";
import Icon from "metabase/components/Icon";
import SearchBar from "./SearchBar";
export default class SelectionModule extends Component {
constructor(props, context) {
......@@ -24,8 +23,6 @@ export default class SelectionModule extends Component {
this.state = {
open: isInitiallyOpen,
expanded: false,
searchThreshold: 20,
searchEnabled: false,
filterTerm: null,
};
}
......@@ -56,18 +53,6 @@ export default class SelectionModule extends Component {
});
}
_enableSearch() {
/*
not showing search for now
if(this.props.items.length > this.state.searchThreshold) {
return true
} else {
return false
}
*/
return false;
}
_toggleOpen() {
this.setState({
open: !this.state.open,
......@@ -205,11 +190,6 @@ export default class SelectionModule extends Component {
"SelectionItems--expanded": this.state.expanded,
});
let searchBar;
if (this._enableSearch()) {
searchBar = <SearchBar onFilter={this._filterSelections} />;
}
return (
<Popover
target={this.rootRef.current}
......@@ -217,7 +197,6 @@ export default class SelectionModule extends Component {
onClose={this.onClose}
>
<div className={itemListClasses}>
{searchBar}
<ul className="SelectionList scroll-show scroll-y">
{this._listItems(selection)}
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment