2018-09-23 15:44:14 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-03-23 06:39:58 -04:00
|
|
|
class Dashboard::LabelsController < Dashboard::ApplicationController
|
2021-10-27 11:13:41 -04:00
|
|
|
feature_category :team_planning
|
2022-05-13 11:07:43 -04:00
|
|
|
urgency :low
|
2020-10-02 08:09:03 -04:00
|
|
|
|
2016-03-23 06:39:58 -04:00
|
|
|
def index
|
|
|
|
respond_to do |format|
|
2017-05-05 18:47:32 -04:00
|
|
|
format.json { render json: LabelSerializer.new.represent_appearance(labels) }
|
2016-03-23 06:39:58 -04:00
|
|
|
end
|
|
|
|
end
|
2017-07-07 08:54:49 -04:00
|
|
|
|
|
|
|
def labels
|
|
|
|
finder_params = { project_ids: projects.select(:id) }
|
|
|
|
|
2020-10-14 08:08:58 -04:00
|
|
|
LabelsFinder.new(current_user, finder_params).execute
|
|
|
|
.select('DISTINCT ON (labels.title) labels.*')
|
2017-07-07 08:54:49 -04:00
|
|
|
end
|
2016-03-23 06:39:58 -04:00
|
|
|
end
|