backups panels show only when the asset has data
This commit is contained in:
@@ -91,7 +91,7 @@ class BackupsPlugin(BasePlugin):
|
||||
panels = [kind.infopanel() for kind in REGISTRY.values()
|
||||
if kind.infopanel()]
|
||||
for position, kind in enumerate(REGISTRY.values()):
|
||||
panels.append({
|
||||
panel = {
|
||||
'id': 'backups-{}'.format(kind.key),
|
||||
'title': kind.displayname,
|
||||
'assettypes': list(kind.assettypes),
|
||||
@@ -105,7 +105,6 @@ class BackupsPlugin(BasePlugin):
|
||||
{'key': 'shorthash', 'label': 'Hash', 'mono': True},
|
||||
],
|
||||
},
|
||||
'empty': kind.emptytext,
|
||||
# The generic renderer has no per-item actions, and downloading
|
||||
# a .reg needs a per-revision control plus a dialect choice, so
|
||||
# the panel links to the plugin's own history view instead.
|
||||
@@ -115,7 +114,16 @@ class BackupsPlugin(BasePlugin):
|
||||
'emptylabel': 'View history',
|
||||
},
|
||||
'position': 40 + position,
|
||||
})
|
||||
}
|
||||
# OMIT 'empty' entirely unless the kind sets it. The list renderer
|
||||
# shows a panel when it has rows OR declares empty text, so a
|
||||
# present-but-null 'empty' would still render the panel on every
|
||||
# asset of the type. Most machines are not part markers and never
|
||||
# will be, so that panel must disappear rather than announce it has
|
||||
# nothing.
|
||||
if kind.emptytext:
|
||||
panel['empty'] = kind.emptytext
|
||||
panels.append(panel)
|
||||
return panels
|
||||
|
||||
def get_settings_defaults(self) -> List[Dict]:
|
||||
|
||||
Reference in New Issue
Block a user