Skip to content

Commit

Permalink
Merge pull request #5660 from martenson/merge-genomespace
Browse files Browse the repository at this point in the history
Merge forward genomespace changes
  • Loading branch information
martenson authored Mar 7, 2018
2 parents fffca43 + cf369e8 commit 300fffe
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 47 deletions.
20 changes: 4 additions & 16 deletions client/galaxy/scripts/mvc/ui/ui-select-genomespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,18 @@ var View = Backbone.View.extend({
// create genomespace filepath textbox
this.filename_textbox = new Ui.Input();

// create genomespace token textbox
this.token_textbox = new Ui.Input({
type: "password"
});

// create elements
this.setElement(this._template(options));
this.$(".ui-gs-browse-button").append(this.browse_button.$el);
this.$(".ui-gs-filename-textbox").append(this.filename_textbox.$el);
this.$(".ui-gs-token-textbox").append(this.token_textbox.$el);
},

/** Browse GenomeSpace */
browseGenomeSpace: function(options) {
var self = this;
GenomespaceBrowser.openFileBrowser({
successCallback: function(data) {
self.value(`${data.destination}^${data.token}`);
self.value(data.destination);
}
});
},
Expand All @@ -56,15 +50,11 @@ var View = Backbone.View.extend({
'<span class="ui-gs-browse-button" />' +
'<span class="ui-gs-filename-textbox" />' +
"</div>" +
'<div class="ui-gs-token-field">' +
'<span class=ui-gs-label"><div class="ui-gs-token-label">Token</div></span>' +
'<span class="ui-gs-token-textbox" />' +
"</div>" +
"</div>"
);
},

/** Return/Set currently selected genomespace filename/token */
/** Return/Set currently selected genomespace filename */
value: function(new_value) {
// check if new_value is defined
if (new_value !== undefined) {
Expand All @@ -76,15 +66,13 @@ var View = Backbone.View.extend({

// get value
_getValue: function() {
return `${this.filename_textbox.value()}^${this.token_textbox.value()}`;
return this.filename_textbox.value();
},

// set value
_setValue: function(new_value) {
if (new_value) {
var values = new_value.split("^");
this.filename_textbox.value(values[0]);
this.token_textbox.value(values[1]);
this.filename_textbox.value(new_value);
}
this.options.onchange && this.options.onchange(new_value);
}
Expand Down
16 changes: 3 additions & 13 deletions client/galaxy/style/less/ui.less
Original file line number Diff line number Diff line change
Expand Up @@ -906,26 +906,16 @@
float: right;
width: ~'calc(100% - 76px)';
}
.ui-gs-token-textbox {
float: right;
width: ~'calc(100% - 76px)';
}
.ui-gs-browse-button {
float: left;
.ui-button-icon {
margin-top: 3px;
margin-right: 5px;
}
}
.ui-gs-token-label {
margin-top: 5px;
margin-left: 32px;
margin-right: 5px;
float: left;
}
.ui-gs-token-field {
clear: both;
padding-top: 5px;
.ui-gs-browse-field {
height: @input-height-base;
line-height: @line-height-base;
}
}

Expand Down
2 changes: 1 addition & 1 deletion static/style/blue/base.css

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions tools/genomespace/genomespace_exporter.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<tool name="GenomeSpace Exporter" id="genomespace_exporter" version="0.0.5">
<tool name="GenomeSpace Exporter" id="genomespace_exporter" require_login="True" version="0.0.6">
<description> - send data to GenomeSpace</description>
<environment_variables>
<environment_variable name="GS_TOKEN">
#set $token = $genomespace_browser.split('^')[1] or $__user__.preferences.get('genomespace_token', None)
#assert $token, Exception('Invalid token. You must be logged into GenomeSpace through OpenID or select a valid folder via the GenomeSpace browse dialog.')
#set $token = $__user__.preferences.get('genomespace_token', None)
#assert $token, Exception('Invalid token. You must be logged into GenomeSpace through OpenID.')
$token
</environment_variable>
</environment_variables>
Expand All @@ -31,11 +31,9 @@
<data format="auto" name="output_log" />
</outputs>
<help>
This Tool allows you to export data to GenomeSpace. Click the Browse button to select a file to export. The tool will automatically
fetch your GenomeSpace token when you select a file from the export dialog.
This Tool allows you to export data to GenomeSpace. Click the Browse button to select a file to export.

Alternatively, you can be logged in using your GenomeSpace OpenID, and the tool will use this ID if no token is entered.
This allows you to simply paste the filepath into the location box and leave the token empty.
To use this tool, you must have logged in using your GenomeSpace OpenID.
You can associate your OpenID credentials under the User Preferences panel.
Click here_ to refresh your GenomeSpace token.

Expand Down
17 changes: 10 additions & 7 deletions tools/genomespace/genomespace_importer.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<?xml version="1.0"?>
<tool name="GenomeSpace Importer" id="genomespace_importer" require_login="False" version="0.0.5">
<tool name="GenomeSpace Importer" id="genomespace_importer" require_login="True" version="0.0.6">
<description> - receive data from GenomeSpace</description>
<environment_variables>
<environment_variable name="GS_TOKEN">
#set $token = $__user__.preferences.get('genomespace_token', None)
#assert $token, Exception('Invalid token. You must be logged into GenomeSpace through OpenID.')
$token
</environment_variable>
</environment_variables>
<command><![CDATA[
python $__tool_directory__/genomespace_importer.py
#set $input_file = $URL.split('^')[0] if '^' in $URL else $URL
#set $token = $URL.split('^')[1] if '^' in $URL and $URL.split('^')[1] else $__user__.preferences.get('genomespace_token', None)
#assert $input_file, Exception('You must select a valid input file.')
#assert $token, Exception('Invalid token. You must be logged into GenomeSpace through OpenID.')
--json_parameter_file '${output_file1}'
--galaxy_root $__root_dir__
--data_conf $__datatypes_config__
Expand All @@ -21,11 +26,9 @@
<data format="auto" name="output_file1" />
</outputs>
<help>
This tool allows you to import data from GenomeSpace. Click the Browse button to select a file to import. The tool will automatically
fetch your GenomeSpace token when you select a file from the import dialog.
This tool allows you to import data from GenomeSpace. Click the Browse button to select a file to import.

Alternatively, you can be logged in using your GenomeSpace OpenID, and the tool will use this ID if no token is entered.
This allows you to simply paste the filepath into the location box and leave the token empty.
To use this tool, you must have logged in using your GenomeSpace OpenID.
You can associate your OpenID credentials under the User Preferences panel.
Click here_ to refresh your GenomeSpace token.

Expand Down
6 changes: 3 additions & 3 deletions tools/genomespace/genomespace_push.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<tool name="GenomeSpace Push" id="genomespace_push" tool_type="data_source" force_history_refresh="True" hidden="True" display_interface="False" require_login="True" version="0.0.1">
<tool name="GenomeSpace Push" id="genomespace_push" tool_type="data_source" force_history_refresh="True" hidden="True" display_interface="False" require_login="True" version="0.0.6">
<description> - Push data from GenomeSpace to Galaxy</description>
<environment_variables>
<environment_variable name="GS_TOKEN">
#set $token = $__user__.preferences.get( 'genomespace_token', None )
#assert $token, Exception('Invalid token. You must be logged into GenomeSpace through OpenID or select a valid file via the GenomeSpace browse dialog.' )
#set $token = $__user__.preferences.get('genomespace_token', None)
#assert $token, Exception('Invalid token. You must be logged into GenomeSpace through OpenID.')
$token
</environment_variable>
</environment_variables>
Expand Down

0 comments on commit 300fffe

Please sign in to comment.