Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the opened help panel when clicking on the search bar icon #2406

Merged
merged 1 commit into from
Mar 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/app/scripts/actions/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ import {
RESOURCE_VIEW_MODE,
} from '../constants/naming';


const log = debug('scope:app-actions');

export function showHelp() {
return {type: ActionTypes.SHOW_HELP};
return { type: ActionTypes.SHOW_HELP };
}


export function hideHelp() {
return {type: ActionTypes.HIDE_HELP};
return { type: ActionTypes.HIDE_HELP };
}


Expand Down
10 changes: 5 additions & 5 deletions client/app/scripts/components/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import classnames from 'classnames';
import { debounce } from 'lodash';

import { blurSearch, doSearch, focusSearch, showHelp } from '../actions/app-actions';
import { blurSearch, doSearch, focusSearch, toggleHelp } from '../actions/app-actions';
import { searchMatchCountByTopologySelector } from '../selectors/search';
import { isResourceViewModeSelector } from '../selectors/topology';
import { slugify } from '../utils/string-utils';
Expand Down Expand Up @@ -103,8 +103,8 @@ class Search extends React.Component {
}

render() {
const { nodes, pinnedSearches, searchFocused, searchMatchCountByTopology, isResourceViewMode,
searchQuery, topologiesLoaded, onClickHelp, inputId = 'search' } = this.props;
const { nodes, pinnedSearches, searchFocused, searchMatchCountByTopology,
isResourceViewMode, searchQuery, topologiesLoaded, inputId = 'search' } = this.props;
const hidden = !topologiesLoaded || isResourceViewMode;
const disabled = this.props.isTopologyEmpty && !hidden;
const matchCount = searchMatchCountByTopology
Expand Down Expand Up @@ -143,7 +143,7 @@ class Search extends React.Component {
{!showPinnedSearches && <div className="search-hint">
{getHint(nodes)} <span
className="search-help-link fa fa-question-circle"
onMouseDown={onClickHelp} />
onMouseDown={this.props.toggleHelp} />
</div>}
</div>
</div>
Expand All @@ -163,5 +163,5 @@ export default connect(
searchQuery: state.get('searchQuery'),
searchMatchCountByTopology: searchMatchCountByTopologySelector(state),
}),
{ blurSearch, doSearch, focusSearch, onClickHelp: showHelp }
{ blurSearch, doSearch, focusSearch, toggleHelp }
)(Search);