Commit 672bd4e6 authored by Phil Hughes's avatar Phil Hughes

Correctly sends project ID

parent 8536c49f
...@@ -40,7 +40,7 @@ class AutocompleteController < ApplicationController ...@@ -40,7 +40,7 @@ class AutocompleteController < ApplicationController
end end
no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project') no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project')
projects.unshift(no_project.marshal_dump) projects.unshift(no_project.to_h)
projects.delete(project) projects.delete(project)
render json: projects.to_json(only: [:id, :name_with_namespace], methods: :name_with_namespace) render json: projects.to_json(only: [:id, :name_with_namespace], methods: :name_with_namespace)
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
= label_tag :move_to_project_id, 'Move', class: 'control-label' = label_tag :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10 .col-sm-10
.issuable-form-select-holder .issuable-form-select-holder
= hidden_field_tag :move_to_project_id, nil, class: 'js-move-dropdown', data: { placeholder: 'Select project', projects_url: autocomplete_projects_path(project_id: '1') } = hidden_field_tag :move_to_project_id, nil, class: 'js-move-dropdown', data: { placeholder: 'Select project', projects_url: autocomplete_projects_path(project_id: @project.id) }
&nbsp; &nbsp;
%span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default', %span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default',
title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' } title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' }
......
...@@ -47,7 +47,7 @@ feature 'issue move to another project' do ...@@ -47,7 +47,7 @@ feature 'issue move to another project' do
expect(page).to have_content(issue.title) expect(page).to have_content(issue.title)
end end
context 'projects user does not have permission to move issue to exist', js: true do context 'user does not have permission to move the issue to a project', js: true do
let!(:private_project) { create(:project, :private) } let!(:private_project) { create(:project, :private) }
let(:another_project) { create(:project) } let(:another_project) { create(:project) }
background { another_project.team << [user, :guest] } background { another_project.team << [user, :guest] }
......
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