🐛 fix(types.py): add missing error field to component template in build_invalid_menu function
🐛 fix(base.py): add missing error field to FrontendNode class to match the template structure
This commit is contained in:
parent
6bf7612292
commit
36772dac99
2 changed files with 4 additions and 1 deletions
|
|
@ -305,8 +305,8 @@ def load_files_from_path(path: str):
|
||||||
def build_and_validate_all_files(reader, file_list):
|
def build_and_validate_all_files(reader, file_list):
|
||||||
"""Build and validate all files"""
|
"""Build and validate all files"""
|
||||||
data = reader.build_component_menu_list(file_list)
|
data = reader.build_component_menu_list(file_list)
|
||||||
valid_components = reader.filter_loaded_components(data=data, with_errors=False)
|
|
||||||
|
|
||||||
|
valid_components = reader.filter_loaded_components(data=data, with_errors=False)
|
||||||
invalid_components = reader.filter_loaded_components(data=data, with_errors=True)
|
invalid_components = reader.filter_loaded_components(data=data, with_errors=True)
|
||||||
|
|
||||||
return valid_components, invalid_components
|
return valid_components, invalid_components
|
||||||
|
|
@ -359,6 +359,7 @@ def build_invalid_menu(invalid_components):
|
||||||
.get(type(CustomComponent()).__name__)
|
.get(type(CustomComponent()).__name__)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
component_template["error"] = component.get("error", "")
|
||||||
component_template.get("template").get("code")["value"] = component_code
|
component_template.get("template").get("code")["value"] = component_code
|
||||||
|
|
||||||
invalid_menu[menu_name][component_name] = component_template
|
invalid_menu[menu_name][component_name] = component_template
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ class FrontendNode(BaseModel):
|
||||||
output_types: List[str] = []
|
output_types: List[str] = []
|
||||||
field_formatters: FieldFormatters = Field(default_factory=FieldFormatters)
|
field_formatters: FieldFormatters = Field(default_factory=FieldFormatters)
|
||||||
beta: bool = False
|
beta: bool = False
|
||||||
|
error: str = ""
|
||||||
|
|
||||||
# field formatters is an instance attribute but it is not used in the class
|
# field formatters is an instance attribute but it is not used in the class
|
||||||
# so we need to create a method to get it
|
# so we need to create a method to get it
|
||||||
|
|
@ -85,6 +86,7 @@ class FrontendNode(BaseModel):
|
||||||
"output_types": self.output_types,
|
"output_types": self.output_types,
|
||||||
"documentation": self.documentation,
|
"documentation": self.documentation,
|
||||||
"beta": self.beta,
|
"beta": self.beta,
|
||||||
|
"error": self.error,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue