🐛 fix(component.py): add support for "documentation" field in template_config to properly handle component documentation

🐛 fix(types.py): update_attributes function now updates frontend_node with "documentation" field from template_config
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-09 15:32:41 -03:00
commit e5e23a1da6
2 changed files with 6 additions and 0 deletions

View file

@ -66,6 +66,9 @@ class Component(BaseModel):
elif "beta" in item_name:
template_config["beta"] = ast.literal_eval(item_value)
elif "documentation" in item_name:
template_config["documentation"] = ast.literal_eval(item_value)
return template_config
def build(self, *args: Any, **kwargs: Any) -> Any:

View file

@ -199,6 +199,9 @@ def update_attributes(frontend_node, template_config):
if "beta" in template_config:
frontend_node["beta"] = template_config["beta"]
if "documentation" in template_config:
frontend_node["documentation"] = template_config["documentation"]
def build_field_config(custom_component: CustomComponent):
"""Build the field configuration for a custom component"""