Commit 70abcd5e authored by Rémy Coutable's avatar Rémy Coutable

Fix conflicts

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent bccf08ab
...@@ -117,28 +117,6 @@ class Group < Namespace ...@@ -117,28 +117,6 @@ class Group < Namespace
self[:lfs_enabled] self[:lfs_enabled]
end end
<<<<<<< HEAD
def add_users(user_ids, access_level, current_user: nil, skip_notification: false, expires_at: nil, ldap: false)
user_ids.each do |user_id|
Member.add_user(
self.group_members,
user_id,
access_level,
current_user: current_user,
skip_notification: skip_notification,
expires_at: expires_at,
ldap: ldap
)
end
end
def add_user(user, access_level, current_user: nil, skip_notification: false, expires_at: nil)
add_users([user], access_level, current_user: current_user, skip_notification: skip_notification, expires_at: expires_at)
end
def add_owner(user, current_user = nil, skip_notification: false)
add_user(user, Gitlab::Access::OWNER, current_user: current_user, skip_notification: skip_notification)
=======
def add_users(users, access_level, current_user: nil, expires_at: nil) def add_users(users, access_level, current_user: nil, expires_at: nil)
GroupMember.add_users_to_group( GroupMember.add_users_to_group(
self, self,
...@@ -149,15 +127,15 @@ class Group < Namespace ...@@ -149,15 +127,15 @@ class Group < Namespace
) )
end end
def add_user(user, access_level, current_user: nil, expires_at: nil) def add_user(user, access_level, current_user: nil, expires_at: nil, ldap: false)
GroupMember.add_user( GroupMember.add_user(
self, self,
user, user,
access_level, access_level,
current_user: current_user, current_user: current_user,
expires_at: expires_at expires_at: expires_at,
ldap: ldap
) )
>>>>>>> ce/master
end end
def add_guest(user, current_user = nil) def add_guest(user, current_user = nil)
...@@ -176,13 +154,10 @@ class Group < Namespace ...@@ -176,13 +154,10 @@ class Group < Namespace
add_user(user, :master, current_user: current_user) add_user(user, :master, current_user: current_user)
end end
<<<<<<< HEAD
=======
def add_owner(user, current_user = nil) def add_owner(user, current_user = nil)
add_user(user, :owner, current_user: current_user) add_user(user, :owner, current_user: current_user)
end end
>>>>>>> ce/master
def has_owner?(user) def has_owner?(user)
owners.include?(user) owners.include?(user)
end end
......
...@@ -81,25 +81,9 @@ class Member < ActiveRecord::Base ...@@ -81,25 +81,9 @@ class Member < ActiveRecord::Base
find_by(invite_token: invite_token) find_by(invite_token: invite_token)
end end
<<<<<<< HEAD def add_user(source, user, access_level, current_user: nil, expires_at: nil, ldap: false)
# This method is used to find users that have been entered into the "Add members" field.
# These can be the User objects directly, their IDs, their emails, or new emails to be invited.
def user_for_id(user_id)
return user_id if user_id.is_a?(User)
user = User.find_by(id: user_id)
user ||= User.find_by(email: user_id)
user ||= user_id
user
end
def add_user(members, user_id, access_level, current_user: nil, skip_notification: false, expires_at: nil, ldap: false)
user = user_for_id(user_id)
=======
def add_user(source, user, access_level, current_user: nil, expires_at: nil)
user = retrieve_user(user) user = retrieve_user(user)
access_level = retrieve_access_level(access_level) access_level = retrieve_access_level(access_level)
>>>>>>> ce/master
# `user` can be either a User object or an email to be invited # `user` can be either a User object or an email to be invited
member = member =
...@@ -116,26 +100,24 @@ class Member < ActiveRecord::Base ...@@ -116,26 +100,24 @@ class Member < ActiveRecord::Base
member.attributes = { member.attributes = {
created_by: member.created_by || current_user, created_by: member.created_by || current_user,
access_level: access_level, access_level: access_level,
expires_at: expires_at expires_at: expires_at,
skip_notification: ldap,
ldap: ldap
} }
if member.request? if member.request?
::Members::ApproveAccessRequestService.new(source, current_user, id: member.id).execute ::Members::ApproveAccessRequestService.new(
source,
current_user,
id: member.id,
access_level: access_level
).execute
else else
member.save member.save
end end
<<<<<<< HEAD
if can_update_member?(current_user, member) || project_creator?(member, access_level)
member.created_by ||= current_user
member.access_level = access_level
member.expires_at = expires_at
member.skip_notification = skip_notification
member.ldap = ldap
=======
member member
end end
>>>>>>> ce/master
def access_levels def access_levels
Gitlab::Access.sym_options Gitlab::Access.sym_options
......
...@@ -33,13 +33,9 @@ class ProjectTeam ...@@ -33,13 +33,9 @@ class ProjectTeam
member member
end end
<<<<<<< HEAD def add_users(users, access_level, current_user: nil, expires_at: nil)
def add_users(users, access, current_user: nil, expires_at: nil)
return false if group_member_lock return false if group_member_lock
=======
def add_users(users, access_level, current_user: nil, expires_at: nil)
>>>>>>> ce/master
ProjectMember.add_users_to_projects( ProjectMember.add_users_to_projects(
[project.id], [project.id],
users, users,
......
...@@ -16,12 +16,9 @@ module MergeRequests ...@@ -16,12 +16,9 @@ module MergeRequests
end end
merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch) merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch)
<<<<<<< HEAD
old_approvers = merge_request.overall_approvers.to_a old_approvers = merge_request.overall_approvers.to_a
=======
handle_wip_event(merge_request) handle_wip_event(merge_request)
>>>>>>> ce/master
update(merge_request) update(merge_request)
new_approvers = merge_request.overall_approvers.to_a - old_approvers new_approvers = merge_request.overall_approvers.to_a - old_approvers
......
...@@ -578,7 +578,6 @@ class NotificationService ...@@ -578,7 +578,6 @@ class NotificationService
end end
end end
<<<<<<< HEAD
def approve_mr_email(merge_request, project, current_user) def approve_mr_email(merge_request, project, current_user)
recipients = build_recipients(merge_request, project, current_user) recipients = build_recipients(merge_request, project, current_user)
...@@ -595,10 +594,7 @@ class NotificationService ...@@ -595,10 +594,7 @@ class NotificationService
end end
end end
def build_recipients(target, project, current_user, action: nil, previous_assignee: nil)
=======
def build_recipients(target, project, current_user, action: nil, previous_assignee: nil, skip_current_user: true) def build_recipients(target, project, current_user, action: nil, previous_assignee: nil, skip_current_user: true)
>>>>>>> ce/master
custom_action = build_custom_key(action, target) custom_action = build_custom_key(action, target)
recipients = target.participants(current_user) recipients = target.participants(current_user)
......
...@@ -18,16 +18,12 @@ ...@@ -18,16 +18,12 @@
= sort_title_recently_updated = sort_title_recently_updated
= link_to page_filter_path(sort: sort_value_oldest_updated, label: true) do = link_to page_filter_path(sort: sort_value_oldest_updated, label: true) do
= sort_title_oldest_updated = sort_title_oldest_updated
<<<<<<< HEAD
- if local_assigns[:type] == :issues - if local_assigns[:type] == :issues
= link_to page_filter_path(sort: sort_value_more_weight) do = link_to page_filter_path(sort: sort_value_more_weight) do
= sort_title_more_weight = sort_title_more_weight
= link_to page_filter_path(sort: sort_value_less_weight) do = link_to page_filter_path(sort: sort_value_less_weight) do
= sort_title_less_weight = sort_title_less_weight
= link_to page_filter_path(sort: sort_value_milestone_soon) do
=======
= link_to page_filter_path(sort: sort_value_milestone_soon, label: true) do = link_to page_filter_path(sort: sort_value_milestone_soon, label: true) do
>>>>>>> ce/master
= sort_title_milestone_soon = sort_title_milestone_soon
= link_to page_filter_path(sort: sort_value_milestone_later, label: true) do = link_to page_filter_path(sort: sort_value_milestone_later, label: true) do
= sort_title_milestone_later = sort_title_milestone_later
......
...@@ -130,12 +130,8 @@ For testing you can use the oauth2 ruby gem: ...@@ -130,12 +130,8 @@ For testing you can use the oauth2 ruby gem:
``` ```
client = OAuth2::Client.new('the_client_id', 'the_client_secret', :site => "http://example.com") client = OAuth2::Client.new('the_client_id', 'the_client_secret', :site => "http://example.com")
<<<<<<< HEAD
access_token = client.password.get_token('user@example.com', 'sekret')
=======
access_token = client.password.get_token('user@example.com', 'secret') access_token = client.password.get_token('user@example.com', 'secret')
puts access_token.token puts access_token.token
>>>>>>> ce/master
``` ```
[personal access tokens]: ./README.md#personal-access-tokens [personal access tokens]: ./README.md#personal-access-tokens
...@@ -59,22 +59,12 @@ module API ...@@ -59,22 +59,12 @@ module API
authorize_admin_source!(source_type, source) authorize_admin_source!(source_type, source)
required_attributes! [:user_id, :access_level] required_attributes! [:user_id, :access_level]
<<<<<<< HEAD
## EE specific ## EE specific
if source_type == 'project' && source.group && source.group.membership_lock if source_type == 'project' && source.group && source.group.membership_lock
not_allowed! not_allowed!
end end
## EE specific ## EE specific
access_requester = source.requesters.find_by(user_id: params[:user_id])
if access_requester
# We pass current_user = access_requester so that the requester doesn't
# receive a "access denied" email
::Members::DestroyService.new(access_requester, access_requester.user).execute
end
=======
>>>>>>> ce/master
member = source.members.find_by(user_id: params[:user_id]) member = source.members.find_by(user_id: params[:user_id])
# This is to ensure back-compatibility but 409 behavior should be used # This is to ensure back-compatibility but 409 behavior should be used
......
...@@ -287,7 +287,46 @@ describe MergeRequest, models: true do ...@@ -287,7 +287,46 @@ describe MergeRequest, models: true do
end end
end end
<<<<<<< HEAD describe "#wipless_title" do
['WIP ', 'WIP:', 'WIP: ', '[WIP]', '[WIP] ', ' [WIP] WIP [WIP] WIP: WIP '].each do |wip_prefix|
it "removes the '#{wip_prefix}' prefix" do
wipless_title = subject.title
subject.title = "#{wip_prefix}#{subject.title}"
expect(subject.wipless_title).to eq wipless_title
end
it "is satisfies the #work_in_progress? method" do
subject.title = "#{wip_prefix}#{subject.title}"
subject.title = subject.wipless_title
expect(subject.work_in_progress?).to eq false
end
end
end
describe "#wip_title" do
it "adds the WIP: prefix to the title" do
wip_title = "WIP: #{subject.title}"
expect(subject.wip_title).to eq wip_title
end
it "does not add the WIP: prefix multiple times" do
wip_title = "WIP: #{subject.title}"
subject.title = subject.wip_title
subject.title = subject.wip_title
expect(subject.wip_title).to eq wip_title
end
it "is satisfies the #work_in_progress? method" do
subject.title = subject.wip_title
expect(subject.work_in_progress?).to eq true
end
end
describe "#approvers_left" do describe "#approvers_left" do
let(:merge_request) {create :merge_request} let(:merge_request) {create :merge_request}
...@@ -359,27 +398,10 @@ describe MergeRequest, models: true do ...@@ -359,27 +398,10 @@ describe MergeRequest, models: true do
blocked_developer = create(:user).tap { |u| u.block! } blocked_developer = create(:user).tap { |u| u.block! }
group.add_developer(blocked_developer) group.add_developer(blocked_developer)
end.to change { merge_request.number_of_potential_approvers }.by(2) end.to change { merge_request.number_of_potential_approvers }.by(2)
=======
describe "#wipless_title" do
['WIP ', 'WIP:', 'WIP: ', '[WIP]', '[WIP] ', ' [WIP] WIP [WIP] WIP: WIP '].each do |wip_prefix|
it "removes the '#{wip_prefix}' prefix" do
wipless_title = subject.title
subject.title = "#{wip_prefix}#{subject.title}"
expect(subject.wipless_title).to eq wipless_title
end
it "is satisfies the #work_in_progress? method" do
subject.title = "#{wip_prefix}#{subject.title}"
subject.title = subject.wipless_title
expect(subject.work_in_progress?).to eq false
>>>>>>> ce/master
end end
end end
end end
<<<<<<< HEAD
describe "#approvals_required" do describe "#approvals_required" do
let(:merge_request) { build(:merge_request) } let(:merge_request) { build(:merge_request) }
before { merge_request.target_project.update_attributes(approvals_before_merge: 3) } before { merge_request.target_project.update_attributes(approvals_before_merge: 3) }
...@@ -396,27 +418,6 @@ describe MergeRequest, models: true do ...@@ -396,27 +418,6 @@ describe MergeRequest, models: true do
it "takes approvals_before_merge from the target project" do it "takes approvals_before_merge from the target project" do
expect(merge_request.approvals_required).to eq(3) expect(merge_request.approvals_required).to eq(3)
end end
=======
describe "#wip_title" do
it "adds the WIP: prefix to the title" do
wip_title = "WIP: #{subject.title}"
expect(subject.wip_title).to eq wip_title
end
it "does not add the WIP: prefix multiple times" do
wip_title = "WIP: #{subject.title}"
subject.title = subject.wip_title
subject.title = subject.wip_title
expect(subject.wip_title).to eq wip_title
end
it "is satisfies the #work_in_progress? method" do
subject.title = subject.wip_title
expect(subject.work_in_progress?).to eq true
>>>>>>> ce/master
end end
end end
......
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