Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2e1ea8ec
Commit
2e1ea8ec
authored
Mar 14, 2022
by
Vitaly Slobodin
Committed by
Natalia Tepluhina
Mar 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn the subscribable banner into an alert
Changelog: changed EE: true
parent
04ef4238
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
23 deletions
+16
-23
ee/app/views/layouts/header/_ee_subscribable_banner.html.haml
...pp/views/layouts/header/_ee_subscribable_banner.html.haml
+14
-21
ee/spec/features/admin/groups/admin_subscription_alerts_spec.rb
...c/features/admin/groups/admin_subscription_alerts_spec.rb
+1
-1
ee/spec/views/layouts/header/_ee_subscribable_banner.html.haml_spec.rb
.../layouts/header/_ee_subscribable_banner.html.haml_spec.rb
+1
-1
No files found.
ee/app/views/layouts/header/_ee_subscribable_banner.html.haml
View file @
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?
=
image_tag
(
'illustrations/subscription-cancelled.svg'
)
-
elsif
subscribable
.
expired?
=
image_tag
(
'illustrations/subscription-downgraded.svg'
)
-
else
=
image_tag
(
'illustrations/subscription-warning.svg'
)
.gl-text-left.gl-pt-3
=
message
-
if
subscribable
.
block_changes?
-
if
subscribable
.
block_changes?
=
link_to_button_style
(
path:
renew_subscription_path
,
track_property:
'renew'
)
=
link_to_button_style
(
path:
renew_subscription_path
,
track_property:
'renew'
)
-
elsif
subscribable
.
expired?
-
elsif
subscribable
.
expired?
=
link_to_button_style
(
path:
upgrade_subscription_path
,
track_property:
'upgrade'
)
=
link_to_button_style
(
path:
upgrade_subscription_path
,
track_property:
'upgrade'
)
-
else
-
else
=
link_to_button_style
(
path:
renew_subscription_path
,
track_property:
'renew'
)
=
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'
%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'
}
=
_
(
"That's OK, I don't want to renew"
)
ee/spec/features/admin/groups/admin_subscription_alerts_spec.rb
View file @
2e1ea8ec
...
@@ -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
)
...
...
ee/spec/views/layouts/header/_ee_subscribable_banner.html.haml_spec.rb
View file @
2e1ea8ec
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment