Merge branch '3187-pipeline-instance-page' into 3605-improved-dashboard
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 19 Sep 2014 19:40:53 +0000 (15:40 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 19 Sep 2014 19:40:53 +0000 (15:40 -0400)
Conflicts:
apps/workbench/app/models/job.rb

20 files changed:
apps/workbench/app/assets/javascripts/application.js
apps/workbench/app/assets/javascripts/dates.js
apps/workbench/app/assets/stylesheets/projects.css.scss
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/models/job.rb
apps/workbench/app/views/application/_pipeline_status_label.html.erb
apps/workbench/app/views/collections/_show_source_summary.html.erb
apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
apps/workbench/app/views/projects/_compute_node_status.html.erb [new file with mode: 0644]
apps/workbench/app/views/projects/_compute_node_summary.html.erb [new file with mode: 0644]
apps/workbench/app/views/projects/_show_dashboard.html.erb [new file with mode: 0644]
apps/workbench/app/views/projects/index.html.erb
apps/workbench/test/integration/application_layout_test.rb
apps/workbench/test/integration/jobs_test.rb
apps/workbench/test/integration/logins_test.rb
apps/workbench/test/integration/pipeline_instances_test.rb
apps/workbench/test/integration/pipeline_templates_test.rb
apps/workbench/test/integration/projects_test.rb
apps/workbench/test/integration/user_profile_test.rb
services/api/app/controllers/arvados/v1/jobs_controller.rb

index cf0812adae935d955a60b09719e8545dc1efbe8e..39e8cf96eac5b9e8cfbb886451931f45eb545bac 100644 (file)
@@ -205,4 +205,12 @@ jQuery(function($){
         });
     });
 
+    $(document).on('click', '.compute-detail', function(e) {
+        $(e.target).collapse('hide');
+    });
+
+    $(document).on('click', '.compute-node-summary', function(e) {
+        $(e.target.href).collapse('toggle');
+    });
+
 });
index 4b90ab0a343735fca9de57dce9267dcd4222aca3..eeb6edea1cd8442480fd5bd0a295c0459665c9b4 100644 (file)
@@ -1,10 +1,23 @@
+jQuery(function($){
 $(document).on('ajax:complete arv:pane:loaded ready', function() {
     $('[data-utc-date]').each(function(i, elm) {
-        var re = /(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d) UTC/;
-        var v = $(elm).attr('data-utc-date').match(re);
+            console.log("woble!");
+        var v = $(elm).attr('data-utc-date').match(/(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d) UTC/);
+        if (!v) {
+            v = $(elm).attr('data-utc-date').match(/(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z/);
+        }
+
         if (v) {
             var ts = new Date(Date.UTC(v[1], v[2]-1, v[3], v[4], v[5], v[6]));
-            $(elm).text(ts.toLocaleTimeString() + " " + ts.toLocaleDateString());
+            if ($(elm).attr('data-utc-date-opts') && $(elm).attr('data-utc-date-opts').match(/noseconds/)) {
+                $(elm).text((ts.getHours() > 12 ? (ts.getHours()-12) : ts.getHours())
+                            + ":" + (ts.getMinutes() < 10 ? '0' : '') + ts.getMinutes()
+                            + (ts.getHours() > 12 ? " PM " : " AM ")
+                            + ts.toLocaleDateString());
+            } else {
+                $(elm).text(ts.toLocaleTimeString() + " " + ts.toLocaleDateString());
+            }
         }
     });
 });
+});
index 53b352d5e798a0abaf1acebdd79dc4c2a866f1f6..d9edfd89fd7aa7c1b997cc20d20acb937c57cdef 100644 (file)
@@ -10,3 +10,59 @@ div.scroll-20em {
     height: 20em;
     overflow-y: scroll;
 }
+
+.compute-summary {
+    margin: 0.15em 0em 0.15em 0em;
+    display: inline-block;
+}
+
+.compute-summary-head {
+    margin-left: 0.3em;
+}
+
+.compute-detail {
+    border: 1px solid;
+    border-color: #DDD;
+    border-radius: 3px;
+    padding: 0.2em;
+    position: absolute;
+    z-index: 1;
+    background: white;
+}
+
+.compute-detail:hover {
+   cursor: pointer;
+}
+
+.compute-node-summary:hover {
+  cursor: pointer;
+}
+
+.compute-summary-numbers .panel {
+  margin-bottom: 0px;
+}
+
+.compute-summary-numbers table {
+  width: 100%;
+  td,th {
+    text-align: center;
+  }
+}
+
+.compute-summary-nodelist {
+  margin-bottom: 10px
+}
+
+.dashboard-panel-info-row {
+  padding: .5em;
+  border-radius: .3em;
+}
+
+.x-ellip {
+  overflow-x: hide;
+  text-overflow: ellipsis;
+}
+
+.dashboard-panel-info-row:hover {
+  background-color: #D9EDF7;
+}
\ No newline at end of file
index 8acaa608183f57c9e9016b58342a0904a8f12fd4..756339e5be3924f59032b5dc2956da4b41cd240b 100644 (file)
@@ -692,6 +692,26 @@ class ApplicationController < ActionController::Base
     end.reverse
   end
 
+  helper_method :running_pipelines
+  def running_pipelines
+    PipelineInstance.order(["started_at asc", "created_at asc"]).filter([["state", "in", ["RunningOnServer", "RunningOnClient"]]])
+  end
+
+  helper_method :finished_pipelines
+  def finished_pipelines lim
+    PipelineInstance.limit(lim).order(["finished_at desc"]).filter([["state", "in", ["Complete", "Failed", "Paused"]], ["finished_at", "!=", nil]])
+  end
+
+  helper_method :recent_collections
+  def recent_collections lim
+    c = Collection.limit(lim).order(["modified_at desc"]).filter([["owner_uuid", "is_a", "arvados#group"]])
+    own = {}
+    Group.filter([["uuid", "in", c.map(&:owner_uuid)]]).each do |g|
+      own[g[:uuid]] = g
+    end
+    {collections: c, owners: own}
+  end
+
   helper_method :my_project_tree
   def my_project_tree
     build_project_trees
index 1deb13ab538d3537be3fcf3e63d5cdeb4f4bc673..a0247ef10448284ce1b6bea0573f1ac77c8fd994 100644 (file)
@@ -38,6 +38,10 @@ class Job < ArvadosBase
     arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
   end
 
+  def self.queue_size
+    arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
+  end
+
   def self.state job
     if job.respond_to? :state and job.state
       return job.state
index 8abf65b4537cf01f22027e8be36586e8f414bdd0..9e5b71047b3147daf54fe9478429d26555d03e8a 100644 (file)
@@ -4,6 +4,8 @@
   <span class="label label-danger">failed</span>
 <% elsif p.state == 'RunningOnServer' || p.state == 'RunningOnClient' %>
   <span class="label label-info">running</span>
+<% elsif p.state == 'Paused'  %>
+  <span class="label label-default">paused</span>
 <% else %>
   <% if not p.components.values.any? { |c| c[:job] rescue false } %>
     <span class="label label-default">not started</span>
index ba9e9dfb9fe628b4faf8dc318c19b6f7ab78b49b..51f9348450219e2e6ead5f0eec3dbd673fe59ebd 100644 (file)
@@ -7,10 +7,12 @@
     <% pipelines = PipelineInstance.filter([["components", "like", "%#{@object.uuid}%"]]).each do |pipeline| %>
       <% pipeline.components.each do |cname, c| %>
         <% if c[:output_uuid] == @object.uuid %>
-          <b><%= cname %></b> component of pipeline <b><%= link_to_if_arvados_object(pipeline, friendly_name: true) %></b>
+          <b><%= cname %></b> component of <b><%= link_to_if_arvados_object(pipeline, friendly_name: true) %></b>
           <% if c.andand[:job].andand[:finished_at] %>
-            <b>finished at <%= c[:job][:finished_at] %></b>
+            finished at <span class="utc-date"
+                                 data-utc-date="<%= c[:job][:finished_at] %>"><%= c[:job][:finished_at] %></span>
           <% end %>
+          <br>
         <% end %>
       <% end %>
     <% end %>
index 0d27566e538d7d0c15cea447ed7901fee8e44c82..18ae9b08cfe35cb9537b267edff39a06286b99d6 100644 (file)
@@ -9,17 +9,15 @@
 
 <p>
   <% if @object.started_at %>
-    Started at <span data-utc-date="<%= @object.started_at %>"><%= @object.started_at %></span> and
-  <% else %>
-    Has not started.
+    Started at <span data-utc-date="<%= @object.started_at %>"><%= @object.started_at %></span>.
   <% end %>
 
   <% if @object.state == 'Complete' %>
-    completed in
+    Completed in
   <% elsif @object.state == 'Failed' %>
-    failed after
-  <% elsif @object.started_at %>
-    has been active for
+    Failed after
+  <% else %>
+    Has been active for
   <% end %>
 
   <% walltime = if @object.started_at
@@ -76,7 +74,7 @@
         <div class="row">
           <div class="col-md-3">
             <h4 class="panel-title">
-              <a data-toggle="collapse" data-parent="#accordion" href="#collapse<%= i %>">
+              <a data-toggle="collapse" href="#collapse<%= i %>">
                 <%= pj[:name] %> <span class="caret"></span>
               </a>
             </h4>
             <div class="col-md-5">
               <% queuetime = Time.now - current_job[:created_at] %>
               Queued for <%= runtime(queuetime, true) %>.
+              <% begin %>
               <% if current_job.queue_position == 0 %>
                 This job is next in the queue to run.
               <% elsif current_job.queue_position == 1 %>
               <% else  %>
                 There are <%= current_job.queue_position %> jobs in the queue ahead of this one.
               <% end %>
+              <% rescue %>
+          <% end %>
             </div>
           <% end %>
         <% else %>
diff --git a/apps/workbench/app/views/projects/_compute_node_status.html.erb b/apps/workbench/app/views/projects/_compute_node_status.html.erb
new file mode 100644 (file)
index 0000000..528d0ea
--- /dev/null
@@ -0,0 +1,18 @@
+
+<div class="compute-summary-nodelist">
+    <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
+      <% if n.crunch_worker_state.in? ["busy", "idle"] %>
+        <div class="compute-summary">
+          <a data-toggle="collapse" href="#detail_<%= n.hostname %>" class="compute-summary-head label label-<%= if n.crunch_worker_state == 'busy' then 'primary' else 'default' end %>">
+            <%= n.hostname %>
+          </a>
+          <div id="detail_<%= n.hostname %>" class="collapse compute-detail">
+            state: <%= n.crunch_worker_state %><br>
+            <% [:total_cpu_cores, :total_ram_mb, :total_scratch_mb].each do |i| %>
+              <%= i.to_s.gsub '_', ' ' %>: <%= n.info[i] %><br>
+            <% end %>
+          </div>
+        </div>
+      <% end %>
+    <% end %>
+</div>
diff --git a/apps/workbench/app/views/projects/_compute_node_summary.html.erb b/apps/workbench/app/views/projects/_compute_node_summary.html.erb
new file mode 100644 (file)
index 0000000..9a58d09
--- /dev/null
@@ -0,0 +1,23 @@
+<div class="compute-summary-numbers">
+    <table>
+      <colgroup>
+        <col width="25%">
+        <col width="25%">
+        <col width="25%">
+        <col width="25%">
+
+      </colgroup>
+      <tr>
+        <td><%= Job.queue_size %></td>
+        <td><%= nodes.select {|n| n.crunch_worker_state.in? ["busy", "idle"] }.size %></td>
+        <td><%= nodes.select {|n| n.crunch_worker_state == "busy" }.size %></td>
+        <td><%= nodes.select {|n| n.crunch_worker_state == "idle" }.size %></td>
+      </tr>
+      <tr>
+        <th>Queue</th>
+        <th>Nodes</th>
+        <th>Busy</th>
+        <th>Idle</th>
+      </tr>
+    </table>
+</div>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
new file mode 100644 (file)
index 0000000..a197059
--- /dev/null
@@ -0,0 +1,179 @@
+
+  <div class="row">
+    <div class="col-md-6">
+      <div class="panel panel-default">
+        <div class="panel-heading"><span class="panel-title">Active pipelines</span>
+          <span class="pull-right">
+    <%= link_to(
+         choose_pipeline_templates_path(
+           title: 'Choose a pipeline to run:',
+           action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
+           action_href: pipeline_instances_path,
+           action_method: 'post',
+           action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json),
+         { class: "btn btn-primary btn-xs", remote: true, method: 'get' }) do %>
+      <i class="fa fa-fw fa-gear"></i> Run a pipeline...
+    <% end %>
+    </span>
+        </div>
+
+        <div class="panel-body">
+          <% if running_pipelines.empty? %>
+            No pipelines are currently running.
+          <% end %>
+          <% running_pipelines.each do |p| %>
+            <div class="dashboard-panel-info-row">
+              <div class="clearfix">
+                <%= link_to_if_arvados_object p, friendly_name: true %>
+
+                <div class="pull-right" style="width: 40%">
+                  <div class="progress" style="margin-bottom: 0px">
+                    <% running = [] %>
+                    <% failed = [] %>
+                    <% completed = [] %>
+                    <% queued = [] %>
+                    <% p.components.each do |k, v| %>
+                      <% if v.is_a? Hash and v[:job] %>
+                        <% if Job::state(v[:job]) == "Running" %>
+                          <% running << k %>
+                        <% elsif Job::state(v[:job]) == "Failed" or Job::state(v[:job]) == "Canceled" %>
+                          <% failed << k %>
+                        <% elsif Job::state(v[:job]) == "Completed" %>
+                          <% completed << k %>
+                        <% elsif Job::state(v[:job]) == "Queued" %>
+                          <% queued << k %>
+                        <% end %>
+                      <% end %>
+                    <% end %>
+                    <% completed_pct = (completed.size * 100) / p.components.size %>
+                    <% failed_pct = (failed.size * 100) / p.components.size %>
+                    <% running_pct = (running.size * 100) / p.components.size %>
+                    <% queued_pct = (queued.size * 100) / p.components.size %>
+
+                    <div class="progress-bar progress-bar-success" style="width: <%= completed_pct %>%">
+                      <span class="sr-only"></span>
+                    </div>
+                    <div class="progress-bar progress-bar-warning" style="width: <%= failed_pct %>%">
+                      <span class="sr-only"></span>
+                    </div>
+                    <div class="progress-bar progress-bar-primary" style="width: <%= running_pct %>%">
+                      <span class="sr-only"></span>
+                    </div>
+                    <div class="progress-bar progress-bar-default" style="width: <%= queued_pct %>%">
+                      <span class="sr-only"></span>
+                    </div>
+                  </div>
+                </div>
+              </div>
+
+              <div class="clearfix">
+                Started at <span class="utc-date" data-utc-date="<%= p[:started_at] || p[:created_at] %>"
+                                 data-utc-date-opts="noseconds"><%= p[:created_at] %></span>.
+                <% pipeline_time = Time.now - (p[:started_at] || p[:created_at]) %>
+                Active for <%= runtime(pipeline_time, false) %>.
+
+                <div class="pull-right">
+                  <% running.each do |k| %>
+                    <span class="label label-primary"><%= k %></span>
+                  <% end %>
+                  <% queued.each do |k| %>
+                    <span class="label label-default"><%= k %></span>
+                  <% end %>
+                </div>
+              </div>
+            </div>
+          <% end %>
+          </div>
+      </div>
+
+      <div class="panel panel-default">
+        <div class="panel-heading"><span class="panel-title">Recently finished pipelines</span></div>
+        <div class="panel-body">
+          <% finished_pipelines(8).each do |p| %>
+            <div class="dashboard-panel-info-row">
+              <div class="row">
+                <div class="col-md-6 x-ellip">
+                <%= link_to_if_arvados_object p, friendly_name: true %>
+              </div>
+              <div class="col-md-2">
+                <%= render partial: "pipeline_status_label", locals: {p: p}%>
+              </div>
+              <div class="col-md-4">
+                <span class="utc-date" data-utc-date="<%= p[:finished_at] || p[:modified_at] %>"
+                      data-utc-date-opts="noseconds"><%= p[:modified_at] %></span>
+              </div>
+              </div>
+              <div class="row">
+                <div class="col-md-12">
+                  <% if p[:started_at] and p[:finished_at] %>
+                    <% pipeline_time = p[:finished_at] - p[:started_at] %>
+                    Active for <%= runtime(pipeline_time, false) %>
+                  <% end %>
+
+                  <span class="pull-right">
+                    <% outputs = [] %>
+                    <% p.components.each do |k, c| %>
+                      <% outputs << c[:output_uuid] if c[:output_uuid] %>
+                    <% end %>
+                    <% if outputs.size == 0 %>
+                      No output.
+                    <% elsif outputs.size == 1 %>
+                      <i class="fa fa-fw fa-archive"></i> <%= link_to_if_arvados_object outputs[0], friendly_name: true %>
+                    <% else %>
+                      <a href="#<%= p[:uuid] %>" data-toggle="collapse">Outputs <span class="caret"></span></a>
+                    <% end %>
+                  </span>
+                </div>
+              </div>
+
+                <div class="row collapse" id="<%= p[:uuid] %>" >
+                  <div class="col-md-offset-3 col-md-10">
+                    <% outputs.each do |out| %>
+                      <div>
+                        <i class="fa fa-fw fa-archive"></i> <%= link_to_if_arvados_object out, friendly_name: true %>
+                      </div>
+                    <% end %>
+                  </div>
+                </div>
+
+            </div>
+          <% end %>
+        </div>
+      </div>
+    </div>
+
+    <div class="col-md-6">
+      <% nodes = Node.all %>
+      <div class="panel panel-default">
+        <div class="panel-heading"><span class="panel-title"><a data-toggle="collapse" href="#compute_node_status">Compute node status <span class="caret"></span></a></span></div>
+        <div class="panel-body">
+          <div class="compute-node-summary" data-toggle="collapse" href="#compute_node_status">
+            <%= render partial: 'compute_node_summary', locals: {nodes: nodes} %>
+          </div>
+          <div id="compute_node_status" class="collapse">
+            <%= render partial: 'compute_node_status', locals: {nodes: nodes} %>
+          </div>
+        </div>
+      </div>
+      <div class="panel panel-default">
+        <div class="panel-heading"><span class="panel-title">Recent collections</span></div>
+        <div class="panel-body">
+          <% r = recent_collections(8) %>
+          <% r[:collections].each do |p| %>
+            <div class="dashboard-panel-info-row">
+            <div>
+              <i class="fa fa-fw fa-folder-o"></i><%= link_to_if_arvados_object r[:owners][p[:owner_uuid]], friendly_name: true %>/
+              <span class="pull-right"><span class="utc-date"
+                                             data-utc-date="<%= p[:modified_at] %>"
+                                             data-utc-date-opts="noseconds"><%= p[:modified_at]%></span></span>
+            </div>
+            <div class="x-ellip" style="margin-left: 1em"><%= link_to_if_arvados_object p, friendly_name: true %>
+            </div>
+            </div>
+          <% end %>
+        </div>
+      </div>
+    </div>
+  </div>
+
+</div>
index 219bad262b59ddac55972c20680887e563e97fe6..4c0450c6302dbd71d1ce581817650e133f3d0cd1 100644 (file)
@@ -1,74 +1,15 @@
-<div>
-  <div class="row">
-    <div class="col-sm-6">
-      <% if my_projects.empty? %>
-        <div class="panel panel-info">
-          <div class="panel-heading">
-            <h3 class="panel-title">
-              Welcome to <b><%= Rails.configuration.site_name %></b>.
-            </h3>
-          </div>
-          <div class="panel-body">
-            <img src="/favicon.ico" class="pull-right" alt="" style="opacity: 0.3"/>
-            <p>
-              This site runs Arvados, the open source biomedical analysis platform. <a href="https://arvados.org" target="_blank">Learn more&hellip;</a>
-            </p>
-            <p>
-              <b>To get started,</b> create a project using the "Add new project" button below.
-            </p>
-          </div>
-        </div>
-      <% end %>
-      <div class="panel panel-default">
-        <div class="panel-heading">
-          <div class="pull-right">
-            <%= button_to projects_path(method: 'post'), class: 'btn btn-xs btn-primary' do %>
-              <i class="fa fa-fw fa-plus"></i>
-              Add new project
-            <% end %>
-          </div>
-          <h3 class="panel-title">
-            My projects
-          </h3>
-        </div>
-        <div class="panel-body scroll-20em">
-          <%= render partial: 'index_projects', locals: {tree: my_project_tree, show_root_node: true} %>
-        </div>
-      </div>
-    </div>
-    <div class="col-sm-6">
-      <div class="panel panel-default">
-        <div class="panel-heading">
-          <h3 class="panel-title">
-            Projects shared with me
-          </h3>
-        </div>
-        <div class="panel-body scroll-20em">
-          <%= render partial: 'index_projects', locals: {tree: shared_project_tree, show_root_node: false} %>
-        </div>
-      </div>
-    </div>
-  </div>
-  <div class="row">
-    <div class="col-sm-12">
-      <div class="panel panel-default">
-        <div class="panel-heading">
-          <div class="pull-right">
-            <%= link_to jobs_path, class: 'btn btn-default btn-xs' do %>
-              All jobs <i class="fa fa-fw fa-arrow-circle-right"></i>
-            <% end %>
-            <%= link_to pipeline_instances_path, class: 'btn btn-default btn-xs' do %>
-              All pipelines <i class="fa fa-fw fa-arrow-circle-right"></i>
-            <% end %>
-          </div>
-          <h3 class="panel-title">
-            Recent jobs and pipelines
-          </h3>
-        </div>
-        <div class="panel-body">
-          <%= render partial: 'index_jobs_and_pipelines' %>
-        </div>
-      </div>
-    </div>
+<% content_for :js do %>
+    setInterval(function(){
+        $('#dashboard-content').trigger('arv:pane:reload');
+    }, 15000);
+<% end %>
+
+<div id="dashboard-content"
+     class="pane-anchor loaded"
+     href="#dashboard-content-pane"
+     data-pane-content-url="<%= root_url tab_pane: "dashboard" %>"
+     >
+  <div id="dashboard-content-pane" class="active">
+    <%= render partial: 'show_dashboard' %>
   </div>
 </div>
index 6ec535b7b6ec99aa9e319e2a494545bf4c6fa493..69e346d078e0a4b3a744eb52493e0afce46266cb 100644 (file)
@@ -21,7 +21,8 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       if profile_config && !has_profile
         assert page.has_text?('Save profile'), 'No text - Save profile'
       else
-        assert page.has_text?('My projects'), 'Not found text - My projects'
+        assert page.has_link?("Projects"), 'Not found link - Projects'
+        page.find("#projects-menu").click
         assert page.has_text?('Projects shared with me'), 'Not found text - Project shared with me'
       end
     elsif invited
index b5fc56a4f36e95ba28cb0b3b7d2b50e55559d024..50616de45fc077326cfed3de2e06f1e49276bcc6 100644 (file)
@@ -23,7 +23,6 @@ class JobsTest < ActionDispatch::IntegrationTest
     assert page.has_text? 'Textile description for job'
     assert page.has_link? 'Go to dashboard'
     click_link 'Go to dashboard'
-    assert page.has_text? 'My projects'
-    assert page.has_text? 'Projects shared with me'
+    assert page.has_text? 'Active pipelines'
   end
 end
index 0317f162ad888720a77cff2b8917fe783edb516c..9d4e04bfee5f4cee67638c607f2cc1ddcd7d902a 100644 (file)
@@ -7,7 +7,7 @@ class LoginsTest < ActionDispatch::IntegrationTest
 
   test "login with api_token works after redirect" do
     visit page_with_token('active_trustedclient')
-    assert page.has_text?('Recent jobs'), "Missing 'Recent jobs' from page"
+    assert page.has_text?('Active pipelines'), "Missing 'Active pipelines' from page"
     assert_no_match(/\bapi_token=/, current_path)
   end
 
index 0be483a29b0fcad13399c3c416e3f947a65c4131..33e581a0ef07a603acf63a1e902fcb44c091e92b 100644 (file)
@@ -38,7 +38,8 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
 
     # Add this collection to the project
     visit '/projects'
-    find('.arv-project-list a,button', text: 'A Project').click
+    find("#projects-menu").click
+    find('.dropdown-menu a,button', text: 'A Project').click
     find('.btn', text: 'Add data').click
     within('.modal-dialog') do
       wait_for_ajax
@@ -100,7 +101,8 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
 
     # Add this collection to the project using collections menu from top nav
     visit '/projects'
-    find('.arv-project-list a,button', text: 'A Project').click
+    find("#projects-menu").click
+    find('.dropdown-menu a,button', text: 'A Project').click
     find('.btn', text: 'Add data').click
     within('.modal-dialog') do
       wait_for_ajax
index 56d6f4a009ada155f3cf6eeac3f9e2fcaa33be15..b909ac0378da9497beab2fda4783cd3e138c73f8 100644 (file)
@@ -35,8 +35,7 @@ class PipelineTemplatesTest < ActionDispatch::IntegrationTest
     assert page.has_text? 'Textile description for pipeline template'
     assert page.has_link? 'Go to dashboard'
     click_link 'Go to dashboard'
-    assert page.has_text? 'My projects'
-    assert page.has_text? 'Projects shared with me'
+    assert page.has_text? 'Active pipelines'
 
     # again visit recent templates page and verify edited description
     visit page_with_token("active", "/pipeline_templates")
index c0443cc46c6bb21360ec25b12f1e25066e4a09ce..2a363c57bec85a47bc220df247e1a17d6373378c 100644 (file)
@@ -16,8 +16,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
   test 'Find a project and edit its description' do
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: 'A Project').
-      click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: "A Project").click
     within('.container-fluid', text: api_fixture('groups')['aproject']['name']) do
       find('span', text: api_fixture('groups')['aproject']['name']).click
       within('.arv-description-as-subtitle') do
