Update field_order to be an optional list
This commit is contained in:
parent
0e30d7b12b
commit
c456306f8e
1 changed files with 4 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ class CustomComponent(Component):
|
|||
"""The code of the component. Defaults to None."""
|
||||
field_config: dict = {}
|
||||
"""The field configuration of the component. Defaults to an empty dictionary."""
|
||||
field_order: List[str] = []
|
||||
field_order: Optional[List[str]] = None
|
||||
"""The field order of the component. Defaults to an empty list."""
|
||||
code_class_base_inheritance: ClassVar[str] = "CustomComponent"
|
||||
function_entrypoint_name: ClassVar[str] = "build"
|
||||
|
|
@ -64,6 +64,9 @@ class CustomComponent(Component):
|
|||
flow_id, file_name = path.split("/", 1)
|
||||
return storage_svc.build_full_path(flow_id, file_name)
|
||||
|
||||
def _get_field_order(self):
|
||||
return self.field_order or list(self.field_config.keys())
|
||||
|
||||
def custom_repr(self):
|
||||
if self.repr_value == "":
|
||||
self.repr_value = self.status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue