Issue list and detail use legacy view for unsupported types (Incidents and Service Desk issues)

We'd like to ensure that incidents will work using legacy views and workflows although issues and epics use the new work item views.

With the feature flag work_items_view_preference we allow users to switch to the new work item view for all issues and work items using the user preference use_work_items_view.

This involves all workflows related to incidents and Service Desk issues:

  1. Create workflow
  2. List and browse to detail view
  3. Detail view

Functionality overview

  1. New route
    1. Legacy view: We reuse the legacy view and
      1. Option a) (current POC behavior) remove the option to change the type from incident to something else (for example if you select new incident from the incidents list page).
      2. Option b) remove the type select altogether and use new incident language throughout the view.
    2. Work items view: If you select the type Incident we’ll redirect you to the legacy view with only the incident type option.
  2. Links from list view (full reload instead of router)
    1. We determine whether we use the router to load the detail view or browse to the detail view for the legacy view.
    2. This now includes a type condition so links to incidents and Service Desk issues will always browse to the legacy view.
  3. Detail view
    1. Depending on the user preference we render a different haml file and run different javascript. The logic now includes the type condition mentioned above, so when you access an incident or Service Desk issue directly it will always render the legacy view.