Skip to content

Show the Trial Status widget in the super sidebar

What does this MR do and why?

Show the Trial Status widget in the super sidebar when group has an active trial.

Screenshots or screen recordings

Old nav New nav
Screenshot_2023-04-19_at_10.25.01_AM Screenshot_2023-04-19_at_10.26.37_AM

How to set up and validate locally

  1. Start the GDK in SaaS mode. Typically, this is done by setting the GITLAB_SIMULATE_SAAS environment variable:
    gdk stop
    export GITLAB_SIMULATE_SAAS=1
    gdk start
  2. Enable the check_namespace_plan application setting:
    echo "ApplicationSetting.first.update(check_namespace_plan: true)" | rails c
  3. Enable the new nav:
    1. Enable the feature flag:

      echo "Feature.enable(:super_sidebar_nav)" | rails c
    2. Enable the user setting from the user dropdown:

      Screenshot_2022-12-13_at_1.32.43_PM

  4. Create a new top-level group.
  5. Start a trial for the group you've just created in the rails console:
    group = Group.last
    ultimate_plan = Plan.find_by_name("ultimate_trial")
    trial_start_date = -5.days.from_now
    trial_end_date = trial_start_date + 30.days
    
    gitlab_subscription = group.gitlab_subscription
    gitlab_subscription.hosted_plan_id = ultimate_plan.id
    gitlab_subscription.trial = true
    gitlab_subscription.trial_starts_on = trial_start_date
    gitlab_subscription.trial_ends_on = trial_end_date
    gitlab_subscription.save!
    
    group.web_url # Prints the group's URL for convenience
  6. Navigate to the group and notice the trial status widget in the left sidebar.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #406756 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports