diff options
author | James Lopez <james@jameslopez.es> | 2016-11-03 17:41:46 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-17 10:22:56 +0300 |
commit | 1b5b2eac222cc25bfe7301cdefb69a6635ef0682 (patch) | |
tree | 318480e1ebd2749cc233b1b4595d91f37376533f /app | |
parent | 8f7266cd4b6a3e65224b55c2b91509f5ac88d837 (diff) |
added missing fields to plan events and updated spec
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/cycle_analytics/events_controller.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/app/controllers/projects/cycle_analytics/events_controller.rb b/app/controllers/projects/cycle_analytics/events_controller.rb index 49c7303dccc..86ed01b9ea4 100644 --- a/app/controllers/projects/cycle_analytics/events_controller.rb +++ b/app/controllers/projects/cycle_analytics/events_controller.rb @@ -1,40 +1,43 @@ class Projects::CycleAnalytics::EventsController < Projects::ApplicationController + # TODO: fix authorization # before_action :authorize_read_cycle_analytics! + # TODO: refactor +event_hash+ + def issue - render_events(events.issue_events) + render_events(issues: events.issue_events) end def plan - render_events(events.plan_events) + render_events(commits: events.plan_events) end def code - render_events(events.code_events) + render_events(merge_requests: events.code_events) end def test - render_events(events.test_events) + render_events(builds: events.test_events) end def review - render_events(events.review_events) + render_events(merge_requests: events.review_events) end def staging - render_events(events.staging_events) + render_events(builds: events.staging_events) end def production - render_events(events.production_events) + render_events(issues: events.production_events) end private - def render_events(event_list) + def render_events(event_hash) respond_to do |format| format.html - format.json { render json: { events: event_list } } + format.json { render json: event_hash } end end |