Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier Settings for Tray publisher addon #44

Merged
merged 14 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions server/settings/creator_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ColumnItemModel(BaseSettingsModel):
asset is parsed from file names ('asset.mov', 'asset_v001.mov',
'my_asset_to_publish.mov')"""

_layout = "expanded"
name: str = SettingsField(
title="Name",
default=""
Expand Down Expand Up @@ -89,6 +90,7 @@ class RepresentationItemModel(BaseSettingsModel):
('asset.mov', 'asset_v001.mov', 'my_asset_to_publish.mov')
"""

_layout = "expanded"
name: str = SettingsField(
title="Name",
default=""
Expand Down Expand Up @@ -134,7 +136,7 @@ def validate_unique_outputs(cls, value):


class FolderTypeRegexItem(BaseSettingsModel):
_layout = "expanded"
_layout = "compact"
regex: str = SettingsField("", title="Folder Regex")
folder_type: str = SettingsField(
"Folder",
Expand All @@ -146,7 +148,7 @@ class FolderTypeRegexItem(BaseSettingsModel):


class TaskTypeRegexItem(BaseSettingsModel):
_layout = "expanded"
_layout = "compact"
regex: str = SettingsField("", title="Task Regex")
task_type: str = SettingsField(
"",
Expand All @@ -164,39 +166,37 @@ class FolderCreationConfigModel(BaseSettingsModel):
title="Enabled folder creation",
default=False,
)

folder_type_regexes: list[FolderTypeRegexItem] = SettingsField(
default_factory=FolderTypeRegexItem,
description=(
"Using Regex expressions to create missing folders. \nThose can be used"
" to define which folder types are used for new folder creation"
" depending on their names."
)
)

folder_create_type: str = SettingsField(
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
"Folder",
title="Default Folder Type",
enum_resolver=folder_types_enum,
description=(
"Default folder type for new folder(s) creation."),
section="Folder Settings"
)

task_type_regexes: list[TaskTypeRegexItem] = SettingsField(
default_factory=TaskTypeRegexItem,
folder_type_regexes: list[FolderTypeRegexItem] = SettingsField(
default_factory=FolderTypeRegexItem,
description=(
"Using Regex expressions to create missing tasks. \nThose can be used"
" to define which task types are used for new folder+task creation"
"Using Regex expressions to create missing folders. \nThose can be used"
" to define which folder types are used for new folder creation"
" depending on their names."
)
)

task_create_type: str = SettingsField(
"",
title="Default Task Type",
enum_resolver=task_types_enum,
description=(
"Default task type for new task(s) creation."),
section="Task Settings"
)
task_type_regexes: list[TaskTypeRegexItem] = SettingsField(
default_factory=TaskTypeRegexItem,
description=(
"Using Regex expressions to create missing tasks. \nThose can be used"
" to define which task types are used for new folder+task creation"
" depending on their names."
)
)


Expand Down
6 changes: 4 additions & 2 deletions server/settings/editorial_creators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@


class ClipNameTokenizerItem(BaseSettingsModel):
_layout = "expanded"
_layout = "compact"
name: str = SettingsField("", title="Tokenizer name")
regex: str = SettingsField("", title="Tokenizer regex")


class ShotAddTasksItem(BaseSettingsModel):
_layout = "expanded"
_layout = "compact"
name: str = SettingsField('', title="Key")
task_type: str = SettingsField(
title="Task type",
Expand All @@ -37,6 +37,7 @@ class ShotRenameSubmodel(BaseSettingsModel):


class TokenToParentConvertorItem(BaseSettingsModel):
_layout = "compact"
# TODO - was 'type' must be renamed in code to `parent_type`
parent_type: str = SettingsField(
"Project",
Expand Down Expand Up @@ -75,6 +76,7 @@ class ShotHierarchySubmodel(BaseSettingsModel):


class ProductTypePresetItem(BaseSettingsModel):
_layout="compact"
product_type: str = SettingsField("", title="Product type")
# TODO add placeholder '< Inherited >'
variant: str = SettingsField("", title="Variant")
Expand Down
2 changes: 1 addition & 1 deletion server/settings/simple_creators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class SimpleCreatorPlugin(BaseSettingsModel):
_layout = "expanded"
Copy link
Member

@iLLiCiTiT iLLiCiTiT Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should stay there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, Expanded layout in this setting is very confusing. it's very hard for me to go through it.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried updating the setting group name with label but that was not recommended because admins are allowed to leave the label blank.

Also, I tried updating the setting group name with product_type but AYON server ignored the name in favor of the label.
https://discord.com/channels/517362899170230292/773127690453516298/1313448327903445012

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you've tried to change, but then reverted, so this should be reverted too. It was bad before, now it is worse...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create another PR this afternoon.


product_type: str = SettingsField("", title="Product type")
# TODO add placeholder
identifier: str = SettingsField("", title="Identifier")
Expand Down
Loading