Skip to content

Commit

Permalink
fix-empty-categories
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-aws committed Nov 10, 2023
1 parent 8549fe7 commit 73d19f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cid/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,16 @@ def _deploy(self, dashboard_id: str=None, recursive=True, update=False, **kwargs
dashboard_options = {}
for category in categories:
dashboard_options[f'{category.upper()}'] = '[category]'
counter = 0
for dashboard in self.resources.get('dashboards').values():
if dashboard.get('deprecationNotice'):
continue
if dashboard.get('category', 'Other') == category:
check = '✓' if dashboard.get('dashboardId') in self.qs.dashboards else ' '
dashboard_options[f" {check}[{dashboard.get('dashboardId')}] {dashboard.get('name')}"] = dashboard.get('dashboardId')
counter += 1
if not counter: # remove empty categories
del dashboard_options[f'{category.upper()}']
while True:
dashboard_id = get_parameter(
param_name='dashboard-id',
Expand Down

0 comments on commit 73d19f7

Please sign in to comment.