diff --git a/app/assets/javascripts/admin/tasktype/task_type_list_view.js b/app/assets/javascripts/admin/tasktype/task_type_list_view.js index 5e86c7f154..863f41712a 100644 --- a/app/assets/javascripts/admin/tasktype/task_type_list_view.js +++ b/app/assets/javascripts/admin/tasktype/task_type_list_view.js @@ -19,6 +19,7 @@ const { Search } = Input; type Props = { history: RouterHistory, + initialSearchValue?: string, }; type State = { @@ -41,6 +42,11 @@ class TaskTypeListView extends React.PureComponent { componentWillMount() { this.setState(persistence.load(this.props.history)); + if (this.props.initialSearchValue && this.props.initialSearchValue !== "") { + this.setState({ + searchQuery: this.props.initialSearchValue, + }); + } } componentDidMount() { diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index b4ccacac97..5d895883ce 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -262,7 +262,10 @@ class ReactRouter extends React.Component { ( + // Strip the leading # away. If there is no hash, "".slice(1) will evaluate to "", too. + + )} exact />