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 ...@@ -61,7 +61,7 @@ module LabelsHelper
render_label_text( render_label_text(
label.name, label.name,
suffix: suffix, 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 bg_color: label.color
) )
end end
...@@ -281,7 +281,7 @@ module LabelsHelper ...@@ -281,7 +281,7 @@ module LabelsHelper
def render_label_text(name, suffix: '', css_class: nil, bg_color: nil) def render_label_text(name, suffix: '', css_class: nil, bg_color: nil)
<<~HTML.chomp.html_safe <<~HTML.chomp.html_safe
<span <span
class="gl-label-text #{css_class}" class="#{css_class}"
data-container="body" data-container="body"
data-html="true" data-html="true"
#{"style=\"background-color: #{bg_color}\"" if bg_color} #{"style=\"background-color: #{bg_color}\"" if bg_color}
......
...@@ -13,11 +13,11 @@ module EE ...@@ -13,11 +13,11 @@ module EE
render_label_text( render_label_text(
label.scoped_label_key, 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 bg_color: label.color
) + render_label_text( ) + render_label_text(
label.scoped_label_value, 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 suffix: suffix
) )
end end
......
---
title: Fix scoped labels padding
merge_request: 44044
author:
type: fixed
...@@ -18,7 +18,7 @@ RSpec.describe Banzai::Filter::LabelReferenceFilter do ...@@ -18,7 +18,7 @@ RSpec.describe Banzai::Filter::LabelReferenceFilter do
let(:doc) { reference_filter("See #{scoped_label.to_reference}") } let(:doc) { reference_filter("See #{scoped_label.to_reference}") }
it 'renders scoped label' do 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 end
it 'renders HTML tooltips' do 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