summaryrefslogtreecommitdiff
path: root/lib/api/helpers/label_helpers.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-18 15:10:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-18 15:10:46 +0000
commit346c2ebb5a818524c5d8d95dc6b9fc8c892e3b5c (patch)
tree63bf068a9d8cedf0b7f9e80cf99e491813617db1 /lib/api/helpers/label_helpers.rb
parent5f287a8e306da1e0b6152a0b7f8621a8e71a3fe4 (diff)
downloadgitlab-ce-346c2ebb5a818524c5d8d95dc6b9fc8c892e3b5c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers/label_helpers.rb')
-rw-r--r--lib/api/helpers/label_helpers.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/api/helpers/label_helpers.rb b/lib/api/helpers/label_helpers.rb
index da0ee8f207e..796b8928243 100644
--- a/lib/api/helpers/label_helpers.rb
+++ b/lib/api/helpers/label_helpers.rb
@@ -5,27 +5,34 @@ module API
module LabelHelpers
extend Grape::API::Helpers
+ params :optional_label_params do
+ optional :description, type: String, desc: 'The description of the label'
+ optional :remove_on_close, type: Boolean, desc: 'Whether the label should be removed from an issue when the issue is closed'
+ end
+
params :label_create_params do
requires :name, type: String, desc: 'The name of the label to be created'
requires :color, type: String, desc: "The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names"
- optional :description, type: String, desc: 'The description of label to be created'
+
+ use :optional_label_params
end
params :label_update_params do
optional :new_name, type: String, desc: 'The new name of the label'
optional :color, type: String, desc: "The new color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names"
- optional :description, type: String, desc: 'The new description of label'
+
+ use :optional_label_params
end
params :project_label_update_params do
use :label_update_params
optional :priority, type: Integer, desc: 'The priority of the label', allow_blank: true
- at_least_one_of :new_name, :color, :description, :priority
+ at_least_one_of :new_name, :color, :description, :priority, :remove_on_close
end
params :group_label_update_params do
use :label_update_params
- at_least_one_of :new_name, :color, :description
+ at_least_one_of :new_name, :color, :description, :remove_on_close
end
def find_label(parent, id_or_title, params = { include_ancestor_groups: true })