Commit 5e6a5804 authored by Tristan Read's avatar Tristan Read Committed by Robert Speicher

Remove gfm_embed_metrics flag from BE

Removes the feature flag that controls whether
metrics dashboard urls unfurl the metrics dashboard
charts.
parent 25dd49cd
......@@ -18,9 +18,7 @@ $.fn.renderGFM = function renderGFM() {
highlightCurrentUser(this.find('.gfm-project_member').get());
initUserPopovers(this.find('.gfm-project_member').get());
initMRPopovers(this.find('.gfm-merge_request').get());
if (gon.features && gon.features.gfmEmbeddedMetrics) {
renderMetrics(this.find('.js-render-metrics').get());
}
renderMetrics(this.find('.js-render-metrics').get());
return this;
};
......
......@@ -161,7 +161,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def metrics_dashboard
if Feature.enabled?(:gfm_embedded_metrics, project) && params[:embedded]
if params[:embedded]
result = dashboard_finder.find(
project,
current_user,
......
---
title: Link and embed metrics in GitLab Flavored Markdown
merge_request: 31106
author:
type: added
......@@ -10,8 +10,6 @@ module Banzai
# the link, and insert this node after any html content
# surrounding the link.
def call
return doc unless Feature.enabled?(:gfm_embedded_metrics, context[:project])
doc.xpath(xpath_search).each do |node|
next unless element = element_to_embed(node)
......
......@@ -13,8 +13,6 @@ module Banzai
# uses to identify the embedded content, removing
# only unnecessary nodes.
def call
return doc unless Feature.enabled?(:gfm_embedded_metrics, context[:project])
nodes.each do |node|
path = paths_by_node[node]
user_has_access = user_access_by_path[path]
......
......@@ -38,11 +38,6 @@ module Gitlab
gon.current_user_fullname = current_user.name
gon.current_user_avatar_url = current_user.avatar_url
end
# Flag controls a GFM feature used across many routes.
# Pushing the flag from one place simplifies control
# and facilitates easy removal.
push_frontend_feature_flag(:gfm_embedded_metrics)
end
# Exposes the state of a feature flag to the frontend code.
......
......@@ -613,31 +613,13 @@ describe Projects::EnvironmentsController do
end
end
shared_examples_for 'dashboard cannot be embedded' do
context 'when the embedded flag is included' do
let(:dashboard_params) { { format: :json, embedded: true } }
it_behaves_like 'the default dashboard'
end
end
let(:dashboard_params) { { format: :json } }
it_behaves_like 'the default dashboard'
it_behaves_like 'dashboard can be specified'
it_behaves_like 'dashboard can be embedded'
context 'when multiple dashboards is enabled and embedding metrics is disabled' do
before do
stub_feature_flags(gfm_embedded_metrics: false)
end
it_behaves_like 'the default dashboard'
it_behaves_like 'dashboard can be specified'
it_behaves_like 'dashboard cannot be embedded'
end
context 'when multiple dashboards is disabled and embedding metrics is enabled' do
context 'when multiple dashboards is disabled' do
before do
stub_feature_flags(environment_metrics_show_multiple_dashboards: false)
end
......@@ -646,19 +628,6 @@ describe Projects::EnvironmentsController do
it_behaves_like 'dashboard cannot be specified'
it_behaves_like 'dashboard can be embedded'
end
context 'when multiple dashboards and embedding metrics are disabled' do
before do
stub_feature_flags(
environment_metrics_show_multiple_dashboards: false,
gfm_embedded_metrics: false
)
end
it_behaves_like 'the default dashboard'
it_behaves_like 'dashboard cannot be specified'
it_behaves_like 'dashboard cannot be embedded'
end
end
describe 'GET #search' do
......
......@@ -40,16 +40,6 @@ describe Banzai::Filter::InlineMetricsFilter do
expect(doc.at_css('p').to_s).to include paragraph
expect(doc.at_css('.js-render-metrics')).to be_present
end
context 'when the feature is disabled' do
before do
stub_feature_flags(gfm_embedded_metrics: false)
end
it 'does nothing' do
expect(doc.to_s).to eq input
end
end
end
end
end
......@@ -11,16 +11,6 @@ describe Banzai::Filter::InlineMetricsRedactorFilter do
let(:input) { %(<a href="#{url}">example</a>) }
let(:doc) { filter(input) }
context 'when the feature is disabled' do
before do
stub_feature_flags(gfm_embedded_metrics: false)
end
it 'does nothing' do
expect(doc.to_s).to eq input
end
end
context 'without a metrics charts placeholder' do
it 'leaves regular non-metrics links unchanged' do
expect(doc.to_s).to eq input
......
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