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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2210a71b
Commit
2210a71b
authored
Jul 04, 2017
by
Diego Souza
Committed by
Rémy Coutable
Jul 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove group modal like remove project modal. Closes #33130
parent
016b9f25
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
9 deletions
+27
-9
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+5
-0
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+9
-6
changelogs/unreleased/33130-remove-group-modal.yml
changelogs/unreleased/33130-remove-group-modal.yml
+4
-0
spec/features/groups_spec.rb
spec/features/groups_spec.rb
+9
-3
No files found.
app/helpers/groups_helper.rb
View file @
2210a71b
...
@@ -58,6 +58,11 @@ module GroupsHelper
...
@@ -58,6 +58,11 @@ module GroupsHelper
IssuesFinder
.
new
(
current_user
,
group_id:
group
.
id
).
execute
IssuesFinder
.
new
(
current_user
,
group_id:
group
.
id
).
execute
end
end
def
remove_group_message
(
group
)
_
(
"You are going to remove %{group_name}.
\n
Removed groups CANNOT be restored!
\n
Are you ABSOLUTELY sure?"
)
%
{
group_name:
group
.
name
}
end
private
private
def
group_title_link
(
group
,
hidable:
false
)
def
group_title_link
(
group
,
hidable:
false
)
...
...
app/views/groups/edit.html.haml
View file @
2210a71b
...
@@ -45,10 +45,13 @@
...
@@ -45,10 +45,13 @@
.panel.panel-danger
.panel.panel-danger
.panel-heading
Remove group
.panel-heading
Remove group
.panel-body
.panel-body
%p
=
form_tag
(
@group
,
method: :delete
)
do
Removing group will cause all child projects and resources to be removed.
%p
%br
Removing group will cause all child projects and resources to be removed.
%strong
Removed group can not be restored!
%br
%strong
Removed group can not be restored!
.form-actions
.form-actions
=
link_to
'Remove group'
,
@group
,
data:
{
confirm:
'Removed group can not be restored! Are you sure?'
},
method: :delete
,
class:
"btn btn-remove"
=
button_to
'Remove group'
,
'#'
,
class:
"btn btn-remove js-confirm-danger"
,
data:
{
"confirm-danger-message"
=>
remove_group_message
(
@group
)
}
=
render
'shared/confirm_modal'
,
phrase:
@group
.
path
changelogs/unreleased/33130-remove-group-modal.yml
0 → 100644
View file @
2210a71b
---
title
:
"
Remove
group
modal
like
remove
project
modal
(requires
typing
+
confirmation)"
merge_request
:
12569
author
:
Diego Souza
spec/features/groups_spec.rb
View file @
2210a71b
...
@@ -135,7 +135,7 @@ feature 'Group', feature: true do
...
@@ -135,7 +135,7 @@ feature 'Group', feature: true do
expect
(
page
).
not_to
have_content
(
'secret-group'
)
expect
(
page
).
not_to
have_content
(
'secret-group'
)
end
end
describe
'group edit'
do
describe
'group edit'
,
js:
true
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:path
)
{
edit_group_path
(
group
)
}
let
(
:path
)
{
edit_group_path
(
group
)
}
let
(
:new_name
)
{
'new-name'
}
let
(
:new_name
)
{
'new-name'
}
...
@@ -157,8 +157,8 @@ feature 'Group', feature: true do
...
@@ -157,8 +157,8 @@ feature 'Group', feature: true do
end
end
it
'removes group'
do
it
'removes group'
do
click_link
'Remove group'
expect
{
remove_with_confirm
(
'Remove group'
,
group
.
path
)
}.
to
change
{
Group
.
count
}.
by
(
-
1
)
expect
(
group
.
members
.
all
.
count
).
to
be_zero
expect
(
page
).
to
have_content
"scheduled for deletion"
expect
(
page
).
to
have_content
"scheduled for deletion"
end
end
end
end
...
@@ -212,4 +212,10 @@ feature 'Group', feature: true do
...
@@ -212,4 +212,10 @@ feature 'Group', feature: true do
expect
(
page
).
to
have_content
(
nested_group
.
name
)
expect
(
page
).
to
have_content
(
nested_group
.
name
)
end
end
end
end
def
remove_with_confirm
(
button_text
,
confirm_with
)
click_button
button_text
fill_in
'confirm_name_input'
,
with:
confirm_with
click_button
'Confirm'
end
end
end
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