Skip to content
Snippets Groups Projects
Commit 5e6a5804 authored by Tristan Read's avatar Tristan Read Committed by Robert Speicher
Browse files

Remove gfm_embed_metrics flag from BE

Removes the feature flag that controls whether
metrics dashboard urls unfurl the metrics dashboard
charts.
parent 25dd49cd
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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;
};
 
Loading
Loading
Loading
Loading
@@ -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,
Loading
Loading
---
title: Link and embed metrics in GitLab Flavored Markdown
merge_request: 31106
author:
type: added
Loading
Loading
@@ -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)
 
Loading
Loading
Loading
Loading
@@ -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]
Loading
Loading
Loading
Loading
@@ -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.
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment