Commit 6ab48131 authored by Philipp Siegmantel's avatar Philipp Siegmantel
Browse files

13947 FIX Add blank seperator to dashboard tooltips

On some dashboard tooltips there was a space missing between the two words of the tootltip.
It is now correctly sperated.
For example, the tooltip will now display "Namespace my-namespace" instead of "Namespacemy-namespace".

Change-Id: I4079eb836d0f6c84c0c14cf0a798bed66ab14c91
parent c08587a5
Title: Add blank seperator to dashboard tooltips
Class: fix
Compatible: compat
Component: multisite
Date: 1652262782
Edition: cre
Knowledge: doc
Level: 1
State: unknown
Version: 2.2.0i1
On some dashboard tooltips there was a space missing between the two words of the tootltip.
It is now correctly sperated.
For example, the tooltip will now display "Namespace my-namespace" instead of "Namespacemy-namespace".
......@@ -2219,7 +2219,7 @@ class Cell:
tooltip_cell = Cell(self._view, PainterSpec(self.tooltip_painter_name()))
_tooltip_tdclass, tooltip_content = tooltip_cell.render_content(row)
assert not isinstance(tooltip_content, Mapping)
tooltip_text = escaping.strip_tags(tooltip_content)
tooltip_text = escaping.strip_tags_for_tooltip(tooltip_content)
if tooltip_text:
content = HTMLWriter.render_span(content, title=tooltip_text)
......
......@@ -283,3 +283,16 @@ def strip_tags(ht: EscapableEntity) -> str:
string = _TAG_RE.sub("", string)
if string == prev:
return string
def strip_tags_for_tooltip(ht: EscapableEntity) -> str:
string = str(ht)
# Some painters render table and cell tags that would be stripped away in the next step and
# result in the content of tables being joined together to a single word.
# We replace the tags here with spaces to prevent that.
#
# For the moment we keep it simple and only fix the special case we stumbled upon.
# In the future it might be better to find a more generic approach
# that solves the problem for different tag combinations.
string = string.replace("</th><td>", " ")
return strip_tags(string)
Supports Markdown
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