Skip to content

Commit

Permalink
add labels back
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrodes committed Sep 19, 2024
1 parent 1267d3f commit b358499
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions apps/wizard/app_pages/chart_diff/chart_diff_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@
gm.ChartStatus.APPROVED.value: {
"label": "Approve",
"color": "green",
# "icon": ":material/done_outline:",
"icon": "✅",
},
gm.ChartStatus.REJECTED.value: {
"label": "Reject",
"color": "red",
# "icon": ":material/delete:",
"icon": "❌",
},
gm.ChartStatus.PENDING.value: {
"label": "Pending",
"color": "gray",
# "icon": ":material/schedule:",
"icon": "⏳",
},
}
Expand Down Expand Up @@ -89,20 +92,20 @@ def box_label(self):
This contains the state of the approval (by means of an emoji), the slug of the chart, and any tags (like "NEW" or "DRAFT").
"""
label = self.diff.slug
label = f"{self.diff.slug} "
tags = []
if self.diff.is_new:
tags.append(" :blue-background[**NEW**]")
tags.append(" :blue-background[:material/grade: **NEW**]")
if self.diff.is_draft:
tags.append(" :gray-background[**DRAFT**]")
tags.append(" :gray-background[:material/draft: **DRAFT**]")
for change in self.diff.change_types:
tags.append(f":red-background[**{change.upper()} CHANGE**]")
tags.append(f":red-background[:material/refresh: **{change.upper()} CHANGE**]")

# Add TAG if modified and no change_types is provided
if (self.diff.is_modified) and (tags == []):
label += ":break[:rainbow-background[**UNKNOWN -- REPORT THIS**]]"
label += ":rainbow-background[**UNKNOWN -- REPORT THIS**]"
else:
label += f":break[{' '.join(tags)}]"
label += f"{' '.join(tags)}"
return label

@property
Expand Down Expand Up @@ -497,7 +500,7 @@ def _show(self) -> None:

# SHOW MODIFIED CHART
if self.diff.is_modified:
tab1, tab2, tab3 = st.tabs(["Charts", "Config diff", "Change history"])
tab1, tab2, tab3 = st.tabs(["Charts", "Config diff", "Status log"])
with tab1:
self._show_chart_comparison()
with tab2:
Expand All @@ -507,7 +510,7 @@ def _show(self) -> None:

# SHOW NEW CHART
elif self.diff.is_new:
tab1, tab2 = st.tabs(["Chart", "Change history"])
tab1, tab2 = st.tabs(["Chart", "Status log"])
with tab1:
self._show_chart_comparison()
with tab2:
Expand Down

0 comments on commit b358499

Please sign in to comment.