Skip to content

Add trial status widget to projects within group trial

What does this MR do and why?

Adds the trial status widget in the projects menu as per #344870 (closed)

Fix some display issues with the trial status widget

Screenshots or screen recordings

In project that is inside a group or subgroup with a trial

Screen_Shot_2021-11-15_at_4.19.54_PM

Remove focus, text decoration, etc to better match sidebar

before after
Screen_Shot_2021-11-15_at_3.56.16_PM Screen_Shot_2021-11-15_at_4.19.54_PM

How to set up and validate locally

  1. Run the following commands in the rails console:

    # Turn on billing features in the app
    ApplicationSetting.first.update(check_namespace_plan: true)
    # Create a new User
    user = FactoryBot.create(:user, username: 'user_288015', email: 'user.288015@example.org', password: '12345678')
    # Create a new Group & assign the new user as its owner
    group = FactoryBot.create(:group)
    group.add_owner(user)
    # Find or create the Ultimate plan
    plan = Plan.create_with(title: 'Ultimate (Formerly Gold)').find_or_create_by(name: :ultimate)
    # Create a new subscription for the Group
    GitlabSubscription.create(namespace: group, hosted_plan: plan, seats: 10, start_date: Date.current, end_date: Date.current.advance(years: 1), trial: true, trial_starts_on: Date.current, trial_ends_on: Date.current.advance(days: 30))
  2. Log into the app with username user_288015 and password 12345678

  3. Navigate to Groups › Your Groups › “group1” (or whatever the group was named)

  4. Create a project.

  5. Check out the feature in the sidebar of the newly created project.

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 #344870 (closed)

Edited by Doug Stull

Merge request reports

Loading