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
750030da
Commit
750030da
authored
Apr 07, 2021
by
Serena Fang
Committed by
Enrique Alcántara
Apr 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project access token creation group settings link
parent
f69bcd39
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
app/views/projects/settings/access_tokens/index.html.haml
app/views/projects/settings/access_tokens/index.html.haml
+3
-2
changelogs/unreleased/sfang-fix-group-settings-link.yml
changelogs/unreleased/sfang-fix-group-settings-link.yml
+5
-0
spec/features/projects/settings/access_tokens_spec.rb
spec/features/projects/settings/access_tokens_spec.rb
+16
-0
No files found.
app/views/projects/settings/access_tokens/index.html.haml
View file @
750030da
...
@@ -17,8 +17,9 @@
...
@@ -17,8 +17,9 @@
-
else
-
else
=
_
(
'Project access token creation is disabled in this group. You can still use and manage existing tokens.'
)
=
_
(
'Project access token creation is disabled in this group. You can still use and manage existing tokens.'
)
%p
%p
-
if
current_user
.
can?
(
:admin_group
,
@project
.
group
)
-
root_group
=
@project
.
group
.
root_ancestor
-
group_settings_link
=
edit_group_path
(
@project
.
group
)
-
if
current_user
.
can?
(
:admin_group
,
root_group
)
-
group_settings_link
=
edit_group_path
(
root_group
)
-
link_start
=
'<a href="%{url}" target="_blank" rel="noopener noreferrer">'
.
html_safe
%
{
url:
group_settings_link
}
-
link_start
=
'<a href="%{url}" target="_blank" rel="noopener noreferrer">'
.
html_safe
%
{
url:
group_settings_link
}
=
_
(
'You can enable project access token creation in %{link_start}group settings%{link_end}.'
).
html_safe
%
{
link_start:
link_start
,
link_end:
'</a>'
.
html_safe
}
=
_
(
'You can enable project access token creation in %{link_start}group settings%{link_end}.'
).
html_safe
%
{
link_start:
link_start
,
link_end:
'</a>'
.
html_safe
}
...
...
changelogs/unreleased/sfang-fix-group-settings-link.yml
0 → 100644
View file @
750030da
---
title
:
Fix project access token creation group settings link
merge_request
:
58686
author
:
type
:
fixed
spec/features/projects/settings/access_tokens_spec.rb
View file @
750030da
...
@@ -116,6 +116,22 @@ RSpec.describe 'Project > Settings > Access Tokens', :js do
...
@@ -116,6 +116,22 @@ RSpec.describe 'Project > Settings > Access Tokens', :js do
end
end
end
end
context
'with nested groups'
do
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
context
'when user is not a top level group owner'
do
before
do
subgroup
.
add_owner
(
user
)
end
it
'does not show group settings link'
do
visit
project_settings_access_tokens_path
(
project
)
expect
(
page
).
not_to
have_link
(
'group settings'
,
href:
edit_group_path
(
group
))
end
end
end
context
'when user is a group owner'
do
context
'when user is a group owner'
do
before
do
before
do
group
.
add_owner
(
user
)
group
.
add_owner
(
user
)
...
...
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