@@ -34,8 +34,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
   test 'Find a project and edit description to textile description' do
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: 'A Project').
-      click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: "A Project").click
     within('.container-fluid', text: api_fixture('groups')['aproject']['name']) do
       find('span', text: api_fixture('groups')['aproject']['name']).click
       within('.arv-description-as-subtitle') do
@@ -59,17 +59,13 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     click_link 'take me home'
 
     # now in dashboard
-    assert(page.has_text?('My projects'), 'My projects - not found on dashboard')
-    assert(page.has_text?('Projects shared with me'), 'Projects shared with me - not found on dashboard')
-    assert(page.has_text?('Textile description for A project'), "Project description not found")
-    assert(page.has_no_text?('*Textile description for A project*'), "Project description is not rendered properly in dashboard")
-    assert(page.has_no_text?('And a new paragraph in description'), "Project description is not truncated after first paragraph")
+    assert(page.has_text?('Active pipelines'), 'Active pipelines - not found on dashboard')
   end
 
   test 'Find a project and edit description to html description' do
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: 'A Project').
-      click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: "A Project").click
     within('.container-fluid', text: api_fixture('groups')['aproject']['name']) do
       find('span', text: api_fixture('groups')['aproject']['name']).click
       within('.arv-description-as-subtitle') do
@@ -86,14 +82,13 @@ class ProjectsTest < ActionDispatch::IntegrationTest
            "Textile description is displayed with uninterpreted formatting characters")
     assert(page.has_link?("take me home"),"link not found in description")
     click_link 'take me home'
