Welcome to mirror list, hosted at ThFree Co, Russian Federation.

group_sort_enum.rb « organizations « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8fb2f553539a2d1bd222538427317d840c78ff01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Types
  module Organizations
    class GroupSortEnum < BaseEnum
      graphql_name 'OrganizationGroupSort'
      description 'Values for sorting organization groups'

      sortable_fields = ['ID', 'Name', 'Path', 'Updated at', 'Created at']

      sortable_fields.each do |field|
        value "#{field.upcase.tr(' ', '_')}_ASC",
          value: { field: field.downcase.tr(' ', '_'), direction: :asc },
          description: "#{field} in ascending order.",
          alpha: { milestone: '16.4' }

        value "#{field.upcase.tr(' ', '_')}_DESC",
          value: { field: field.downcase.tr(' ', '_'), direction: :desc },
          description: "#{field} in descending order.",
          alpha: { milestone: '16.4' }
      end
    end
  end
end