Commit 6da3c126 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'cngo-fix-scoped-labels-padding' into 'master'

Fix scoped labels padding

See merge request gitlab-org/gitlab!44044
parents 8799c7e4 11cce432
......@@ -61,7 +61,7 @@ module LabelsHelper
render_label_text(
label.name,
suffix: suffix,
css_class: text_color_class_for_bg(label.color),
css_class: "gl-label-text #{text_color_class_for_bg(label.color)}",
bg_color: label.color
)
end
......@@ -281,7 +281,7 @@ module LabelsHelper
def render_label_text(name, suffix: '', css_class: nil, bg_color: nil)
<<~HTML.chomp.html_safe
<span
class="gl-label-text #{css_class}"
class="#{css_class}"
data-container="body"
data-html="true"
#{"style=\"background-color: #{bg_color}\"" if bg_color}
......
......@@ -13,11 +13,11 @@ module EE
render_label_text(
label.scoped_label_key,
css_class: text_color_class_for_bg(label.color),
css_class: "gl-label-text #{text_color_class_for_bg(label.color)}",
bg_color: label.color
) + render_label_text(
label.scoped_label_value,
css_class: ('gl-label-text-dark' if light_color?(label.color)),
css_class: "gl-label-text-scoped #{('gl-label-text-dark' if light_color?(label.color))}",
suffix: suffix
)
end
......
---
title: Fix scoped labels padding
merge_request: 44044
author:
type: fixed
......@@ -18,7 +18,7 @@ RSpec.describe Banzai::Filter::LabelReferenceFilter do
let(:doc) { reference_filter("See #{scoped_label.to_reference}") }
it 'renders scoped label' do
expect(doc.css('.gl-label-scoped .gl-label-text').map(&:text)).to eq([scoped_label.scoped_label_key, scoped_label.scoped_label_value])
expect(doc.css('.gl-label-scoped').text).to eq(scoped_label.scoped_label_key + scoped_label.scoped_label_value)
end
it 'renders HTML tooltips' do
......
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