mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #5631 from martenson/genomespace
[17.09] Changed GenomeSpace token handling to use manual OpenID association only
This commit is contained in:
@@ -25,16 +25,10 @@ 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);
|
||||
this.$(".ui-gs-browse-button").append(this.browse_button.$el);
|
||||
this.$(".ui-gs-filename-textbox").append(this.filename_textbox.$el);
|
||||
},
|
||||
|
||||
/** Browse GenomeSpace */
|
||||
@@ -42,27 +36,25 @@ var View = Backbone.View.extend({
|
||||
var self = this;
|
||||
GenomespaceBrowser.openFileBrowser({
|
||||
successCallback: function(data) {
|
||||
self.value(data.destination + "^" + data.token);
|
||||
self.value(data.destination);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** Main Template */
|
||||
_template: function(options) {
|
||||
return '<div class="ui-gs-select-file">' +
|
||||
'<div class="ui-gs-browse-field">' +
|
||||
'<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 (
|
||||
'<div class="ui-gs-select-file">' +
|
||||
'<div class="ui-gs-browse-field">' +
|
||||
'<span class="ui-gs-browse-button" />' +
|
||||
'<span class="ui-gs-filename-textbox" />' +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
);
|
||||
},
|
||||
|
||||
/** Return/Set currently selected genomespace filename/token */
|
||||
value : function (new_value) {
|
||||
|
||||
/** Return/Set currently selected genomespace filename */
|
||||
value: function(new_value) {
|
||||
// check if new_value is defined
|
||||
if (new_value !== undefined) {
|
||||
this._setValue(new_value);
|
||||
@@ -71,22 +63,19 @@ var View = Backbone.View.extend({
|
||||
return this._getValue();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 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) {
|
||||
values = new_value.split("^");
|
||||
this.filename_textbox.value(values[0]);
|
||||
this.token_textbox.value(values[1]);
|
||||
this.filename_textbox.value(new_value);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -884,10 +884,6 @@
|
||||
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 {
|
||||
@@ -895,15 +891,9 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"ui-select-genomespace.js","sources":["../../../src/mvc/ui/ui-select-genomespace.js"],"names":["define","Utils","Ui","GenomespaceBrowser","View","Backbone","extend","initialize","options","self","this","browse_button","ButtonIcon","title","icon","tooltip","onclick","browseGenomeSpace","filename_textbox","Input","token_textbox","type","setElement","_template","$","append","$el","openFileBrowser","successCallback","data","value","destination","token","new_value","undefined","_getValue","_setValue","values","split"],"mappings":"AACAA,QAAQ,cAAe,iBAAkB,6BACjC,SAASC,EAAOC,EAAIC,GAK5B,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAa,SAASC,GAGlB,GAAIC,GAAOC,IAGXA,MAAKC,cAAgB,GAAIT,GAAGU,YACxBC,MAAc,SACdC,KAAc,gBACdC,QAAc,qBACdC,QAAc,WACVP,EAAKQ,uBAKbP,KAAKQ,iBAAmB,GAAIhB,GAAGiB,MAG/BT,KAAKU,cAAgB,GAAIlB,GAAGiB,OAC1BE,KAAa,aAIfX,KAAKY,WAAWZ,KAAKa,UAAUf,IAC/BE,KAAKc,EAAE,wBAAwBC,OAAOf,KAAKC,cAAce,KACzDhB,KAAKc,EAAE,2BAA2BC,OAAOf,KAAKQ,iBAAiBQ,KAC/DhB,KAAKc,EAAE,wBAAwBC,OAAOf,KAAKU,cAAcM,MAI7DT,kBAAmB,WACf,GAAIR,GAAOC,IACXP,GAAmBwB,iBACfC,gBAAiB,SAASC,GACtBpB,EAAKqB,MAAMD,EAAKE,YAAc,IAAMF,EAAKG,WAMrDT,UAAW,WACP,MAAQ,6SAaZO,MAAQ,SAAUG,GAEd,MAAkBC,UAAdD,EAIKvB,KAAKyB,gBAHVzB,MAAK0B,UAAUH,IAQvBE,UAAW,WACP,MAAOzB,MAAKQ,iBAAiBY,QACzB,IAAMpB,KAAKU,cAAcU,SAIjCM,UAAW,SAASH,GACZA,IACFI,OAASJ,EAAUK,MAAM,KACzB5B,KAAKQ,iBAAiBY,MAAMO,OAAO,IACnC3B,KAAKU,cAAcU,MAAMO,OAAO,OAM1C,QACIjC,KAAMA"}
|
||||
{"version":3,"file":"ui-select-genomespace.js","sources":["../../../src/mvc/ui/ui-select-genomespace.js"],"names":["define","Utils","Ui","GenomespaceBrowser","View","Backbone","extend","initialize","options","self","this","browse_button","ButtonIcon","title","icon","tooltip","onclick","browseGenomeSpace","filename_textbox","Input","setElement","_template","$","append","$el","openFileBrowser","successCallback","data","value","destination","new_value","undefined","_getValue","_setValue"],"mappings":"AACAA,QAAQ,cAAe,iBAAkB,6BACjC,SAASC,EAAOC,EAAIC,GAK5B,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAa,SAASC,GAGlB,GAAIC,GAAOC,IAGXA,MAAKC,cAAgB,GAAIT,GAAGU,YACxBC,MAAc,SACdC,KAAc,gBACdC,QAAc,qBACdC,QAAc,WACVP,EAAKQ,uBAKbP,KAAKQ,iBAAmB,GAAIhB,GAAGiB,MAG/BT,KAAKU,WAAWV,KAAKW,UAAUb,IAC/BE,KAAKY,EAAE,wBAAwBC,OAAOb,KAAKC,cAAca,KACzDd,KAAKY,EAAE,2BAA2BC,OAAOb,KAAKQ,iBAAiBM,MAInEP,kBAAmB,WACf,GAAIR,GAAOC,IACXP,GAAmBsB,iBACfC,gBAAiB,SAASC,GACtBlB,EAAKmB,MAAMD,EAAKE,iBAM5BR,UAAW,WACP,MAAO,0JAWXO,MAAO,SAASE,GAEZ,MAAkBC,UAAdD,EAIKpB,KAAKsB,gBAHVtB,MAAKuB,UAAUH,IAQvBE,UAAW,WACP,MAAOtB,MAAKQ,iBAAiBU,SAIjCK,UAAW,SAASH,GACZA,GACApB,KAAKQ,iBAAiBU,MAAME,KAMxC,QACI1B,KAAMA"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/tool/tool-genomespace"],function(a,b,c){var d=Backbone.View.extend({initialize:function(a){var c=this;this.browse_button=new b.ButtonIcon({title:"Browse",icon:"fa fa-sign-in",tooltip:"Browse GenomeSpace",onclick:function(){c.browseGenomeSpace()}}),this.filename_textbox=new b.Input,this.token_textbox=new b.Input({type:"password"}),this.setElement(this._template(a)),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)},browseGenomeSpace:function(){var a=this;c.openFileBrowser({successCallback:function(b){a.value(b.destination+"^"+b.token)}})},_template:function(){return'<div class="ui-gs-select-file"><div class="ui-gs-browse-field"><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>'},value:function(a){return void 0===a?this._getValue():void this._setValue(a)},_getValue:function(){return this.filename_textbox.value()+"^"+this.token_textbox.value()},_setValue:function(a){a&&(values=a.split("^"),this.filename_textbox.value(values[0]),this.token_textbox.value(values[1]))}});return{View:d}});
|
||||
define(["utils/utils","mvc/ui/ui-misc","mvc/tool/tool-genomespace"],function(a,b,c){var d=Backbone.View.extend({initialize:function(a){var c=this;this.browse_button=new b.ButtonIcon({title:"Browse",icon:"fa fa-sign-in",tooltip:"Browse GenomeSpace",onclick:function(){c.browseGenomeSpace()}}),this.filename_textbox=new b.Input,this.setElement(this._template(a)),this.$(".ui-gs-browse-button").append(this.browse_button.$el),this.$(".ui-gs-filename-textbox").append(this.filename_textbox.$el)},browseGenomeSpace:function(){var a=this;c.openFileBrowser({successCallback:function(b){a.value(b.destination)}})},_template:function(){return'<div class="ui-gs-select-file"><div class="ui-gs-browse-field"><span class="ui-gs-browse-button" /><span class="ui-gs-filename-textbox" /></div></div>'},value:function(a){return void 0===a?this._getValue():void this._setValue(a)},_getValue:function(){return this.filename_textbox.value()},_setValue:function(a){a&&this.filename_textbox.value(a)}});return{View:d}});
|
||||
//# sourceMappingURL=../../../maps/mvc/ui/ui-select-genomespace.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -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>
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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__
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user