Add Unlimited Members During Trial Alert component

What does this MR do and why?

  • Convert existing Unlimited Members trial alert partial content to ViewComponent
  • Moves show_unlimited_members_during_trial_alert? and members_page? into component
  • Adds RSpec tests for new UnlimitedMembersDuringTrialAlertComponent
  • Adds RSpec test for previously untested method in GroupCalloutsHelper

References

Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Appearance / UI is unchanged - code has just been moved into component.

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-11-13_at_6.32.40_PM Screenshot_2024-11-13_at_10.00.15_PM

Screenshot_2024-11-13_at_10.00.28_PM|

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Launch local GDK to simulate saas
  2. Setup active trial for namespace owned by signed-in user via the console (optional create new group and make your user the owner a la below)
   bin/rails c
   namespace = Group.last
   namespace.owner_id = User.first.id # if needed / you need to be the owner of the namespace
   gitlab_subscription = namespace.gitlab_subscription # find or create a new one if needed
   gitlab_subscription.update(hosted_plan: Plan.find_by(name: 'ultimate'), trial: true, trial_ends_on: Date.today + 15)
  1. Navigate to any group and project under the namespace owned by the signed-in user

Note: To skip setting up the trial for a namespace / step 2 locally, go to the file ee/app/helpers/ee/users/group_callouts_helper.rb and replace group.trial_active? with true.

Related to #405016 (closed)

Edited by Buck O'Leary

Merge request reports

Loading