added settings for the attribute collector

This commit is contained in:
Jakub Trllo 2022-12-05 19:29:01 +01:00
parent f7f5019401
commit fd5ac3be1b
3 changed files with 41 additions and 2 deletions

View file

@ -35,12 +35,26 @@ class CollectInstanceCommentDef(
label = "Comment per instance"
targets = ["local"]
# Disable plugin by default
families = ["*"]
enabled = True
families = []
enabled = False
def process(self, instance):
pass
@classmethod
def apply_settings(cls, project_setting, _):
plugin_settings = project_setting["global"]["publish"].get(
"collect_comment_per_instance"
)
if not plugin_settings:
return
if plugin_settings.get("enabled") is not None:
cls.enabled = plugin_settings["enabled"]
if plugin_settings.get("families") is not None:
cls.families = plugin_settings["families"]
@classmethod
def get_attribute_defs(cls):
return [

View file

@ -24,6 +24,10 @@
],
"skip_hosts_headless_publish": []
},
"collect_comment_per_instance": {
"enabled": false,
"families": []
},
"ValidateEditorialAssetName": {
"enabled": true,
"optional": false

View file

@ -60,6 +60,27 @@
}
]
},
{
"type": "dict",
"collapsible": true,
"key": "collect_comment_per_instance",
"label": "Collect comment per instance",
"checkbox_key": "enabled",
"is_group": true,
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"key": "families",
"label": "Families",
"type": "list",
"object_type": "text"
}
]
},
{
"type": "dict",
"collapsible": true,