Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3a6c7a2d
Commit
3a6c7a2d
authored
Mar 15, 2017
by
Mark Fletcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display full project name with namespace upon deletion
* Removes ambiguity when two projects exist with the same name
parent
8fddde5b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
changelogs/unreleased/29469-message-for-project-x-will-be-deleted-should-include-namespace.yml
...or-project-x-will-be-deleted-should-include-namespace.yml
+4
-0
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+2
-2
No files found.
app/controllers/projects_controller.rb
View file @
3a6c7a2d
...
@@ -117,7 +117,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -117,7 +117,7 @@ class ProjectsController < Projects::ApplicationController
return
access_denied!
unless
can?
(
current_user
,
:remove_project
,
@project
)
return
access_denied!
unless
can?
(
current_user
,
:remove_project
,
@project
)
::
Projects
::
DestroyService
.
new
(
@project
,
current_user
,
{}).
async_execute
::
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
redirect_to
dashboard_projects_path
rescue
Projects
::
DestroyService
::
DestroyError
=>
ex
rescue
Projects
::
DestroyService
::
DestroyError
=>
ex
...
...
changelogs/unreleased/29469-message-for-project-x-will-be-deleted-should-include-namespace.yml
0 → 100644
View file @
3a6c7a2d
---
title
:
Display full project name with namespace upon deletion
merge_request
:
author
:
spec/features/projects_spec.rb
View file @
3a6c7a2d
...
@@ -56,7 +56,7 @@ feature 'Project', feature: true do
...
@@ -56,7 +56,7 @@ feature 'Project', feature: true do
end
end
describe
'removal'
,
js:
true
do
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'
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
,
name:
'project1'
)
}
before
do
before
do
...
@@ -67,7 +67,7 @@ feature 'Project', feature: true do
...
@@ -67,7 +67,7 @@ feature 'Project', feature: true do
it
'removes a project'
do
it
'removes a project'
do
expect
{
remove_with_confirm
(
'Remove project'
,
project
.
path
)
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
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
.
all
.
count
).
to
be_zero
expect
(
project
.
issues
).
to
be_empty
expect
(
project
.
issues
).
to
be_empty
expect
(
project
.
merge_requests
).
to
be_empty
expect
(
project
.
merge_requests
).
to
be_empty
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment