Commit 33381463 authored by Jason Blanchard's avatar Jason Blanchard Committed by Dmitriy Zaporozhets

Added option to remove issue assignee on project issue page and issue edit page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG
parent b1021806
v 6.6.5
- Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard)
v 6.6.4
- Add missing html escape for highlighted code blocks in comments, issues
......
......@@ -10,6 +10,16 @@
query: (query) ->
Api.projectUsers project_id, query.term, (users) ->
data = { results: users }
nullUser = {
name: 'Unassigned',
avatar: null,
username: 'none',
id: ''
}
data.results.unshift(nullUser)
query.callback(data)
initSelection: (element, callback) ->
......@@ -35,8 +45,13 @@
else
avatar = gon.relative_url_root + "/assets/no_avatar.png"
if user.id == ''
avatarMarkup = ''
else
avatarMarkup = "<div class='user-image'><img class='avatar s24' src='#{avatar}'></div>"
"<div class='user-result'>
<div class='user-image'><img class='avatar s24' src='#{avatar}'></div>
#{avatarMarkup}
<div class='user-name'>#{user.name}</div>
<div class='user-username'>#{user.username}</div>
</div>"
......
......@@ -43,6 +43,31 @@ describe "Issues" do
page.should have_content project.name
end
end
end
describe "Editing issue assignee" do
let!(:issue) do
create(:issue,
author: @user,
assignee: @user,
project: project)
end
it 'allows user to select unasigned', :js => true do
visit edit_project_issue_path(project, issue)
page.should have_content "Assign to #{@user.name}"
page.first('#s2id_issue_assignee_id').click
sleep 2 # wait for ajax stuff to complete
page.first('.user-result').click
click_button "Save changes"
page.should have_content "Assignee: Select assignee"
issue.reload.assignee.should be_nil
end
end
describe "Filter issue" do
......@@ -245,6 +270,28 @@ describe "Issues" do
page.should have_content milestone.title
end
end
describe 'removing assignee' do
let(:user2) { create(:user) }
before :each do
issue.assignee = user2
issue.save
end
it 'allows user to remove assignee', :js => true do
visit project_issue_path(project, issue)
page.should have_content "Assignee: #{user2.name}"
page.first('#s2id_issue_assignee_id').click
sleep 2 # wait for ajax stuff to complete
page.first('.user-result').click
page.should have_content "Assignee: Unassigned"
sleep 2 # wait for ajax stuff to complete
issue.reload.assignee.should be_nil
end
end
end
def first_issue
......
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