Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

SUP-2582, Upcoming SRMs should be ordered by most recent date #541

Merged
merged 2 commits into from
Nov 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/my-dashboard/srms/srms.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
function getSRMs() {
var params = {
filter: 'status=future',
orderBy: 'registrationStartAt',
limit: 3
};

Expand Down
4 changes: 3 additions & 1 deletion app/my-srms/my-srms.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@

function changeFilter(filter) {
vm.statusFilter = filter;
vm.orderBy = filter === 'future'? 'startDate': 'endDate';
// for upcoming SRMs sorting is done ascending order of codingStartAt
// for past SRMs sorting is done descending order of codingEndAt
vm.orderBy = filter === 'future'? 'codingStartAt': 'codingEndAt';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some comments stating why we are using one over the other. Thanks

vm.reverseOrder = filter !== 'future';
// update url but don't reload
$state.go($state.$current.name, {status: filter}, {notify: false});
Expand Down