2018-09-23 19:44:14 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-03-23 10:39:58 +00:00
|
|
|
class Dashboard::LabelsController < Dashboard::ApplicationController
|
2020-10-02 12:09:03 +00:00
|
|
|
feature_category :issue_tracking
|
|
|
|
|
2016-03-23 10:39:58 +00:00
|
|
|
def index
|
|
|
|
respond_to do |format|
|
2017-05-05 22:47:32 +00:00
|
|
|
format.json { render json: LabelSerializer.new.represent_appearance(labels) }
|
2016-03-23 10:39:58 +00:00
|
|
|
end
|
|
|
|
end
|
2017-07-07 12:54:49 +00:00
|
|
|
|
|
|
|
def labels
|
|
|
|
finder_params = { project_ids: projects.select(:id) }
|
|
|
|
|
2020-10-14 12:08:58 +00:00
|
|
|
LabelsFinder.new(current_user, finder_params).execute
|
|
|
|
.select('DISTINCT ON (labels.title) labels.*')
|
2017-07-07 12:54:49 +00:00
|
|
|
end
|
2016-03-23 10:39:58 +00:00
|
|
|
end
|