Commit 9e441d21 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Replace `sort-dropdown` with `SortMenu` in `top-bar` component

parent 617ebe4b
...@@ -18,9 +18,6 @@ describe('topBar', function() { ...@@ -18,9 +18,6 @@ describe('topBar', function() {
}) })
.component('searchInput', { .component('searchInput', {
bindings: require('../search-input').bindings, bindings: require('../search-input').bindings,
})
.component('sortDropdown', {
bindings: require('../sort-dropdown').bindings,
}); });
}); });
...@@ -160,25 +157,6 @@ describe('topBar', function() { ...@@ -160,25 +157,6 @@ describe('topBar', function() {
assert.calledWith(onSearch, 'new-query'); assert.calledWith(onSearch, 'new-query');
}); });
it('displays the sort dropdown and propagates sort key changes', function() {
const onChangeSortKey = sinon.stub();
const el = createTopBar({
sortKeysAvailable: ['Newest', 'Oldest'],
sortKey: 'Newest',
onChangeSortKey: {
args: ['sortKey'],
callback: onChangeSortKey,
},
});
const sortDropdown = el.find('sort-dropdown').controller('sortDropdown');
assert.deepEqual(sortDropdown.sortKeysAvailable, ['Newest', 'Oldest']);
assert.deepEqual(sortDropdown.sortKey, 'Newest');
sortDropdown.onChangeSortKey({ sortKey: 'Oldest' });
assert.calledWith(onChangeSortKey, 'Oldest');
});
it('shows the clean theme when settings contains the clean theme option', function() { it('shows the clean theme when settings contains the clean theme option', function() {
angular.mock.module('app', { angular.mock.module('app', {
settings: { theme: 'clean' }, settings: { theme: 'clean' },
......
...@@ -25,9 +25,6 @@ module.exports = { ...@@ -25,9 +25,6 @@ module.exports = {
onSharePage: '&', onSharePage: '&',
onSignUp: '&', onSignUp: '&',
searchController: '<', searchController: '<',
sortKey: '<',
sortKeysAvailable: '<',
onChangeSortKey: '&',
pendingUpdateCount: '<', pendingUpdateCount: '<',
onApplyPendingUpdates: '&', onApplyPendingUpdates: '&',
}, },
......
...@@ -41,11 +41,7 @@ ...@@ -41,11 +41,7 @@
on-search="vm.searchController.update($query)" on-search="vm.searchController.update($query)"
title="Filter the annotation list"> title="Filter the annotation list">
</search-input> </search-input>
<sort-dropdown <sort-menu></sort-menu>
sort-keys-available="vm.sortKeysAvailable"
sort-key="vm.sortKey"
on-change-sort-key="vm.onChangeSortKey({sortKey: sortKey})">
</sort-dropdown>
<button class="top-bar__btn" <button class="top-bar__btn"
ng-click="vm.onSharePage()" ng-click="vm.onSharePage()"
ng-if="vm.showSharePageButton()" ng-if="vm.showSharePageButton()"
......
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