Commit 1c744a51 authored by Robert Knight's avatar Robert Knight

Respond to code review feedback

 - Clarify or reword a few comments and test descriptions

 - Pluralize "annotations" correctly in the real-time update notification
   icon's tooltip
parent 9c0a7a42
......@@ -54,7 +54,8 @@ function StreamContentController(
}
});
// If redirected to this route from `/a/:id`, clear any existing annotations.
// In case this route loaded after a client-side route change (eg. from
// '/a/:id'), clear any existing annotations.
store.clearAnnotations();
// Perform the initial search
......
......@@ -11,8 +11,7 @@ const SearchInput = require('./search-input');
/**
* Search input for the single annotation view and stream.
*
* This displays and updates the "q" query param in the URL which controls
* the API query that is used to search for annotations.
* This displays and updates the "q" query param in the URL.
*/
function StreamSearchInput({ $location, $rootScope }) {
const [query, setQuery] = useState($location.search().q);
......
......@@ -167,7 +167,7 @@ describe('TopBar', () => {
assert.equal(wrapper.find(SearchInput).prop('query'), 'test-query');
});
it('updates search in the sidebar', () => {
it('updates current filter when changing search query in the sidebar', () => {
const wrapper = createTopBar();
wrapper.find('SearchInput').prop('onSearch')('new-query');
assert.calledWith(fakeStore.setFilterQuery, 'new-query');
......
......@@ -90,7 +90,9 @@ function TopBar({
<a
className="top-bar__apply-update-btn"
onClick={onApplyPendingUpdates}
title={`Show ${pendingUpdateCount} new/updated annotation(s)`}
title={`Show ${pendingUpdateCount} new/updated ${
pendingUpdateCount === 1 ? 'annotation' : 'annotations'
}`}
>
<SvgIcon className="top-bar__apply-icon" name="refresh" />
</a>
......
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