* limitations under the License.
*/
-import React from 'react';
+import React, { Component } from 'react';
import PropTypes from 'prop-types';
import InfiniteScroll from 'shared/scroll/InfiniteScroll';
import Workflows from 'features/catalog/views/Workflows';
import Header from 'features/catalog/views/Header';
import Main from 'features/catalog/views/Main';
-
import { NAME, ASC, DESC } from 'features/catalog/catalogConstants';
-class CatalogView extends React.Component {
+class CatalogView extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ searchValue: ''
+ };
+ }
+
componentDidMount() {
const { clearWorkflow } = this.props;
history.push('/workflow/' + id + '/overview');
};
+ searchChange = searchValue => {
+ const { searchInputChanged, catalog } = this.props;
+ this.setState({ searchValue: searchValue });
+ searchInputChanged({
+ ...catalog,
+ searchNameFilter: searchValue
+ });
+ };
+
render() {
const { catalog, showNewWorkflowModal } = this.props;
const {
return (
<div className="wf-catalog">
- <Header />
+ <Header
+ searchChange={this.searchChange}
+ searchValue={this.state.searchValue}
+ />
<InfiniteScroll
useWindow={false}
loadMore={this.handleScroll}
handleResetWorkflow: PropTypes.func,
handleFetchWorkflow: PropTypes.func,
showNewWorkflowModal: PropTypes.func,
- clearWorkflow: PropTypes.func
+ clearWorkflow: PropTypes.func,
+ searchInputChanged: PropTypes.func
};
CatalogView.defaultProps = {