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

refactor: refactor enum field in plugin metadata #376

Merged
merged 1 commit into from
Jun 16, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def _generate_tabs(self, tabs_meta: list) -> dict:
del inner_tab_meta["root_path"]

if "sort" in inner_tab_meta:
inner_dynamic_view["options"]["default_sort"] = (
self._generate_sort(inner_tab_meta["sort"])
)
inner_dynamic_view["options"][
"default_sort"
] = self._generate_sort(inner_tab_meta["sort"])

if "root_path" in inner_tab_meta:
inner_dynamic_view["options"]["root_path"] = inner_tab_meta[
Expand Down Expand Up @@ -148,7 +148,6 @@ def _generate_sort(table: dict) -> dict:
def _generate_fields(self, fields: list) -> list:
gen_fields = []
for field in fields:

if "type" not in field:
gen_fields.append(self._generate_text_field(field))

Expand Down Expand Up @@ -433,6 +432,10 @@ def _generate_enum_field(self, field: dict) -> dict:
field=enum, is_enum=True
)

if "name" in enum:
enums[main_key]["name"] = enum["name"]
del enum["name"]

if "options" in field:
field["options"].update(enums)
else:
Expand Down
Loading