From 349449e90363e574b94571b9b4b7617721ab92b7 Mon Sep 17 00:00:00 2001 From: frikky Date: Tue, 8 Feb 2022 21:59:52 +0100 Subject: [PATCH] Re-added comment setup and added custom webhook response --- frontend/src/views/AngularWorkflow.jsx | 133 +++++++++++++++++++------ 1 file changed, 101 insertions(+), 32 deletions(-) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index be7ccd71..57ee2ebf 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -6179,7 +6179,6 @@ const AngularWorkflow = (defaultprops) => { }} fullWidth multiline={multiline} - rows={5} color="primary" defaultValue={data.value} placeholder={placeholder} @@ -8751,6 +8750,10 @@ const AngularWorkflow = (defaultprops) => { name: "auth_headers", value: "", }; + workflow.triggers[selectedTriggerIndex].parameters[3] = { + name: "custom_response_body", + value: "", + }; setWorkflow(workflow); } else { // Always update @@ -8978,13 +8981,51 @@ const AngularWorkflow = (defaultprops) => { onBlur={(e) => { setTriggerCronWrapper(e.target.value); }} - /> + />
+ + +
+ +
{ }} />
- Required headers + Authentication headers
@@ -9036,43 +9077,62 @@ const AngularWorkflow = (defaultprops) => { }} />
- -
-
+
+ {}} + InputProps={{ + style: { + color: "white", + marginLeft: "5px", + maxWidth: "95%", + fontSize: "1em", + }, + }} + fullWidth + multiline + rows="4" + defaultValue={trigger_header_auth} + color="primary" disabled={selectedTrigger.status === "running"} - onClick={() => { - newWebhook(workflow.triggers[selectedTriggerIndex]); + placeholder={"OK"} + onBlur={(e) => { + const value = e.target.value; + if (selectedTrigger.parameters === null) { + selectedTrigger.parameters = []; + } + + workflow.triggers[selectedTriggerIndex].parameters[3] = { + value: value, + name: "custom_response_body", + }; + setWorkflow(workflow); }} - color="primary" - > - Start - - + />
@@ -9242,6 +9302,14 @@ const AngularWorkflow = (defaultprops) => { auth = param.value; } + const customRespParam = trigger.parameters.find( + (param) => param.name === "custom_response_body" + ) + var custom_response = ""; + if (customRespParam !== undefined && customRespParam !== null) { + custom_response = customRespParam.value; + } + console.log("TRIG: ", trigger); const data = { name: hookname, @@ -9251,6 +9319,7 @@ const AngularWorkflow = (defaultprops) => { start: startNode, environment: trigger.environment, auth: auth, + custom_response: custom_response, }; fetch(globalUrl + "/api/v1/hooks/new", {