Commit 61248933 authored by Kushal Pandya's avatar Kushal Pandya

Remove Requirements count from navigation bar

Removes total Requirements count from left navigation sidebar
parent 972c347a
......@@ -136,8 +136,6 @@ export default {
opened: tabsContainerEl.querySelector('.js-opened-count'),
archived: tabsContainerEl.querySelector('.js-archived-count'),
all: tabsContainerEl.querySelector('.js-all-count'),
nav: document.querySelector('.js-nav-requirements-count'),
navFlyOut: document.querySelector('.js-nav-requirements-count-fly-out'),
},
};
},
......@@ -200,8 +198,6 @@ export default {
const totalCount = this.requirements.count.ALL;
this.countEls.all.innerText = totalCount;
this.countEls.nav.innerText = totalCount;
this.countEls.navFlyOut.innerText = totalCount;
},
openedCount(value) {
this.countEls.opened.innerText = value;
......
- return unless Feature.enabled?(:requirements_management, project, default_enabled: true)
- return unless can?(current_user, :read_requirement, project)
- requirements_count = Hash.new(0).merge(project.requirements.counts_by_state)
- total_count = requirements_count['opened'] + requirements_count['archived']
= nav_link(path: 'requirements#index') do
= link_to project_requirements_path(project), class: 'qa-project-requirements-link' do
.nav-icon-container
= sprite_icon('requirements')
%span.nav-item-name
= _('Requirements')
%span.badge.badge-pill.count.js-nav-requirements-count= number_with_delimiter(total_count)
%ul.sidebar-sub-level-items
= nav_link(path: 'requirements#index', html_options: { class: "fly-out-top-item" } ) do
= link_to project_requirements_path(project) do
%strong.fly-out-top-item-name= _('Requirements')
%span.badge.badge-pill.count.requirements_counter.fly-out-badge.js-nav-requirements-count-fly-out= number_with_delimiter(total_count)
%li.divider.fly-out-top-item
= nav_link(path: 'requirements#index', html_options: { class: 'home' }) do
= link_to project_requirements_path(project), title: 'List' do
......
......@@ -42,7 +42,6 @@ describe 'Requirements list', :js do
it 'shows the requirements in the navigation sidebar' do
expect(first('.nav-sidebar .active a .nav-item-name')).to have_content('Requirements')
expect(first('.nav-sidebar .active a .count')).to have_content('4')
end
it 'shows requirements tabs for each status type' do
......@@ -93,7 +92,6 @@ describe 'Requirements list', :js do
end
it 'updates requirements count in nav sidebar and opened and all tab badges' do
expect(page.find('.js-nav-requirements-count')).to have_content('4')
page.within('.requirements-state-filters') do
expect(find('li > a#state-opened .badge')).to have_content('3')
expect(find('li > a#state-all .badge')).to have_content('4')
......@@ -101,7 +99,6 @@ describe 'Requirements list', :js do
create_requirement('Foobar')
expect(page.find('.js-nav-requirements-count')).to have_content('5')
page.within('.requirements-state-filters') do
expect(find('li > a#state-opened .badge')).to have_content('4')
expect(find('li > a#state-all .badge')).to have_content('5')
......
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