Skip to content

Commit

Permalink
removing name from the plugin config
Browse files Browse the repository at this point in the history
  • Loading branch information
anuprulez committed Aug 12, 2016
1 parent 85fde4c commit 4b53ae0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
9 changes: 5 additions & 4 deletions client/galaxy/scripts/mvc/user/extra-information.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ var ExtraInformation = Backbone.View.extend({
// values to each input field
var input_val = "";
if( Object.keys(plugins).length !== 0 ) {
plugin_name = item_object["name"];
plugin_name = item;
model = plugins[plugin_name];
}
else {
is_plugin_empty = true;
}

template = template + '<div class="form-row '+ item_object["name"] +' ">';
template = template + '<div class="form-row '+ plugin_name +' ">';
template = template + "<label>" + item_object["description"] + ":</label>";

for( var i = 0; i < item_object["inputs"].length; i++ ) {
Expand Down Expand Up @@ -100,11 +100,12 @@ var ExtraInformation = Backbone.View.extend({
attrvalue = $(this).val();

// checks if the required fields are left empty
if( $( this ).attr("required") && attrvalue === "" ) {
/*if( $( this ).attr("required") && attrvalue === "" ) {
messageBar.renderError( "Please fill the "+ attrname +" required field" );
is_form_valid = false;
return;
}
}*/

// builds the JSON object
element[ $(this).attr('name') ] = attrvalue;
if( data[section_name] ) {
Expand Down
2 changes: 0 additions & 2 deletions config/user_preferences_extra_conf.xml.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
preferences:
# the key you can refer to
apollo_url_01:
name: section_apollo_url
# description that is displayed to the user
description: The URL to your personal Apollo instance
inputs:
Expand All @@ -15,7 +14,6 @@ preferences:
required: True

openstack_account:
name: section_openstack_account
description: Your own Open Stack account
inputs:
- name: username
Expand Down
8 changes: 3 additions & 5 deletions lib/galaxy/webapps/galaxy/api/user_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,12 @@ def get_extra_preferences( self, trans, cntrller='user_preferences', **kwd ):
user = trans.user
plugin_data = user.preferences.get("dynamic_user_preferences", "{}")
log.warn(plugin_data)

# deserializes the json and returns to the client
return { "config": config,
"plugins": json.loads(plugin_data)
return {
"config": config,
"plugins": json.loads(plugin_data)
}


@expose_api
def save_extra_preferences( self, trans, cntrller='user_preferences', **kwd ):
"""
Expand All @@ -585,4 +584,3 @@ def save_extra_preferences( self, trans, cntrller='user_preferences', **kwd ):
'message': "The data was successfully saved",
'status': "done"
}

4 changes: 2 additions & 2 deletions static/scripts/bundled/libs.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

0 comments on commit 4b53ae0

Please sign in to comment.