Commit dc6099a5 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'fix/contributions-forked-projects' into 'master'

include contributions from forked projects on profile calendar

Shows contributions from forked projects in the calendar

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3612

See merge request !2918
parents 32929407 8fe72af3
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.6.0 (unreleased) v 8.6.0 (unreleased)
- Contributions to forked projects are included in calendar
- Improve the formatting for the user page bio (Connor Shea) - Improve the formatting for the user page bio (Connor Shea)
- Fix issue when pushing to projects ending in .wiki - Fix issue when pushing to projects ending in .wiki
- Fix avatar stretching by providing a cropping feature (Johann Pardanaud) - Fix avatar stretching by providing a cropping feature (Johann Pardanaud)
......
...@@ -57,7 +57,7 @@ class UsersController < ApplicationController ...@@ -57,7 +57,7 @@ class UsersController < ApplicationController
def contributions_calendar def contributions_calendar
@contributions_calendar ||= Gitlab::ContributionsCalendar. @contributions_calendar ||= Gitlab::ContributionsCalendar.
new(contributed_projects.reject(&:forked?), @user) new(contributed_projects, @user)
end end
def load_events def load_events
......
...@@ -41,6 +41,7 @@ describe UsersController do ...@@ -41,6 +41,7 @@ describe UsersController do
end end
describe 'GET #calendar' do describe 'GET #calendar' do
it 'renders calendar' do it 'renders calendar' do
sign_in(user) sign_in(user)
...@@ -48,6 +49,23 @@ describe UsersController do ...@@ -48,6 +49,23 @@ describe UsersController do
expect(response).to render_template('calendar') expect(response).to render_template('calendar')
end end
context 'forked project' do
let!(:project) { create(:project) }
let!(:forked_project) { Projects::ForkService.new(project, user).execute }
before do
sign_in(user)
project.team << [user, :developer]
EventCreateService.new.push(project, user, [])
EventCreateService.new.push(forked_project, user, [])
end
it 'includes forked projects' do
get :calendar, username: user.username
expect(assigns(:contributions_calendar).projects.count).to eq(2)
end
end
end end
describe 'GET #calendar_activities' do describe 'GET #calendar_activities' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment