Skip to content

Commit ee33c5f

Browse files
Merge pull request #449 from DemocracyLab/groups_sorting
Groups sorting updates
2 parents 8cc0275 + e85d85a commit ee33c5f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

civictechprojects/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def groups_list(request):
708708
if 'sortField' in query_params:
709709
group_list = projects_by_sortField(group_list, query_params['sortField'][0])
710710
else:
711-
group_list = projects_by_sortField(group_list, '-group_date_modified')
711+
group_list = projects_by_sortField(group_list, 'group_name')
712712

713713
group_count = len(group_list)
714714

common/components/common/groups/AboutGroupDisplay.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class AboutGroupDisplay extends React.PureComponent<Props, State> {
4747
: [];
4848
return ({
4949
group: group,
50-
approvedProjects: approvedProjects,
50+
approvedProjects: _.reverse(_.sortBy(approvedProjects, (p: ProjectRelationshipAPIData) => p.project_date_modified)),
5151
issueAreas: this.getUniqueIssueAreas(approvedProjects)
5252
});
5353
}

common/components/componentsBySection/FindGroups/GroupSearchSort.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ type State = {|
1616
|};
1717

1818
const sortOptions: $ReadOnlyArray<SelectOption> = [
19-
{value: "", label: "Date Modified"},
20-
{value: "group_name", label: "Name - Ascending"},
21-
{value: "-group_name", label: "Name - Descending"}
22-
];
19+
{value: "", label: "Name - Ascending"},
20+
{value: "-group_name", label: "Name - Descending"},
21+
{value: "-group_date_modified", label: "Date Modified"}
22+
];
2323

2424
class GroupSearchSort extends React.Component<{||}, State> {
2525

0 commit comments

Comments
 (0)