aboutsummaryrefslogtreecommitdiffstats
path: root/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx')
-rw-r--r--workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx24
1 files changed, 10 insertions, 14 deletions
diff --git a/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx b/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx
index 4fdcc786..3f002523 100644
--- a/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx
+++ b/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx
@@ -27,9 +27,6 @@ import { NAME, ASC, DESC } from 'features/catalog/catalogConstants';
class CatalogView extends Component {
constructor(props) {
super(props);
- this.state = {
- searchValue: ''
- };
}
componentDidMount() {
@@ -38,34 +35,31 @@ class CatalogView extends Component {
clearWorkflow();
}
- componentWillUnmount() {
- this.props.handleResetWorkflow();
- }
-
handleAlphabeticalOrderByClick = e => {
e.preventDefault();
const {
handleFetchWorkflow,
- catalog: { sort }
+ catalog: { sort, searchNameFilter }
} = this.props;
const payload = {
...sort
};
payload[NAME] = payload[NAME] === ASC ? DESC : ASC;
- handleFetchWorkflow(payload, undefined, this.state.searchValue);
+ handleFetchWorkflow(payload, undefined, searchNameFilter);
};
handleScroll = () => {
const {
catalog: {
paging: { offset },
- sort
+ sort,
+ searchNameFilter
},
handleFetchWorkflow
} = this.props;
- handleFetchWorkflow(sort, offset, this.state.searchValue);
+ handleFetchWorkflow(sort, offset, searchNameFilter);
};
goToOverviewPage = id => {
@@ -91,7 +85,8 @@ class CatalogView extends Component {
const {
sort,
paging: { hasMore, total },
- items
+ items,
+ searchNameFilter
} = catalog;
const alphabeticalOrder = sort[NAME];
@@ -99,7 +94,7 @@ class CatalogView extends Component {
<div className="wf-catalog">
<Header
searchChange={this.searchChange}
- searchValue={this.state.searchValue}
+ searchValue={searchNameFilter}
/>
<InfiniteScroll
useWindow={false}
@@ -132,7 +127,8 @@ CatalogView.propTypes = {
handleFetchWorkflow: PropTypes.func,
showNewWorkflowModal: PropTypes.func,
clearWorkflow: PropTypes.func,
- searchInputChanged: PropTypes.func
+ searchInputChanged: PropTypes.func,
+ searchNameFilter: PropTypes.string
};
CatalogView.defaultProps = {