diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 4f30b555ba09d1e8f81b54cd3cb36740df508670..c7864c1d45f4d2e27213193b4a53670a17b70f74 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -87,8 +87,6 @@ def admin_analytics_nav_links end def show_super_sidebar?(user = current_user) - return false unless Feature.enabled?(:super_sidebar_nav, user) - # The new sidebar is not enabled for anonymous use # Once we enable the new sidebar by default, this # should return true diff --git a/app/views/layouts/header/_current_user_dropdown.html.haml b/app/views/layouts/header/_current_user_dropdown.html.haml index 1739dee15111d4c66182b5aa61487925eb01fb6c..65dbafc19dab0f4db5a99b5c7e18c2cb7c39cdfe 100644 --- a/app/views/layouts/header/_current_user_dropdown.html.haml +++ b/app/views/layouts/header/_current_user_dropdown.html.haml @@ -42,9 +42,8 @@ %li.d-md-none = link_to _("Switch to GitLab Next"), Gitlab::Saas.canary_toggle_com_url, data: { track_action: "click_link", track_label: "switch_to_canary", track_property: "navigation_top" } - - if Feature.enabled?(:super_sidebar_nav, current_user) - %li.divider - .js-new-nav-toggle{ data: { enabled: show_super_sidebar?.to_s, endpoint: profile_preferences_url} } + %li.divider + .js-new-nav-toggle{ data: { enabled: show_super_sidebar?.to_s, endpoint: profile_preferences_url} } - if current_user_menu?(:sign_out) %li.divider diff --git a/config/feature_flags/development/super_sidebar_nav.yml b/config/feature_flags/development/super_sidebar_nav.yml deleted file mode 100644 index 81dd4a7842adbe72e8fbfe0639ce1a0d8f836fc3..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/super_sidebar_nav.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: super_sidebar_nav -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/101910 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/381456 -milestone: '15.7' -type: development -group: group::foundations -default_enabled: true diff --git a/doc/development/navigation_sidebar.md b/doc/development/navigation_sidebar.md index cd543012ddd490e603ec8e71f3acdc8dbe386eda..f7ab75b62f4082a12c9fd92238047e22c472adad 100644 --- a/doc/development/navigation_sidebar.md +++ b/doc/development/navigation_sidebar.md @@ -15,10 +15,7 @@ the sidebar is a work in progress, and so is this documentation. ## Enable the new navigation sidebar -To enable the new navigation sidebar: - -- Enable the `super_sidebar_nav` feature flag. -- Select your avatar, then turn on the **New navigation** toggle. +To enable the new navigation sidebar, select your avatar, then turn on the **New navigation** toggle. ## Adding items to the sidebar diff --git a/ee/spec/lib/sidebars/projects/menus/trial_widget_menu_spec.rb b/ee/spec/lib/sidebars/projects/menus/trial_widget_menu_spec.rb index 8b9369b0644ab8d747278a1177db0c1d93a7fd25..60223ae2e65cfc6380e118392adab131dc7f6921 100644 --- a/ee/spec/lib/sidebars/projects/menus/trial_widget_menu_spec.rb +++ b/ee/spec/lib/sidebars/projects/menus/trial_widget_menu_spec.rb @@ -3,10 +3,6 @@ require 'spec_helper' RSpec.describe Sidebars::Projects::Menus::TrialWidgetMenu, :saas, feature_category: :experimentation_conversion do - before do - stub_feature_flags(super_sidebar_nav: true) - end - it_behaves_like 'trial widget menu items' do let(:context) do container = instance_double(Project, namespace: group) diff --git a/spec/features/commit_spec.rb b/spec/features/commit_spec.rb index dd96b763e55ad40f3d029c19a5ed1ff16046b1bf..61792ea5a5889bfe3389d8035e238e4c5f57bf65 100644 --- a/spec/features/commit_spec.rb +++ b/spec/features/commit_spec.rb @@ -70,7 +70,6 @@ def diff_files_on_page context "when super sidebar is enabled" do before do user.update!(use_new_navigation: true) - stub_feature_flags(super_sidebar_nav: true) end it_behaves_like "single commit view" diff --git a/spec/features/nav/new_nav_toggle_spec.rb b/spec/features/nav/new_nav_toggle_spec.rb index 2cdaf12bb15630f5357ef6abb8ee53de2288aa02..6872058be8e6a02f684cd150760494a7353460b6 100644 --- a/spec/features/nav/new_nav_toggle_spec.rb +++ b/spec/features/nav/new_nav_toggle_spec.rb @@ -7,75 +7,53 @@ before do user.update!(use_new_navigation: user_preference) - stub_feature_flags(super_sidebar_nav: new_nav_ff) sign_in(user) visit explore_projects_path end - context 'with feature flag off' do - let(:new_nav_ff) { false } + context 'when user has new nav disabled' do + let(:user_preference) { false } - where(:user_preference) do - [true, false] - end + it 'allows to enable new nav', :aggregate_failures do + within '.js-nav-user-dropdown' do + find('a[data-toggle="dropdown"]').click + expect(page).to have_content('Navigation redesign') - with_them do - it 'shows old topbar user dropdown with no way to toggle to new nav' do - within '.js-header-content .js-nav-user-dropdown' do - find('a[data-toggle="dropdown"]').click - expect(page).not_to have_content('Navigation redesign') - end + toggle = page.find('.gl-toggle:not(.is-checked)') + toggle.click # reloads the page end - end - end - - context 'with feature flag on' do - let(:new_nav_ff) { true } - context 'when user has new nav disabled' do - let(:user_preference) { false } + wait_for_requests - it 'allows to enable new nav', :aggregate_failures do - within '.js-nav-user-dropdown' do - find('a[data-toggle="dropdown"]').click - expect(page).to have_content('Navigation redesign') - - toggle = page.find('.gl-toggle:not(.is-checked)') - toggle.click # reloads the page - end - - wait_for_requests - - expect(user.reload.use_new_navigation).to eq true - end + expect(user.reload.use_new_navigation).to eq true + end - it 'shows the old navigation' do - expect(page).to have_selector('.js-navbar') - expect(page).not_to have_selector('[data-testid="super-sidebar"]') - end + it 'shows the old navigation' do + expect(page).to have_selector('.js-navbar') + expect(page).not_to have_selector('[data-testid="super-sidebar"]') end + end - context 'when user has new nav enabled' do - let(:user_preference) { true } + context 'when user has new nav enabled' do + let(:user_preference) { true } - it 'allows to disable new nav', :aggregate_failures do - within '[data-testid="super-sidebar"] [data-testid="user-dropdown"]' do - click_button "#{user.name} user’s menu" - expect(page).to have_content('Navigation redesign') + it 'allows to disable new nav', :aggregate_failures do + within '[data-testid="super-sidebar"] [data-testid="user-dropdown"]' do + click_button "#{user.name} user’s menu" + expect(page).to have_content('Navigation redesign') - toggle = page.find('.gl-toggle.is-checked') - toggle.click # reloads the page - end + toggle = page.find('.gl-toggle.is-checked') + toggle.click # reloads the page + end - wait_for_requests + wait_for_requests - expect(user.reload.use_new_navigation).to eq false - end + expect(user.reload.use_new_navigation).to eq false + end - it 'shows the new navigation' do - expect(page).not_to have_selector('.js-navbar') - expect(page).to have_selector('[data-testid="super-sidebar"]') - end + it 'shows the new navigation' do + expect(page).not_to have_selector('.js-navbar') + expect(page).to have_selector('[data-testid="super-sidebar"]') end end end diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb index 3313f6ef3b79b181f4c08786d3058501c5d0568a..beb5fa7822bd5f601e61d6f08844d96cb918c8b9 100644 --- a/spec/features/projects/compare_spec.rb +++ b/spec/features/projects/compare_spec.rb @@ -189,7 +189,6 @@ def select_using_dropdown(dropdown_type, selection, commit: false) context "when super sidebar is enabled" do before do user.update!(use_new_navigation: true) - stub_feature_flags(super_sidebar_nav: true) end it_behaves_like "compare view of branches" diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 9f56c2c1cb07a55622e17c51122d65f3c89d079d..d05b7649f94a17354cf4ce193bc13173d0e10816 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -99,7 +99,6 @@ context 'when the new navigation is enabled' do before do user.update!(use_new_navigation: true) - stub_feature_flags(super_sidebar_nav: true) end include_examples '"New project" page' diff --git a/spec/frontend/fixtures/startup_css.rb b/spec/frontend/fixtures/startup_css.rb index 5b09e1c9495fb5f95baece57432ad759a16a7135..83e02470321001b7cb2f2f04d7b1bf3640475b64 100644 --- a/spec/frontend/fixtures/startup_css.rb +++ b/spec/frontend/fixtures/startup_css.rb @@ -40,11 +40,8 @@ expect(response).to be_successful end - # This Feature Flag is off by default # This ensures that the correct css is generated for super sidebar - # When the feature flag is off, the general startup will capture it it "startup_css/project-#{type}-super-sidebar.html" do - stub_feature_flags(super_sidebar_nav: true) user.update!(use_new_navigation: true) get :show, params: { diff --git a/spec/helpers/nav_helper_spec.rb b/spec/helpers/nav_helper_spec.rb index 17d28b07763aeea644d7c38956cfbe6bf61e6da4..4a02b1845228428bc93e53f5ae4aa431ce7119bd 100644 --- a/spec/helpers/nav_helper_spec.rb +++ b/spec/helpers/nav_helper_spec.rb @@ -138,55 +138,34 @@ describe '#show_super_sidebar?' do shared_examples 'show_super_sidebar is supposed to' do before do - stub_feature_flags(super_sidebar_nav: new_nav_ff) user.update!(use_new_navigation: user_preference) end - context 'with feature flag off' do - let(:new_nav_ff) { false } + context 'when user has not interacted with the new nav toggle yet' do + let(:user_preference) { nil } - context 'when user has new nav disabled' do - let(:user_preference) { false } + specify { expect(subject).to eq false } - specify { expect(subject).to eq false } - end - - context 'when user has new nav enabled' do - let(:user_preference) { true } + context 'when the user was enrolled into the new nav via a special feature flag' do + before do + # this ff is disabled in globally to keep tests of the old nav working + stub_feature_flags(super_sidebar_nav_enrolled: true) + end - specify { expect(subject).to eq false } + specify { expect(subject).to eq true } end end - context 'with feature flag on' do - let(:new_nav_ff) { true } - - context 'when user has not interacted with the new nav toggle yet' do - let(:user_preference) { nil } - - specify { expect(subject).to eq false } - - context 'when the user was enrolled into the new nav via a special feature flag' do - before do - # this ff is disabled in globally to keep tests of the old nav working - stub_feature_flags(super_sidebar_nav_enrolled: true) - end - - specify { expect(subject).to eq true } - end - end - - context 'when user has new nav disabled' do - let(:user_preference) { false } + context 'when user has new nav disabled' do + let(:user_preference) { false } - specify { expect(subject).to eq false } - end + specify { expect(subject).to eq false } + end - context 'when user has new nav enabled' do - let(:user_preference) { true } + context 'when user has new nav enabled' do + let(:user_preference) { true } - specify { expect(subject).to eq true } - end + specify { expect(subject).to eq true } end end