From a0a7008357e51510e49ecf908d5acce9a1b200d7 Mon Sep 17 00:00:00 2001 From: Fabien Arcellier Date: Tue, 8 Oct 2024 17:36:24 +0200 Subject: [PATCH] feat: prevent workflows tree to be sent during run mode * create default create_default_workflows_root * migrate e2e:presets --- alfred/apps.py | 10 ++++++++++ apps/ai-starter/.wf/components-workflows_root.jsonl | 1 + apps/hello/.wf/components-workflows_root.jsonl | 1 + apps/pdg-tutorial/.wf/components-workflows_root.jsonl | 1 + apps/quickstart/.wf/components-workflows_root.jsonl | 1 + apps/text-demo/.wf/components-workflows_root.jsonl | 1 + src/ui/index.html | 1 + src/writer/app_runner.py | 3 +++ src/writer/wf_project.py | 6 ++++++ .../testbasicauth/.wf/components-workflows_root.jsonl | 1 + .../app1/.wf/components-workflows_root.jsonl | 1 + .../app2/.wf/components-workflows_root.jsonl | 1 + .../2columns/.wf/components-workflows_root.jsonl | 1 + .../presets/2pages/.wf/components-workflows_root.jsonl | 1 + .../empty_page/.wf/components-workflows_root.jsonl | 1 + .../jsonviewer/.wf/components-workflows_root.jsonl | 1 + .../low_code/.wf/components-workflows_root.jsonl | 1 + .../section/.wf/components-workflows_root.jsonl | 1 + .../presets/state/.wf/components-workflows_root.jsonl | 1 + 19 files changed, 35 insertions(+) create mode 100644 apps/ai-starter/.wf/components-workflows_root.jsonl create mode 100644 apps/hello/.wf/components-workflows_root.jsonl create mode 100644 apps/pdg-tutorial/.wf/components-workflows_root.jsonl create mode 100644 apps/quickstart/.wf/components-workflows_root.jsonl create mode 100644 apps/text-demo/.wf/components-workflows_root.jsonl create mode 100644 tests/backend/testbasicauth/.wf/components-workflows_root.jsonl create mode 100644 tests/backend/testmultiapp/app1/.wf/components-workflows_root.jsonl create mode 100644 tests/backend/testmultiapp/app2/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/2columns/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/2pages/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/empty_page/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/jsonviewer/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/low_code/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/section/.wf/components-workflows_root.jsonl create mode 100644 tests/e2e/presets/state/.wf/components-workflows_root.jsonl diff --git a/alfred/apps.py b/alfred/apps.py index 359dcf4aa..1f6d9ae57 100644 --- a/alfred/apps.py +++ b/alfred/apps.py @@ -24,6 +24,13 @@ def apps_update(app: str = None): 'tests/backend/testbasicauth', 'tests/backend/testmultiapp/app1', 'tests/backend/testmultiapp/app2', + 'tests/e2e/presets/2columns', + 'tests/e2e/presets/2pages', + 'tests/e2e/presets/empty_page', + 'tests/e2e/presets/jsonviewer', + 'tests/e2e/presets/low_code', + 'tests/e2e/presets/section', + 'tests/e2e/presets/state', ] for app in apps: @@ -35,6 +42,9 @@ def apps_update(app: str = None): print(f'{app} : migrate ui.json') wf_project.migrate_obsolete_ui_json(abs_path) + if not os.path.isfile(os.path.join(abs_path, ".wf", 'components-workflows_root.jsonl')): + wf_project.create_default_workflows_root(abs_path) + metadata, components = wf_project.read_files(abs_path) if metadata.get('writer_version') == writer.VERSION: print("The app is already up to date") diff --git a/apps/ai-starter/.wf/components-workflows_root.jsonl b/apps/ai-starter/.wf/components-workflows_root.jsonl new file mode 100644 index 000000000..4e9c84ea1 --- /dev/null +++ b/apps/ai-starter/.wf/components-workflows_root.jsonl @@ -0,0 +1 @@ +{"id": "workflows_root", "type": "workflows_root", "content": {}, "isCodeManaged": false, "position": 0, "handlers": {}, "visible": {"expression": true, "binding": "", "reversed": false}} \ No newline at end of file diff --git a/apps/hello/.wf/components-workflows_root.jsonl b/apps/hello/.wf/components-workflows_root.jsonl new file mode 100644 index 000000000..4e9c84ea1 --- /dev/null +++ b/apps/hello/.wf/components-workflows_root.jsonl @@ -0,0 +1 @@ +{"id": "workflows_root", "type": "workflows_root", "content": {}, "isCodeManaged": false, "position": 0, "handlers": {}, "visible": {"expression": true, "binding": "", "reversed": false}} \ No newline at end of file diff --git a/apps/pdg-tutorial/.wf/components-workflows_root.jsonl b/apps/pdg-tutorial/.wf/components-workflows_root.jsonl new file mode 100644 index 000000000..4e9c84ea1 --- /dev/null +++ b/apps/pdg-tutorial/.wf/components-workflows_root.jsonl @@ -0,0 +1 @@ +{"id": "workflows_root", "type": "workflows_root", "content": {}, "isCodeManaged": false, "position": 0, "handlers": {}, "visible": {"expression": true, "binding": "", "reversed": false}} \ No newline at end of file diff --git a/apps/quickstart/.wf/components-workflows_root.jsonl b/apps/quickstart/.wf/components-workflows_root.jsonl new file mode 100644 index 000000000..4e9c84ea1 --- /dev/null +++ b/apps/quickstart/.wf/components-workflows_root.jsonl @@ -0,0 +1 @@ +{"id": "workflows_root", "type": "workflows_root", "content": {}, "isCodeManaged": false, "position": 0, "handlers": {}, "visible": {"expression": true, "binding": "", "reversed": false}} \ No newline at end of file diff --git a/apps/text-demo/.wf/components-workflows_root.jsonl b/apps/text-demo/.wf/components-workflows_root.jsonl new file mode 100644 index 000000000..4e9c84ea1 --- /dev/null +++ b/apps/text-demo/.wf/components-workflows_root.jsonl @@ -0,0 +1 @@ +{"id": "workflows_root", "type": "workflows_root", "content": {}, "isCodeManaged": false, "position": 0, "handlers": {}, "visible": {"expression": true, "binding": "", "reversed": false}} \ No newline at end of file diff --git a/src/ui/index.html b/src/ui/index.html index 1e34d5333..fb8078354 100644 --- a/src/ui/index.html +++ b/src/ui/index.html @@ -5,6 +5,7 @@ Writer Framework +