mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 22:18:15 +08:00
feat(api): Add app_id field to HumanInputForm model
This ensures that `HumanInputForm` could be associated to a specific application without relying on `WorkflowRun`, providing us a smoother migration path if we want to implement test form.
This commit is contained in:
@ -67,6 +67,7 @@ def _build_form_params(delivery_methods: list[EmailDeliveryMethod]) -> FormCreat
|
||||
user_actions=[UserAction(id="approve", title="Approve")],
|
||||
)
|
||||
return FormCreateParams(
|
||||
app_id="app-1",
|
||||
workflow_execution_id=str(uuid4()),
|
||||
node_id="human-input-node",
|
||||
form_config=form_config,
|
||||
@ -174,6 +175,7 @@ class TestHumanInputFormRepositoryImplWithContainers:
|
||||
repository = HumanInputFormRepositoryImpl(session_factory=engine, tenant_id=tenant.id)
|
||||
resolved_values = {"greeting": "Hello!"}
|
||||
params = FormCreateParams(
|
||||
app_id="app-1",
|
||||
workflow_execution_id=str(uuid4()),
|
||||
node_id="human-input-node",
|
||||
form_config=HumanInputNodeData(
|
||||
@ -209,6 +211,7 @@ class TestHumanInputFormRepositoryImplWithContainers:
|
||||
|
||||
repository = HumanInputFormRepositoryImpl(session_factory=engine, tenant_id=tenant.id)
|
||||
params = FormCreateParams(
|
||||
app_id="app-1",
|
||||
workflow_execution_id=str(uuid4()),
|
||||
node_id="human-input-node",
|
||||
form_config=HumanInputNodeData(
|
||||
|
||||
@ -123,6 +123,7 @@ def create_human_input_message_fixture(db_session) -> HumanInputMessageFixture:
|
||||
)
|
||||
form = HumanInputForm(
|
||||
tenant_id=tenant.id,
|
||||
app_id=app.id,
|
||||
workflow_run_id=workflow_run_id,
|
||||
node_id="node-id",
|
||||
form_definition=form_definition.model_dump_json(),
|
||||
|
||||
@ -88,6 +88,7 @@ def _build_form(db_session_with_containers, tenant, account):
|
||||
engine = db_session_with_containers.get_bind()
|
||||
repo = HumanInputFormRepositoryImpl(session_factory=engine, tenant_id=tenant.id)
|
||||
params = FormCreateParams(
|
||||
app_id="app-1",
|
||||
workflow_execution_id=str(uuid.uuid4()),
|
||||
node_id="node-1",
|
||||
form_config=node_data,
|
||||
|
||||
Reference in New Issue
Block a user