From: Yarin Dekel Date: Wed, 28 Nov 2018 12:26:22 +0000 (+0200) Subject: WF-keep search result& search visibility X-Git-Tag: 1.4.0~33 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F73783%2F2;p=sdc%2Fsdc-workflow-designer.git WF-keep search result& search visibility Issue-ID: SDC-1963 Change-Id: I81faaa3229db830475b6d827b578cb361c744228 Signed-off-by: Yarin Dekel --- 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;