feat(dashboard): Multiple changes in compliance page (#4051)

This commit is contained in:
Pedro Martín
2024-05-21 11:01:40 +02:00
committed by GitHub
parent a9b7fc5e48
commit 921cbb14d6
6 changed files with 40 additions and 17 deletions
+6 -2
View File
@@ -1535,7 +1535,7 @@ def get_section_container_iso(data, section_1, section_2):
return html.Div(section_containers, className="compliance-data-layout")
def get_section_containers_pci(data, section_1):
def get_section_containers_format4(data, section_1):
data["STATUS"] = data["STATUS"].apply(map_status_to_icon)
data[section_1] = data[section_1].astype(str)
@@ -1654,9 +1654,13 @@ def get_section_containers_pci(data, section_1):
)
graph_div_service = html.Div(graph_service, className="graph-section-req")
if "REQUIREMENTS_NAME" not in specific_data.columns:
title_internal = f"{service}"
else:
title_internal = f"{service} - {specific_data['REQUIREMENTS_NAME'].iloc[0]}"
internal_accordion_item = dbc.AccordionItem(
title=service,
title=title_internal,
children=[html.Div([data_table], className="inner-accordion-content")],
)
@@ -0,0 +1,23 @@
import warnings
from dashboard.common_methods import get_section_containers_format1
warnings.filterwarnings("ignore")
def get_table(data):
aux = data[
[
"REQUIREMENTS_ID",
"REQUIREMENTS_ATTRIBUTES_SECTION",
"CHECKID",
"STATUS",
"REGION",
"ACCOUNTID",
"RESOURCEID",
]
].copy()
return get_section_containers_format1(
aux, "REQUIREMENTS_ATTRIBUTES_SECTION", "REQUIREMENTS_ID"
)
+4 -6
View File
@@ -1,6 +1,6 @@
import warnings
from dashboard.common_methods import get_section_containers_format2
from dashboard.common_methods import get_section_containers_format4
warnings.filterwarnings("ignore")
@@ -9,15 +9,13 @@ def get_table(data):
aux = data[
[
"REQUIREMENTS_ID",
"REQUIREMENTS_SUBTECHNIQUES",
"REQUIREMENTS_NAME",
"CHECKID",
"STATUS",
"REGION",
"ACCOUNTID",
"RESOURCEID",
]
].copy()
]
return get_section_containers_format2(
aux, "REQUIREMENTS_ID", "REQUIREMENTS_SUBTECHNIQUES"
)
return get_section_containers_format4(aux, "REQUIREMENTS_ID")
+4 -6
View File
@@ -1,6 +1,6 @@
import warnings
from dashboard.common_methods import get_section_containers_format2
from dashboard.common_methods import get_section_containers_format4
warnings.filterwarnings("ignore")
@@ -9,15 +9,13 @@ def get_table(data):
aux = data[
[
"REQUIREMENTS_ID",
"REQUIREMENTS_SUBTECHNIQUES",
"REQUIREMENTS_NAME",
"CHECKID",
"STATUS",
"REGION",
"ACCOUNTID",
"RESOURCEID",
]
].copy()
]
return get_section_containers_format2(
aux, "REQUIREMENTS_ID", "REQUIREMENTS_SUBTECHNIQUES"
)
return get_section_containers_format4(aux, "REQUIREMENTS_ID")
+2 -2
View File
@@ -1,6 +1,6 @@
import warnings
from dashboard.common_methods import get_section_containers_pci
from dashboard.common_methods import get_section_containers_format4
warnings.filterwarnings("ignore")
@@ -17,4 +17,4 @@ def get_table(data):
]
]
return get_section_containers_pci(aux, "REQUIREMENTS_ID")
return get_section_containers_format4(aux, "REQUIREMENTS_ID")
+1 -1
View File
@@ -474,7 +474,7 @@ def display_data(
overall_status_result_graph = get_graph(pie_1, "Overall Status Result")
security_level_graph = get_graph(
pie_2, f"Top 5 failed {current_filter} by findings"
pie_2, f"Top 5 failed {current_filter} by requirements"
)
return (