diff options
author | James Lopez <james@jameslopez.es> | 2016-10-24 15:49:25 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-17 08:22:55 +0100 |
commit | 32679232635dbd0d196a91d0788ee1135ff56b43 (patch) | |
tree | e8efc365222449082446986f4428e27d68ca218d /app | |
parent | d4726112656df24ff7721865a96237d5168466f7 (diff) | |
download | gitlab-ce-32679232635dbd0d196a91d0788ee1135ff56b43.tar.gz |
added the rest of the stages to the controller and relevant specs
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/cycle_analytics/events_controller.rb | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/app/controllers/projects/cycle_analytics/events_controller.rb b/app/controllers/projects/cycle_analytics/events_controller.rb index fe0135874b9..142cbc344a5 100644 --- a/app/controllers/projects/cycle_analytics/events_controller.rb +++ b/app/controllers/projects/cycle_analytics/events_controller.rb @@ -1,15 +1,43 @@ class Projects::CycleAnalytics::EventsController < Projects::ApplicationController #before_action :authorize_read_cycle_analytics! - def issues + def issue + render_events(events.issue_events) + end + + def plan + render_events(events.plan_events) + end + + def code + render_events(events.code_events) + end + + def test + render_events(events.test_events) + end + + def review + render_events(events.review_events) + end + + def staging + render_events(events.staging_events) + end + + def production + render_events(events.production_events) + end + + private + + def render_events(event_list) respond_to do |format| format.html - format.json { render json: events.issue_events } + format.json { render json: { events: event_list } } end end - private - # TODO refactor this def start_date case events_params[:start_date] |