Module: MilestoneActions

Extended by:
ActiveSupport::Concern
Included in:
Groups::MilestonesController, Projects::MilestonesController
Defined in:
app/controllers/concerns/milestone_actions.rb

Instance Method Summary collapse

Instance Method Details

#labelsObject

rubocop:disable Gitlab/ModuleWithInstanceVariables


30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/concerns/milestone_actions.rb', line 30

def labels
  respond_to do |format|
    format.html { redirect_to milestone_redirect_path }
    format.json do
      milestone_labels = @milestone.issue_labels_visible_by_user(current_user)

      render json: tabs_json("shared/milestones/_labels_tab", {
        labels: milestone_labels.map do |label|
          label.present(issuable_subject: @milestone.resource_parent)
        end
      })
    end
  end
end

#merge_requestsObject


6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/concerns/milestone_actions.rb', line 6

def merge_requests
  respond_to do |format|
    format.html { redirect_to milestone_redirect_path }
    format.json do
      render json: tabs_json("shared/milestones/_merge_requests_tab", {
        merge_requests: @milestone.sorted_merge_requests(current_user), # rubocop:disable Gitlab/ModuleWithInstanceVariables
        show_project_name: true
      })
    end
  end
end

#participantsObject


18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/concerns/milestone_actions.rb', line 18

def participants
  respond_to do |format|
    format.html { redirect_to milestone_redirect_path }
    format.json do
      render json: tabs_json("shared/milestones/_participants_tab", {
        users: @milestone.issue_participants_visible_by_user(current_user) # rubocop:disable Gitlab/ModuleWithInstanceVariables
      })
    end
  end
end