summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-09-20 11:55:31 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:24 -0200
commitb10e5764ac0765b556d64dfebb9dad948154e31a (patch)
tree20dfe3bf8920b97383313daa8e43bd57c31fa8a4 /app/controllers
parentbaf47a0bd0e0563cbc99b3ae4b1336b8b3b4380a (diff)
downloadgitlab-ce-b10e5764ac0765b556d64dfebb9dad948154e31a.tar.gz
List only labels that belongs to the group on the group issues page
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/dashboard/labels_controller.rb7
-rw-r--r--app/controllers/groups/labels_controller.rb10
2 files changed, 10 insertions, 7 deletions
diff --git a/app/controllers/dashboard/labels_controller.rb b/app/controllers/dashboard/labels_controller.rb
index 797f8503b2d..05f7bc37952 100644
--- a/app/controllers/dashboard/labels_controller.rb
+++ b/app/controllers/dashboard/labels_controller.rb
@@ -1,12 +1,7 @@
class Dashboard::LabelsController < Dashboard::ApplicationController
def index
- labels = LabelsFinder.new(current_user, project_id: projects)
- .execute
- .select(:id, :title, :color)
- .uniq(:title)
-
respond_to do |format|
- format.json { render json: labels }
+ format.json { render json: LabelsFinder.new(current_user).execute }
end
end
end
diff --git a/app/controllers/groups/labels_controller.rb b/app/controllers/groups/labels_controller.rb
index 0ec2fcda0ef..0ebdee55c79 100644
--- a/app/controllers/groups/labels_controller.rb
+++ b/app/controllers/groups/labels_controller.rb
@@ -8,7 +8,15 @@ class Groups::LabelsController < Groups::ApplicationController
respond_to :html
def index
- @labels = @group.labels.page(params[:page])
+ respond_to do |format|
+ format.html do
+ @labels = @group.labels.page(params[:page])
+ end
+
+ format.json do
+ render json: LabelsFinder.new(current_user, group_id: @group.id).execute
+ end
+ end
end
def new