[ARVADOS] created: 9d6ce80869e187a7c5a574ea5a5272bb89dd81ce
git at public.curoverse.com
git at public.curoverse.com
Tue May 20 20:21:54 EDT 2014
at 9d6ce80869e187a7c5a574ea5a5272bb89dd81ce (commit)
commit 9d6ce80869e187a7c5a574ea5a5272bb89dd81ce
Author: Tom Clegg <tom at curoverse.com>
Date: Tue May 20 20:20:49 2014 -0400
2754: Fix up instruction text and formatting.
diff --git a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
index a24aaa2..a1b90ec 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
@@ -28,16 +28,24 @@
<% end %>
<% if n_inputs == 0 %>
- <p>This pipeline does not need any further inputs specified. You can start it by clicking the "Run" button.</p>
+ <div class="alert alert-info">
+ <p>This pipeline does not need any further inputs specified. You can start it by clicking the "Run" button.</p>
+ </div>
<% else %>
- <p>Please choose values for the following <%= n_inputs > 1 ? 'inputs' : 'input' %> before starting the pipeline.</p>
+ <div class="alert alert-info">
+ <p>Provide <%= n_inputs > 1 ? 'values' : 'a value' %> for the following <%= n_inputs > 1 ? 'parameters' : 'parameter' %>, then click the "Run" button to start the pipeline.</p>
+ </div>
<%= content_for :pi_input_form %>
<%= form_tag @object, :method => :put do |f| %>
<%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :state, :value => 'RunningOnServer' %>
<%= button_tag({class: 'btn btn-primary run-pipeline-button'}) do %>
- Run <i class="fa fa-fw fa-play"></i>
+ Run <i class="fa fa-fw fa-play"></i>
<% end %>
<% end %>
<% end %>
+
+<div style="margin-top: 1em;">
+ <p>For a full list of pipeline components and parameters, click the "Components" tab above.</p>
+</div>
commit e2dc7f5b9068e23822391bd3cf987b6f14e83ec0
Author: Tom Clegg <tom at curoverse.com>
Date: Tue May 20 20:08:49 2014 -0400
2754: Allow editing the same parameter in two different places on the page.
diff --git a/apps/workbench/app/assets/javascripts/editable.js b/apps/workbench/app/assets/javascripts/editable.js
index 8eea169..0514c1e 100644
--- a/apps/workbench/app/assets/javascripts/editable.js
+++ b/apps/workbench/app/assets/javascripts/editable.js
@@ -9,6 +9,10 @@ $.fn.editable.defaults.send = 'always';
// too narrow, when the popup box will just move to do the right thing.
//$.fn.editable.defaults.mode = 'inline';
+$.fn.editable.defaults.success = function (response, newValue) {
+ $(document).trigger('editable:success', [this, response, newValue]);
+};
+
$.fn.editable.defaults.params = function (params) {
var a = {};
var key = params.pk.key;
diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index dbd6214..3209d67 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -1,45 +1,46 @@
-(function() {
- var run_pipeline_button_state = function() {
- var a = $('a.editable.required.editable-empty');
- if (a.length > 0) {
- $(".run-pipeline-button").addClass("disabled");
+function run_pipeline_button_state() {
+ var a = $('a.editable.required.editable-empty');
+ if (a.length > 0) {
+ $(".run-pipeline-button").addClass("disabled");
+ }
+ else {
+ $(".run-pipeline-button").removeClass("disabled");
+ }
+}
+
+$(document).on('editable:success', function(event, tag, response, newValue) {
+ if ($('.run-pipeline-button').length == 0)
+ return;
+ tag = $(tag);
+ if (tag.hasClass("required")) {
+ if (newValue && newValue.trim() != "") {
+ tag.removeClass("editable-empty");
+ tag.parent().css("background-color", "");
+ tag.parent().prev().css("background-color", "");
}
else {
- $(".run-pipeline-button").removeClass("disabled");
+ tag.addClass("editable-empty");
+ tag.parent().css("background-color", "#ffdddd");
+ tag.parent().prev().css("background-color", "#ffdddd");
}
}
-
- $.fn.editable.defaults.success = function (response, newValue) {
- var tag = $(this);
- if (tag.hasClass("required")) {
- if (newValue && newValue.trim() != "") {
- tag.removeClass("editable-empty");
- tag.parent().css("background-color", "");
- tag.parent().prev().css("background-color", "");
- }
- else {
- tag.addClass("editable-empty");
- tag.parent().css("background-color", "#ffdddd");
- tag.parent().prev().css("background-color", "#ffdddd");
- }
- }
- run_pipeline_button_state();
+ if (tag.attr('data-name')) {
+ // Update other inputs representing the same piece of data
+ $('[data-name="' + tag.attr('data-name') + '"]').html(newValue);
}
+ run_pipeline_button_state();
+});
- $(window).on('load', function() {
- var a = $('a.editable.required');
- for (var i = 0; i < a.length; i++) {
- var tag = $(a[i]);
- if (tag.hasClass("editable-empty")) {
- tag.parent().css("background-color", "#ffdddd");
- tag.parent().prev().css("background-color", "#ffdddd");
- }
- else {
- tag.parent().css("background-color", "");
- tag.parent().prev().css("background-color", "");
- }
+$(document).on('ready ajax:complete', function() {
+ $('a.editable.required').each(function() {
+ if (this.hasClass("editable-empty")) {
+ this.parent().css("background-color", "#ffdddd");
+ this.parent().prev().css("background-color", "#ffdddd");
}
- run_pipeline_button_state();
- } );
-
-})();
+ else {
+ this.parent().css("background-color", "");
+ this.parent().prev().css("background-color", "");
+ }
+ });
+ run_pipeline_button_state();
+});
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 71c6038..63196d3 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -277,7 +277,7 @@ module ApplicationHelper
lt += raw("add_form_selection_sources(#{selectables.to_json});\n")
end
- lt += raw("$('##{id}').editable({source: function() { return select_form_sources('#{dataclass}'); } });\n")
+ lt += raw("$('[data-name=\"#{dn}\"]').editable({source: function() { return select_form_sources('#{dataclass}'); } });\n")
lt += raw("</script>")
commit 1797ee0dea063ff59361740ee512c84d086dacaf
Author: Tom Clegg <tom at curoverse.com>
Date: Tue May 20 16:09:11 2014 -0400
2754: Add easy "Inputs" tab for providing required/described inputs for a pipeline instance.
diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index a9ca4df..dbd6214 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -2,10 +2,10 @@
var run_pipeline_button_state = function() {
var a = $('a.editable.required.editable-empty');
if (a.length > 0) {
- $("#run-pipeline-button").addClass("disabled");
+ $(".run-pipeline-button").addClass("disabled");
}
else {
- $("#run-pipeline-button").removeClass("disabled");
+ $(".run-pipeline-button").removeClass("disabled");
}
}
diff --git a/apps/workbench/app/controllers/pipeline_instances_controller.rb b/apps/workbench/app/controllers/pipeline_instances_controller.rb
index d54cd49..761dc91 100644
--- a/apps/workbench/app/controllers/pipeline_instances_controller.rb
+++ b/apps/workbench/app/controllers/pipeline_instances_controller.rb
@@ -142,7 +142,11 @@ class PipelineInstancesController < ApplicationController
end
def show_pane_list
- %w(Components Graph Attributes Metadata JSON API)
+ panes = %w(Components Graph Attributes Metadata JSON API)
+ if @object and @object.state.in? ['New', 'Ready']
+ panes = %w(Inputs) + panes
+ end
+ panes
end
def compare_pane_list
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index dbb05d6..71c6038 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -267,7 +267,7 @@ module ApplicationHelper
"data-pk" => "{id: \"#{object.uuid}\", key: \"#{object.class.to_s.underscore}\"}",
"data-showbuttons" => "false",
"data-value" => attrvalue,
- :class => "editable #{'required' if required}",
+ :class => "editable #{'required' if required} form-control",
:id => id
}.merge(htmloptions)
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
index 61a4ca1..c9c1e77 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
@@ -83,7 +83,9 @@ setInterval(function(){$('a.refresh').click()}, 15000);
<%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :state, :value => 'Paused' %>
- <%= button_tag "Stop pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
+ <%= button_tag({class: 'btn btn-primary pull-right run-pipeline-button'}) do %>
+ Stop <i class="fa fa-fw fa-stop"></i>
+ <% end %>
<% end %>
<% end %>
@@ -99,7 +101,9 @@ setInterval(function(){$('a.refresh').click()}, 15000);
<%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :state, :value => 'RunningOnServer' %>
- <%= button_tag "Run pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
+ <%= button_tag({class: 'btn btn-primary pull-right run-pipeline-button'}) do %>
+ Run <i class="fa fa-fw fa-play"></i>
+ <% end %>
<% end %>
<% end %>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components_editable.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components_editable.html.erb
index 57c73fb..284c84c 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components_editable.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components_editable.html.erb
@@ -25,7 +25,7 @@
<tr>
<td><span class="label label-default"><%= k %></span></td>
- <td><%= render_pipeline_component_attribute (editable && @object), :components, [k, :script], component[:script] %></td>
+ <td><%= component[:script] %></td>
<td>script version</td>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
new file mode 100644
index 0000000..a24aaa2
--- /dev/null
+++ b/apps/workbench/app/views/pipeline_instances/_show_inputs.html.erb
@@ -0,0 +1,43 @@
+<% n_inputs = 0 %>
+
+<% content_for :pi_input_form do %>
+<form role="form">
+ <div class="form-group">
+ <% @object.components.each do |cname, component| %>
+ <% next if !component %>
+ <% component[:script_parameters].andand.each do |pname, pvalue_spec| %>
+ <% if pvalue_spec.is_a? Hash %>
+ <% if (pvalue_spec[:description] or
+ (pvalue_spec[:required] and not pvalue_spec[:value])) %>
+ <% n_inputs += 1 %>
+ <label for="<% "#{cname}-#{pname}" %>"><%= pname.to_s.humanize %> for <%= cname %> component:</label>
+ <div>
+ <p class="form-control-static">
+ <%= render_pipeline_component_attribute @object, :components, [cname, :script_parameters, pname.to_sym], pvalue_spec %>
+ </p>
+ </div>
+ <p class="help-block">
+ <%= pvalue_spec[:description] %>
+ </p>
+ <% end %>
+ <% end %>
+ <% end %>
+ <% end %>
+ </div>
+</form>
+<% end %>
+
+<% if n_inputs == 0 %>
+ <p>This pipeline does not need any further inputs specified. You can start it by clicking the "Run" button.</p>
+<% else %>
+ <p>Please choose values for the following <%= n_inputs > 1 ? 'inputs' : 'input' %> before starting the pipeline.</p>
+ <%= content_for :pi_input_form %>
+
+ <%= form_tag @object, :method => :put do |f| %>
+ <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :state, :value => 'RunningOnServer' %>
+ <%= button_tag({class: 'btn btn-primary run-pipeline-button'}) do %>
+ Run <i class="fa fa-fw fa-play"></i>
+ <% end %>
+ <% end %>
+
+<% end %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list