-    assert page.has_text?('My projects')
-    assert page.has_text?('Projects shared with me')
+    assert page.has_text?('Active pipelines')
   end
 
   test 'Find a project and edit description to textile description with link to object' do
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: 'A Project').
-      click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: "A Project").click
     within('.container-fluid', text: api_fixture('groups')['aproject']['name']) do
       find('span', text: api_fixture('groups')['aproject']['name']).click
       within('.arv-description-as-subtitle') do
@@ -143,7 +138,9 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
   test 'Create a project and move it into a different project' do
     visit page_with_token 'active', '/projects'
-    find('.btn', text: "Add new project").click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: "Home").click
+    find('.btn', text: "Add a subproject").click
 
     # within('.editable', text: 'New project') do
     within('h2') do
@@ -154,7 +151,9 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     wait_for_ajax
 
     visit '/projects'
-    find('.btn', text: "Add new project").click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: "Home").click
+    find('.btn', text: "Add a subproject").click
     within('h2') do
       find('.fa-pencil').click
       find('.editable-input input').set('Project 5678')
@@ -282,7 +281,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       when 'Copy'
         assert page.has_text?(my_collection['name']), 'Collection not found in src project after copy'
         visit page_with_token 'active', '/'
-        find('.arv-project-list a,button', text: dest['name']).click
+        find("#projects-menu").click
+        find(".dropdown-menu a", text: dest['name']).click
         assert page.has_text?(my_collection['name']), 'Collection not found in dest project after copy'
 
         # now remove it from destination project to restore to original state
