diff --git a/src/writer/app_runner.py b/src/writer/app_runner.py index e7e7b0e3e..1355474fe 100644 --- a/src/writer/app_runner.py +++ b/src/writer/app_runner.py @@ -19,7 +19,13 @@ from watchdog.observers.polling import PollingObserver from writer import VERSION, audit_and_fix, core_ui, wf_project -from writer.core import Config, EventHandlerRegistry, MiddlewareRegistry, WriterSession, use_request_context +from writer.core import ( + Config, + EventHandlerRegistry, + MiddlewareRegistry, + WriterSession, + use_request_context, +) from writer.core_ui import ingest_bmc_component_tree from writer.ss_types import ( AppProcessServerRequest, diff --git a/src/writer/core_ui.py b/src/writer/core_ui.py index 9997b4000..ca413c2d1 100644 --- a/src/writer/core_ui.py +++ b/src/writer/core_ui.py @@ -448,7 +448,17 @@ def export_component_tree(component_tree: ComponentTree, mode: ServeMode, only_u if only_update is True and component_tree.updated is False: return None - return component_tree.to_dict() + roots = ['root'] + if mode == "edit": + roots.append('workflows_root') + + _components: List[Component] = [] + for root in roots: + _root_component = cast(Component, component_tree.get_component(root)) + _components.append(_root_component) + _components += component_tree.get_descendents(root) + + return {c.id: c.to_dict() for c in _components} class UIError(Exception): ...