OpenFn / OpenFn/lightning

UI to Select Workflows on Sandbox Creation

Open
#3,592 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

sandboxes and sync
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

We need to add a workflow selection interface to the sandbox creation modal, allowing users to choose which workflows from the parent project should be included in the new sandbox.

Currently, when creating a sandbox via Lightning.Projects.Sandboxes.provision/3, all workflows from the parent project are automatically cloned. This issue adds UI controls to let users selectively choose which workflows to include.

The backend already supports workflow selection through the provision_attrs type:

  • The provision/3 function in the Sandboxes context module accepts workflow filtering parameters
  • Workflow cloning logic handles partial workflow sets
  • Job references and edges are properly maintained for selected workflows

Consider updating the LightningWeb.SandboxLive.FormComponent to:

  • Add workflow selection state management
  • Fetch parent project's workflows on component mount
  • Add validation to ensure at least one workflow is selected

Consider adding a new workflow picker component based on the regular multi-select project picker we already have in project credentials and other places in the app. The new workflow picker component should be implemented in LightningWeb.SandboxLive.Components and used in the LightningWeb.SandboxLive.FormComponent.

Define it like this in the Components module:

def workflow_picker(assigns) do
  # Checkbox list of available workflows
  # Show workflow names
  # Include "Select All" / "Deselect All" toggle
end

Use it like this in the FormComponent module:

<Components.workflow_picker 
  id="workflow-selection"
  workflows={@parent_workflows}
  selected={@selected_workflows}
  on_change={...}
/>

The user experience flow should look like this:

  1. User clicks "Create Sandbox"
  2. Modal opens with basic fields (name, env, color)
  3. Workflow selection shows all parent workflows (maybe checked by default?)
  4. User can uncheck workflows they don't want to include
  5. Form validates at least one workflow is selected
  6. Submission creates sandbox with only selected workflows

Few recommendations:

  • Leveraging existing provision_attrs.workflow_ids parameter support
  • Maintaining existing UI patterns from other form components
  • Ensuring proper error handling for invalid workflow selections
  • Considering performance implications for projects with many workflows

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LightningWeb.SandboxLive.FormComponent and the LightningWeb.SandboxLive.Components module, then trace Lightning.Projects.Sandboxes.provision/3 and provision_attrs.workflow_ids. Compare the existing multi-select project picker patterns and inspect how parent workflows are loaded. Done means the modal supports selecting workflows, validates the selection, and provisions a sandbox containing only those workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.