Skip to content
Snippets Groups Projects
Unverified Commit 8fe9995f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Replace deprecated name_with_namespace with full_name in app and spec

parent 1b54a8cd
No related branches found
No related tags found
No related merge requests found
Showing
with 31 additions and 31 deletions
Loading
Loading
@@ -62,7 +62,7 @@ class InvitesController < ApplicationController
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
Loading
Loading
Loading
Loading
@@ -38,7 +38,7 @@ class Projects::BlobController < Projects::ApplicationController
end
 
format.json do
page_title @blob.path, @ref, @project.name_with_namespace
page_title @blob.path, @ref, @project.full_name
 
show_json
end
Loading
Loading
Loading
Loading
@@ -36,7 +36,7 @@ class Projects::TreeController < Projects::ApplicationController
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
Loading
Loading
Loading
Loading
@@ -130,7 +130,7 @@ class ProjectsController < Projects::ApplicationController
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
Loading
Loading
Loading
Loading
@@ -99,7 +99,7 @@ module IssuablesHelper
project = Project.find_by(id: project_id)
 
if project
project.name_with_namespace
project.full_name
else
default_label
end
Loading
Loading
Loading
Loading
@@ -97,13 +97,13 @@ module ProjectsHelper
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)
Loading
Loading
Loading
Loading
@@ -110,7 +110,7 @@ module SearchHelper
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
Loading
Loading
Loading
Loading
@@ -114,7 +114,7 @@ module TodosHelper
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
Loading
Loading
Loading
Loading
@@ -158,7 +158,7 @@ class Event < ActiveRecord::Base
 
def project_name
if project
project.name_with_namespace
project.full_name
else
"(deleted project)"
end
Loading
Loading
Loading
Loading
@@ -68,7 +68,7 @@ http://app.asana.com/-/account_api'
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]} ):"
Loading
Loading
Loading
Loading
@@ -86,7 +86,7 @@ class CampfireService < Service
after = push[:after]
 
message = ""
message << "[#{project.name_with_namespace}] "
message << "[#{project.full_name}] "
message << "#{push[:user_name]} "
 
if Gitlab::Git.blank_ref?(before)
Loading
Loading
Loading
Loading
@@ -129,7 +129,7 @@ class ChatNotificationService < Service
end
 
def project_name
project.name_with_namespace.gsub(/\s/, '')
project.full_name.gsub(/\s/, '')
end
 
def project_url
Loading
Loading
Loading
Loading
@@ -120,7 +120,7 @@ class HipchatService < Service
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|
Loading
Loading
@@ -274,7 +274,7 @@ class HipchatService < Service
end
 
def project_name
project.name_with_namespace.gsub(/\s/, '')
project.full_name.gsub(/\s/, '')
end
 
def project_url
Loading
Loading
Loading
Loading
@@ -37,7 +37,7 @@ class MattermostSlashCommandsService < SlashCommandsService
private
 
def command(params)
pretty_project_name = project.name_with_namespace
pretty_project_name = project.full_name
 
params.merge(
auto_complete: true,
Loading
Loading
Loading
Loading
@@ -88,10 +88,10 @@ class PushoverService < Service
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
Loading
Loading
Loading
Loading
@@ -246,7 +246,7 @@ describe AutocompleteController do
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
Loading
Loading
@@ -267,7 +267,7 @@ describe AutocompleteController do
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
Loading
Loading
Loading
Loading
@@ -173,7 +173,7 @@ feature 'Admin Groups' do
 
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
Loading
Loading
Loading
Loading
@@ -58,7 +58,7 @@ describe "Admin::Projects" do
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
Loading
Loading
Loading
Loading
@@ -76,8 +76,8 @@ describe "Admin Runners" do
 
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
 
Loading
Loading
@@ -89,8 +89,8 @@ describe "Admin Runners" do
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
 
Loading
Loading
Loading
Loading
@@ -74,8 +74,8 @@ RSpec.describe 'Dashboard Issues' do
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
 
Loading
Loading
@@ -85,7 +85,7 @@ RSpec.describe 'Dashboard Issues' do
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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment