From d700ba7fae234c2a6e804ff746e4d78843a52616 Mon Sep 17 00:00:00 2001 From: Yarin Dekel Date: Wed, 28 Nov 2018 14:26:22 +0200 Subject: WF-keep search result& search visibility Issue-ID: SDC-1963 Change-Id: I81faaa3229db830475b6d827b578cb361c744228 Signed-off-by: Yarin Dekel --- .../src/main/frontend/src/features/catalog/CatalogView.jsx | 1 + .../frontend/src/features/catalog/__tests__/catalogReducer-test.js | 1 + .../src/main/frontend/src/features/catalog/catalogReducer.js | 4 +++- .../src/main/frontend/src/shared/searchInput/SearchInput.jsx | 2 +- 4 files changed, 6 insertions(+), 2 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 73ef6548..0f3d9702 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 @@ -101,6 +101,7 @@ class CatalogView extends Component { ...catalog, searchNameFilter: searchValue }); + sessionStorage.setItem('searchNameFilter', searchValue); }; render() { diff --git a/workflow-designer-ui/src/main/frontend/src/features/catalog/__tests__/catalogReducer-test.js b/workflow-designer-ui/src/main/frontend/src/features/catalog/__tests__/catalogReducer-test.js index 406e2d52..264e8112 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/catalog/__tests__/catalogReducer-test.js +++ b/workflow-designer-ui/src/main/frontend/src/features/catalog/__tests__/catalogReducer-test.js @@ -34,6 +34,7 @@ describe('Catalog Reducer', () => { sort: { [NAME]: ASC }, + searchNameFilter: '', items: [ { id: 'c5b7ca1a0f7944bfa948b85b32c5f314', diff --git a/workflow-designer-ui/src/main/frontend/src/features/catalog/catalogReducer.js b/workflow-designer-ui/src/main/frontend/src/features/catalog/catalogReducer.js index 18507c21..db7bc43b 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/catalog/catalogReducer.js +++ b/workflow-designer-ui/src/main/frontend/src/features/catalog/catalogReducer.js @@ -29,7 +29,9 @@ export const initialState = { sort: { [NAME]: ASC }, - status: WORKFLOW_STATUS.ACTIVE + status: WORKFLOW_STATUS.ACTIVE, + //In order to save state inside iframe session + searchNameFilter: sessionStorage.getItem('searchNameFilter') || '' }; const catalogReducer = (state = initialState, action) => { diff --git a/workflow-designer-ui/src/main/frontend/src/shared/searchInput/SearchInput.jsx b/workflow-designer-ui/src/main/frontend/src/shared/searchInput/SearchInput.jsx index 24dbca43..ef1f0f37 100644 --- a/workflow-designer-ui/src/main/frontend/src/shared/searchInput/SearchInput.jsx +++ b/workflow-designer-ui/src/main/frontend/src/shared/searchInput/SearchInput.jsx @@ -25,7 +25,7 @@ class ExpandableInput extends React.Component { value: PropTypes.string }; - state = { showInput: false }; + state = { showInput: !!this.props.value }; handleRef = input => { this.domNode = input; -- cgit 1.2.3-korg