mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_18.09' into dev
This commit is contained in:
@@ -135,8 +135,8 @@ Disabled
|
||||
|
||||
```
|
||||
<div>
|
||||
<span class="badge badge-default">Default</span>
|
||||
<span class="badge badge-primary">Primary</span>
|
||||
<span class="badge badge-secondary">Secondary</span>
|
||||
<span class="badge badge-success">Success</span>
|
||||
<span class="badge badge-warning">Warning</span>
|
||||
<span class="badge badge-danger">Danger</span>
|
||||
|
||||
@@ -447,7 +447,11 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm
|
||||
// Get item ID and name.
|
||||
var item_id = elt.val();
|
||||
// Use ':first' because there are many labels in table; the first one is the item name.
|
||||
var item_name = elt.closest('td').next('td').find('label').text();
|
||||
var item_name = elt
|
||||
.closest("td")
|
||||
.next("td")
|
||||
.find("label")
|
||||
.text();
|
||||
|
||||
if (make_importable) make_item_importable(item_info.controller, item_id, item_info.singular);
|
||||
|
||||
|
||||
@@ -2,6 +2,12 @@ import _l from "utils/localization";
|
||||
import Utils from "utils/utils";
|
||||
import Ui from "mvc/ui/ui-misc";
|
||||
import Form from "mvc/form/form-view";
|
||||
import * as Backbone from "backbone";
|
||||
import * as _ from "underscore";
|
||||
|
||||
/* global Galaxy */
|
||||
/* global $ */
|
||||
|
||||
/** Dataset edit attributes view */
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
@@ -57,12 +63,23 @@ var View = Backbone.View.extend({
|
||||
<p>An error occured while running the tool <b>${job.tool_id}</b>.</p>
|
||||
<p>Tool execution generated the following messages:</p>
|
||||
<pre class="code">${_.escape(job.stderr)}</pre>
|
||||
<h2>Report This Error</h2>
|
||||
|
||||
<h3>Troubleshoot This Error</h3>
|
||||
<p>
|
||||
Usually the local Galaxy administrators regularly review errors that occur on the server
|
||||
However, if you would like to provide additional information (such as what you were trying
|
||||
to do when the error occurred) and a contact e-mail address, we will be better able to
|
||||
investigate your problem and get back to you.
|
||||
There are a number of help resources to self diagnose and
|
||||
correct problems.
|
||||
Start here: <a
|
||||
href="https://galaxyproject.org/support/tool-error/"
|
||||
target="_blank"> My job ended with an error. What can I do?</a>
|
||||
</p>
|
||||
|
||||
<h3>Report This Error</h3>
|
||||
<p>
|
||||
Usually the local Galaxy administrators regularly review errors
|
||||
that occur on the server However, if you would like to provide
|
||||
additional information (such as what you were trying to do when
|
||||
the error occurred) and a contact e-mail address, we will be
|
||||
better able to investigate your problem and get back to you.
|
||||
</p>`);
|
||||
this.$el.append(this._getBugFormTemplate(dataset, job));
|
||||
},
|
||||
|
||||
@@ -88,7 +88,7 @@ export default FormBase.extend({
|
||||
}
|
||||
options.tool_errors &&
|
||||
this.message.update({
|
||||
status: 'danger',
|
||||
status: "danger",
|
||||
message: options.tool_errors,
|
||||
persistent: true
|
||||
});
|
||||
|
||||
@@ -129,14 +129,14 @@ var View = Backbone.View.extend({
|
||||
this.wp_inputs = {};
|
||||
|
||||
function _ensureWorkflowParameter(wp_name) {
|
||||
return self.wp_inputs[wp_name] = self.wp_inputs[wp_name] || {
|
||||
return (self.wp_inputs[wp_name] = self.wp_inputs[wp_name] || {
|
||||
label: wp_name,
|
||||
name: wp_name,
|
||||
type: "text",
|
||||
color: `hsl( ${++wp_count * 100}, 70%, 30% )`,
|
||||
style: "ui-form-wp-source",
|
||||
links: []
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function _handleWorkflowParameter(value, callback) {
|
||||
|
||||
@@ -828,7 +828,7 @@ var templates = {
|
||||
'<a class="<%- id %> tool-link" href="<%= link %>" target="<%- target %>" minsizehint="<%- min_width %>">',
|
||||
'<span class="labels">',
|
||||
"<% _.each( labels, function( label ){ %>",
|
||||
'<span class="badge badge-default badge-<%- label %>">',
|
||||
'<span class="badge badge-primary badge-<%- label %>">',
|
||||
"<%- label %>",
|
||||
"</span>",
|
||||
"<% }); %>",
|
||||
|
||||
@@ -278,7 +278,7 @@ class Workflow {
|
||||
$.each(node.output_terminals, (ot_id, ot) => {
|
||||
if (node.post_job_actions[`HideDatasetAction${ot.name}`] === undefined) {
|
||||
node.addWorkflowOutput(ot.name);
|
||||
var callout = $(node.element).find(`.callout.${ot.name.replace(/(?=[()])/g, '\\')}`);
|
||||
var callout = $(node.element).find(`.callout.${ot.name.replace(/(?=[()])/g, "\\")}`);
|
||||
callout.find("img").attr("src", `${Galaxy.root}static/images/fugue/asterisk-small.png`);
|
||||
wf.has_changes = true;
|
||||
}
|
||||
|
||||
@@ -278,46 +278,51 @@ export default Backbone.View.extend({
|
||||
let workflow_versions = JSON.parse(
|
||||
$.ajax({
|
||||
url: `${Galaxy.root}api/workflows/${self.options.id}/versions`,
|
||||
async: false,
|
||||
async: false
|
||||
}).responseText
|
||||
);
|
||||
|
||||
for (let i = 0; i < workflow_versions.length; i++) {
|
||||
let current_wf = workflow_versions[i];
|
||||
let version_text = `Version ${current_wf['version']}, ${current_wf['steps']} steps`;
|
||||
let version_text = `Version ${current_wf["version"]}, ${current_wf["steps"]} steps`;
|
||||
let selected = false;
|
||||
if (i == self.workflow.workflow_version) {
|
||||
version_text = `${version_text} (active)`;
|
||||
selected = true;
|
||||
};
|
||||
}
|
||||
_workflow_version_dropdown[version_text] = {
|
||||
version: i,
|
||||
selected: selected,
|
||||
}
|
||||
selected: selected
|
||||
};
|
||||
}
|
||||
return _workflow_version_dropdown
|
||||
}
|
||||
return _workflow_version_dropdown;
|
||||
};
|
||||
|
||||
this.build_version_select = function() {
|
||||
let versions = this.get_workflow_versions();
|
||||
$("#workflow-version-switch").empty();
|
||||
$.each(versions, function(k, v) {
|
||||
$('#workflow-version-switch').append($('<option></option>').html(k).val(v.version).selected(v.selected));
|
||||
$("#workflow-version-switch").append(
|
||||
$("<option></option>")
|
||||
.html(k)
|
||||
.val(v.version)
|
||||
.selected(v.selected)
|
||||
);
|
||||
});
|
||||
$("#workflow-version-switch").on('change', function () {
|
||||
$('#workflow-version-switch').unbind('change');
|
||||
$("#workflow-version-switch").on("change", function() {
|
||||
$("#workflow-version-switch").unbind("change");
|
||||
if (this.value != self.workflow.workflow_version) {
|
||||
if (self.workflow && self.workflow.has_changes) {
|
||||
let r = confirm("There are unsaved changes to your workflow which will be lost. Continue ?");
|
||||
if (r == false) {
|
||||
// We rebuild the version select list, to reset the selected version
|
||||
self.build_version_select();
|
||||
return
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.load_workflow(self.options.id, this.value);
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
this.load_workflow = function load_workflow(id, version) {
|
||||
@@ -360,19 +365,21 @@ export default Backbone.View.extend({
|
||||
self.showWorkflowParameters();
|
||||
},
|
||||
error: function(response) {
|
||||
window.show_modal("Loading workflow failed.", response.err_msg, { Ok: function( response ){
|
||||
window.onbeforeunload = undefined;
|
||||
window.document.location = workflow_index;
|
||||
}})
|
||||
window.show_modal("Loading workflow failed.", response.err_msg, {
|
||||
Ok: function(response) {
|
||||
window.onbeforeunload = undefined;
|
||||
window.document.location = workflow_index;
|
||||
}
|
||||
});
|
||||
},
|
||||
beforeSubmit: function(data) {
|
||||
show_message("Loading workflow", "progress");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Load workflow definition
|
||||
this.load_workflow(self.options.id, self.options.version)
|
||||
this.load_workflow(self.options.id, self.options.version);
|
||||
if (window.make_popupmenu) {
|
||||
make_popupmenu($("#workflow-options-button"), {
|
||||
Save: save_current_workflow,
|
||||
|
||||
@@ -576,10 +576,10 @@
|
||||
<datatype extension="pdbqt" type="galaxy.datatypes.molecules:PDBQT" display_in_upload="true"/>
|
||||
<datatype extension="trr" type="galaxy.datatypes.binary:Trr" display_in_upload="true"/>
|
||||
<datatype extension="dcd" type="galaxy.datatypes.binary:Dcd" display_in_upload="true"/>
|
||||
<datatype extension="top" type="galaxy.datatypes.text:Top" display_in_upload="true"/>
|
||||
<datatype extension="top" type="galaxy.datatypes.data:Text" subclass="true" display_in_upload="true"/>
|
||||
<datatype extension="xtc" type="galaxy.datatypes.binary:Xtc" display_in_upload="true"/>
|
||||
<datatype extension="cpt" type="galaxy.datatypes.binary:Cpt" display_in_upload="true"/>
|
||||
<datatype extension="gro" type="galaxy.datatypes.tabular:Gro" display_in_upload="true"/>
|
||||
<datatype extension="gro" type="galaxy.datatypes.tabular:Tabular" subclass="true" display_in_upload="true"/>
|
||||
<datatype extension="vel" type="galaxy.datatypes.binary:Vel" display_in_upload="true"/>
|
||||
<datatype extension="grd" type="galaxy.datatypes.molecules:grd" display_in_upload="true"/>
|
||||
<datatype extension="grd.tgz" type="galaxy.datatypes.molecules:grdtgz" display_in_upload="true"/>
|
||||
|
||||
@@ -2599,7 +2599,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
self.version = self.version + 1 if self.version else 1
|
||||
session.add(past_hda)
|
||||
|
||||
def copy(self, parent_id=None, copy_tags=None, force_flush=True, copy_hid=True):
|
||||
def copy(self, parent_id=None, copy_tags=None, force_flush=True, copy_hid=True, new_name=None):
|
||||
"""
|
||||
Create a copy of this HDA.
|
||||
"""
|
||||
@@ -2607,7 +2607,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
|
||||
if copy_hid:
|
||||
hid = self.hid
|
||||
hda = HistoryDatasetAssociation(hid=hid,
|
||||
name=self.name,
|
||||
name=new_name or self.name,
|
||||
info=self.info,
|
||||
blurb=self.blurb,
|
||||
peek=self.peek,
|
||||
@@ -3451,6 +3451,17 @@ class DatasetCollection(Dictifiable, UsesAnnotations):
|
||||
elements.append(element)
|
||||
return elements
|
||||
|
||||
@property
|
||||
def first_dataset_element(self):
|
||||
for element in self.elements:
|
||||
if element.is_collection:
|
||||
first_element = element.child_collection.first_dataset_element
|
||||
if first_element:
|
||||
return first_element
|
||||
else:
|
||||
return element
|
||||
return None
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
# TODO: DatasetCollection state handling...
|
||||
|
||||
@@ -2481,14 +2481,15 @@ class ExtractDatasetCollectionTool(DatabaseOperationTool):
|
||||
assert collection_type in ["list", "paired"]
|
||||
how = incoming["which"]["which_dataset"]
|
||||
if how == "first":
|
||||
extracted = collection.dataset_instances[0]
|
||||
extracted_element = collection.first_dataset_element
|
||||
elif how == "by_identifier":
|
||||
extracted = collection[incoming["which"]["identifier"]].element_object
|
||||
extracted_element = collection[incoming["which"]["identifier"]]
|
||||
elif how == "by_index":
|
||||
extracted = collection[int(incoming["which"]["index"])].element_object
|
||||
extracted_element = collection[int(incoming["which"]["index"])]
|
||||
else:
|
||||
raise Exception("Invalid tool parameters.")
|
||||
extracted_o = extracted.copy(copy_tags=tags)
|
||||
extracted = extracted_element.element_object
|
||||
extracted_o = extracted.copy(copy_tags=tags, new_name=extracted_element.element_identifier)
|
||||
self._add_datasets_to_history(history, [extracted_o])
|
||||
|
||||
out_data["output"] = extracted_o
|
||||
|
||||
@@ -50,7 +50,9 @@ This tool will create new history datasets from your collection but your quota u
|
||||
<element name="bar" value="simple_line_alternative.txt" />
|
||||
</collection>
|
||||
</param>
|
||||
<output name="output" file="simple_line.txt" />
|
||||
<output name="output" file="simple_line.txt">
|
||||
<metadata name="name" value="foo" />
|
||||
</output>
|
||||
</test>
|
||||
<test>
|
||||
<conditional name="which">
|
||||
@@ -63,7 +65,9 @@ This tool will create new history datasets from your collection but your quota u
|
||||
<element name="bar" value="simple_line_alternative.txt" />
|
||||
</collection>
|
||||
</param>
|
||||
<output name="output" file="simple_line_alternative.txt" />
|
||||
<output name="output" file="simple_line_alternative.txt">
|
||||
<metadata name="name" value="bar" />
|
||||
</output>
|
||||
</test>
|
||||
<test>
|
||||
<conditional name="which">
|
||||
@@ -76,7 +80,9 @@ This tool will create new history datasets from your collection but your quota u
|
||||
<element name="bar" value="simple_line_alternative.txt" />
|
||||
</collection>
|
||||
</param>
|
||||
<output name="output" file="simple_line_alternative.txt" />
|
||||
<output name="output" file="simple_line_alternative.txt">
|
||||
<metadata name="name" value="bar" />
|
||||
</output>
|
||||
</test>
|
||||
</tests>
|
||||
</tool>
|
||||
|
||||
@@ -6,6 +6,7 @@ import logging
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
from bleach import clean
|
||||
from whoosh import analysis
|
||||
from whoosh.analysis import StandardAnalyzer
|
||||
from whoosh.fields import (
|
||||
@@ -49,7 +50,7 @@ class ToolBoxSearch(object):
|
||||
self.storage, self.index = self._index_setup()
|
||||
# We keep track of how many times the tool index has been rebuilt.
|
||||
# We start at -1, so that after the first index the count is at 0,
|
||||
# which is the same is the toolbox reload count. This way we can skip
|
||||
# which is the same as the toolbox reload count. This way we can skip
|
||||
# reindexing if the index count is equal to the toolbox reload count.
|
||||
self.index_count = -1
|
||||
|
||||
@@ -105,7 +106,9 @@ class ToolBoxSearch(object):
|
||||
add_doc_kwds['labels'] = to_unicode(" ".join(tool.labels))
|
||||
if index_help and tool.help:
|
||||
try:
|
||||
add_doc_kwds['help'] = to_unicode(tool.help.render(host_url="", static_path=""))
|
||||
raw_html = tool.help.render(host_url="", static_path="")
|
||||
cleantext = clean(raw_html, tags=[''], strip=True).replace('\n', ' ')
|
||||
add_doc_kwds['help'] = to_unicode(cleantext)
|
||||
except Exception:
|
||||
# Don't fail to build index just because a help message
|
||||
# won't render.
|
||||
|
||||
@@ -118,6 +118,27 @@ class ToolsTestCase(api.ApiTestCase):
|
||||
output_details = self.dataset_populator.get_history_dataset_details(history_id, dataset=output)
|
||||
assert output_details["file_ext"] == "bed"
|
||||
|
||||
@skip_without_tool("test_data_source")
|
||||
def test_data_source_sniff_fastqsanger(self):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
payload = self.dataset_populator.run_tool_payload(
|
||||
tool_id="test_data_source",
|
||||
inputs={
|
||||
"URL": "https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/1.fastqsanger.gz",
|
||||
"URL_method": "get",
|
||||
},
|
||||
history_id=history_id,
|
||||
)
|
||||
create_response = self._post("tools", data=payload)
|
||||
self._assert_status_code_is(create_response, 200)
|
||||
create_object = create_response.json()
|
||||
self._assert_has_keys(create_object, "outputs")
|
||||
assert len(create_object["outputs"]) == 1
|
||||
output = create_object["outputs"][0]
|
||||
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
|
||||
output_details = self.dataset_populator.get_history_dataset_details(history_id, dataset=output)
|
||||
assert output_details["file_ext"] == "fastqsanger.gz", output_details
|
||||
|
||||
@skip_without_tool("test_data_source")
|
||||
def test_data_sources_block_file_parameters(self):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
|
||||
Reference in New Issue
Block a user