<!DOCTYPE html>
<html class="no-js">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <title><%= @view_title %> - Go</title>

  <link rel="shortcut icon" href="<%= asset_path('cruise.ico') %>"/>
  <%= stylesheet_link_tag 'frameworks' %>
  <%= stylesheet_link_tag "single_page_apps/#{controller_name}" %>
  <% if (controller_name == 'pipeline_configs' && @enable_new_quick_edit_page) %>
      <%= javascript_include_tag *webpack_asset_paths("single_page_apps/#{controller_name}") %>
  <% else %>
      <%= requirejs_include_tag 'single_page_apps/pipeline_configs' %>
  <% end %>
  <%= csrf_meta_tags %>
</head>

<body data-controller-name="<%= controller_name %>" data-action-name="<%= action_name %>" id="<%= controller_name %>-page">
<div class="page-wrap">
  <header class="app-header">
    <div class="row expanded">
      <%= render :partial => 'new_navigation_elements/navigation' %>
    </div>
  </header>

  <main class="main-container">

    <%= yield %>
  </main>

</div>
<%= render :partial => 'new_navigation_elements/footer' %>

</body>
</html>

<!DOCTYPE html>
<html class="no-js">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <title><%= @view_title %> - Go</title>

  <link rel="shortcut icon" href="<%= asset_path('cruise.ico') %>"/>
  <%= stylesheet_link_tag 'frameworks' %>
  <%= stylesheet_link_tag "single_page_apps/#{controller_name}" %>
  <% if (controller_name == 'pipeline_configs' && !@enable_new_quick_edit_page) %>
    <%= requirejs_include_tag 'single_page_apps/pipeline_configs' %>
  <% else %>
    <%= javascript_include_tag *webpack_asset_paths("single_page_apps/#{controller_name}") %>
  <% end %>
  <%= csrf_meta_tags %>
</head>

<body data-controller-name="<%= controller_name %>" data-action-name="<%= action_name %>" id="<%= controller_name %>-page">
<div class="page-wrap">
  <header class="app-header">
    <div class="row expanded">
      <%= render :partial => 'new_navigation_elements/navigation' %>
    </div>
  </header>

  <main class="main-container">

    <%= yield %>
  </main>

</div>
<%= render :partial => 'new_navigation_elements/footer' %>

</body>
</html>

Fix JS errors when navigating to single_page_app pages where controller_name != "pipeline_configs"
Fix JS errors when navigating to single_page_app pages where controller_name != "pipeline_configs"

The previous logic caused pipeline_configs.js to load for other single_page_app pages, which would
throw errors as the script tried to perform operations on elements that did not exist.
