Skip to content

Commit

Permalink
bug fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
anatskiy committed Oct 5, 2016
1 parent 3c38199 commit 6f10917
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 32 deletions.
23 changes: 1 addition & 22 deletions client/galaxy/scripts/mvc/history/options-menu.js
Expand Up @@ -169,30 +169,9 @@ var menu = [
}
];


// Webhooks
Webhooks.addToHistoryMenu(_l, menu);

var webhooks = new Webhooks.Webhooks();
webhooks.url = Galaxy.root + 'api/webhooks/history-menu/all';
webhooks.fetch({
async: false, // slows down History Panel loading
success: function() {
if (webhooks.length > 0) {
menu.push({
html : _l( 'Webhooks' ),
header : true
});

$.each(webhooks.models, function(index, model) {
var webhook = model.toJSON();
menu.push({
html : _l( webhook.config.title ),
anon : true
});
});
}
}
});

function buildMenu( isAnon, purgeAllowed, urlRoot ){
return _.clone( menu ).filter( function( menuOption ){
Expand Down
Expand Up @@ -2,3 +2,4 @@ name: history_test1
title: History Menu Webhook Item 1
type:
- history-menu
activate: false
Expand Up @@ -2,3 +2,4 @@ name: history_test2
title: History Menu Webhook Item 2
type:
- history-menu
activate: false
@@ -1,6 +1,8 @@
name: masthead_test
icon: fa-repeat
type:
- masthead
activate: false

icon: fa-repeat
tooltip: Masthead Plugin Test
activate: true

3 changes: 2 additions & 1 deletion config/plugins/webhooks/phdcomics/config/phdcomics.yaml
@@ -1,4 +1,5 @@
name: phdcomics
type:
- tools
- tool
- workflow
activate: false
3 changes: 2 additions & 1 deletion config/plugins/webhooks/xkcd/config/xkcd.yml
@@ -1,4 +1,5 @@
name: xkcd
type:
- tools
- tool
- workflow
activate: true
11 changes: 9 additions & 2 deletions lib/galaxy/webhooks/__init__.py
Expand Up @@ -12,9 +12,10 @@


class Webhook(object):
def __init__(self, w_name, w_type, w_path):
def __init__(self, w_name, w_type, w_activate, w_path):
self.name = w_name
self.type = w_type
self.activate = w_activate
self.path = w_path
self.styles = ''
self.script = ''
Expand All @@ -25,6 +26,7 @@ def to_dict(self):
return {
'name': self.name,
'type': self.type,
'activate': self.activate,
'styles': self.styles,
'script': self.script,
'config': self.config
Expand Down Expand Up @@ -63,7 +65,12 @@ def load_webhook_from_config(self, config_dir, config_file):
with open(os.path.join(config_dir, config_file)) as file:
config = yaml.load(file)
path = os.path.normpath(os.path.join(config_dir, '..'))
webhook = Webhook(config['name'], config['type'], path)
webhook = Webhook(
config['name'],
config['type'],
config['activate'],
path,
)

# Read styles into a string, assuming all styles are in a
# single file
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/history/options-menu.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/maps/mvc/webhooks.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/scripts/mvc/history/options-menu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f10917

Please sign in to comment.