Display full project name with namespace upon deletion
* Removes ambiguity when two projects exist with the same name
This commit is contained in:
parent
8fddde5b9f
commit
3a6c7a2df3
3 changed files with 7 additions and 3 deletions
|
@ -117,7 +117,7 @@ class ProjectsController < Projects::ApplicationController
|
|||
return access_denied! unless can?(current_user, :remove_project, @project)
|
||||
|
||||
::Projects::DestroyService.new(@project, current_user, {}).async_execute
|
||||
flash[:alert] = "Project '#{@project.name}' will be deleted."
|
||||
flash[:alert] = "Project '#{@project.name_with_namespace}' will be deleted."
|
||||
|
||||
redirect_to dashboard_projects_path
|
||||
rescue Projects::DestroyService::DestroyError => ex
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Display full project name with namespace upon deletion
|
||||
merge_request:
|
||||
author:
|
|
@ -56,7 +56,7 @@ feature 'Project', feature: true do
|
|||
end
|
||||
|
||||
describe 'removal', js: true do
|
||||
let(:user) { create(:user) }
|
||||
let(:user) { create(:user, username: 'test', name: 'test') }
|
||||
let(:project) { create(:project, namespace: user.namespace, name: 'project1') }
|
||||
|
||||
before do
|
||||
|
@ -67,7 +67,7 @@ feature 'Project', feature: true do
|
|||
|
||||
it 'removes a project' do
|
||||
expect { remove_with_confirm('Remove project', project.path) }.to change {Project.count}.by(-1)
|
||||
expect(page).to have_content "Project 'project1' will be deleted."
|
||||
expect(page).to have_content "Project 'test / project1' will be deleted."
|
||||
expect(Project.all.count).to be_zero
|
||||
expect(project.issues).to be_empty
|
||||
expect(project.merge_requests).to be_empty
|
||||
|
|
Loading…
Reference in a new issue