@@ -290,7 +290,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       when 'Move'
         assert page.has_no_text?(my_collection['name']), 'Collection still found in src project after move'
         visit page_with_token 'active', '/'
-        find('.arv-project-list a,button', text: dest['name']).click
+        find("#projects-menu").click
+        find(".dropdown-menu a", text: dest['name']).click
         assert page.has_text?(my_collection['name']), 'Collection not found in dest project after move'
 
         # move it back to src project to restore to original state
@@ -298,7 +299,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       when 'Remove'
         assert page.has_no_text?(my_collection['name']), 'Collection still found in src project after remove'
         visit page_with_token 'active', '/'
-        find('.arv-project-list a,button', text: 'Home').click
+        find("#projects-menu").click
+        find(".dropdown-menu a", text: "Home").click
         assert page.has_text?(my_collection['name']), 'Collection not found in home project after remove'
       end
     end
@@ -306,7 +308,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
   def perform_selection_action src, dest, item, action
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: src['name']).click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: src['name']).click
     assert page.has_text?(item['name']), 'Collection not found in src project'
 
     within('tr', text: item['name']) do
@@ -342,7 +345,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     # verify that selection options are disabled on the project until an item is selected
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: my_project['name']).click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: my_project['name']).click
 
     click_button 'Selection...'
     within('.selection-action-container') do
