aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/dash/app/pal/news/layout.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-07-21 13:40:50 +0200
committerTibor Frank <tifrank@cisco.com>2022-07-21 13:40:50 +0200
commitaa9f6d2b4d417b439e2953a9c82c31b0d561f632 (patch)
tree39e7ec4ed6199b332ae7ab5ac59510e677e1e144 /resources/tools/dash/app/pal/news/layout.py
parentae1fe880286d7b0414664bce2b2c7c91c3f543f3 (diff)
UTI: Move common functions to utils.
Change-Id: Ic390359afcea7855a964f8f9793f6d17a5b9b616 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/news/layout.py')
-rw-r--r--resources/tools/dash/app/pal/news/layout.py47
1 files changed, 5 insertions, 42 deletions
diff --git a/resources/tools/dash/app/pal/news/layout.py b/resources/tools/dash/app/pal/news/layout.py
index c9f2808a14..6743b5a33c 100644
--- a/resources/tools/dash/app/pal/news/layout.py
+++ b/resources/tools/dash/app/pal/news/layout.py
@@ -28,7 +28,7 @@ from copy import deepcopy
from ..data.data import Data
from ..utils.constants import Constants as C
-from ..utils.utils import classify_anomalies
+from ..utils.utils import classify_anomalies, show_tooltip
from ..data.data import Data
from .tables import table_news
@@ -389,43 +389,6 @@ class Layout:
lst_job[1], lst_job[3], lst_job[4]))
}
- def _show_tooltip(self, id: str, title: str,
- clipboard_id: str=None) -> list:
- """Generate list of elements to display a text (e.g. a title) with a
- tooltip and optionaly with Copy&Paste icon and the clipboard
- functionality enabled.
-
- :param id: Tooltip ID.
- :param title: A text for which the tooltip will be displayed.
- :param clipboard_id: If defined, a Copy&Paste icon is displayed and the
- clipboard functionality is enabled.
- :type id: str
- :type title: str
- :type clipboard_id: str
- :returns: List of elements to display a text with a tooltip and
- optionaly with Copy&Paste icon.
- :rtype: list
- """
-
- return [
- dcc.Clipboard(target_id=clipboard_id, title="Copy URL") \
- if clipboard_id else str(),
- f"{title} ",
- dbc.Badge(
- id=id,
- children="?",
- pill=True,
- color="white",
- text_color="info",
- class_name="border ms-1",
- ),
- dbc.Tooltip(
- children=self._tooltips.get(id, str()),
- target=id,
- placement="auto"
- )
- ]
-
def add_content(self):
"""Top level method which generated the web page.
@@ -552,7 +515,7 @@ class Layout:
children=[
dbc.Label(
class_name="p-0",
- children=self._show_tooltip(
+ children=show_tooltip(self._tooltips,
"help-dut", "Device under Test")
),
dbc.Row(
@@ -570,7 +533,7 @@ class Layout:
children=[
dbc.Label(
class_name="p-0",
- children=self._show_tooltip(
+ children=show_tooltip(self._tooltips,
"help-ttype", "Test Type"),
),
dbc.RadioItems(
@@ -586,7 +549,7 @@ class Layout:
children=[
dbc.Label(
class_name="p-0",
- children=self._show_tooltip(
+ children=show_tooltip(self._tooltips,
"help-cadence", "Cadence"),
),
dbc.RadioItems(
@@ -602,7 +565,7 @@ class Layout:
children=[
dbc.Label(
class_name="p-0",
- children=self._show_tooltip(
+ children=show_tooltip(self._tooltips,
"help-tbed", "Test Bed"),
),
dbc.Select(