mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
change settings for better readability
This commit is contained in:
parent
d812395af9
commit
2eecac36da
2 changed files with 19 additions and 2 deletions
|
|
@ -478,8 +478,12 @@ class LoaderController(BackendLoaderController, FrontendLoaderController):
|
|||
}
|
||||
)
|
||||
if profile:
|
||||
# TODO remove 'is_include' after release '0.4.3'
|
||||
is_allow_list = profile.get("is_include")
|
||||
if is_allow_list is None:
|
||||
is_allow_list = profile["filter_type"] == "is_allow_list"
|
||||
output = ProductTypesFilter(
|
||||
is_allow_list=profile["is_include"],
|
||||
is_allow_list=is_allow_list,
|
||||
product_types=profile["filter_product_types"]
|
||||
)
|
||||
return output
|
||||
|
|
|
|||
|
|
@ -222,6 +222,13 @@ def _product_types_enum():
|
|||
]
|
||||
|
||||
|
||||
def filter_type_enum():
|
||||
return [
|
||||
{"value": "is_allow_list", "label": "Allow list"},
|
||||
{"value": "is_deny_list", "label": "Deny list"},
|
||||
]
|
||||
|
||||
|
||||
class LoaderProductTypeFilterProfile(BaseSettingsModel):
|
||||
_layout = "expanded"
|
||||
# TODO this should use hosts enum
|
||||
|
|
@ -231,9 +238,15 @@ class LoaderProductTypeFilterProfile(BaseSettingsModel):
|
|||
title="Task types",
|
||||
enum_resolver=task_types_enum
|
||||
)
|
||||
is_include: bool = SettingsField(True, title="Exclude / Include")
|
||||
filter_type: str = SettingsField(
|
||||
"is_allow_list",
|
||||
title="Filter type",
|
||||
section="Product type filter",
|
||||
enum_resolver=filter_type_enum
|
||||
)
|
||||
filter_product_types: list[str] = SettingsField(
|
||||
default_factory=list,
|
||||
title="Product types",
|
||||
enum_resolver=_product_types_enum
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue