Commit 1f98e978 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Replace deprecated name_with_namespace with full_name in app and spec


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8e3b48bf82d8
......@@ -62,7 +62,7 @@ def source_info(source)
case source
when Project
project = member.source
label = "project #{project.name_with_namespace}"
label = "project #{project.full_name}"
path = project_path(project)
when Group
group = member.source
......
......@@ -38,7 +38,7 @@ def show
end
format.json do
page_title @blob.path, @ref, @project.name_with_namespace
page_title @blob.path, @ref, @project.full_name
show_json
end
......
......@@ -36,7 +36,7 @@ def show
end
format.json do
page_title @path.presence || _("Files"), @ref, @project.name_with_namespace
page_title @path.presence || _("Files"), @ref, @project.full_name
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38261
Gitlab::GitalyClient.allow_n_plus_1_calls do
......
......@@ -130,7 +130,7 @@ def destroy
return access_denied! unless can?(current_user, :remove_project, @project)
::Projects::DestroyService.new(@project, current_user, {}).async_execute
flash[:notice] = _("Project '%{project_name}' is in the process of being deleted.") % { project_name: @project.name_with_namespace }
flash[:notice] = _("Project '%{project_name}' is in the process of being deleted.") % { project_name: @project.full_name }
redirect_to dashboard_projects_path, status: 302
rescue Projects::DestroyService::DestroyError => ex
......
......@@ -99,7 +99,7 @@ def project_dropdown_label(project_id, default_label)
project = Project.find_by(id: project_id)
if project
project.name_with_namespace
project.full_name
else
default_label
end
......
......@@ -97,13 +97,13 @@ def project_title(project)
end
def remove_project_message(project)
_("You are going to remove %{project_name_with_namespace}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?") %
{ project_name_with_namespace: project.name_with_namespace }
_("You are going to remove %{project_full_name}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?") %
{ project_full_name: project.full_name }
end
def transfer_project_message(project)
_("You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?") %
{ project_name_with_namespace: project.name_with_namespace }
_("You are going to transfer %{project_full_name} to another owner. Are you ABSOLUTELY sure?") %
{ project_full_name: project.full_name }
end
def remove_fork_project_message(project)
......
......@@ -110,7 +110,7 @@ def projects_autocomplete(term, limit = 5)
category: "Projects",
id: p.id,
value: "#{search_result_sanitize(p.name)}",
label: "#{search_result_sanitize(p.name_with_namespace)}",
label: "#{search_result_sanitize(p.full_name)}",
url: project_path(p)
}
end
......
......@@ -114,7 +114,7 @@ def todo_projects_options
projects = current_user.authorized_projects.sorted_by_activity.non_archived.with_route
projects = projects.map do |project|
{ id: project.id, text: project.name_with_namespace }
{ id: project.id, text: project.full_name }
end
projects.unshift({ id: '', text: 'Any Project' }).to_json
......
......@@ -158,7 +158,7 @@ def visible_to_user?(user = nil)
def project_name
if project
project.name_with_namespace
project.full_name
else
"(deleted project)"
end
......
......@@ -68,7 +68,7 @@ def execute(data)
end
user = data[:user_name]
project_name = project.name_with_namespace
project_name = project.full_name
data[:commits].each do |commit|
push_msg = "#{user} pushed to branch #{branch} of #{project_name} ( #{commit[:url]} ):"
......
......@@ -86,7 +86,7 @@ def build_message(push)
after = push[:after]
message = ""
message << "[#{project.name_with_namespace}] "
message << "[#{project.full_name}] "
message << "#{push[:user_name]} "
if Gitlab::Git.blank_ref?(before)
......
......@@ -129,7 +129,7 @@ def event_channel_name(event)
end
def project_name
project.name_with_namespace.gsub(/\s/, '')
project.full_name.gsub(/\s/, '')
end
def project_url
......
......@@ -120,7 +120,7 @@ def create_push_message(push)
else
message << "pushed to #{ref_type} <a href=\""\
"#{project.web_url}/commits/#{CGI.escape(ref)}\">#{ref}</a> "
message << "of <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/, '')}</a> "
message << "of <a href=\"#{project.web_url}\">#{project.full_name.gsub!(/\s/, '')}</a> "
message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)"
push[:commits].take(MAX_COMMITS).each do |commit|
......@@ -274,7 +274,7 @@ def pipeline_status_color(data)
end
def project_name
project.name_with_namespace.gsub(/\s/, '')
project.full_name.gsub(/\s/, '')
end
def project_url
......
......@@ -37,7 +37,7 @@ def list_teams(current_user)
private
def command(params)
pretty_project_name = project.name_with_namespace
pretty_project_name = project.full_name
params.merge(
auto_complete: true,
......
......@@ -88,10 +88,10 @@ def execute(data)
user: user_key,
device: device,
priority: priority,
title: "#{project.name_with_namespace}",
title: "#{project.full_name}",
message: message,
url: data[:project][:web_url],
url_title: "See project #{project.name_with_namespace}"
url_title: "See project #{project.full_name}"
}
# Sound parameter MUST NOT be sent to API if not selected
......
......@@ -246,7 +246,7 @@
expect(json_response.size).to eq(1)
expect(json_response.first['id']).to eq authorized_project.id
expect(json_response.first['name_with_namespace']).to eq authorized_project.name_with_namespace
expect(json_response.first['full_name']).to eq authorized_project.full_name
end
end
end
......@@ -267,7 +267,7 @@
expect(json_response.size).to eq(1)
expect(json_response.first['id']).to eq authorized_search_project.id
expect(json_response.first['name_with_namespace']).to eq authorized_search_project.name_with_namespace
expect(json_response.first['full_name']).to eq authorized_search_project.full_name
end
end
end
......
......@@ -173,7 +173,7 @@
visit admin_group_path(group)
expect(page).to have_content(empty_project.name_with_namespace)
expect(page).to have_content(empty_project.full_name)
expect(page).to have_content('Projects shared with')
end
end
......
......@@ -58,7 +58,7 @@
expect(current_path).to eq admin_project_path(project)
expect(page).to have_content(project.path)
expect(page).to have_content(project.name)
expect(page).to have_content(project.name_with_namespace)
expect(page).to have_content(project.full_name)
expect(page).to have_content(project.creator.name)
end
end
......
......@@ -76,8 +76,8 @@
describe 'projects' do
it 'contains project names' do
expect(page).to have_content(@project1.name_with_namespace)
expect(page).to have_content(@project2.name_with_namespace)
expect(page).to have_content(@project1.full_name)
expect(page).to have_content(@project2.full_name)
end
end
......@@ -89,8 +89,8 @@
end
it 'contains name of correct project' do
expect(page).to have_content(@project1.name_with_namespace)
expect(page).not_to have_content(@project2.name_with_namespace)
expect(page).to have_content(@project1.full_name)
expect(page).not_to have_content(@project2.full_name)
end
end
......
......@@ -74,8 +74,8 @@
find('.new-project-item-select-button').click
page.within('.select2-results') do
expect(page).to have_content(project.name_with_namespace)
expect(page).not_to have_content(project_with_issues_disabled.name_with_namespace)
expect(page).to have_content(project.full_name)
expect(page).not_to have_content(project_with_issues_disabled.full_name)
end
end
......@@ -85,7 +85,7 @@
wait_for_requests
project_path = "/#{project.full_path}"
project_json = { name: project.name_with_namespace, url: project_path }.to_json
project_json = { name: project.full_name, url: project_path }.to_json
# simulate selection, and prevent overlap by dropdown menu
first('.project-item-select', visible: false)
......
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