Remove contained alerts logic

parent 4d4ae050
......@@ -8,16 +8,14 @@
- close_button_class = local_assigns.fetch(:close_button_class, nil)
- close_button_data = local_assigns.fetch(:close_button_data, nil)
- icon = icons[variant]
- alert_container_class = [container_class, @content_class] unless fluid_layout || local_assigns.fetch(:is_contained, false)
%div{ role: 'alert', class: ['gl-alert', "gl-alert-#{variant}", alert_class], data: alert_data }
.gl-alert-container{ class: alert_container_class }
= sprite_icon(icon, size: 16, css_class: "gl-alert-icon#{' gl-alert-icon-no-title' if title.nil?}")
- if dismissible
%button.btn.gl-dismiss-btn.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-close{ type: 'button', aria: { label: _('Dismiss') }, class: close_button_class, data: close_button_data }
= sprite_icon('close', size: 16)
.gl-alert-content{ role: 'alert' }
- if title
%h4.gl-alert-title
= title
= yield
= sprite_icon(icon, size: 16, css_class: "gl-alert-icon#{' gl-alert-icon-no-title' if title.nil?}")
- if dismissible
%button.btn.gl-dismiss-btn.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.js-close{ type: 'button', aria: { label: _('Dismiss') }, class: close_button_class, data: close_button_data }
= sprite_icon('close', size: 16)
.gl-alert-content{ role: 'alert' }
- if title
%h4.gl-alert-title
= title
= yield
......@@ -43,33 +43,4 @@ RSpec.describe 'shared/_global_alert.html.haml' do
expect(rendered).not_to have_selector('.gl-dismiss-btn')
end
end
context 'fixed layout' do
before do
allow(view).to receive(:fluid_layout).and_return(false)
end
it 'adds container classes' do
render
expect(rendered).to have_selector('.container-fluid.container-limited')
end
it 'does not add container classes if is_contained is true' do
render partial: 'shared/global_alert', locals: { is_contained: true }
expect(rendered).not_to have_selector('.container-fluid.container-limited')
end
end
context 'fluid layout' do
before do
allow(view).to receive(:fluid_layout).and_return(true)
render
end
it 'does not add container classes' do
expect(rendered).not_to have_selector('.container-fluid.container-limited')
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