Commit 73c0bbe6 authored by Jay's avatar Jay Committed by Sean McGivern

Remove "whats new" feature flag

This commit removes the "whats new" feature flag and enables the feature
for everyone: EE, and CE.

part of:
https://gitlab.com/gitlab-org/gitlab/-/issues/254186
parent 62f8dab1
......@@ -5,7 +5,6 @@ class WhatsNewController < ApplicationController
skip_before_action :authenticate_user!
before_action :check_feature_flag
before_action :check_valid_page_param, :set_pagination_headers, unless: -> { has_version_param? }
feature_category :navigation
......@@ -20,10 +19,6 @@ class WhatsNewController < ApplicationController
private
def check_feature_flag
render_404 unless Feature.enabled?(:whats_new_drawer, current_user)
end
def check_valid_page_param
render_404 if current_page < 1
end
......
......@@ -120,8 +120,7 @@
= sprite_icon('ellipsis_h', size: 12, css_class: 'more-icon js-navbar-toggle-right')
= sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left')
- if ::Feature.enabled?(:whats_new_drawer, current_user)
#whats-new-app{ data: { storage_key: whats_new_storage_key, versions: whats_new_versions, gitlab_dot_com: Gitlab.dev_env_org_or_com? } }
#whats-new-app{ data: { storage_key: whats_new_storage_key, versions: whats_new_versions, gitlab_dot_com: Gitlab.dev_env_org_or_com? } }
- if can?(current_user, :update_user_status, current_user)
.js-set-status-modal-wrapper{ data: user_status_data }
%ul
- if current_user_menu?(:help)
= render_if_exists 'layouts/header/whats_new_dropdown_item'
= render 'layouts/header/whats_new_dropdown_item'
%li
= link_to _("Help"), help_path
%li
......
%li
%button.gl-justify-content-space-between.gl-align-items-center.js-whats-new-trigger{ type: 'button', data: { storage_key: whats_new_storage_key }, class: 'gl-display-flex!' }
= _("What's new")
%span.js-whats-new-notification-count.whats-new-notification-count
= whats_new_most_recent_release_items_count
---
title: Add "What's new" item to the help dropdown
merge_request: 52020
author:
type: changed
- if ::Feature.enabled?(:whats_new_dropdown, current_user)
- if ::Feature.enabled?(:whats_new_drawer, current_user)
%li
%button.gl-justify-content-space-between.gl-align-items-center.js-whats-new-trigger{ type: 'button', data: { storage_key: whats_new_storage_key }, class: 'gl-display-flex!' }
= _("What's new")
%span.js-whats-new-notification-count.whats-new-notification-count
= whats_new_most_recent_release_items_count
- else
%li
= link_to _("What's new"), "#{promo_url}/releases/gitlab-com/", target: '_blank', rel: 'noopener noreferrer', data: { track_event: 'click_whats_new', track_property: 'question_menu' }
......@@ -6,8 +6,6 @@ RSpec.describe "renders a `whats new` dropdown item", :js do
let_it_be(:user) { create(:user) }
before do
stub_feature_flags(whats_new_dropdown: true, whats_new_drawer: true)
sign_in(user)
end
......
......@@ -7,59 +7,41 @@ RSpec.describe WhatsNewController do
let(:item) { double(:item) }
let(:highlights) { double(:highlight, items: [item], map: [item].map, next_page: 2) }
context 'with whats_new_drawer feature enabled' do
before do
stub_feature_flags(whats_new_drawer: true)
end
context 'with no page param' do
it 'responds with paginated data and headers' do
allow(ReleaseHighlight).to receive(:paginated).with(page: 1).and_return(highlights)
allow(Gitlab::WhatsNew::ItemPresenter).to receive(:present).with(item).and_return(item)
context 'with no page param' do
it 'responds with paginated data and headers' do
allow(ReleaseHighlight).to receive(:paginated).with(page: 1).and_return(highlights)
allow(Gitlab::WhatsNew::ItemPresenter).to receive(:present).with(item).and_return(item)
get whats_new_path, xhr: true
get whats_new_path, xhr: true
expect(response.body).to eq(highlights.items.to_json)
expect(response.headers['X-Next-Page']).to eq(2)
end
expect(response.body).to eq(highlights.items.to_json)
expect(response.headers['X-Next-Page']).to eq(2)
end
end
context 'with page param' do
it 'passes the page parameter' do
expect(ReleaseHighlight).to receive(:paginated).with(page: 2).and_call_original
get whats_new_path(page: 2), xhr: true
end
it 'returns a 404 if page param is negative' do
get whats_new_path(page: -1), xhr: true
context 'with page param' do
it 'passes the page parameter' do
expect(ReleaseHighlight).to receive(:paginated).with(page: 2).and_call_original
expect(response).to have_gitlab_http_status(:not_found)
end
get whats_new_path(page: 2), xhr: true
end
context 'with version param' do
it 'returns items without pagination headers' do
allow(ReleaseHighlight).to receive(:for_version).with(version: '42').and_return(highlights)
allow(Gitlab::WhatsNew::ItemPresenter).to receive(:present).with(item).and_return(item)
it 'returns a 404 if page param is negative' do
get whats_new_path(page: -1), xhr: true
get whats_new_path(version: 42), xhr: true
expect(response.body).to eq(highlights.items.to_json)
expect(response.headers['X-Next-Page']).to be_nil
end
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'with whats_new_drawer feature disabled' do
before do
stub_feature_flags(whats_new_drawer: false)
end
context 'with version param' do
it 'returns items without pagination headers' do
allow(ReleaseHighlight).to receive(:for_version).with(version: '42').and_return(highlights)
allow(Gitlab::WhatsNew::ItemPresenter).to receive(:present).with(item).and_return(item)
it 'returns a 404' do
get whats_new_path, xhr: true
get whats_new_path(version: 42), xhr: true
expect(response).to have_gitlab_http_status(:not_found)
expect(response.body).to eq(highlights.items.to_json)
expect(response.headers['X-Next-Page']).to be_nil
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment