Commit 7ca1f91b authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'vs/change-subscribable-banner-to-alert' into 'master'

Turn the subscribable banner into an alert

See merge request gitlab-org/gitlab!81236
parents a9a0a82d 2e1ea8ec
...@@ -2,24 +2,17 @@ ...@@ -2,24 +2,17 @@
- message = gitlab_subscription_message_or_license_message - message = gitlab_subscription_message_or_license_message
- if message.present? && subscribable.present? - if message.present? && subscribable.present?
.container-fluid.container-limited.pt-3 .js-gitlab-ee-license-banner.hidden{ class: [container_class, @content_class, 'gl-pt-5!'] }
.gl-alert.gitlab-ee-license-banner.hidden.js-gitlab-ee-license-banner.gl-pb-7.gl-border-1.gl-border-solid.gl-border-gray-100.gl-rounded-base{ role: 'alert', data: { license_expiry: subscribable.expires_at } } = render 'shared/global_alert',
%button.gl-alert-dismiss.js-close{ type: 'button', 'aria-label' => 'Dismiss', data: { track_action: 'click_button', track_label: 'dismiss_subscribable_banner' } } variant: :danger,
= sprite_icon('close', css_class: 'gl-icon') title: message,
.gl-display-flex.gl-flex-direction-row.gl-align-items-center alert_data: { license_expiry: subscribable.expires_at, defer_links: "true" } do
.gl-pr-6.gl-pl-5.gl-pt-3.gl-display-none.gl-sm-display-block .gl-alert-body
- if subscribable.block_changes? - if subscribable.block_changes?
= image_tag('illustrations/subscription-cancelled.svg') = link_to_button_style(path: renew_subscription_path, track_property: 'renew')
- elsif subscribable.expired? - elsif subscribable.expired?
= image_tag('illustrations/subscription-downgraded.svg') = link_to_button_style(path: upgrade_subscription_path, track_property: 'upgrade')
- else - else
= image_tag('illustrations/subscription-warning.svg') = link_to_button_style(path: renew_subscription_path, track_property: 'renew')
.gl-text-left.gl-pt-3 %button{ type: 'button', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-default js-close gl-mb-2' }
= message = _("That's OK, I don't want to renew")
- if subscribable.block_changes?
= link_to_button_style(path: renew_subscription_path, track_property: 'renew')
- elsif subscribable.expired?
= link_to_button_style(path: upgrade_subscription_path, track_property: 'upgrade')
- else
= link_to_button_style(path: renew_subscription_path, track_property: 'renew')
= link_to _("That's OK, I don't want to renew"), '#', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2'
...@@ -32,7 +32,7 @@ RSpec.describe 'Subscription expired notification', :js do ...@@ -32,7 +32,7 @@ RSpec.describe 'Subscription expired notification', :js do
it 'displays and dismisses alert' do it 'displays and dismisses alert' do
expect(page).to have_content(expected_content) expect(page).to have_content(expected_content)
find('.gl-alert-dismiss.js-close').click click_button('Dismiss')
visit group_path(group) visit group_path(group)
expect(page).not_to have_content(expected_content) expect(page).not_to have_content(expected_content)
......
...@@ -19,7 +19,7 @@ RSpec.describe 'layouts/header/_ee_subscribable_banner' do ...@@ -19,7 +19,7 @@ RSpec.describe 'layouts/header/_ee_subscribable_banner' do
it 'shows both renew and dismiss links' do it 'shows both renew and dismiss links' do
expect(rendered).to have_link 'Renew subscription', href: view.renew_subscription_path expect(rendered).to have_link 'Renew subscription', href: view.renew_subscription_path
expect(rendered).to have_link "That's OK, I don't want to renew", href: '#' expect(rendered).to have_button "That's OK, I don't want to renew"
end 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