aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/dash/app/pal/news/tables.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-09-13 12:55:42 +0200
committerTibor Frank <tifrank@cisco.com>2022-09-13 11:44:22 +0000
commit8d85a976dc8bd2c960044b32e830eb97f63f5ffe (patch)
tree2468e9df6437d897d2a63436e7d72d6a39bae729 /resources/tools/dash/app/pal/news/tables.py
parent086b0449501bc4eb51cd617f28dd50e04326878a (diff)
UTI: Simplify the News
Change-Id: I790674b7c99bfdf3056a8e9209a3ca1617f4984a Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/news/tables.py')
-rw-r--r--resources/tools/dash/app/pal/news/tables.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/resources/tools/dash/app/pal/news/tables.py b/resources/tools/dash/app/pal/news/tables.py
index 04b4fc975e..7c0cc66eda 100644
--- a/resources/tools/dash/app/pal/news/tables.py
+++ b/resources/tools/dash/app/pal/news/tables.py
@@ -18,9 +18,6 @@ import pandas as pd
import dash_bootstrap_components as dbc
from datetime import datetime, timedelta
-from dash import html
-
-from ..utils.constants import Constants as C
def _table_info(job_data: pd.DataFrame) -> dbc.Table:
@@ -149,22 +146,31 @@ def table_news(data: pd.DataFrame, job: str, period: int) -> list:
return r_list
-def table_summary(data: pd.DataFrame, jobs: list) -> list:
+def table_summary(data: pd.DataFrame, jobs: list, period: int) -> list:
"""Generates summary (failed tests, regressions and progressions) from the
last week.
:param data: Trending data with calculated annomalies to be displayed in the
tables.
:param jobs: List of jobs.
+ :params period: The time period for the summary table.
:type data: pandas.DataFrame
:type job: str
+ :type period: int
:returns: List of tables.
:rtype: list
"""
- r_list = list()
- for job in jobs:
- r_list.extend(table_news(data, job, C.NEWS_SUMMARY_PERIOD))
- r_list.append(html.Div(html.P(" ")))
-
- return r_list
+ return [
+ dbc.Accordion(
+ children=[
+ dbc.AccordionItem(
+ title=job,
+ children=table_news(data, job, period)
+ ) for job in jobs
+ ],
+ class_name="gy-2 p-0",
+ start_collapsed=True,
+ always_open=True
+ )
+ ]