mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
DEV: Standardize table sorting verbiage (#9757)
* DEV: Standardize table sorting verbiage This commit creates a common component that tables can use to make their headers sortable. This commit also standardizes on using `desc` as the default and passing in the `asc=true` flag to adjust the sorting direction. * Add deprecation warnings Adds deprecation warnings if using previous params and maintains backwards compatibility. Set the default sort value for group members to be asc. * switch group requests to use common table-header-toggle * update fixture
This commit is contained in:
@ -209,7 +209,11 @@ class GroupsController < ApplicationController
|
||||
raise Discourse::InvalidParameters.new(:limit) if limit < 0 || limit > 1000
|
||||
raise Discourse::InvalidParameters.new(:offset) if offset < 0
|
||||
|
||||
dir = (params[:desc] && params[:desc].present?) ? 'DESC' : 'ASC'
|
||||
dir = (params[:asc] && params[:asc].present?) ? 'ASC' : 'DESC'
|
||||
if params[:desc]
|
||||
Discourse.deprecate(":desc is deprecated please use :asc instead", output_in_test: true)
|
||||
dir = (params[:desc] && params[:desc].present?) ? 'DESC' : 'ASC'
|
||||
end
|
||||
order = ""
|
||||
|
||||
if params[:requesters]
|
||||
|
Reference in New Issue
Block a user