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() {
})
.component('searchInput', {
bindings: require('../search-input').bindings,
})
.component('sortDropdown', {
bindings: require('../sort-dropdown').bindings,
});
});
......@@ -160,25 +157,6 @@ describe('topBar', function() {
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() {
angular.mock.module('app', {
settings: { theme: 'clean' },
......
......@@ -25,9 +25,6 @@ module.exports = {
onSharePage: '&',
onSignUp: '&',
searchController: '<',
sortKey: '<',
sortKeysAvailable: '<',
onChangeSortKey: '&',
pendingUpdateCount: '<',
onApplyPendingUpdates: '&',
},
......
......@@ -41,11 +41,7 @@
on-search="vm.searchController.update($query)"
title="Filter the annotation list">
</search-input>
<sort-dropdown
sort-keys-available="vm.sortKeysAvailable"
sort-key="vm.sortKey"
on-change-sort-key="vm.onChangeSortKey({sortKey: sortKey})">
</sort-dropdown>
<sort-menu></sort-menu>
<button class="top-bar__btn"
ng-click="vm.onSharePage()"
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