Change wording for expired message
What does this MR do?
Update a message that is shown to SaaS users from 15 to 30 days after expiration
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/330988
Screenshots or Screencasts (strongly suggested)
Before | After |
---|---|
How to setup and validate locally (strongly suggested)
- Create a new group
- Add a Premium/Ultimate subscription to it
We would need to emulate the expired subscription for this group. There is a patch you need to apply under the spoiler. I didn't find a better way for it, please let me know if there is one
Patch
diff --git a/ee/app/models/gitlab_subscription.rb b/ee/app/models/gitlab_subscription.rb
index 7d81f3ebbc5..08be5aed565 100644
--- a/ee/app/models/gitlab_subscription.rb
+++ b/ee/app/models/gitlab_subscription.rb
@@ -81,6 +81,7 @@ def has_a_paid_hosted_plan?(include_trials: false)
end
def expired?
+ return true
return false unless end_date
end_date < Date.current
diff --git a/ee/app/presenters/subscription_presenter.rb b/ee/app/presenters/subscription_presenter.rb
index b726876e4aa..08c5ec00f79 100644
--- a/ee/app/presenters/subscription_presenter.rb
+++ b/ee/app/presenters/subscription_presenter.rb
@@ -22,13 +22,15 @@ def notify_users?
end
def expires_at
- end_date
+ # end_date
+ end_date - 385
end
def block_changes_at
return unless end_date
- end_date + GRACE_PERIOD_EXTENSION_DAYS
+ # end_date + GRACE_PERIOD_EXTENSION_DAYS
+ end_date + GRACE_PERIOD_EXTENSION_DAYS - 385
end
def remaining_days
diff --git a/ee/lib/gitlab/expiring_subscription_message.rb b/ee/lib/gitlab/expiring_subscription_message.rb
index 76e57d5c1d6..ac6d5e92f63 100644
--- a/ee/lib/gitlab/expiring_subscription_message.rb
+++ b/ee/lib/gitlab/expiring_subscription_message.rb
@@ -9,7 +9,11 @@ class ExpiringSubscriptionMessage
attr_reader :subscribable, :signed_in, :is_admin, :namespace, :force_notification
- delegate :auto_renew, to: :subscribable
+ # delegate :auto_renew, to: :subscribable
+ def auto_renew
+ # We show a different message if auto_renew is enabled
+ return false
+ end
def initialize(subscribable:, signed_in:, is_admin:, namespace: nil, force_notification: false)
@subscribable = subscribable
@@ -159,7 +163,9 @@ def plan_name
end
def plan_downgraded?
- plan_name.downcase == ::Plan::FREE
+ # plan_name.downcase == ::Plan::FREE
+ # we don't show the post expiration message if the group is not yet downgraded
+ return true
end
def show_downgrade_messaging?
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Edited by Diana Zubova