Commit 79f0f345 authored by Robert Knight's avatar Robert Knight

Only clear filter query when closing search panel

As part of the filter UI overhaul we want to make it easier to toggle filters
independently, which enables going back / forward one step at a time. For the
search panel, this means that closing search should not affect other filters.
parent e60e8058
...@@ -19,7 +19,7 @@ export default function SearchPanel() { ...@@ -19,7 +19,7 @@ export default function SearchPanel() {
initialFocus={inputRef} initialFocus={inputRef}
onActiveChanged={active => { onActiveChanged={active => {
if (!active) { if (!active) {
store.clearSelection(); store.setFilterQuery(null);
} }
}} }}
> >
......
...@@ -8,7 +8,6 @@ describe('SearchPanel', () => { ...@@ -8,7 +8,6 @@ describe('SearchPanel', () => {
beforeEach(() => { beforeEach(() => {
fakeStore = { fakeStore = {
clearSelection: sinon.stub(),
setFilterQuery: sinon.stub(), setFilterQuery: sinon.stub(),
filterQuery: sinon.stub().returns(null), filterQuery: sinon.stub().returns(null),
closeSidebarPanel: sinon.stub(), closeSidebarPanel: sinon.stub(),
...@@ -36,7 +35,11 @@ describe('SearchPanel', () => { ...@@ -36,7 +35,11 @@ describe('SearchPanel', () => {
wrapper.find('SidebarPanel').props().onActiveChanged(active); wrapper.find('SidebarPanel').props().onActiveChanged(active);
assert.equal(fakeStore.clearSelection.called, !active); if (!active) {
assert.calledWith(fakeStore.setFilterQuery, null);
} else {
assert.notCalled(fakeStore.setFilterQuery);
}
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment