bugfixes and small improvements

This commit is contained in:
Evgeny Anatskiy
2017-04-08 23:42:20 +02:00
parent ebcb2627df
commit ebf1f3903c
3 changed files with 11 additions and 17 deletions
@@ -9,21 +9,21 @@ $(document).ready(function() {
// Add attribute 'tour_id' to the execution button
$('#execute').attr('tour_id', 'execute');
var url = '/api/webhooks/tour_generator/get_data/' + JSON.stringify({
'tool_id': this.toolId
});
$.getJSON(url, function(obj) {
$.getJSON('/api/webhooks/tour_generator/get_data/', {
tool_id: this.toolId
})
.done(function(obj) {
if (obj.success) {
$('#history-refresh-button').click(); // Refresh history panel
// Create a tour only when the uploaded dataset is ready
// Add a delay because of the history panel refreshing
setTimeout(function() {
var dataset = Galaxy.currHistoryPanel.collection.where({
hid: obj.data.hid
})[0];
if (dataset) {
// Create a tour only when the uploaded dataset is ready
dataset.on('change:state', function(model) {
if (model.get('state') === 'ok') {
me._main(obj.data);
+5 -4
View File
@@ -56,15 +56,16 @@ class WebhooksController(BaseAPIController):
]
@expose_api_anonymous_and_sessionless
def get_data(self, trans, webhook_name, params, **kwd):
# def get_data(self, trans, webhook_name, params, **kwd):
def get_data(self, trans, webhook_name, **kwd):
"""
*GET /api/webhooks/{webhook_name}/get_data/{params}
Returns the result of executing helper function
"""
params = {}
# If params is not None, convert it into a dictionary
if params:
params = json.loads(params)
for key, value in kwd.items():
params[key] = value
webhook = [
webhook
-7
View File
@@ -598,13 +598,6 @@ def populate_api_routes( webapp, app ):
'/api/webhooks/{webhook_name}/get_data',
controller='webhooks',
action='get_data',
params=None,
conditions=dict( method=[ "GET" ] ) )
webapp.mapper.connect( 'get_data',
'/api/webhooks/{webhook_name}/get_data/{params}',
controller='webhooks',
action='get_data',
conditions=dict( method=[ "GET" ] ) )
# =======================