Skip to content

Simplify current new trial creation methods

Summary

Currently the actions in the trials_controller have more than 2 possible branches. We should simplify the controller layer so that we are at max 2 branches in the controller layer per action.

Currently we have a multi-step form hiding between many actions of create_lead/select/apply

Current trial flows

  1. A namespace has only 1 possible namespace for trials
    • new submits to create_lead
    • create_lead then creates the lead and applies the trial and successfully redirects
  2. A namespace has more than 1 possible namespace for trials
    • new submits to create_lead
    • create_lead then creates the lead
    • create_lead then redirects to select for user to select a namespace or create a new one
    • select then submits to apply
    • apply then:
      • either finds the namespace or creates it
      • applies the trial

Plan

Simplify down to a new and create action and utilize multi-step concepts to drive lead or trial creation.

New Trial flows

Core change is that new will replace functionality of select and create will replace functionality of apply. This will allow us to more clearly see the process as right now it is not clear that select and apply are the tail end processes coming from new.

  1. A namespace has only 1 possible namespace for trials
    • new submits to create
    • create then creates the lead and applies the trial and successfully redirects
  2. A namespace has more than 1 possible namespace for trials
    • new submits to create
    • create then creates the lead
    • create then redirects to new for user to select a namespace or create a new one
    • new then submits to create
    • create then:
      • either finds the namespace or creates it
      • applies the trial

Tasks

Edited by Doug Stull