You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Frontend Ticket: Handle Action Logic for Selected Node
Objective
Implement the frontend logic for handling actions when a user selects a node and clicks on an action. The logic includes rendering forms (if required), handling bounty flows, and submitting the action to the backend.
Requirements
1. Trigger Action on Node Selection
Trigger: When a user clicks on an action button associated with a selected node.
Fetch the corresponding action details from the schemaStore (added in Ticket 1).
2. Handle Form Logic
If form_required = true:
Render a form dynamically using the form_data structure.
Allow users to input data (e.g., a prompt).
Collect the form data for the POST request.
If form_required = false or not passed:
Skip the form step and proceed directly to the next action logic.
3. Handle Bounty Flow
If bounty = true:
Trigger the bounty flow after form submission (if applicable).
Use the workspace_id and amount parameters from the action details to display the bounty creation screen.
4. Submit Action to Backend
Send a POST /action request to the backend with the required data:
Mandatory:
ref_id: The selected node's reference ID.
action_name: The action to be performed.
Optional:
form_data (if a form is used).
bounty parameters (if applicable).
Example Payload:
{
"ref_id": "node_123",
"action_name": "generate_unit_test",
"pubkey": "1234
"form_data": {
"prompt": "Write unit tests for function XYZ"
},
"bounty": {
"workspace_id": "workspace_456",
"amount": 100,
"jwt"
}
}
Flow Breakdown
User Interaction:
User selects a node.
Available actions are fetched and displayed as buttons (handled in Ticket 1).
Action Click Logic:
Fetch the action configuration from schemaStore:
Check if form_required = true.
If true, render the form and collect user input.
If false, skip the form step.
Check if bounty = true.
If true, trigger the bounty flow at the end.
Send the POST /action request with the collected data.
Acceptance Criteria
Clicking on an action button dynamically handles form_required logic:
Renders a form if required and collects input.
Skips the form step if not required.
If bounty = true, the bounty flow is triggered with appropriate parameters.
The POST /action request is sent to the backend with the correct payload.
The text was updated successfully, but these errors were encountered:
Frontend Ticket: Handle Action Logic for Selected Node
Objective
Implement the frontend logic for handling actions when a user selects a node and clicks on an action. The logic includes rendering forms (if required), handling bounty flows, and submitting the action to the backend.
Requirements
1. Trigger Action on Node Selection
schemaStore
(added in Ticket 1).2. Handle Form Logic
If
form_required = true
:form_data
structure.POST
request.If
form_required = false
or not passed:3. Handle Bounty Flow
bounty = true
:workspace_id
andamount
parameters from the action details to display the bounty creation screen.4. Submit Action to Backend
POST /action
request to the backend with the required data:ref_id
: The selected node's reference ID.action_name
: The action to be performed.form_data
(if a form is used).bounty
parameters (if applicable).Example Payload:
Flow Breakdown
User Interaction:
Action Click Logic:
Acceptance Criteria
The text was updated successfully, but these errors were encountered: