Feat(uti): Last failed tests
[csit.git] / resources / tools / dash / app / pal / report / layout.py
index ef98b7b..081a0fd 100644 (file)
@@ -23,14 +23,10 @@ from dash import dcc
 from dash import html
 from dash import callback_context, no_update, ALL
 from dash import Input, Output, State
-from dash.exceptions import PreventUpdate
 from yaml import load, FullLoader, YAMLError
 from copy import deepcopy
-from json import loads, JSONDecodeError
 from ast import literal_eval
 
-from pprint import pformat
-
 from ..data.data import Data
 from ..data.url_processing import url_decode, url_encode
 from .graphs import graph_iterative, table_comparison, get_short_version
@@ -102,10 +98,10 @@ class Layout:
         self._data = pd.DataFrame()
         for rls in releases:
             data_mrr = Data(self._data_spec_file, True).\
-                read_iterative_mrr(release=rls)
+                read_iterative_mrr(release=rls.replace("csit", "rls"))
             data_mrr["release"] = rls
             data_ndrpdr = Data(self._data_spec_file, True).\
-                read_iterative_ndrpdr(release=rls)
+                read_iterative_ndrpdr(release=rls.replace("csit", "rls"))
             data_ndrpdr["release"] = rls
             self._data = pd.concat(
                 [self._data, data_mrr, data_ndrpdr], ignore_index=True)
@@ -415,7 +411,7 @@ class Layout:
                             [
                                 dbc.InputGroupText(
                                     children=self._show_tooltip(
-                                        "help-release", "Release")
+                                        "help-release", "CSIT Release")
                                 ),
                                 dbc.Select(
                                     id="dd-ctrl-rls",
@@ -662,7 +658,7 @@ class Layout:
                             id="cl-selected",
                             options=[],
                             inline=False,
-                            style={"max-height": "12em"},
+                            style={"max-height": "20em"},
                         )
                     ],
                 ),
@@ -1003,7 +999,7 @@ class Layout:
                     "cl-testtype-all-value": list(),
                     "cl-testtype-all-options": self.CL_ALL_DISABLED
                 })
-            if trigger_id == "dd-ctrl-dut":
+            elif trigger_id == "dd-ctrl-dut":
                 try:
                     rls = ctrl_panel.get("dd-rls-value")
                     dut = self.spec_tbs[rls][dd_dut]
@@ -1374,77 +1370,6 @@ class Layout:
             ret_val.extend(ctrl_panel.values())
             return ret_val
 
-        # @app.callback(
-        #     Output("metadata-tput-lat", "children"),
-        #     Output("metadata-hdrh-graph", "children"),
-        #     Output("offcanvas-metadata", "is_open"),
-        #     Input({"type": "graph", "index": ALL}, "clickData"),
-        #     prevent_initial_call=True
-        # )
-        # def _show_metadata_from_graphs(graph_data: dict) -> tuple:
-        #     """
-        #     """
-        #     try:
-        #         trigger_id = loads(
-        #             callback_context.triggered[0]["prop_id"].split(".")[0]
-        #         )["index"]
-        #         idx = 0 if trigger_id == "tput" else 1
-        #         graph_data = graph_data[idx]["points"][0]
-        #     except (JSONDecodeError, IndexError, KeyError, ValueError,
-        #             TypeError):
-        #         raise PreventUpdate
-
-        #     metadata = no_update
-        #     graph = list()
-
-        #     children = [
-        #         dbc.ListGroupItem(
-        #             [dbc.Badge(x.split(":")[0]), x.split(": ")[1]]
-        #         ) for x in graph_data.get("text", "").split("<br>")
-        #     ]
-        #     if trigger_id == "tput":
-        #         title = "Throughput"
-        #     elif trigger_id == "lat":
-        #         title = "Latency"
-        #         hdrh_data = graph_data.get("customdata", None)
-        #         if hdrh_data:
-        #             graph = [dbc.Card(
-        #                 class_name="gy-2 p-0",
-        #                 children=[
-        #                     dbc.CardHeader(hdrh_data.pop("name")),
-        #                     dbc.CardBody(children=[
-        #                         dcc.Graph(
-        #                             id="hdrh-latency-graph",
-        #                             figure=graph_hdrh_latency(
-        #                                 hdrh_data, self.layout
-        #                             )
-        #                         )
-        #                     ])
-        #                 ])
-        #             ]
-        #     metadata = [
-        #         dbc.Card(
-        #             class_name="gy-2 p-0",
-        #             children=[
-        #                 dbc.CardHeader(children=[
-        #                     dcc.Clipboard(
-        #                         target_id="tput-lat-metadata",
-        #                         title="Copy",
-        #                         style={"display": "inline-block"}
-        #                     ),
-        #                     title
-        #                 ]),
-        #                 dbc.CardBody(
-        #                     id="tput-lat-metadata",
-        #                     class_name="p-0",
-        #                     children=[dbc.ListGroup(children, flush=True), ]
-        #                 )
-        #             ]
-        #         )
-        #     ]
-
-        #     return metadata, graph, True
-
         # @app.callback(
         #     Output("download-data", "data"),
         #     State("selected-tests", "data"),