Commit ec8d9ce4 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Remove unused/old `sort-dropdown` component

parent 9e441d21
...@@ -73,16 +73,6 @@ function HypothesisAppController( ...@@ -73,16 +73,6 @@ function HypothesisAppController(
frameSync.connect(); frameSync.connect();
} }
this.sortKey = function() {
return store.getState().sortKey;
};
this.sortKeysAvailable = function() {
return store.getState().sortKeysAvailable;
};
this.setSortKey = store.setSortKey;
// Reload the view when the user switches accounts // Reload the view when the user switches accounts
$scope.$on(events.USER_CHANGED, function(event, data) { $scope.$on(events.USER_CHANGED, function(event, data) {
self.auth = authStateFromProfile(data.profile); self.auth = authStateFromProfile(data.profile);
......
'use strict';
module.exports = {
controllerAs: 'vm',
controller: function() {},
bindings: {
/** The name of the currently selected sort key. */
sortKey: '<',
/** A list of possible keys that the user can opt to sort by. */
sortKeysAvailable: '<',
/** Called when the user changes the sort key. */
onChangeSortKey: '&',
},
template: require('../templates/sort-dropdown.html'),
};
'use strict';
const angular = require('angular');
const util = require('../../directive/test/util');
describe('sortDropdown', function() {
before(function() {
angular
.module('app', [])
.component('sortDropdown', require('../sort-dropdown'));
});
beforeEach(function() {
angular.mock.module('app');
});
it('should update the sort key on click', function() {
const changeSpy = sinon.spy();
const elem = util.createDirective(document, 'sortDropdown', {
sortKeysAvailable: ['Newest', 'Oldest'],
sortKey: 'Newest',
onChangeSortKey: {
args: ['sortKey'],
callback: changeSpy,
},
});
const links = elem.find('li');
angular.element(links[0]).click();
assert.calledWith(changeSpy, 'Newest');
});
});
...@@ -184,7 +184,6 @@ function startAngularApp(config) { ...@@ -184,7 +184,6 @@ function startAngularApp(config) {
) )
.component('sidebarTutorial', require('./components/sidebar-tutorial')) .component('sidebarTutorial', require('./components/sidebar-tutorial'))
.component('shareDialog', require('./components/share-dialog')) .component('shareDialog', require('./components/share-dialog'))
.component('sortDropdown', require('./components/sort-dropdown'))
.component( .component(
'sortMenu', 'sortMenu',
wrapReactComponent(require('./components/sort-menu')) wrapReactComponent(require('./components/sort-menu'))
......
...@@ -9,10 +9,7 @@ ...@@ -9,10 +9,7 @@
is-sidebar="::vm.isSidebar" is-sidebar="::vm.isSidebar"
pending-update-count="vm.countPendingUpdates()" pending-update-count="vm.countPendingUpdates()"
on-apply-pending-updates="vm.applyPendingUpdates()" on-apply-pending-updates="vm.applyPendingUpdates()"
search-controller="vm.search" search-controller="vm.search">
sort-key="vm.sortKey()"
sort-keys-available="vm.sortKeysAvailable()"
on-change-sort-key="vm.setSortKey(sortKey)">
</top-bar> </top-bar>
<div class="content"> <div class="content">
......
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