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
d7c014dc
Commit
d7c014dc
authored
Dec 04, 2020
by
Jake Burden
Committed by
Sean McGivern
Dec 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not display renewal banner if future dated license is applied
parent
9b516b9c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletion
+29
-1
ee/changelogs/unreleased/banner-future-date-license.yml
ee/changelogs/unreleased/banner-future-date-license.yml
+5
-0
ee/lib/gitlab/expiring_subscription_message.rb
ee/lib/gitlab/expiring_subscription_message.rb
+1
-1
ee/spec/helpers/ee/subscribable_banner_helper_spec.rb
ee/spec/helpers/ee/subscribable_banner_helper_spec.rb
+13
-0
ee/spec/lib/gitlab/expiring_subscription_message_spec.rb
ee/spec/lib/gitlab/expiring_subscription_message_spec.rb
+10
-0
No files found.
ee/changelogs/unreleased/banner-future-date-license.yml
0 → 100644
View file @
d7c014dc
---
title
:
'
Do
not
display
renewal
banner
if
future
dated
license
is
applied'
merge_request
:
48283
author
:
type
:
changed
ee/lib/gitlab/expiring_subscription_message.rb
View file @
d7c014dc
...
...
@@ -120,7 +120,7 @@ module Gitlab
end
def
require_notification?
return
false
if
expiring_auto_renew?
return
false
if
expiring_auto_renew?
||
::
License
.
future_dated
.
present?
auto_renew_choice_exists?
&&
expired_subscribable_within_notification_window?
end
...
...
ee/spec/helpers/ee/subscribable_banner_helper_spec.rb
View file @
d7c014dc
...
...
@@ -77,6 +77,19 @@ RSpec.describe EE::SubscribableBannerHelper do
expect
(
subject
).
to
eq
(
license
)
end
end
context
'with a future dated license'
do
let
(
:gl_license
)
{
build
(
:gitlab_license
,
starts_at:
Date
.
current
+
1
.
month
)
}
before
do
allow
(
::
Gitlab
::
CurrentSettings
).
to
receive
(
:should_check_namespace_plan?
).
and_return
(
true
)
end
it
'returns the current license'
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
expect
(
subject
).
to
eq
(
license
)
end
end
end
end
...
...
ee/spec/lib/gitlab/expiring_subscription_message_spec.rb
View file @
d7c014dc
...
...
@@ -162,6 +162,16 @@ RSpec.describe Gitlab::ExpiringSubscriptionMessage do
end
end
context
'when a future dated license is applied'
do
before
do
create
(
:license
,
created_at:
Time
.
current
,
data:
build
(
:gitlab_license
,
starts_at:
expired_date
,
expires_at:
Date
.
current
+
13
.
months
).
export
)
end
it
'returns nil'
do
expect
(
subject
).
to
be
nil
end
end
context
'with namespace'
do
let
(
:namespace
)
{
double
(
:namespace
,
name:
'No Limit Records'
)
}
...
...
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