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
de6bab91
Commit
de6bab91
authored
Mar 31, 2019
by
Elias Werberich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable inaccessible navigation links upon archiving a project
parent
afbc8274
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
2 deletions
+59
-2
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+2
-2
changelogs/unreleased/58793-fix-nav-links-archived-project.yml
...elogs/unreleased/58793-fix-nav-links-archived-project.yml
+5
-0
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+52
-0
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
de6bab91
...
...
@@ -357,12 +357,12 @@
=
link_to
project_settings_repository_path
(
@project
),
title:
_
(
'Repository'
)
do
%span
=
_
(
'Repository'
)
-
if
@project
.
feature_available?
(
:builds
,
current_user
)
-
if
!
@project
.
archived?
&&
@project
.
feature_available?
(
:builds
,
current_user
)
=
nav_link
(
controller: :ci_cd
)
do
=
link_to
project_settings_ci_cd_path
(
@project
),
title:
_
(
'CI / CD'
)
do
%span
=
_
(
'CI / CD'
)
-
if
settings_operations_available?
-
if
!
@project
.
archived?
&&
settings_operations_available?
=
nav_link
(
controller:
[
:operations
])
do
=
link_to
project_settings_operations_path
(
@project
),
title:
_
(
'Operations'
)
do
=
_
(
'Operations'
)
...
...
changelogs/unreleased/58793-fix-nav-links-archived-project.yml
0 → 100644
View file @
de6bab91
---
title
:
"
Disable
inaccessible
navigation
links
upon
archiving
a
project"
merge_request
:
26020
author
:
Elias Werberich
type
:
fixed
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
de6bab91
...
...
@@ -113,4 +113,56 @@ describe 'layouts/nav/sidebar/_project' do
end
end
end
describe
'ci/cd settings tab'
do
before
do
project
.
update!
(
archived:
project_archived
)
end
context
'when project is archived'
do
let
(
:project_archived
)
{
true
}
it
'does not show the ci/cd settings tab'
do
render
expect
(
rendered
).
not_to
have_link
(
'CI / CD'
,
href:
project_settings_ci_cd_path
(
project
))
end
end
context
'when project is active'
do
let
(
:project_archived
)
{
false
}
it
'shows the ci/cd settings tab'
do
render
expect
(
rendered
).
to
have_link
(
'CI / CD'
,
href:
project_settings_ci_cd_path
(
project
))
end
end
end
describe
'operations settings tab'
do
before
do
project
.
update!
(
archived:
project_archived
)
end
context
'when project is archived'
do
let
(
:project_archived
)
{
true
}
it
'does not show the operations settings tab'
do
render
expect
(
rendered
).
not_to
have_link
(
'Operations'
,
href:
project_settings_operations_path
(
project
))
end
end
context
'when project is active'
do
let
(
:project_archived
)
{
false
}
it
'shows the operations settings tab'
do
render
expect
(
rendered
).
to
have_link
(
'Operations'
,
href:
project_settings_operations_path
(
project
))
end
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