@@ -355,7 +359,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     # select collection and verify links are enabled
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: my_project['name']).click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: my_project['name']).click
     assert page.has_text?(my_collection['name']), 'Collection not found in project'
 
     within('tr', text: my_collection['name']) do
@@ -377,7 +382,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     # select subproject and verify that copy action is disabled
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: my_project['name']).click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: my_project['name']).click
 
     click_link 'Subprojects'
     assert page.has_text?(my_subproject['name']), 'Subproject not found in project'
@@ -399,7 +405,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     # select subproject and a collection and verify that copy action is still disabled
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: my_project['name']).click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: my_project['name']).click
 
     click_link 'Subprojects'
     assert page.has_text?(my_subproject['name']), 'Subproject not found in project'
@@ -432,7 +439,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     my_collection = api_fixture('collections')['collection_to_move_around_in_aproject']
 
     visit page_with_token 'active', '/'
-    find('.arv-project-list a,button', text: my_project['name']).click
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: my_project['name']).click
     assert page.has_text?(my_collection['name']), 'Collection not found in project'
 
     within('tr', text: my_collection['name']) do
index ede67ff36aff82dd661a2cb0f2ebc1df6996e724..6dbb90c32591e104bd9065b3da593303abb2860f 100644 (file)
@@ -25,7 +25,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
         assert page.has_text?('Save profile'), 'No text - Save profile'
         add_profile user
       else
-        assert page.has_text?('My projects'), 'Not found text - My projects'
+        assert page.has_text?('Active pipelines'), 'Not found text - Active pipelines'
         assert page.has_no_text?('Save profile'), 'Found text - Save profile'
       end
     elsif invited
@@ -106,8 +106,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     click_link 'Back to work!'
 
     # profile saved and in home page now
-    assert page.has_text?('My projects'), 'No text - My projects'
-    assert page.has_text?('Projects shared with me'), 'No text - Projects shared with me'
+    assert page.has_text?('Active pipelines'), 'No text - My projects'
   end
 
   [
index 7b3b6586f68a1e0bb86383cef6f4c7e5e006a61e..d8ceb850f8a7c0dc7e1290b4b39f66f48961671b 100644 (file)
@@ -164,7 +164,8 @@ class Arvados::V1::JobsController < ApplicationController
 
   def queue_size
     # Users may not be allowed to see all the jobs in the queue, so provide a
-    # method to get the actual queue length.
+    # method to get just the queue size in order to get a gist of how busy the
+    # cluster is.
     render :json => {:queue_size => Job.queue.size}
   end