Commit 8b4bec59 authored by Phil Hughes's avatar Phil Hughes

Fixed boards text in the project sidebar

Closes #3415
parent fd326fc3
...@@ -124,9 +124,9 @@ ...@@ -124,9 +124,9 @@
List List
= nav_link(controller: :boards) do = nav_link(controller: :boards) do
= link_to project_boards_path(@project), title: 'Board' do = link_to project_boards_path(@project), title: boards_link_text do
%span %span
Board = boards_link_text
.feature-highlight.js-feature-highlight{ disabled: true, data: { trigger: 'manual', container: 'body', toggle: 'popover', placement: 'right', highlight: 'issue-boards' } } .feature-highlight.js-feature-highlight{ disabled: true, data: { trigger: 'manual', container: 'body', toggle: 'popover', placement: 'right', highlight: 'issue-boards' } }
.feature-highlight-popover-content .feature-highlight-popover-content
= render 'feature_highlight/issue_boards.svg' = render 'feature_highlight/issue_boards.svg'
......
...@@ -54,5 +54,13 @@ module EE ...@@ -54,5 +54,13 @@ module EE
def board_sidebar_user_data def board_sidebar_user_data
super.merge(group_id: @group&.id) super.merge(group_id: @group&.id)
end end
def boards_link_text
if @project.multiple_issue_boards_available?(current_user)
"Boards"
else
"Board"
end
end
end end
end end
require 'spec_helper' require 'spec_helper'
describe 'layouts/nav/sidebar/_project' do describe 'layouts/nav/sidebar/_project' do
let(:project) { create(:project, :repository) }
before do
assign(:project, project)
assign(:repository, project.repository)
allow(view).to receive(:current_ref).and_return('master')
allow(view).to receive(:can?).and_return(true)
end
describe 'issue boards' do
it 'has boards tab when multiple issue boards available' do
render
expect(rendered).to have_css('a[title="Boards"]')
end
it 'has board tab when multiple issue boards is not available' do
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:multiple_issue_boards) { false }
render
expect(rendered).to have_css('a[title="Board"]')
end
end
describe 'container registry tab' do describe 'container registry tab' do
before do before do
project = create(:project, :repository)
stub_container_registry_config(enabled: true) stub_container_registry_config(enabled: true)
assign(:project, project)
assign(:repository, project.repository)
allow(view).to receive(:current_ref).and_return('master')
allow(view).to receive(:can?).and_return(true)
allow(controller).to receive(:controller_name) allow(controller).to receive(:controller_name)
.and_return('repositories') .and_return('repositories')
allow(controller).to receive(:controller_path) allow(controller).to receive(:controller_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment