Diff
Modified: branches/datasets/app/helpers/data_sets_helper.rb (2891 => 2892)
--- branches/datasets/app/helpers/data_sets_helper.rb 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/helpers/data_sets_helper.rb 2012-01-05 09:08:30 UTC (rev 2892)
@@ -5,4 +5,17 @@
module DataSetsHelper
+ def describe_data_type(data_type)
+ case data_type
+ when "FileData"
+ "A file uploaded from your computer"
+ when "TextData"
+ "Text"
+ when "Blob"
+ "A file on #{Conf.sitename}"
+ else
+ data_type.titleize
+ end
+ end
+
end
Modified: branches/datasets/app/models/data_item.rb (2891 => 2892)
--- branches/datasets/app/models/data_item.rb 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/models/data_item.rb 2012-01-05 09:08:30 UTC (rev 2892)
@@ -6,20 +6,19 @@
class DataItem < ActiveRecord::Base
# Things that can be attached as data to a workflow port:
+ # NOTE: If adding a new data type, be sure to update app/helpers/data_sets_helper.rb with a
+ # description of the new type.
- # - These types of data are independent from the DataItem:
+ # - These types of data are independent from the DataItem and should remain in the DB regardless of what happens to
+ # the DataItem connected to it:
INDEPENDENT_DATA_TYPES = ["Blob"]
- # - These types of data are strongly linked to the DataItem and will be destroyed if disassociated from it:
+ # - These types of data are strongly linked to the DataItem and will be destroyed if disassociated from it in any way,
+ # ie. if the DataItem is destroyed, or updated to link to a different piece of data:
DEPENDENT_DATA_TYPES = ["FileData", "TextData"]
PERMITTED_DATA_TYPES = INDEPENDENT_DATA_TYPES + DEPENDENT_DATA_TYPES
- DATA_TYPE_EXPLANATIONS = {"Blob" => "A file on #{Conf.sitename}",
- "FileData" => "A file uploaded from your computer",
- "TextData" => "Text"
- }
-
belongs_to :data_set
belongs_to :data, :polymorphic => true, :autosave => true
Modified: branches/datasets/app/models/file_data.rb (2891 => 2892)
--- branches/datasets/app/models/file_data.rb 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/models/file_data.rb 2012-01-05 09:08:30 UTC (rev 2892)
@@ -7,7 +7,6 @@
set_table_name "file_data"
- has_one :data_item, :as => :data
belongs_to :content_blob, :dependent => :destroy, :autosave => true
belongs_to :content_type, :autosave => true
Modified: branches/datasets/app/models/text_data.rb (2891 => 2892)
--- branches/datasets/app/models/text_data.rb 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/models/text_data.rb 2012-01-05 09:08:30 UTC (rev 2892)
@@ -8,5 +8,4 @@
set_table_name "text_data"
validates_presence_of :data
- has_one :data_item, :as => :data
end
Modified: branches/datasets/app/views/data_items/_data_item.rhtml (2891 => 2892)
--- branches/datasets/app/views/data_items/_data_item.rhtml 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/views/data_items/_data_item.rhtml 2012-01-05 09:08:30 UTC (rev 2892)
@@ -27,7 +27,7 @@
<% if Authorization.is_authorized?("destroy", nil, @data_set, current_user) %>
<%= icon('destroy', data_item_path(data_item), nil,
{:method => :delete,
- :confirm => "Are you sure?",
+ :confirm => "Are you sure wish to remove this data from the data set?",
: "$('data_item_#{data_item.id}_spinner').show();",
:title => "Delete this #{data_item.dependent_data? ? "data" : "association"}"}, "", false) %>
<br/>
Modified: branches/datasets/app/views/data_items/_data_item_form.rhtml (2891 => 2892)
--- branches/datasets/app/views/data_items/_data_item_form.rhtml 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/views/data_items/_data_item_form.rhtml 2012-01-05 09:08:30 UTC (rev 2892)
@@ -70,7 +70,7 @@
"$(this.options[this.selectedIndex].value + '_form_#{unique_id}').show();"-%>">
<% DataItem::PERMITTED_DATA_TYPES.each do |type| %>
<option value="<%= type -%>" <%= 'selected="selected"' if type == @data_item.data_type -%>>
- <%= DataItem::DATA_TYPE_EXPLANATIONS[type] || type -%>
+ <%= describe_data_type(type) -%>
</option>
<% end %>
</select>
Modified: branches/datasets/app/views/data_sets/show.rhtml (2891 => 2892)
--- branches/datasets/app/views/data_sets/show.rhtml 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/views/data_sets/show.rhtml 2012-01-05 09:08:30 UTC (rev 2892)
@@ -11,8 +11,8 @@
</li>
<li>
<%= icon('destroy', data_set_path(@data_set), nil,
- {:method => :delete, :confirm => "Are you sure wish to delete this data set? All associated text data "+
- "will be deleted, but any uploaded files will remain on #{Conf.sitename}."},
+ {:method => :delete, :confirm => "Are you sure wish to delete this data set? "+
+ "This action cannot be undone."},
'Delete data set') %>
</li>
<% end %>
Modified: branches/datasets/app/views/workflows/show.rhtml (2891 => 2892)
--- branches/datasets/app/views/workflows/show.rhtml 2012-01-04 12:49:21 UTC (rev 2891)
+++ branches/datasets/app/views/workflows/show.rhtml 2012-01-05 09:08:30 UTC (rev 2892)
@@ -276,9 +276,14 @@
Data Sets
</h3>
<div class="box_infotext">
- Data sets are collections of data linked to specific workflow ports. They can be used as a worked example,
- to assist users in using a workflow, or to document a workflow run.<br/><br/>
- To <%= (["view","download"] + (@authorised_to_edit ? ["provide"] : [])).to_sentence -%> data sets, click the link below.
+ <b>Data Sets</b> are collections of input and output data, consumed and produced by a workflow.<br/>
+ A <b>Data Set</b> can be used to:
+ <ul>
+ <li>document a complete workflow run, specifying what inputs were used and what outputs were produced.</li>
+ <li>provide example data to help a user to execute the workflow.</li>
+ </ul>
+ <br/>
+ To <%= (["view","download"] + (@authorised_to_edit ? ["provide"] : [])).to_sentence -%> <b>Data Sets</b>, click the link below.
</div>
<br/>
<% if @authorised_to_download %>