Skip to content

Commit

Permalink
Merge pull request #222 from MetaPhase-Consulting/fix/sorting_params
Browse files Browse the repository at this point in the history
fix: update sort params to correctly sort
  • Loading branch information
mjoyce91 committed Jun 11, 2019
2 parents 9e54f12 + de0f3d9 commit ed202d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ exports[`FavoritePositionsComponent matches snapshot 1`] = `
},
Object {
"text": "TED: Soonest",
"value": "position__current_assignment__estimated_end_date",
"value": "ted",
},
Object {
"text": "Position number: Low to high",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`SelectForm matches snapshot 1`] = `
Posted date: Most recent
</option>
<option
value="position__current_assignment__estimated_end_date"
value="ted"
>
TED: Soonest
</option>
Expand Down Expand Up @@ -106,7 +106,7 @@ exports[`SelectForm matches snapshot when disabled 1`] = `
Posted date: Most recent
</option>
<option
value="position__current_assignment__estimated_end_date"
value="ted"
>
TED: Soonest
</option>
Expand Down
8 changes: 3 additions & 5 deletions src/Constants/Sort.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { COMMON_PROPERTIES } from './EndpointParams';

export const POSITION_SEARCH_SORTS = {
options: [
{ value: '', text: 'Sort option', disabled: true },
{ value: 'position__title', text: 'Position title: A-Z' },
{ value: '-position__grade', text: 'Grade: Low to high' }, // sort by grade "ranking"
{ value: '-position__bureau', text: 'Bureau: A-Z' }, // numbers first, then A-Z
{ value: `-${COMMON_PROPERTIES.posted}`, text: 'Posted date: Most recent' }, // sort by soonest posted_date
{ value: 'position__current_assignment__estimated_end_date', text: 'TED: Soonest' },
{ value: '-posted_date', text: 'Posted date: Most recent' }, // sort by soonest posted_date
{ value: 'ted', text: 'TED: Soonest' },
{ value: 'position__position_number', text: 'Position number: Low to high' }, // numbers first, then A-Z
{ value: '-position__post__has_service_needs_differential', text: 'Featured positions' }, // sort by service needs first
],
};

POSITION_SEARCH_SORTS.defaultSort = POSITION_SEARCH_SORTS.options.find(o =>
o.value === 'position__current_assignment__estimated_end_date',
o.value === 'ted',
).value;

export const POSITION_PAGE_SIZES = {
Expand Down

0 comments on commit ed202d0

Please sign in to comment.