Skip to content

Commit 2738cfd

Browse files
authored
feat(dashboard): add Description and markdown support (#8667)
1 parent 265c3d8 commit 2738cfd

File tree

3 files changed

+101
-17
lines changed

3 files changed

+101
-17
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* Override Tailwind CSS reset for markdown content */
2+
.markdown-content ul {
3+
list-style: disc !important;
4+
margin-left: 20px !important;
5+
padding-left: 10px !important;
6+
margin-bottom: 8px !important;
7+
}
8+
9+
.markdown-content ol {
10+
list-style: decimal !important;
11+
margin-left: 20px !important;
12+
padding-left: 10px !important;
13+
margin-bottom: 8px !important;
14+
}
15+
16+
.markdown-content li {
17+
margin-bottom: 4px !important;
18+
display: list-item !important;
19+
}
20+
21+
.markdown-content p {
22+
margin-bottom: 8px !important;
23+
}
24+
25+
/* Ensure nested lists work properly */
26+
.markdown-content ul ul {
27+
margin-top: 4px !important;
28+
margin-bottom: 4px !important;
29+
}
30+
31+
.markdown-content ol ol {
32+
margin-top: 4px !important;
33+
margin-bottom: 4px !important;
34+
}

dashboard/pages/overview.py

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,39 @@ def generate_table(data, index, color_mapping_severity, color_mapping_status):
16541654
[
16551655
html.Div(
16561656
[
1657+
# Description as first details item
1658+
html.Div(
1659+
[
1660+
html.P(
1661+
html.Strong(
1662+
"Description: ",
1663+
style={
1664+
"margin-bottom": "8px"
1665+
},
1666+
)
1667+
),
1668+
html.Div(
1669+
dcc.Markdown(
1670+
str(
1671+
data.get(
1672+
"DESCRIPTION",
1673+
"",
1674+
)
1675+
),
1676+
dangerously_allow_html=True,
1677+
style={
1678+
"margin-left": "0px",
1679+
"padding-left": "10px",
1680+
},
1681+
),
1682+
className="markdown-content",
1683+
style={
1684+
"margin-left": "0px",
1685+
"padding-left": "10px",
1686+
},
1687+
),
1688+
],
1689+
),
16571690
html.Div(
16581691
[
16591692
html.P(
@@ -1793,19 +1826,27 @@ def generate_table(data, index, color_mapping_severity, color_mapping_status):
17931826
html.P(
17941827
html.Strong(
17951828
"Risk: ",
1796-
style={
1797-
"margin-right": "5px"
1798-
},
1829+
style={},
17991830
)
18001831
),
1801-
html.P(
1802-
str(data.get("RISK", "")),
1832+
html.Div(
1833+
dcc.Markdown(
1834+
str(
1835+
data.get("RISK", "")
1836+
),
1837+
dangerously_allow_html=True,
1838+
style={
1839+
"margin-left": "0px",
1840+
"padding-left": "10px",
1841+
},
1842+
),
1843+
className="markdown-content",
18031844
style={
1804-
"margin-left": "5px"
1845+
"margin-left": "0px",
1846+
"padding-left": "10px",
18051847
},
18061848
),
18071849
],
1808-
style={"display": "flex"},
18091850
),
18101851
html.Div(
18111852
[
@@ -1847,23 +1888,32 @@ def generate_table(data, index, color_mapping_severity, color_mapping_status):
18471888
html.Strong(
18481889
"Recommendation: ",
18491890
style={
1850-
"margin-right": "5px"
1891+
"margin-bottom": "8px"
18511892
},
18521893
)
18531894
),
1854-
html.P(
1855-
str(
1856-
data.get(
1857-
"REMEDIATION_RECOMMENDATION_TEXT",
1858-
"",
1859-
)
1895+
html.Div(
1896+
dcc.Markdown(
1897+
str(
1898+
data.get(
1899+
"REMEDIATION_RECOMMENDATION_TEXT",
1900+
"",
1901+
)
1902+
),
1903+
dangerously_allow_html=True,
1904+
style={
1905+
"margin-left": "0px",
1906+
"padding-left": "10px",
1907+
},
18601908
),
1909+
className="markdown-content",
18611910
style={
1862-
"margin-left": "5px"
1911+
"margin-left": "0px",
1912+
"padding-left": "10px",
18631913
},
18641914
),
18651915
],
1866-
style={"display": "flex"},
1916+
style={"margin-bottom": "15px"},
18671917
),
18681918
html.Div(
18691919
[

prowler/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
55
## [v5.13.0] (Prowler UNRELEASED)
66

77
### Added
8-
8+
- Support for markdown metadata fields in Dashboard [(#8667)](https://github.com/prowler-cloud/prowler/pull/8667)
99
### Changed
1010

1111
### Fixed

0 commit comments

Comments
 (0)