Commit f0c835e5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ce-to-ee' into 'master'

CE Upstream - Monday

See merge request gitlab-org/gitlab-ee!3220
parents 7eec5485 5fa58058
...@@ -21,7 +21,6 @@ import CommentTypeToggle from './comment_type_toggle'; ...@@ -21,7 +21,6 @@ import CommentTypeToggle from './comment_type_toggle';
import GLForm from './gl_form'; import GLForm from './gl_form';
import loadAwardsHandler from './awards_handler'; import loadAwardsHandler from './awards_handler';
import Autosave from './autosave'; import Autosave from './autosave';
import './dropzone_input';
import TaskList from './task_list'; import TaskList from './task_list';
import { ajaxPost, isInViewport, getPagePath, scrollToElement, isMetaKey } from './lib/utils/common_utils'; import { ajaxPost, isInViewport, getPagePath, scrollToElement, isMetaKey } from './lib/utils/common_utils';
import imageDiffHelper from './image_diff/helpers/index'; import imageDiffHelper from './image_diff/helpers/index';
......
...@@ -12,7 +12,7 @@ class ConfirmationsController < Devise::ConfirmationsController ...@@ -12,7 +12,7 @@ class ConfirmationsController < Devise::ConfirmationsController
users_almost_there_path users_almost_there_path
end end
def after_confirmation_path_for(_resource_name, resource) def after_confirmation_path_for(resource_name, resource)
# incoming resource can either be a :user or an :email # incoming resource can either be a :user or an :email
if signed_in?(:user) if signed_in?(:user)
after_sign_in(resource) after_sign_in(resource)
......
...@@ -14,6 +14,8 @@ class Email < ActiveRecord::Base ...@@ -14,6 +14,8 @@ class Email < ActiveRecord::Base
devise :confirmable devise :confirmable
self.reconfirmable = false # currently email can't be changed, no need to reconfirm self.reconfirmable = false # currently email can't be changed, no need to reconfirm
delegate :username, to: :user
def email=(value) def email=(value)
write_attribute(:email, value.downcase.strip) write_attribute(:email, value.downcase.strip)
end end
......
...@@ -80,7 +80,7 @@ class SystemHooksService ...@@ -80,7 +80,7 @@ class SystemHooksService
project_id: model.id, project_id: model.id,
owner_name: owner.name, owner_name: owner.name,
owner_email: owner.respond_to?(:email) ? owner.email : "", owner_email: owner.respond_to?(:email) ? owner.email : "",
project_visibility: Project.visibility_levels.key(model.visibility_level_value).downcase project_visibility: model.visibility.downcase
} }
end end
......
---
title: 'Fix bug preventing secondary emails from being confirmed'
merge_request: 15010
author:
type: fixed
---
title: Use the correct visibility attribute for projects in system hooks
merge_request: 15065
author:
type: fixed
...@@ -3,31 +3,28 @@ ...@@ -3,31 +3,28 @@
Merge requests are useful to integrate separate changes that you've made to a Merge requests are useful to integrate separate changes that you've made to a
project, on different branches. This is a brief guide on how to create a merge project, on different branches. This is a brief guide on how to create a merge
request. For more information, check the request. For more information, check the
[merge requests documentation](../user/project/merge_requests.md). [merge requests documentation](../user/project/merge_requests/index.md).
--- ---
1. Before you start, you should have already [created a branch](create-branch.md) 1. Before you start, you should have already [created a branch](create-branch.md)
and [pushed your changes](basic-git-commands.md) to GitLab. and [pushed your changes](basic-git-commands.md) to GitLab.
1. Go to the project where you'd like to merge your changes and click on the
1. You can then go to the project where you'd like to merge your changes and **Merge requests** tab.
click on the **Merge requests** tab.
![Merge requests](img/project_navbar.png)
1. Click on **New merge request** on the right side of the screen. 1. Click on **New merge request** on the right side of the screen.
1. From there on, you have the option to select the source branch and the target
![New Merge Request](img/merge_request_new.png) branch you'd like to compare to. The default target project is the upstream
repository, but you can choose to compare across any of its forks.
1. Select a source branch and click on the **Compare branches and continue** button.
![Select a branch](img/merge_request_select_branch.png) ![Select a branch](img/merge_request_select_branch.png)
1. When ready, click on the **Compare branches and continue** button.
1. At a minimum, add a title and a description to your merge request. Optionally, 1. At a minimum, add a title and a description to your merge request. Optionally,
select a user to review your merge request and to accept or close it. You may select a user to review your merge request and to accept or close it. You may
also select a milestone and labels. also select a milestone and labels.
![New merge request page](img/merge_request_page.png) ![New merge request page](img/merge_request_page.png)
1. When ready, click on the **Submit merge request** button. Your merge request 1. When ready, click on the **Submit merge request** button.
will be ready to be approved and published.
Your merge request will be ready to be approved and merged.
...@@ -40,4 +40,12 @@ describe Email do ...@@ -40,4 +40,12 @@ describe Email do
expect(user.emails.confirmed.count).to eq 1 expect(user.emails.confirmed.count).to eq 1
end end
end end
describe 'delegation' do
let(:user) { create(:user) }
it 'delegates to :user' do
expect(build(:email, user: user).username).to eq user.username
end
end
end end
...@@ -63,6 +63,12 @@ describe SystemHooksService do ...@@ -63,6 +63,12 @@ describe SystemHooksService do
:group_id, :user_id, :user_username, :user_name, :user_email, :group_access :group_id, :user_id, :user_username, :user_name, :user_email, :group_access
) )
end end
it 'includes the correct project visibility level' do
data = event_data(project, :create)
expect(data[:project_visibility]).to eq('private')
end
end end
context 'event names' do context 'event names' 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