From 165a1fd3fa109713cc23ea45e12fb4ccf9bfaea5 Mon Sep 17 00:00:00 2001 From: Oliver Sedlbauer Date: Wed, 13 May 2026 10:01:49 +0200 Subject: [PATCH] Add optional parameter 'data' to execute_custom_step keyword Add an optional parameter 'data' to the 'Execute Custom Step' keyword. This allows custom templates to access user-provided data. Signed-off-by: Oliver Sedlbauer --- src/WebDialogs/client/webdialogs_keywords.py | 4 ++-- src/WebDialogs/server/services/dialogs/base.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WebDialogs/client/webdialogs_keywords.py b/src/WebDialogs/client/webdialogs_keywords.py index 3799437..12249f3 100644 --- a/src/WebDialogs/client/webdialogs_keywords.py +++ b/src/WebDialogs/client/webdialogs_keywords.py @@ -51,6 +51,6 @@ def pause_execution(self, message): return self.client_backend.get_response() @keyword("Execute Custom Step") - def execute_custom_step(self, step): - self.client_backend.create_dialog("execute_custom_step", "Custom Step", step=step) + def execute_custom_step(self, step, data=None): + self.client_backend.create_dialog("execute_custom_step", "Custom Step", step=step, data=data) return self.client_backend.get_response() diff --git a/src/WebDialogs/server/services/dialogs/base.py b/src/WebDialogs/server/services/dialogs/base.py index 5d49c81..b2de525 100644 --- a/src/WebDialogs/server/services/dialogs/base.py +++ b/src/WebDialogs/server/services/dialogs/base.py @@ -18,9 +18,10 @@ def get_response(self): class CustomStepDialog(Dialog): template = None - def __init__(self, message="", step=""): + def __init__(self, message="", step="", data=None): super().__init__(message) self.step = step + self.data = data self.template = f"custom/{step}.html"