Commit 1cd35b92 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'remove-alert-contained-prop' into 'master'

Drop contained alerts behavior

See merge request gitlab-org/gitlab!81167
parents a9eee14b 359456c3
......@@ -4,7 +4,6 @@
title: s_('AdminArea|Get security updates from GitLab and stay up to date'),
variant: :tip,
alert_class: 'js-security-newsletter-callout',
is_contained: true,
alert_data: { feature_id: Users::CalloutsHelper::SECURITY_NEWSLETTER_CALLOUT, dismiss_endpoint: callouts_path, defer_links: 'true' },
close_button_data: { testid: 'close-security-newsletter-callout' } do
.gl-alert-body
......
......@@ -9,7 +9,6 @@
= render 'shared/global_alert',
variant: :warning,
alert_class: 'hidden js-cluster-api-unreachable',
is_contained: true,
close_button_class: 'js-close' do
.gl-alert-body
= s_('ClusterIntegration|Your cluster API is unreachable. Please ensure your API URL is correct.')
......@@ -17,7 +16,6 @@
= render 'shared/global_alert',
variant: :warning,
alert_class: 'hidden js-cluster-authentication-failure js-cluster-api-unreachable',
is_contained: true,
close_button_class: 'js-close' do
.gl-alert-body
= s_('ClusterIntegration|There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid.')
......
......@@ -5,7 +5,6 @@
= render 'shared/global_alert',
variant: :info,
alert_class: 'gl-my-5',
is_contained: true,
dismissible: false do
.gl-alert-body
= s_('Profiles|Some options are unavailable for LDAP accounts')
......@@ -14,7 +13,6 @@
= render 'shared/global_alert',
variant: :success,
alert_class: 'gl-my-5',
is_contained: true,
close_button_class: 'js-close-2fa-enabled-success-alert' do
.gl-alert-body
= html_escape(_('You have set up 2FA for your account! If you lose access to your 2FA device, you can use your recovery codes to access your account. Alternatively, if you upload an SSH key, you can %{anchorOpen}use that key to generate additional recovery codes%{anchorClose}.')) % { anchorOpen: '<a href="%{href}">'.html_safe % { href: help_page_path('user/profile/account/two_factor_authentication', anchor: 'generate-new-recovery-codes-using-ssh') }, anchorClose: '</a>'.html_safe }
......
......@@ -4,8 +4,7 @@
- if @error
= render 'shared/global_alert',
variant: :danger,
close_button_class: 'js-close',
is_contained: true do
close_button_class: 'js-close' do
.gl-alert-body
= @error
%h3.page-title
......
= render 'shared/global_alert',
title: _('Too many changes to show.'),
variant: :warning,
is_contained: true,
alert_class: 'gl-mb-5' do
.gl-alert-body
= html_escape(_("To preserve performance only %{strong_open}%{display_size} of %{real_size}%{strong_close} files are displayed.")) % { display_size: diff_files.size, real_size: diff_files.real_size, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
......
......@@ -4,7 +4,6 @@
title: _('Fork Error!'),
variant: :danger,
alert_class: 'gl-mt-5',
is_contained: true,
dismissible: false do
.gl-alert-body
%p
......
......@@ -4,7 +4,6 @@
= render 'shared/global_alert',
variant: :warning,
is_contained: true,
close_button_class: 'js-close',
alert_class: 'hide js-alert-moved-from-service-desk-warning gl-mt-5' do
.gl-alert-body.gl-mr-3
......
......@@ -15,7 +15,6 @@
= render 'shared/global_alert',
variant: :info,
dismissible: false,
is_contained: true,
alert_data: { testid: 'no-issues-alert' },
alert_class: 'gl-mt-3 gl-mb-5' do
.gl-alert-body
......
......@@ -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, 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')
.gl-alert-content{ role: 'alert' }
- if title
%h4.gl-alert-title
= title
= yield
- if session[:ask_for_usage_stats_consent]
= render 'shared/global_alert',
variant: :info,
is_contained: true,
alert_class: 'service-ping-consent-message' do
.gl-alert-body
- docs_link = link_to _('collect usage information'), help_page_path('user/admin_area/settings/usage_statistics.md'), class: 'gl-link'
......
......@@ -9,7 +9,6 @@
= render 'shared/global_alert',
variant: :danger,
dismissible: false,
is_contained: true,
alert_class: 'gl-mb-5' do
.gl-alert-body
Someone edited the #{issuable.class.model_name.human.downcase} the same time you did.
......
......@@ -3,7 +3,6 @@
- if milestone.complete? && milestone.active?
= render 'shared/global_alert',
variant: :success,
is_contained: true,
alert_data: { testid: 'all-issues-closed-alert' },
dismissible: false do
.gl-alert-body
......
......@@ -13,7 +13,6 @@
= render 'shared/global_alert',
title: s_('Webhooks|Webhook was automatically disabled'),
variant: :danger,
is_contained: true,
close_button_class: 'js-close' do
.gl-alert-body
= s_('Webhooks|The webhook was triggered more than %{limit} times per minute and is now disabled. To re-enable this webhook, fix the problems shown in %{strong_start}Recent events%{strong_end}, then re-test your settings. %{support_link_start}Contact Support%{support_link_end} if you need help re-enabling your webhook.').html_safe % placeholders
......@@ -21,7 +20,6 @@
= render 'shared/global_alert',
title: s_('Webhooks|Webhook failed to connect'),
variant: :danger,
is_contained: true,
close_button_class: 'js-close' do
.gl-alert-body
= s_('Webhooks|The webhook failed to connect, and is disabled. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % { strong_start: strong_start, strong_end: strong_end }
......@@ -35,7 +33,6 @@
= render 'shared/global_alert',
title: s_('Webhooks|Webhook fails to connect'),
variant: :warning,
is_contained: true,
close_button_class: 'js-close' do
.gl-alert-body
= s_('Webhooks|The webhook %{help_link_start}failed to connect%{help_link_end}, and will retry in %{retry_time}. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % placeholders
......@@ -107,7 +107,6 @@ export default {
v-if="errorMessage"
variant="danger"
:dismissible="hasSettings"
:contained="true"
:class="{ 'gl-mb-6': hasSettings }"
data-testid="error-alert"
@dismiss="dismissErrorMessage"
......
- if session.delete(:slack_install_success)
= render 'shared/global_alert',
title: s_('SlackIntegration|GitLab for Slack was successfully installed.'),
variant: :success,
is_contained: true do
variant: :success do
.gl-alert-body
= s_('SlackIntegration|You can now close this window and go to your Slack workspace.')
......@@ -8,7 +8,6 @@
= render 'shared/global_alert',
variant: :warning,
title: s_('Admin|Your instance has reached its user cap'),
is_contained: true,
alert_class: 'js-new-user-signups-cap-reached',
alert_data: { feature_id: ::EE::Users::CalloutsHelper::NEW_USER_SIGNUPS_CAP_REACHED, dismiss_endpoint: callouts_path, defer_links: "true" } do
.gl-alert-body
......
......@@ -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