From ce1ff1148a0ce172afd1ce0574340a99694724b6 Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Mon, 27 Jul 2026 08:39:07 +0200 Subject: [PATCH] feat: write ui file to qt/ dir on new service creation --- cli/src/config/paths.py | 1 + cli/src/core/service_creator.py | 8 ++++++++ .../test-service/current => }/qt/A_BD_TestService.ui | 0 .../current => }/qt/A_BD_{{ui_filename}}.ui.jinja | 0 4 files changed, 9 insertions(+) rename cli/tests/fixtures/expected_output/{services/test-service/current => }/qt/A_BD_TestService.ui (100%) rename templates/{service/{{service_name_lower}}/current => }/qt/A_BD_{{ui_filename}}.ui.jinja (100%) diff --git a/cli/src/config/paths.py b/cli/src/config/paths.py index 67d8d4a..2ba62c1 100644 --- a/cli/src/config/paths.py +++ b/cli/src/config/paths.py @@ -13,6 +13,7 @@ class Paths(BaseSettings): repo_root: DirectoryPath = REPO_ROOT services_dir: DirectoryPath = Path("services") + qt_dir: DirectoryPath = Path("qt") service_registry_file: FilePath = Path("config/services_registry.yml") iocs_overview_filename: FilePath = Path("docs/user/ioc/iocs_overview.md") diff --git a/cli/src/core/service_creator.py b/cli/src/core/service_creator.py index 976817a..ed27cd7 100644 --- a/cli/src/core/service_creator.py +++ b/cli/src/core/service_creator.py @@ -17,6 +17,7 @@ logger = logging.getLogger(__name__) REPO_ROOT = get_git_root(__file__) SERVICE_TEMPLATES_DIR = REPO_ROOT / "templates" / "service" +QT_TEMPLATES_DIR = REPO_ROOT / "templates" / "qt" class ServiceCreator: @@ -88,6 +89,13 @@ class ServiceCreator: "service_name_lower": service.name_lower, "service_name_lower_underscores": service.name_lower_underscores, "user": user, + }, + ) + copier.run_copy( + src_path=str(QT_TEMPLATES_DIR), + dst_path=str(self.ctx.write_paths.qt_dir), + data={ + "service_name_upper": service.name_upper, "ui_filename": ui_filename, }, ) diff --git a/cli/tests/fixtures/expected_output/services/test-service/current/qt/A_BD_TestService.ui b/cli/tests/fixtures/expected_output/qt/A_BD_TestService.ui similarity index 100% rename from cli/tests/fixtures/expected_output/services/test-service/current/qt/A_BD_TestService.ui rename to cli/tests/fixtures/expected_output/qt/A_BD_TestService.ui diff --git a/templates/service/{{service_name_lower}}/current/qt/A_BD_{{ui_filename}}.ui.jinja b/templates/qt/A_BD_{{ui_filename}}.ui.jinja similarity index 100% rename from templates/service/{{service_name_lower}}/current/qt/A_BD_{{ui_filename}}.ui.jinja rename to templates/qt/A_BD_{{ui_filename}}.ui.jinja