diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-10-29 12:50:18 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-11-23 18:11:52 +0300 |
commit | c068ac67b3e40fdc039c80372306f9cc3360d594 (patch) | |
tree | d707871f8b7f5deb7f62d7630f317e94946eb1cc /app/models/label.rb | |
parent | f0630090aaea98daef3582bc95efe3a43736a10f (diff) |
Filter by `None`/`Any` for labels in issues/mrs API
By using the parameters `?labels=None|Any` the user can filter
issues/mrs from the API that has `none/any` label.
Affected endpoints are:
- /api/issues
- /api/projects/:id/issues
- /api/groups/:id/issues
- /api/merge_requests
- /api/projects/:id/merge_requests
- /api/groups/:id/merge_requests
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 165e4a8f3e5..5d2d1afd1d9 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -9,15 +9,10 @@ class Label < ActiveRecord::Base include Sortable include FromUnion - # Represents a "No Label" state used for filtering Issues and Merge - # Requests that have no label assigned. - LabelStruct = Struct.new(:title, :name) - None = LabelStruct.new('No Label', 'No Label') - Any = LabelStruct.new('Any Label', '') - cache_markdown_field :description, pipeline: :single_line - DEFAULT_COLOR = '#428BCA'.freeze + DEFAULT_COLOR = '#428BCA' + NONE = 'no label' default_value_for :color, DEFAULT_COLOR |