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
fad2edcb
Commit
fad2edcb
authored
Jul 14, 2020
by
Tom Quirk
Committed by
Gabriel Mazetto
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create wiki link partial and use in all sidebars
Use wiki link partial in group and project sidebars
parent
02814027
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
24 deletions
+46
-24
app/views/layouts/nav/sidebar/_group.html.haml
app/views/layouts/nav/sidebar/_group.html.haml
+1
-12
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-12
app/views/layouts/nav/sidebar/_wiki_link.html.haml
app/views/layouts/nav/sidebar/_wiki_link.html.haml
+11
-0
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
+33
-0
No files found.
app/views/layouts/nav/sidebar/_group.html.haml
View file @
fad2edcb
...
...
@@ -124,18 +124,7 @@
=
render
'layouts/nav/sidebar/analytics_links'
,
links:
group_analytics_navbar_links
(
@group
,
current_user
)
-
if
group_sidebar_link?
(
:wiki
)
-
wiki_url
=
@group
.
wiki
.
web_url
=
nav_link
(
controller: :wikis
)
do
=
link_to
wiki_url
,
class:
'shortcuts-wiki'
,
data:
{
qa_selector:
'wiki_link'
}
do
.nav-icon-container
=
sprite_icon
(
'book'
)
%span
.nav-item-name
=
_
(
'Wiki'
)
%ul
.sidebar-sub-level-items.is-fly-out-only
=
nav_link
(
controller: :wikis
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
wiki_url
do
%strong
.fly-out-top-item-name
=
_
(
'Wiki'
)
=
render
'layouts/nav/sidebar/wiki_link'
,
wiki_url:
@group
.
wiki
.
web_url
-
if
group_sidebar_link?
(
:group_members
)
=
nav_link
(
path:
'group_members#index'
)
do
...
...
app/views/layouts/nav/sidebar/_project.html.haml
View file @
fad2edcb
...
...
@@ -308,18 +308,7 @@
=
_
(
'Confluence'
)
-
if
project_nav_tab?
:wiki
-
wiki_url
=
wiki_path
(
@project
.
wiki
)
=
nav_link
(
controller: :wikis
)
do
=
link_to
wiki_url
,
class:
'shortcuts-wiki'
,
data:
{
qa_selector:
'wiki_link'
}
do
.nav-icon-container
=
sprite_icon
(
'book'
)
%span
.nav-item-name
=
_
(
'Wiki'
)
%ul
.sidebar-sub-level-items.is-fly-out-only
=
nav_link
(
controller: :wikis
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
wiki_url
do
%strong
.fly-out-top-item-name
=
_
(
'Wiki'
)
=
render
'layouts/nav/sidebar/wiki_link'
,
wiki_url:
wiki_path
(
@project
.
wiki
)
-
if
project_nav_tab?
(
:external_wiki
)
-
external_wiki_url
=
@project
.
external_wiki
.
external_wiki_url
...
...
app/views/layouts/nav/sidebar/_wiki_link.html.haml
0 → 100644
View file @
fad2edcb
=
nav_link
(
controller: :wikis
)
do
=
link_to
wiki_url
,
class:
'shortcuts-wiki'
,
data:
{
qa_selector:
'wiki_link'
}
do
.nav-icon-container
=
sprite_icon
(
'book'
)
%span
.nav-item-name
=
_
(
'Wiki'
)
%ul
.sidebar-sub-level-items.is-fly-out-only
=
nav_link
(
controller: :wikis
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
wiki_url
do
%strong
.fly-out-top-item-name
=
_
(
'Wiki'
)
ee/spec/views/layouts/nav/sidebar/_group.html.haml_spec.rb
View file @
fad2edcb
...
...
@@ -200,6 +200,39 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
end
end
describe
'wiki tab'
do
let
(
:can_read_wiki
)
{
true
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
before
do
group
.
add_guest
(
current_user
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
current_user
)
allow
(
view
).
to
receive
(
:can?
).
with
(
current_user
,
:read_wiki
,
group
).
and_return
(
can_read_wiki
)
# TODO can be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/207888
stub_feature_flags
(
group_wiki:
true
)
end
describe
'when wiki is available to user'
do
it
'shows the wiki tab with the wiki internal link'
do
render
expect
(
rendered
).
to
have_link
(
'Wiki'
,
href:
group
.
wiki
.
web_url
)
end
end
describe
'when wiki is unavailable to user'
do
let
(
:can_read_wiki
)
{
false
}
it
'does not show the wiki tab'
do
render
expect
(
rendered
).
not_to
have_link
(
'Wiki'
,
href:
group
.
wiki
.
web_url
)
end
end
end
describe
'iterations link'
do
let_it_be
(
:current_user
)
{
create
(
: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