- 
                Notifications
    You must be signed in to change notification settings 
- Fork 58
Closed
Labels
Canvas Node CreationIssues related to creating and editing workflow nodes on canvasIssues related to creating and editing workflow nodes on canvasCollab Editor
Milestone
Description
Note: This issue was originally titled "Enhance JobInspector with missing LiveView features" but has been refocused to specifically implement Delete functionality. Edit and Run buttons are handled in separate issues (#3708, #3709).
User story
As a workflow developer, I want to delete a job from the inspector panel, so that I can remove jobs I no longer need from my workflow.
Details
Current Implementation (LiveView):
- Delete button in job panel footer (lib/lightning_web/live/workflow_live/edit.ex:587-614)
- Danger theme styling (red button)
- Complex disable conditions checking:
- Workflow not deleted (!is_nil(@workflow.deleted_at))
- User permissions (@can_edit_workflow)
- No child edges dependent on job (@has_child_edges)
- Not first job in workflow (@is_first_job)
- Viewing latest snapshot (@snapshot_version_tag == "latest")
- User has presence edit priority (@has_presence_edit_priority)
 
- Workflow not deleted (
- Tooltip message via job_deletion_tooltip_message()helper (edit.ex:3547-3562)
- Confirmation dialog: "Are you sure you want to delete this step?"
- Triggers phx-click="delete_node"event (handler at edit.ex:1721-1763)
Target Implementation (React):
- JobInspector component already exists (assets/js/collaborative-editor/components/inspector/JobInspector.tsx)
- Add footer section with Delete button
- Implement full delete functionality with validation
- No Edit or Run buttons in this issue (those are Add Edit button to JobInspector #3708, Add Run button to JobInspector #3709)
Delete Validation Logic Needed:
- Check if job has dependent child edges (need to calculate from workflow state)
- Check if job is first job in workflow (has trigger as parent)
- Check user has can_edit_workflowpermission (available in SessionContext)
- Show appropriate tooltip message when button disabled
- Show confirmation dialog before delete
- Call removeJobAndClearSelectionfrom workflow store
Implementation notes
In Scope:
- Footer section structure in JobInspector
- Button component with danger theme styling
- Delete button with full functionality
- Permission checking via can_edit_workflow
- Validation logic (has_child_edges, is_first_job)
- Confirmation dialog (browser confirm or custom modal)
- Tooltip for disabled state explanations
- Integration with workflow store's removeJobAndClearSelectionaction
Out of Scope:
- ❌ Edit button Add Edit button to JobInspector #3708
- ❌ Run button Add Run button to JobInspector #3709
- ❌ Credential creation flow (waiting for brand specs)
- ❌ Presence edit priority checks (CRDT system allows simultaneous editing)
- ❌ Snapshot version checking (handled in different issue)
Component Infrastructure Needed:
- Button component with danger theme
- Tooltip component for disabled state messages
- Confirmation dialog pattern (modal or browser confirm)
Store Integration:
- Use existing removeJobAndClearSelectionaction from WorkflowStore
- Calculate dependent edges from workflow state
- Use can_edit_workflowfrom SessionContextStore
Release notes
Add delete functionality to job inspector panel.
User acceptance criteria
- Footer section appears in JobInspector
- Delete button visible with danger styling
- Button disabled when job has dependent edges
- Button disabled when job is first in workflow (has trigger parent)
- Button disabled when user lacks edit permission
- Tooltip shows appropriate message when disabled
- Confirmation dialog appears before delete
- Delete removes job and clears selection
- Visual parity with LiveView delete button
Metadata
Metadata
Assignees
Labels
Canvas Node CreationIssues related to creating and editing workflow nodes on canvasIssues related to creating and editing workflow nodes on canvasCollab Editor
Type
Projects
Status
Done