Commit 7b64287b authored by Simon Knox's avatar Simon Knox Committed by Dmitry Gruzd

Remove whitespace in sidebar when iterations disabled

parent 4fc1e318
......@@ -7,6 +7,7 @@
- can_edit_issuable = issuable_sidebar.dig(:current_user, :can_edit)
- add_page_startup_api_call "#{issuable_sidebar[:issuable_json_path]}?serializer=sidebar_extras"
- reviewers = local_assigns.fetch(:reviewers, nil)
- in_group_context_with_iterations = @project.group.present? && issuable_sidebar[:supports_iterations]
%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite', 'aria-label': issuable_type }
.issuable-sidebar
......@@ -28,11 +29,11 @@
= render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type
- if issuable_sidebar[:supports_milestone]
.block.milestone{ :class => ("gl-border-b-0!" if issuable_sidebar[:supports_iterations]), data: { qa_selector: 'milestone_block' } }
.block.milestone{ :class => ("gl-border-b-0!" if in_group_context_with_iterations), data: { qa_selector: 'milestone_block' } }
.js-milestone-select{ data: { can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] } }
- if @project.group.present? && issuable_sidebar[:supports_iterations]
.block{ class: 'gl-pt-0!', data: { qa_selector: 'iteration_container' } }
- if in_group_context_with_iterations
.block{ class: 'gl-pt-0! gl-collapse-empty', data: { qa_selector: 'iteration_container', testid: 'iteration_container' } }<
= render_if_exists 'shared/issuable/iteration_select', can_edit: can_edit_issuable.to_s, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type
- if issuable_sidebar[:supports_time_tracking]
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'shared/issuable/_iterations_dropdown.html.haml' do
let_it_be(:user) { create(:user) }
subject(:rendered) do
render 'shared/issuable/sidebar', issuable_sidebar: IssueSerializer.new(current_user: user)
.represent(issuable, serializer: 'sidebar'), assignees: []
end
context 'project in a group' do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
before do
assign(:project, project)
end
context 'issuable that supports iterations' do
let(:issuable) { create(:issue, project: project) }
it 'shows iteration dropdown' do
expect(rendered).to have_css('[data-testid="iteration_container"]')
end
end
context 'issuable does not support iterations' do
let(:issuable) { create(:incident, project: project) }
it 'does not show iteration dropdown' do
expect(rendered).not_to have_css('[data-testid="iteration_container"]')
end
end
end
context 'non-group project' do
let_it_be(:project) { create(:project) }
let(:issuable) { create(:issue, project: project) }
before do
assign(:project, project)
end
it 'does not show iteration dropdown' do
expect(rendered).not_to have_css('[data-testid="iteration_container"]')
end
end
end
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