From 76f818b0c5142b65e42318856d428e1a1ce0ff00 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 14:50:22 -0500 Subject: [PATCH 01/88] Strip openid features from user controller --- lib/galaxy/webapps/galaxy/controllers/user.py | 367 ------------------ 1 file changed, 367 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/user.py b/lib/galaxy/webapps/galaxy/controllers/user.py index cb5c97d53f0d..6a26ec655f7f 100644 --- a/lib/galaxy/webapps/galaxy/controllers/user.py +++ b/lib/galaxy/webapps/galaxy/controllers/user.py @@ -62,375 +62,9 @@ """ -class UserOpenIDGrid(grids.Grid): - title = "OpenIDs linked to your account" - model_class = model.UserOpenID - default_filter = {"openid": "All"} - default_sort_key = "-create_time" - columns = [ - grids.TextColumn("OpenID URL", key="openid", link=(lambda x: dict(action='openid_auth', login_button="Login", openid_url=x.openid if not x.provider else '', openid_provider=x.provider, auto_associate=True))), - grids.GridColumn("Created", key="create_time", format=time_ago), - ] - global_actions = [ - grids.GridAction("Add new account", url_args=dict(action="create_openid"), target="center") - ] - operations = [ - grids.GridOperation("Delete", async_compatible=True), - ] - - def build_initial_query(self, trans, **kwd): - return trans.sa_session.query(self.model_class).filter(self.model_class.user_id == trans.user.id) - - class User(BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, CreatesApiKeysMixin): - user_openid_grid = UserOpenIDGrid() installed_len_files = None - @web.expose - def openid_auth(self, trans, **kwd): - '''Handles user request to access an OpenID provider''' - if not trans.app.config.enable_openid: - return trans.show_error_message('OpenID authentication is not enabled in this instance of Galaxy') - message = 'Unspecified failure authenticating via OpenID' - auto_associate = util.string_as_bool(kwd.get('auto_associate', False)) - use_panels = util.string_as_bool(kwd.get('use_panels', False)) - consumer = trans.app.openid_manager.get_consumer(trans) - openid_url = kwd.get('openid_url', '') - openid_provider = kwd.get('openid_provider', '') - if openid_url: - openid_provider_obj = trans.app.openid_providers.new_provider_from_identifier(openid_url) - elif openid_provider: - openid_provider_obj = trans.app.openid_providers.get(openid_provider) - else: - message = 'An OpenID provider was not specified' - redirect = kwd.get('redirect', '').strip() - if not redirect: - redirect = ' ' - if openid_provider_obj: - process_url = trans.request.base.rstrip('/') + url_for(controller='user', action='openid_process', redirect=redirect, openid_provider=openid_provider, auto_associate=auto_associate) # None of these values can be empty, or else a verification error will occur - request = None - try: - request = consumer.begin(openid_provider_obj.op_endpoint_url) - if request is None: - message = 'No OpenID services are available at %s' % openid_provider_obj.op_endpoint_url - except Exception as e: - message = 'Failed to begin OpenID authentication: %s' % str(e) - if request is not None: - trans.app.openid_manager.add_sreg(trans, request, required=openid_provider_obj.sreg_required, optional=openid_provider_obj.sreg_optional) - if request.shouldSendRedirect(): - redirect_url = request.redirectURL( - trans.request.base, process_url) - trans.app.openid_manager.persist_session(trans, consumer) - return trans.response.send_redirect(redirect_url) - else: - form = request.htmlMarkup(trans.request.base, process_url, form_tag_attrs={'id': 'openid_message', 'target': '_top'}) - trans.app.openid_manager.persist_session(trans, consumer) - return form - return trans.response.send_redirect(url_for(controller='user', - action='login', - redirect=redirect, - use_panels=use_panels, - message=message, - status='error')) - - @web.expose - def openid_process(self, trans, **kwd): - '''Handle's response from OpenID Providers''' - if not trans.app.config.enable_openid: - return trans.show_error_message('OpenID authentication is not enabled in this instance of Galaxy') - auto_associate = util.string_as_bool(kwd.get('auto_associate', False)) - action = 'login' - controller = 'user' - if trans.user: - action = 'openids' - controller = 'list' - if trans.app.config.support_url is not None: - contact = 'support' % trans.app.config.support_url - else: - contact = 'support' - message = 'Verification failed for an unknown reason. Please contact %s for assistance.' % (contact) - status = 'error' - consumer = trans.app.openid_manager.get_consumer(trans) - info = consumer.complete(kwd, trans.request.url) - display_identifier = info.getDisplayIdentifier() - redirect = kwd.get('redirect', '').strip() - openid_provider = kwd.get('openid_provider', None) - if info.status == trans.app.openid_manager.FAILURE and display_identifier: - message = "Login via OpenID failed. The technical reason for this follows, please include this message in your email if you need to %s to resolve this problem: %s" % (contact, info.message) - return trans.response.send_redirect(url_for(controller=controller, - action=action, - use_panels=True, - redirect=redirect, - message=message, - status='error')) - elif info.status == trans.app.openid_manager.SUCCESS: - if info.endpoint.canonicalID: - display_identifier = info.endpoint.canonicalID - openid_provider_obj = trans.app.openid_providers.get(openid_provider) - user_openid = trans.sa_session.query(trans.app.model.UserOpenID).filter(trans.app.model.UserOpenID.table.c.openid == display_identifier).first() - if not openid_provider_obj and user_openid and user_openid.provider: - openid_provider_obj = trans.app.openid_providers.get(user_openid.provider) - if not openid_provider_obj: - openid_provider_obj = trans.app.openid_providers.new_provider_from_identifier(display_identifier) - if not user_openid: - user_openid = trans.app.model.UserOpenID(session=trans.galaxy_session, openid=display_identifier) - if not user_openid.user: - user_openid.session = trans.galaxy_session - if not user_openid.provider and openid_provider: - user_openid.provider = openid_provider - if trans.user: - if user_openid.user and user_openid.user.id != trans.user.id: - message = "The OpenID %s is already associated with another Galaxy account, %s. Please disassociate it from that account before attempting to associate it with a new account." % (escape(display_identifier), escape(user_openid.user.email)) - if not trans.user.active and trans.app.config.user_activation_on: # Account activation is ON and the user is INACTIVE. - if (trans.app.config.activation_grace_period != 0): # grace period is ON - if self.is_outside_grace_period(trans, trans.user.create_time): # User is outside the grace period. Login is disabled and he will have the activation email resent. - message, status = self.resend_verification_email(trans, trans.user.email, trans.user.username) - else: # User is within the grace period, let him log in. - pass - else: # Grace period is off. Login is disabled and user will have the activation email resent. - message, status = self.resend_verification_email(trans, trans.user.email, trans.user.username) - elif not user_openid.user or user_openid.user == trans.user: - if openid_provider_obj.id: - user_openid.provider = openid_provider_obj.id - user_openid.session = trans.galaxy_session - if not openid_provider_obj.never_associate_with_user: - if not auto_associate and (user_openid.user and user_openid.user.id == trans.user.id): - message = "The OpenID %s is already associated with your Galaxy account, %s." % (escape(display_identifier), escape(trans.user.email)) - status = "warning" - else: - message = "The OpenID %s has been associated with your Galaxy account, %s." % (escape(display_identifier), escape(trans.user.email)) - status = "done" - user_openid.user = trans.user - trans.sa_session.add(user_openid) - trans.sa_session.flush() - trans.log_event("User associated OpenID: %s" % display_identifier) - else: - message = "The OpenID %s cannot be used to log into your Galaxy account, but any post authentication actions have been performed." % escape(openid_provider_obj.name) - status = "info" - openid_provider_obj.post_authentication(trans, trans.app.openid_manager, info) - if redirect: - message = '%s
Click here to return to the page you were previously viewing.' % (message, escape(self.__get_redirect_url(redirect))) - if redirect and status != "error": - return trans.response.send_redirect(self.__get_redirect_url(redirect)) - return trans.response.send_redirect(url_for(controller='openids', - action='list', - use_panels=True, - redirect=redirect, - message=message, - status=status)) - elif user_openid.user: - trans.handle_user_login(user_openid.user) - trans.log_event("User logged in via OpenID: %s" % display_identifier) - openid_provider_obj.post_authentication(trans, trans.app.openid_manager, info) - if not redirect: - redirect = url_for('/') - redirect = self.__get_redirect_url(redirect) - return trans.response.send_redirect(redirect) - trans.sa_session.add(user_openid) - trans.sa_session.flush() - message = "OpenID authentication was successful, but you need to associate your OpenID with a Galaxy account." - sreg_resp = trans.app.openid_manager.get_sreg(info) - try: - sreg_username_name = openid_provider_obj.use_for.get('username') - username = sreg_resp.get(sreg_username_name, '') - except AttributeError: - username = '' - try: - sreg_email_name = openid_provider_obj.use_for.get('email') - email = sreg_resp.get(sreg_email_name, '') - except AttributeError: - email = '' - # OpenID success, but user not logged in, and not previously associated - return trans.response.send_redirect(url_for(controller='user', - action='openid_associate', - use_panels=True, - redirect=redirect, - username=username, - email=email, - message=message, - status='warning')) - elif info.status == trans.app.openid_manager.CANCEL: - message = "Login via OpenID was cancelled by an action at the OpenID provider's site." - status = "warning" - elif info.status == trans.app.openid_manager.SETUP_NEEDED: - if info.setup_url: - return trans.response.send_redirect(info.setup_url) - else: - message = "Unable to log in via OpenID. Setup at the provider is required before this OpenID can be used. Please visit your provider's site to complete this step." - return trans.response.send_redirect(url_for(controller='user', - action=action, - use_panels=True, - redirect=redirect, - message=message, - status=status)) - - @web.expose - def openid_associate(self, trans, cntrller='user', **kwd): - '''Associates a user with an OpenID log in''' - if not trans.app.config.enable_openid: - return trans.show_error_message('OpenID authentication is not enabled in this instance of Galaxy') - use_panels = util.string_as_bool(kwd.get('use_panels', False)) - message = escape(kwd.get('message', '')) - status = kwd.get('status', 'done') - email = kwd.get('email', '') - username = kwd.get('username', '') - redirect = kwd.get('redirect', '').strip() - params = util.Params(kwd) - is_admin = cntrller == 'admin' and trans.user_is_admin - openids = trans.galaxy_session.openids - user = None - if not openids: - return trans.show_error_message('You have not successfully completed an OpenID authentication in this session. You can do so on the login page.' % url_for(controller='user', action='login', use_panels=use_panels)) - elif is_admin: - return trans.show_error_message('Associating OpenIDs with accounts cannot be done by administrators.') - if kwd.get('login_button', False): - message, status, user, success = self.__validate_login(trans, **kwd) - if success: - openid_objs = [] - for openid in openids: - openid_provider_obj = trans.app.openid_providers.get(openid.provider) - if not openid_provider_obj or not openid_provider_obj.never_associate_with_user: - openid.user = user - trans.sa_session.add(openid) - trans.log_event("User associated OpenID: %s" % openid.openid) - if openid_provider_obj and openid_provider_obj.has_post_authentication_actions(): - openid_objs.append(openid_provider_obj) - trans.sa_session.flush() - if len(openid_objs) == 1: - return trans.response.send_redirect(url_for(controller='user', action='openid_auth', openid_provider=openid_objs[0].id, redirect=redirect, auto_associate=True)) - elif openid_objs: - message = 'You have authenticated with several OpenID providers, please click the following links to execute the post authentication actions. ' - message = "%s
" % (message) - return trans.response.send_redirect(url_for(controller='openids', - action='list', - message=message, - status='info')) - if redirect: - return trans.response.send_redirect(redirect) - return trans.response.send_redirect(url_for(controller='openids', - action='list', - message=message, - status='info')) - if kwd.get('create_user_button', False): - password = kwd.get('password', '') - confirm = kwd.get('confirm', '') - subscribe = params.get('subscribe', '') - subscribe_checked = CheckboxField.is_checked(subscribe) - error = '' - if not trans.app.config.allow_user_creation and not trans.user_is_admin: - error = 'User registration is disabled. Please contact your local Galaxy administrator for an account.' - else: - # Check email and password validity - error = self.__validate(trans, params, email, password, confirm, username) - if not error: - # all the values are valid - message, status, user, success = self.__register(trans, - cntrller, - subscribe_checked, - **kwd) - if success: - openid_objs = [] - for openid in openids: - openid_provider_obj = trans.app.openid_providers.get(openid.provider) - if not openid_provider_obj: - openid_provider_obj = trans.app.openid_providers.new_provider_from_identifier(openid.identifier) - if not openid_provider_obj.never_associate_with_user: - openid.user = user - trans.sa_session.add(openid) - trans.log_event("User associated OpenID: %s" % openid.openid) - if openid_provider_obj.has_post_authentication_actions(): - openid_objs.append(openid_provider_obj) - trans.sa_session.flush() - if len(openid_objs) == 1: - return trans.response.send_redirect(url_for(controller='user', action='openid_auth', openid_provider=openid_objs[0].id, redirect=redirect, auto_associate=True)) - elif openid_objs: - message = 'You have authenticated with several OpenID providers, please click the following links to execute the post authentication actions. ' - message = "%s
" % (message) - return trans.response.send_redirect(url_for(controller='openids', - action='list', - message=message, - status='info')) - if redirect: - return trans.response.send_redirect(redirect) - return trans.response.send_redirect(url_for(controller='openids', - action='list', - message=message, - status='info')) - else: - message = error - status = 'error' - return trans.fill_template('/user/openid_associate.mako', - cntrller=cntrller, - email=email, - password='', - confirm='', - username=transform_publicname(trans, username), - header='', - use_panels=use_panels, - redirect=redirect, - refresh_frames=[], - message=message, - status=status, - active_view="user", - subscribe_checked=False, - openids=openids) - - @web.expose - @web.require_login('create OpenIDs') - def create_openid(self, trans, **kwd): - return trans.fill_template('/user/openid_manage.mako', - openid_providers=trans.app.openid_providers, - redirect=kwd.get('redirect', url_for(controller='openids', action='list')).strip()) - - @web.expose_api - @web.require_login('manage OpenIDs') - def openids_list(self, trans, **kwd): - '''List of availabel OpenIDs for user''' - message = kwd.get('message', '') - status = kwd.get('status', '') - if not trans.app.config.enable_openid: - message = 'OpenID authentication is not enabled in this instance of Galaxy.' - status = 'error' - if 'operation' in kwd: - operation = kwd['operation'].lower() - ids = util.listify(kwd.get('id')) - if operation == 'delete': - if not ids: - message = 'You must select at least one OpenID to disassociate from your Galaxy account.' - status = 'error' - else: - user_openids = [] - for id in ids: - id = trans.security.decode_id(id) - user_openid = trans.sa_session.query(trans.app.model.UserOpenID).get(int(id)) - if not user_openid or (trans.user.id != user_openid.user_id): - message = 'The selected OpenID(s) are not associated with your Galaxy account.' - status = 'error' - user_openids = [] - break - user_openids.append(user_openid) - if user_openids: - deleted_urls = [] - for user_openid in user_openids: - trans.sa_session.delete(user_openid) - deleted_urls.append(user_openid.openid) - trans.sa_session.flush() - for deleted_url in deleted_urls: - trans.log_event('User disassociated OpenID: %s' % deleted_url) - message = '%s OpenIDs were disassociated from your Galaxy account.' % len(ids) - status = 'done' - if message and status: - kwd['message'] = util.sanitize_text(message) - kwd['status'] = status - kwd['dict_format'] = True - return self.user_openid_grid(trans, **kwd) - @web.expose def login(self, trans, refresh_frames=[], **kwd): '''Handle Galaxy Log in''' @@ -482,7 +116,6 @@ def login(self, trans, refresh_frames=[], **kwd): refresh_frames=refresh_frames, message=message, status=status, - openid_providers=trans.app.openid_providers, form_input_auto_focus=True, active_view="user") From a30f3b2e2376f112ca94340ef15aa95a010c6626 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 14:50:41 -0500 Subject: [PATCH 02/88] Remove openid related makos --- templates/user/openid_associate.mako | 73 ---------------------------- templates/user/openid_manage.mako | 6 --- 2 files changed, 79 deletions(-) delete mode 100644 templates/user/openid_associate.mako delete mode 100644 templates/user/openid_manage.mako diff --git a/templates/user/openid_associate.mako b/templates/user/openid_associate.mako deleted file mode 100644 index 2991a94b5146..000000000000 --- a/templates/user/openid_associate.mako +++ /dev/null @@ -1,73 +0,0 @@ -<%! - def inherit(context): - if context.get('use_panels'): - return '/webapps/galaxy/base_panels.mako' - else: - return '/base.mako' -%> -<%inherit file="${inherit(context)}"/> - -<%def name="init()"> -<% - self.has_left_panel=False - self.has_right_panel=False - self.active_view=active_view - self.message_box_visible=False -%> - - -<%namespace file="/message.mako" import="render_msg" /> -<%namespace file="login.mako" import="render_login_form" /> -<%namespace file="register.mako" import="render_registration_form" /> - -<%def name="center_panel()"> - ${body()} - - -<%def name="body()"> - -
- %if context.get('use_panels'): -
- %else: -
- %endif - - %if message: - ${render_msg( message, status )} - %endif - -

OpenID Account Association

-
- OpenIDs must be associated with a Galaxy account before they can be used for authentication. This only needs to be done once per OpenID. You may associate your OpenID with an existing Galaxy account, or create a new one. -
-
- - %if len( openids ) > 1: -
- The following OpenIDs will be associated with the account chosen or created below. -
    - %for openid in openids: -
  • ${openid.openid | h}
  • - %endfor -
-
- %else: -
- The OpenID ${openids[0].openid | h} will be associated with the account chosen or created. -
- %endif -
- - <% form_action = h.url_for( controller='user', action='openid_associate', cntrller=cntrller, use_panels=use_panels ) %> - - ${render_login_form( form_action=form_action )} - -
- - ${render_registration_form( form_action=form_action )} - -
-
- - diff --git a/templates/user/openid_manage.mako b/templates/user/openid_manage.mako deleted file mode 100644 index 4d08ea1a4315..000000000000 --- a/templates/user/openid_manage.mako +++ /dev/null @@ -1,6 +0,0 @@ -<%inherit file="/base.mako"/> -<%namespace file="login.mako" import="render_openid_form" /> -<%def name="body()"> -

Associate more OpenIDs

- ${render_openid_form( redirect, True, openid_providers )} - \ No newline at end of file From 6796c187acd8f8705d78a43d7ffb9936967cbec6 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 14:53:32 -0500 Subject: [PATCH 03/88] Remove openid access links from preferences --- client/galaxy/scripts/apps/analysis.js | 10 ---------- client/galaxy/scripts/mvc/user/user-preferences.js | 11 ----------- lib/galaxy/webapps/galaxy/buildapp.py | 1 - 3 files changed, 22 deletions(-) diff --git a/client/galaxy/scripts/apps/analysis.js b/client/galaxy/scripts/apps/analysis.js index 7826d3d7b645..698c5ed2ff65 100644 --- a/client/galaxy/scripts/apps/analysis.js +++ b/client/galaxy/scripts/apps/analysis.js @@ -57,7 +57,6 @@ window.app = function app(options, bootstrapped) { "(/)tours(/)(:tour_id)": "show_tours", "(/)user(/)": "show_user", "(/)user(/)(:form_id)": "show_user_form", - "(/)openids(/)list": "show_openids", "(/)pages(/)create(/)": "show_pages_create", "(/)pages(/)edit(/)": "show_pages_edit", "(/)pages(/)sharing(/)": "show_pages_sharing", @@ -225,15 +224,6 @@ window.app = function app(options, bootstrapped) { ); }, - show_openids: function() { - this.page.display( - new GridView({ - url_base: `${getAppRoot()}user/openids_list`, - active_tab: "user" - }) - ); - }, - show_datasets: function() { this.page.display( new GridView({ diff --git a/client/galaxy/scripts/mvc/user/user-preferences.js b/client/galaxy/scripts/mvc/user/user-preferences.js index 208ddc07e004..d8bac3fa10f3 100644 --- a/client/galaxy/scripts/mvc/user/user-preferences.js +++ b/client/galaxy/scripts/mvc/user/user-preferences.js @@ -64,14 +64,6 @@ var Model = Backbone.Model.extend({ submit_title: "Save filters", redirect: "user" }, - openids: { - title: _l("Manage OpenIDs"), - description: _l("Associate OpenIDs with your account."), - icon: "fa-openid", - onclick: function() { - Galaxy.page.router.push(`${getAppRoot()}openids/list`); - } - }, custom_builds: { title: _l("Manage custom builds"), description: _l("Add or remove custom builds using history datasets."), @@ -142,9 +134,6 @@ var View = Backbone.View.extend({ if (config.has_user_tool_filters) { self._addLink("toolbox_filters"); } - if (config.enable_openid && !config.use_remote_user) { - self._addLink("openids"); - } if (Galaxy.session_csrf_token) { self._addLink("logout"); } diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 20f7f3612580..d4969d30a777 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -115,7 +115,6 @@ def app_factory(global_conf, load_app_kwds={}, **kwargs): webapp.add_client_route('/tours/{tour_id}') webapp.add_client_route('/user') webapp.add_client_route('/user/{form_id}') - webapp.add_client_route('/openids/list') webapp.add_client_route('/visualizations') webapp.add_client_route('/visualizations/edit') webapp.add_client_route('/visualizations/sharing') From d9098324ee26e18c5f1e5da32ccee851f167cc9b Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 14:54:45 -0500 Subject: [PATCH 04/88] Remove openid feature from login form --- templates/user/login.mako | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/templates/user/login.mako b/templates/user/login.mako index 1941d6a1bc76..111271c4cf14 100644 --- a/templates/user/login.mako +++ b/templates/user/login.mako @@ -54,11 +54,6 @@ def inherit(context): ${render_oidc_form()} %endif - %if trans.app.config.enable_openid: -
- ${render_openid_form( redirect, False, openid_providers )} - %endif - %if trans.app.config.get( 'terms_url', None ) is not None:

@@ -126,27 +121,3 @@ def inherit(context):

- -<%def name="render_openid_form( redirect, auto_associate, openid_providers )"> -
-
OpenID Login
-
-
- - - -
-
- Or, authenticate with your account. -
-
- -
-
-
- - From a48e445abb0f337d5bc18c31a14f22a550719986 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 14:56:05 -0500 Subject: [PATCH 05/88] Remove openid feature from legacy toolshed preference view --- templates/user/index.mako | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/user/index.mako b/templates/user/index.mako index b5804ee7c6a0..5ba9887fe3d8 100644 --- a/templates/user/index.mako +++ b/templates/user/index.mako @@ -15,9 +15,6 @@
  • ${_('Change default permissions')} for new histories
  • ${_('Manage your API keys')}
  • ${_('Manage your ToolBox filters')}
  • - %if trans.app.config.enable_openid and not trans.app.config.use_remote_user: -
  • ${_('Manage OpenIDs')} linked to your account
  • - %endif
  • ${_('Logout')} ${_('of all user sessions')}
  • %else:
  • ${_('Manage your information')}
  • From bf38a74e71fc68d6794f7c33c462c8468c648520 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 14:58:07 -0500 Subject: [PATCH 06/88] Strip openid manager and providers from app --- lib/galaxy/app.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/galaxy/app.py b/lib/galaxy/app.py index 8871407a942b..502057d3f196 100644 --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -17,7 +17,6 @@ from galaxy.managers.histories import HistoryManager from galaxy.managers.libraries import LibraryManager from galaxy.managers.tags import GalaxyTagManager -from galaxy.openid.providers import OpenIDProviders from galaxy.queue_worker import GalaxyQueueWorker from galaxy.tools.cache import ( ToolCache, @@ -164,13 +163,6 @@ def __init__(self, **kwargs): self.quota_agent = galaxy.quota.NoQuotaAgent(self.model) # Heartbeat for thread profiling self.heartbeat = None - # Container for OpenID authentication routines - if self.config.enable_openid: - from galaxy.web.framework import openid_manager - self.openid_manager = openid_manager.OpenIDManager(self.config.openid_consumer_cache_path) - self.openid_providers = OpenIDProviders.from_file(self.config.openid_config_file) - else: - self.openid_providers = OpenIDProviders() from galaxy import auth self.auth_manager = auth.AuthManager(self) # Start the heartbeat process if configured and available (wait until From bb67f5e6167ccaf8e39b07ce2abcee05a205a3ae Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:00:52 -0500 Subject: [PATCH 07/88] Remove openid options from config schema --- config/openid_conf.xml.sample | 5 ----- lib/galaxy/webapps/galaxy/config_schema.yml | 24 --------------------- 2 files changed, 29 deletions(-) delete mode 100644 config/openid_conf.xml.sample diff --git a/config/openid_conf.xml.sample b/config/openid_conf.xml.sample deleted file mode 100644 index 735c4ea86482..000000000000 --- a/config/openid_conf.xml.sample +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index 10bb176bc335..b3a4311be325 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -835,7 +835,6 @@ mapping: Activation grace period (in hours). Activation is not forced (login is not disabled) until grace period has passed. Users under grace period can't run jobs. Enter 0 to disable grace period. - Users with OpenID logins have grace period forever. inactivity_box_content: type: str @@ -2192,29 +2191,6 @@ mapping: desc: | Force serial scheduling of workflows within the context of a particular history - enable_openid: - type: bool - default: false - required: false - desc: | - Enable authentication via OpenID. Allows users to log in to their Galaxy - account by authenticating with an OpenID provider. - - openid_config_file: - type: str - default: config/openid_conf.xml - required: false - desc: | - If OpenID is enabled, this configuration file specifies providers to use. - Falls back to the .sample variant in config if default does not exist. - - openid_consumer_cache_path: - type: str - default: database/openid_consumer_cache - required: false - desc: | - If OpenID is enabled, consumer cache directory to use. - enable_oidc: type: bool default: false From 79445c51c966d3e2fd7e3fa5b5a2f1c6e2bd5e4c Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:07:45 -0500 Subject: [PATCH 08/88] Remove openid from schema and controller endpoints --- lib/galaxy/model/__init__.py | 7 ------- lib/galaxy/webapps/galaxy/controllers/authnz.py | 1 - lib/galaxy/webapps/galaxy/controllers/root.py | 2 -- lib/galaxy/webapps/tool_shed/app.py | 3 --- 4 files changed, 13 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 24c2589b03bc..b40eaffb1483 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -4795,13 +4795,6 @@ def to_dict(self, trans): 'phone' : sanitize_html(self.phone)} -class UserOpenID(RepresentById): - def __init__(self, user=None, session=None, openid=None): - self.user = user - self.session = session - self.openid = openid - - class PSAAssociation(AssociationMixin, RepresentById): # This static property is set at: galaxy.authnz.psa_authnz.PSAAuthnz diff --git a/lib/galaxy/webapps/galaxy/controllers/authnz.py b/lib/galaxy/webapps/galaxy/controllers/authnz.py index 928d50f2f5bb..d992a0a0a8c1 100644 --- a/lib/galaxy/webapps/galaxy/controllers/authnz.py +++ b/lib/galaxy/webapps/galaxy/controllers/authnz.py @@ -83,7 +83,6 @@ def callback(self, trans, provider, **kwargs): refresh_frames='refresh_frames', message="You are now logged in as `{}.`".format(user.username), status='done', - openid_providers=trans.app.openid_providers, form_input_auto_focus=True, active_view="user") diff --git a/lib/galaxy/webapps/galaxy/controllers/root.py b/lib/galaxy/webapps/galaxy/controllers/root.py index 956f01545d0d..5851f879cfd5 100644 --- a/lib/galaxy/webapps/galaxy/controllers/root.py +++ b/lib/galaxy/webapps/galaxy/controllers/root.py @@ -117,8 +117,6 @@ def login(self, trans, redirect=None, **kwd): """ return self.template(trans, 'login', redirect=redirect, - # TODO: move into config - openid_providers=[p.name for p in trans.app.openid_providers], # an installation may have it's own welcome_url - show it here if they've set that welcome_url=web.url_for(controller='root', action='welcome'), show_welcome_with_login=trans.app.config.show_welcome_with_login) diff --git a/lib/galaxy/webapps/tool_shed/app.py b/lib/galaxy/webapps/tool_shed/app.py index 815d7aa4ee99..587b86965f86 100644 --- a/lib/galaxy/webapps/tool_shed/app.py +++ b/lib/galaxy/webapps/tool_shed/app.py @@ -11,7 +11,6 @@ from galaxy import tools from galaxy.config import configure_logging from galaxy.managers.tags import CommunityTagManager -from galaxy.openid.providers import OpenIDProviders from galaxy.util.dbkeys import GenomeBuilds from galaxy.web import security from galaxy.web.stack import application_stack_instance @@ -71,8 +70,6 @@ def __init__(self, **kwd): self.security_agent = self.model.security_agent # The Tool Shed makes no use of a quota, but this attribute is still required. self.quota_agent = galaxy.quota.NoQuotaAgent(self.model) - # TODO: Add OpenID support - self.openid_providers = OpenIDProviders() # Initialize the baseline Tool Shed statistics component. self.shed_counter = self.model.shed_counter # Let the Tool Shed's HgwebConfigManager know where the hgweb.config file is located. From a19abdb73b88a941cfe3c90648ba2de532581d0b Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:09:23 -0500 Subject: [PATCH 09/88] Remove openid manager and routes --- lib/galaxy/web/framework/openid_manager.py | 75 ---------------------- lib/galaxy/web/framework/webapp.py | 4 -- lib/galaxy/webapps/tool_shed/config.py | 1 - 3 files changed, 80 deletions(-) delete mode 100644 lib/galaxy/web/framework/openid_manager.py diff --git a/lib/galaxy/web/framework/openid_manager.py b/lib/galaxy/web/framework/openid_manager.py deleted file mode 100644 index 03a2a0f55f0c..000000000000 --- a/lib/galaxy/web/framework/openid_manager.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -Manage the OpenID consumer and related data stores. -""" - -import logging -import os -import pickle - -try: - from openid import oidutil - from openid.consumer import consumer - from openid.extensions import sreg - from openid.store import filestore -except ImportError: - oidutil = None - - class FakeConsumer(object): - def __getattr__(x, y): - return None - consumer = FakeConsumer() - - -OPENID_IMPORT_MESSAGE = ('The Python openid package is required to use this ' - 'feature, please install it') - -log = logging.getLogger(__name__) - - -def oidlog(message, level=0): - log.debug(message) - - -if oidutil is not None: - oidutil.log = oidlog - - -class OpenIDManager(object): - def __init__(self, cache_path): - assert oidutil is not None, OPENID_IMPORT_MESSAGE - self.session_path = os.path.join(cache_path, 'session') - self.store_path = os.path.join(cache_path, 'store') - for dir in self.session_path, self.store_path: - if not os.path.exists(dir): - os.makedirs(dir) - self.store = filestore.FileOpenIDStore(self.store_path) - - def get_session(self, trans): - session_file = os.path.join(self.session_path, str(trans.galaxy_session.id)) - if not os.path.exists(session_file): - pickle.dump(dict(), open(session_file, 'w')) - return pickle.load(open(session_file)) - - def persist_session(self, trans, oidconsumer): - session_file = os.path.join(self.session_path, str(trans.galaxy_session.id)) - pickle.dump(oidconsumer.session, open(session_file, 'w')) - - def get_consumer(self, trans): - return consumer.Consumer(self.get_session(trans), self.store) - - def add_sreg(self, trans, request, required=None, optional=None): - if required is None: - required = [] - if optional is None: - optional = [] - sreg_request = sreg.SRegRequest(required=required, optional=optional) - request.addExtension(sreg_request) - - def get_sreg(self, info): - return sreg.SRegResponse.fromSuccessResponse(info) - - # so I don't have to expose all of openid.consumer.consumer - FAILURE = consumer.FAILURE - SUCCESS = consumer.SUCCESS - CANCEL = consumer.CANCEL - SETUP_NEEDED = consumer.SETUP_NEEDED diff --git a/lib/galaxy/web/framework/webapp.py b/lib/galaxy/web/framework/webapp.py index d2fbfc755b20..ae72c429f712 100644 --- a/lib/galaxy/web/framework/webapp.py +++ b/lib/galaxy/web/framework/webapp.py @@ -517,10 +517,6 @@ def _ensure_logged_in_user(self, environ, session_cookie): url_for(controller='user', action='logout'), url_for(controller='user', action='reset_password'), url_for(controller='user', action='change_password'), - # required to log in w/ openid - url_for(controller='user', action='openid_auth'), - url_for(controller='user', action='openid_process'), - url_for(controller='user', action='openid_associate'), # TODO: do any of these still need to bypass require login? url_for(controller='user', action='api_keys'), url_for(controller='user', action='create'), diff --git a/lib/galaxy/webapps/tool_shed/config.py b/lib/galaxy/webapps/tool_shed/config.py index 4a378ba472f0..d1d5e6ead522 100644 --- a/lib/galaxy/webapps/tool_shed/config.py +++ b/lib/galaxy/webapps/tool_shed/config.py @@ -94,7 +94,6 @@ def __init__(self, **kwargs): self.require_login = string_as_bool(kwargs.get("require_login", "False")) self.allow_user_creation = string_as_bool(kwargs.get("allow_user_creation", "True")) self.allow_user_deletion = string_as_bool(kwargs.get("allow_user_deletion", "False")) - self.enable_openid = string_as_bool(kwargs.get('enable_openid', False)) self.template_path = resolve_path(kwargs.get("template_path", "templates"), self.root) self.template_cache = resolve_path(kwargs.get("template_cache_path", "database/compiled_templates/community"), self.root) self.admin_users = kwargs.get("admin_users", "") From ca8fc817683949b8b003cc12c80dd143a16760c1 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:13:12 -0500 Subject: [PATCH 10/88] Remove openid settings from config and toolshed --- lib/galaxy/config.py | 5 ----- lib/galaxy/managers/configuration.py | 1 - lib/galaxy/webapps/tool_shed/config_schema.yml | 8 -------- 3 files changed, 14 deletions(-) diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index cf23dca18546..06c542448de8 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -50,7 +50,6 @@ workflow_resource_params_file=['config/workflow_resource_params_conf.xml', 'workflow_resource_params_conf.xml'], migrated_tools_config=['migrated_tools_conf.xml', 'config/migrated_tools_conf.xml'], object_store_config_file=['config/object_store_conf.xml', 'object_store_conf.xml'], - openid_config_file=['config/openid_conf.xml', 'openid_conf.xml', 'config/openid_conf.xml.sample'], shed_data_manager_config_file=['shed_data_manager_conf.xml', 'config/shed_data_manager_conf.xml'], shed_tool_data_table_config=['shed_tool_data_table_conf.xml', 'config/shed_tool_data_table_conf.xml'], tool_sheds_config_file=['config/tool_sheds_conf.xml', 'tool_sheds_conf.xml', 'config/tool_sheds_conf.xml.sample'], @@ -198,10 +197,7 @@ def __init__(self, **kwargs): if override_tempdir: tempfile.tempdir = self.new_file_path self.shared_home_dir = kwargs.get("shared_home_dir", None) - self.openid_consumer_cache_path = resolve_path(kwargs.get("openid_consumer_cache_path", "database/openid_consumer_cache"), self.root) self.cookie_path = kwargs.get("cookie_path", "/") - # Galaxy OpenID settings - self.enable_openid = string_as_bool(kwargs.get('enable_openid', False)) self.enable_quotas = string_as_bool(kwargs.get('enable_quotas', False)) self.enable_unique_workflow_defaults = string_as_bool(kwargs.get('enable_unique_workflow_defaults', False)) self.tool_path = resolve_path(kwargs.get("tool_path", "tools"), self.root) @@ -361,7 +357,6 @@ def __init__(self, **kwargs): self.communication_server_host = kwargs.get('communication_server_host', 'http://localhost') self.communication_server_port = int(kwargs.get('communication_server_port', '7070')) self.persistent_communication_rooms = listify(kwargs.get("persistent_communication_rooms", []), do_strip=True) - self.enable_openid = string_as_bool(kwargs.get('enable_openid', 'False')) self.enable_quotas = string_as_bool(kwargs.get('enable_quotas', 'False')) # Tasked job runner. self.use_tasked_jobs = string_as_bool(kwargs.get('use_tasked_jobs', False)) diff --git a/lib/galaxy/managers/configuration.py b/lib/galaxy/managers/configuration.py index 60f33202c957..fb07cbaa22ec 100644 --- a/lib/galaxy/managers/configuration.py +++ b/lib/galaxy/managers/configuration.py @@ -61,7 +61,6 @@ def _defaults_to(default): 'allow_user_impersonation' : _defaults_to(False), 'allow_user_creation' : _defaults_to(False), 'use_remote_user' : _defaults_to(None), - 'enable_openid' : _defaults_to(False), 'enable_oidc' : _defaults_to(False), 'enable_quotas' : _defaults_to(False), 'remote_user_logout_href' : _defaults_to(''), diff --git a/lib/galaxy/webapps/tool_shed/config_schema.yml b/lib/galaxy/webapps/tool_shed/config_schema.yml index 03f6eb746668..55098ea32567 100644 --- a/lib/galaxy/webapps/tool_shed/config_schema.yml +++ b/lib/galaxy/webapps/tool_shed/config_schema.yml @@ -526,14 +526,6 @@ mapping: in the filter above. This value becomes the "path" attribute set in the cookie so the cookies from each instance will not clobber each other. - enable_openid: - type: bool - default: false - required: false - desc: | - Enable authentication via OpenID. Allows users to log in to their Galaxy - account by authenticating with an OpenID provider. - log_actions: type: bool default: true From df31cb1ad6f1018575f2f241e0afd7ea9cffeb1d Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:17:23 -0500 Subject: [PATCH 11/88] Remove openid service modules --- lib/galaxy/openid/__init__.py | 3 - lib/galaxy/openid/providers.py | 147 --------------------------------- 2 files changed, 150 deletions(-) delete mode 100644 lib/galaxy/openid/__init__.py delete mode 100644 lib/galaxy/openid/providers.py diff --git a/lib/galaxy/openid/__init__.py b/lib/galaxy/openid/__init__.py deleted file mode 100644 index d196c842445b..000000000000 --- a/lib/galaxy/openid/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -OpenID functionality -""" diff --git a/lib/galaxy/openid/providers.py b/lib/galaxy/openid/providers.py deleted file mode 100644 index 39e51a0275f5..000000000000 --- a/lib/galaxy/openid/providers.py +++ /dev/null @@ -1,147 +0,0 @@ -""" -Contains OpenID provider functionality -""" -import logging -import os - -import six - -from galaxy.util import parse_xml, string_as_bool -from galaxy.util.odict import odict - - -log = logging.getLogger(__name__) - -NO_PROVIDER_ID = 'None' -RESERVED_PROVIDER_IDS = [NO_PROVIDER_ID] - - -class OpenIDProvider(object): - '''An OpenID Provider object.''' - @classmethod - def from_file(cls, filename): - return cls.from_elem(parse_xml(filename).getroot()) - - @classmethod - def from_elem(cls, xml_root): - provider_elem = xml_root - provider_id = provider_elem.get('id', None) - provider_name = provider_elem.get('name', provider_id) - op_endpoint_url = provider_elem.find('op_endpoint_url') - if op_endpoint_url is not None: - op_endpoint_url = op_endpoint_url.text - never_associate_with_user = string_as_bool(provider_elem.get('never_associate_with_user', 'False')) - assert (provider_id and provider_name and op_endpoint_url), Exception("OpenID Provider improperly configured") - assert provider_id not in RESERVED_PROVIDER_IDS, Exception('Specified OpenID Provider uses a reserved id: %s' % (provider_id)) - sreg_required = [] - sreg_optional = [] - use_for = {} - store_user_preference = {} - use_default_sreg = True - for elem in provider_elem.findall('sreg'): - use_default_sreg = False - for field_elem in elem.findall('field'): - sreg_name = field_elem.get('name') - assert sreg_name, Exception('A name is required for a sreg element') - if string_as_bool(field_elem.get('required')): - sreg_required.append(sreg_name) - else: - sreg_optional.append(sreg_name) - for use_elem in field_elem.findall('use_for'): - use_for[use_elem.get('name')] = sreg_name - for store_user_preference_elem in field_elem.findall('store_user_preference'): - store_user_preference[store_user_preference_elem.get('name')] = sreg_name - if use_default_sreg: - sreg_required = None - sreg_optional = None - use_for = None - return cls(provider_id, provider_name, op_endpoint_url, sreg_required=sreg_required, sreg_optional=sreg_optional, use_for=use_for, store_user_preference=store_user_preference, never_associate_with_user=never_associate_with_user) - - def __init__(self, id, name, op_endpoint_url, sreg_required=None, sreg_optional=None, use_for=None, store_user_preference=None, never_associate_with_user=None): - '''When sreg options are not specified, defaults are used.''' - self.id = id - self.name = name - self.op_endpoint_url = op_endpoint_url - if sreg_optional is None: - self.sreg_optional = ['nickname', 'email'] - else: - self.sreg_optional = sreg_optional - if sreg_required: - self.sreg_required = sreg_required - else: - self.sreg_required = [] - if use_for is not None: - self.use_for = use_for - else: - self.use_for = {} - if 'nickname' in (self.sreg_optional + self.sreg_required): - self.use_for['username'] = 'nickname' - if 'email' in (self.sreg_optional + self.sreg_required): - self.use_for['email'] = 'email' - if store_user_preference: - self.store_user_preference = store_user_preference - else: - self.store_user_preference = {} - if never_associate_with_user: - self.never_associate_with_user = True - else: - self.never_associate_with_user = False - - def post_authentication(self, trans, openid_manager, info): - sreg_attributes = openid_manager.get_sreg(info) - for store_pref_name, store_pref_value_name in self.store_user_preference.items(): - if store_pref_value_name in (self.sreg_optional + self.sreg_required): - trans.user.preferences[store_pref_name] = sreg_attributes.get(store_pref_value_name) - else: - raise Exception('Only sreg is currently supported.') - trans.sa_session.add(trans.user) - trans.sa_session.flush() - - def has_post_authentication_actions(self): - return bool(self.store_user_preference) - - -class OpenIDProviders(object): - '''Collection of OpenID Providers''' - NO_PROVIDER_ID = NO_PROVIDER_ID - - @classmethod - def from_file(cls, filename): - try: - return cls.from_elem(parse_xml(filename).getroot()) - except Exception as e: - log.error('Failed to load OpenID Providers: %s' % (e)) - return cls() - - @classmethod - def from_elem(cls, xml_root): - oid_elem = xml_root - providers = odict() - for elem in oid_elem.findall('provider'): - try: - provider = OpenIDProvider.from_file(os.path.join('openid', elem.get('file'))) - providers[provider.id] = provider - log.debug('Loaded OpenID provider: %s (%s)' % (provider.name, provider.id)) - except Exception as e: - log.error('Failed to add OpenID provider: %s' % (e)) - return cls(providers) - - def __init__(self, providers=None): - if providers: - self.providers = providers - else: - self.providers = odict() - self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.values() if provider.never_associate_with_user] - - def __iter__(self): - for provider in six.itervalues(self.providers): - yield provider - - def get(self, name, default=None): - if name in self.providers: - return self.providers[name] - else: - return default - - def new_provider_from_identifier(self, identifier): - return OpenIDProvider(None, identifier, identifier, never_associate_with_user=identifier in self._banned_identifiers) From f31d61b71c739c03e5068bff188a56f175a18297 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:20:24 -0500 Subject: [PATCH 12/88] Remove openid check in dependencies --- lib/galaxy/dependencies/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/galaxy/dependencies/__init__.py b/lib/galaxy/dependencies/__init__.py index 1e020e9e6443..4bb1c76398b4 100644 --- a/lib/galaxy/dependencies/__init__.py +++ b/lib/galaxy/dependencies/__init__.py @@ -95,9 +95,6 @@ def check_drmaa(self): def check_pbs_python(self): return "galaxy.jobs.runners.pbs:PBSJobRunner" in self.job_runners - def check_python_openid(self): - return asbool(self.config["enable_openid"]) - def check_chronos_python(self): return "galaxy.jobs.runners.chronos:ChronosJobRunner" in self.job_runners From 0a23204b888b958aa59c198f620bbc1383a8e9b4 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 15:22:48 -0500 Subject: [PATCH 13/88] Strip openid from data model --- lib/galaxy/model/mapping.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index 14eb274e1afe..fa7605e7908a 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -82,16 +82,6 @@ Column("deleted", Boolean, index=True, default=False), Column("purged", Boolean, index=True, default=False)) -model.UserOpenID.table = Table( - "galaxy_user_openid", metadata, - Column("id", Integer, primary_key=True), - Column("create_time", DateTime, default=now), - Column("update_time", DateTime, index=True, default=now, onupdate=now), - Column("session_id", Integer, ForeignKey("galaxy_session.id"), index=True), - Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True), - Column("openid", TEXT, index=True, unique=True), - Column("provider", TrimmedString(255))) - model.PSAAssociation.table = Table( "psa_association", metadata, Column('id', Integer, primary_key=True), @@ -1476,17 +1466,6 @@ def simple_mapping(model, **kwds): order_by=desc(model.UserAddress.table.c.update_time)), )) -mapper(model.UserOpenID, model.UserOpenID.table, properties=dict( - session=relation(model.GalaxySession, - primaryjoin=(model.UserOpenID.table.c.session_id == model.GalaxySession.table.c.id), - backref='openids', - order_by=desc(model.UserOpenID.table.c.update_time)), - user=relation(model.User, - primaryjoin=(model.UserOpenID.table.c.user_id == model.User.table.c.id), - backref='openids', - order_by=desc(model.UserOpenID.table.c.update_time)) -)) - mapper(model.PSAAssociation, model.PSAAssociation.table, properties=None) mapper(model.PSACode, model.PSACode.table, properties=None) From eba5214e95347c306d3211261106877675e77179 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 19 Nov 2018 16:03:15 -0500 Subject: [PATCH 14/88] Remove unused imports --- lib/galaxy/webapps/galaxy/controllers/user.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/user.py b/lib/galaxy/webapps/galaxy/controllers/user.py index 6a26ec655f7f..2b43048c21c9 100644 --- a/lib/galaxy/webapps/galaxy/controllers/user.py +++ b/lib/galaxy/webapps/galaxy/controllers/user.py @@ -18,7 +18,6 @@ from sqlalchemy.orm.exc import NoResultFound from galaxy import ( - model, util, web ) @@ -38,7 +37,6 @@ UsesFormDefinitionsMixin ) from galaxy.web.form_builder import CheckboxField -from galaxy.web.framework.helpers import grids, time_ago log = logging.getLogger(__name__) From c68cd231cbe52e0b51df6e530279dcd5ebb65f8d Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 13:41:13 -0500 Subject: [PATCH 15/88] Add error listener for input elements, utilize to highlight numeric value range adjustments --- client/galaxy/scripts/mvc/form/form-section.js | 14 ++++++++++++++ client/galaxy/scripts/mvc/ui/ui-slider.js | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 751119338179..76ab42381aaf 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -187,10 +187,24 @@ var View = Backbone.View.extend({ field: field }); this.app.element_list[id] = input_element; + this._attachWarningHandler(field, input_element); this._append(input_element.$el, input_def.id); return field; }, + /** Attach warning listeners to input elements */ + _attachWarningHandler: function(field, input_element) { + if (field.model) { + field.model.on("error", message => { + if (message) { + input_element.error(message || "Please verify this parameter."); + } else { + input_element.reset(); + } + }); + } + }, + /** Append a new element to the form i.e. input element, repeat block, conditionals etc. */ _append: function($el, id) { this.$el.append($el.addClass("section-row").attr("id", id)); diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index 7293c62a00e3..49742f42bd3b 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -103,7 +103,9 @@ var View = Backbone.View.extend({ /** Set and return the current value */ value: function(new_val) { - var options = this.model.attributes; + + let options = this.model.attributes; + let original_val = new_val; if (new_val !== undefined) { if (new_val !== null && new_val !== "" && !this._isParameter(new_val)) { if (isNaN(new_val)) { @@ -122,6 +124,9 @@ var View = Backbone.View.extend({ this.model.set("value", new_val); this.model.trigger("change"); options.onchange(new_val); + let has_changed = parseInt(original_val) !== parseInt(new_val); + let message = has_changed ? "Corrected value by range." : null; + this.model.trigger("error", message); } return this.model.get("value"); }, From b72a6d5dffd2a0a8af7b4bdc28b308f3be2db407 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 13:43:46 -0500 Subject: [PATCH 16/88] Fix name of error handler helper function --- client/galaxy/scripts/mvc/form/form-section.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 76ab42381aaf..4ca1b5a94e28 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -187,13 +187,13 @@ var View = Backbone.View.extend({ field: field }); this.app.element_list[id] = input_element; - this._attachWarningHandler(field, input_element); + this._attachErrorHandler(field, input_element); this._append(input_element.$el, input_def.id); return field; }, - /** Attach warning listeners to input elements */ - _attachWarningHandler: function(field, input_element) { + /** Attach error listeners to input elements */ + _attachErrorHandler: function(field, input_element) { if (field.model) { field.model.on("error", message => { if (message) { From caa50a8bed932291f00eb39ccefa2329665b17db Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 13:44:51 -0500 Subject: [PATCH 17/88] Remove unused default error message --- client/galaxy/scripts/mvc/form/form-section.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 4ca1b5a94e28..2fa76a9e3cb5 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -197,7 +197,7 @@ var View = Backbone.View.extend({ if (field.model) { field.model.on("error", message => { if (message) { - input_element.error(message || "Please verify this parameter."); + input_element.error(message); } else { input_element.reset(); } From 0939bfc64bf970ce8e816b4f9598a8e3e7b9de58 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 13:49:57 -0500 Subject: [PATCH 18/88] Move local slider helper variables into score/statement --- client/galaxy/scripts/mvc/ui/ui-slider.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index 49742f42bd3b..a175844587c5 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -103,10 +103,9 @@ var View = Backbone.View.extend({ /** Set and return the current value */ value: function(new_val) { - - let options = this.model.attributes; - let original_val = new_val; if (new_val !== undefined) { + let options = this.model.attributes; + let original_val = new_val; if (new_val !== null && new_val !== "" && !this._isParameter(new_val)) { if (isNaN(new_val)) { new_val = 0; From 5d5f7dbd95d620ac26a2a552e7e98c8e63194789 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 13:57:53 -0500 Subject: [PATCH 19/88] Move field error binding to input element wrapper --- client/galaxy/scripts/mvc/form/form-input.js | 9 +++++++++ client/galaxy/scripts/mvc/form/form-section.js | 14 -------------- client/galaxy/scripts/mvc/ui/ui-slider.js | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/client/galaxy/scripts/mvc/form/form-input.js b/client/galaxy/scripts/mvc/form/form-input.js index 6781e5c50869..0f7b0ff75760 100644 --- a/client/galaxy/scripts/mvc/form/form-input.js +++ b/client/galaxy/scripts/mvc/form/form-input.js @@ -69,6 +69,15 @@ export default Backbone.View.extend({ self.reset(); }); } + + // add error listener + this.field.model && this.field.model.on("error", message => { + if (message) { + this.error(message); + } else { + this.reset(); + } + }); }, /** Set backdrop for input element */ diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 2fa76a9e3cb5..751119338179 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -187,24 +187,10 @@ var View = Backbone.View.extend({ field: field }); this.app.element_list[id] = input_element; - this._attachErrorHandler(field, input_element); this._append(input_element.$el, input_def.id); return field; }, - /** Attach error listeners to input elements */ - _attachErrorHandler: function(field, input_element) { - if (field.model) { - field.model.on("error", message => { - if (message) { - input_element.error(message); - } else { - input_element.reset(); - } - }); - } - }, - /** Append a new element to the form i.e. input element, repeat block, conditionals etc. */ _append: function($el, id) { this.$el.append($el.addClass("section-row").attr("id", id)); diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index a175844587c5..244dd3de72ce 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -124,7 +124,7 @@ var View = Backbone.View.extend({ this.model.trigger("change"); options.onchange(new_val); let has_changed = parseInt(original_val) !== parseInt(new_val); - let message = has_changed ? "Corrected value by range." : null; + let message = has_changed ? "This value was invalid or out-of-range. It has been auto-corrected." : null; this.model.trigger("error", message); } return this.model.get("value"); From 2807f8f66af2ec1ddde6a4824cd958169f8aff03 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 14:14:55 -0500 Subject: [PATCH 20/88] Use listento caller to bind input element error listener --- client/galaxy/scripts/mvc/form/form-input.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/galaxy/scripts/mvc/form/form-input.js b/client/galaxy/scripts/mvc/form/form-input.js index 0f7b0ff75760..aa92a5b84a5b 100644 --- a/client/galaxy/scripts/mvc/form/form-input.js +++ b/client/galaxy/scripts/mvc/form/form-input.js @@ -71,13 +71,15 @@ export default Backbone.View.extend({ } // add error listener - this.field.model && this.field.model.on("error", message => { - if (message) { - this.error(message); - } else { - this.reset(); - } - }); + if (this.field.model) { + this.listenTo(this.field.model, "error", message => { + if (message) { + this.error(message); + } else { + this.reset(); + } + }); + } }, /** Set backdrop for input element */ From 0e6cf700fea90e2b4756f5787b8efd26ae994ce1 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 7 Jan 2019 14:21:01 -0500 Subject: [PATCH 21/88] Add additional validation to slider out-of-range error detection --- client/galaxy/scripts/mvc/ui/ui-slider.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index 244dd3de72ce..fa04bdcf1bd0 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -106,7 +106,8 @@ var View = Backbone.View.extend({ if (new_val !== undefined) { let options = this.model.attributes; let original_val = new_val; - if (new_val !== null && new_val !== "" && !this._isParameter(new_val)) { + let is_value = new_val !== null && new_val !== "" && !this._isParameter(new_val); + if (is_value) { if (isNaN(new_val)) { new_val = 0; } @@ -123,7 +124,7 @@ var View = Backbone.View.extend({ this.model.set("value", new_val); this.model.trigger("change"); options.onchange(new_val); - let has_changed = parseInt(original_val) !== parseInt(new_val); + let has_changed = is_value && parseInt(original_val) !== parseInt(new_val); let message = has_changed ? "This value was invalid or out-of-range. It has been auto-corrected." : null; this.model.trigger("error", message); } From 8570db46fd5cf9669315376041e80bc733255025 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 28 Nov 2018 12:03:59 -0500 Subject: [PATCH 22/88] Abstraction for different metadata collection strategies. --- lib/galaxy/datatypes/metadata.py | 2 - lib/galaxy/jobs/__init__.py | 5 +- lib/galaxy/metadata/__init__.py | 216 +++++++++++++++++++++++++++ lib/galaxy/model/metadata.py | 200 +------------------------ lib/galaxy/tools/__init__.py | 4 +- lib/galaxy/tools/actions/metadata.py | 4 +- 6 files changed, 224 insertions(+), 207 deletions(-) create mode 100644 lib/galaxy/metadata/__init__.py diff --git a/lib/galaxy/datatypes/metadata.py b/lib/galaxy/datatypes/metadata.py index bc6e06ff5e0e..213f534c3f1d 100644 --- a/lib/galaxy/datatypes/metadata.py +++ b/lib/galaxy/datatypes/metadata.py @@ -11,7 +11,6 @@ DBKeyParameter, DictParameter, FileParameter, - JobExternalOutputMetadataWrapper, ListParameter, MetadataCollection, MetadataElement, @@ -42,5 +41,4 @@ "PythonObjectParameter", "FileParameter", "MetadataTempFile", - "JobExternalOutputMetadataWrapper", ) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 5418dfeba3db..85512ba37870 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -24,11 +24,12 @@ import galaxy from galaxy import model, util -from galaxy.datatypes import metadata, sniff +from galaxy.datatypes import sniff from galaxy.exceptions import ObjectInvalid, ObjectNotFound from galaxy.jobs.actions.post import ActionBox from galaxy.jobs.mapper import JobRunnerMapper from galaxy.jobs.runners import BaseJobRunner, JobState +from galaxy.metadata import get_metadata_compute_strategy from galaxy.objectstore import ObjectStorePopulator from galaxy.util import safe_makedirs, unicodify from galaxy.util.bunch import Bunch @@ -702,7 +703,7 @@ def __init__(self, job, queue, use_persisted_destination=False): self.output_hdas_and_paths = None self.tool_provided_job_metadata = None # Wrapper holding the info required to restore and clean up from files used for setting metadata externally - self.external_output_metadata = metadata.JobExternalOutputMetadataWrapper(job) + self.external_output_metadata = get_metadata_compute_strategy(self.app, job.id) self.job_runner_mapper = JobRunnerMapper(self, queue.dispatcher.url_to_destination, self.app.job_config) self.params = None if job.params: diff --git a/lib/galaxy/metadata/__init__.py b/lib/galaxy/metadata/__init__.py new file mode 100644 index 000000000000..06a6faf297ce --- /dev/null +++ b/lib/galaxy/metadata/__init__.py @@ -0,0 +1,216 @@ +"""Define abstraction for capturing the metadata of job's output datasets.""" + +import json +import os +import shutil +import tempfile +from logging import getLogger +from os.path import abspath + +from six.moves import cPickle + +import galaxy.model +from galaxy.model.metadata import FileParameter, MetadataTempFile +from galaxy.util import in_directory + +log = getLogger(__name__) + + +def get_metadata_compute_strategy(app, job_id): + return JobExternalOutputMetadataWrapper(job_id) + + +class JobExternalOutputMetadataWrapper(object): + """ + Class with methods allowing set_meta() to be called externally to the + Galaxy head. + This class allows access to external metadata filenames for all outputs + associated with a job. + We will use JSON as the medium of exchange of information, except for the + DatasetInstance object which will use pickle (in the future this could be + JSONified as well) + """ + + def __init__(self, job_id): + self.job_id = job_id + + def get_output_filenames_by_dataset(self, dataset, sa_session): + if isinstance(dataset, galaxy.model.HistoryDatasetAssociation): + return sa_session.query(galaxy.model.JobExternalOutputMetadata) \ + .filter_by(job_id=self.job_id, + history_dataset_association_id=dataset.id, + is_valid=True) \ + .first() # there should only be one or None + elif isinstance(dataset, galaxy.model.LibraryDatasetDatasetAssociation): + return sa_session.query(galaxy.model.JobExternalOutputMetadata) \ + .filter_by(job_id=self.job_id, + library_dataset_dataset_association_id=dataset.id, + is_valid=True) \ + .first() # there should only be one or None + return None + + def get_dataset_metadata_key(self, dataset): + # Set meta can be called on library items and history items, + # need to make different keys for them, since ids can overlap + return "%s_%d" % (dataset.__class__.__name__, dataset.id) + + def invalidate_external_metadata(self, datasets, sa_session): + for dataset in datasets: + jeom = self.get_output_filenames_by_dataset(dataset, sa_session) + # shouldn't be more than one valid, but you never know + while jeom: + jeom.is_valid = False + sa_session.add(jeom) + sa_session.flush() + jeom = self.get_output_filenames_by_dataset(dataset, sa_session) + + def setup_external_metadata(self, datasets, sa_session, exec_dir=None, + tmp_dir=None, dataset_files_path=None, + output_fnames=None, config_root=None, + config_file=None, datatypes_config=None, + job_metadata=None, compute_tmp_dir=None, + include_command=True, max_metadata_value_size=0, + kwds=None): + kwds = kwds or {} + assert tmp_dir is not None + + if not os.path.exists(tmp_dir): + os.makedirs(tmp_dir) + + # path is calculated for Galaxy, may be different on compute - rewrite + # for the compute server. + def metadata_path_on_compute(path): + compute_path = path + if compute_tmp_dir and tmp_dir and in_directory(path, tmp_dir): + path_relative = os.path.relpath(path, tmp_dir) + compute_path = os.path.join(compute_tmp_dir, path_relative) + return compute_path + + # fill in metadata_files_dict and return the command with args required to set metadata + def __metadata_files_list_to_cmd_line(metadata_files): + def __get_filename_override(): + if output_fnames: + for dataset_path in output_fnames: + if dataset_path.real_path == metadata_files.dataset.file_name: + return dataset_path.false_path or dataset_path.real_path + return "" + line = '"%s,%s,%s,%s,%s,%s"' % ( + metadata_path_on_compute(metadata_files.filename_in), + metadata_path_on_compute(metadata_files.filename_kwds), + metadata_path_on_compute(metadata_files.filename_out), + metadata_path_on_compute(metadata_files.filename_results_code), + __get_filename_override(), + metadata_path_on_compute(metadata_files.filename_override_metadata), + ) + return line + if not isinstance(datasets, list): + datasets = [datasets] + if exec_dir is None: + exec_dir = os.path.abspath(os.getcwd()) + if dataset_files_path is None: + dataset_files_path = galaxy.model.Dataset.file_path + if config_root is None: + config_root = os.path.abspath(os.getcwd()) + if datatypes_config is None: + raise Exception('In setup_external_metadata, the received datatypes_config is None.') + metadata_files_list = [] + for dataset in datasets: + key = self.get_dataset_metadata_key(dataset) + # future note: + # wonkiness in job execution causes build command line to be called more than once + # when setting metadata externally, via 'auto-detect' button in edit attributes, etc., + # we don't want to overwrite (losing the ability to cleanup) our existing dataset keys and files, + # so we will only populate the dictionary once + metadata_files = self.get_output_filenames_by_dataset(dataset, sa_session) + if not metadata_files: + job = sa_session.query(galaxy.model.Job).get(self.job_id) + metadata_files = galaxy.model.JobExternalOutputMetadata(job=job, dataset=dataset) + # we are using tempfile to create unique filenames, tempfile always returns an absolute path + # we will use pathnames relative to the galaxy root, to accommodate instances where the galaxy root + # is located differently, i.e. on a cluster node with a different filesystem structure + + # file to store existing dataset + metadata_files.filename_in = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_in_%s_" % key).name) + + # FIXME: HACK + # sqlalchemy introduced 'expire_on_commit' flag for sessionmaker at version 0.5x + # This may be causing the dataset attribute of the dataset_association object to no-longer be loaded into memory when needed for pickling. + # For now, we'll simply 'touch' dataset_association.dataset to force it back into memory. + dataset.dataset # force dataset_association.dataset to be loaded before pickling + # A better fix could be setting 'expire_on_commit=False' on the session, or modifying where commits occur, or ? + + # Touch also deferred column + dataset._metadata + + cPickle.dump(dataset, open(metadata_files.filename_in, 'wb+')) + # file to store metadata results of set_meta() + metadata_files.filename_out = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_out_%s_" % key).name) + open(metadata_files.filename_out, 'wt+') # create the file on disk, so it cannot be reused by tempfile (unlikely, but possible) + # file to store a 'return code' indicating the results of the set_meta() call + # results code is like (True/False - if setting metadata was successful/failed , exception or string of reason of success/failure ) + metadata_files.filename_results_code = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_results_%s_" % key).name) + # create the file on disk, so it cannot be reused by tempfile (unlikely, but possible) + json.dump((False, 'External set_meta() not called'), open(metadata_files.filename_results_code, 'wt+')) + # file to store kwds passed to set_meta() + metadata_files.filename_kwds = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_kwds_%s_" % key).name) + json.dump(kwds, open(metadata_files.filename_kwds, 'wt+'), ensure_ascii=True) + # existing metadata file parameters need to be overridden with cluster-writable file locations + metadata_files.filename_override_metadata = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_override_%s_" % key).name) + open(metadata_files.filename_override_metadata, 'wt+') # create the file on disk, so it cannot be reused by tempfile (unlikely, but possible) + override_metadata = [] + for meta_key, spec_value in dataset.metadata.spec.items(): + if isinstance(spec_value.param, FileParameter) and dataset.metadata.get(meta_key, None) is not None: + metadata_temp = MetadataTempFile() + metadata_temp.tmp_dir = tmp_dir + shutil.copy(dataset.metadata.get(meta_key, None).file_name, metadata_temp.file_name) + override_metadata.append((meta_key, metadata_temp.to_JSON())) + json.dump(override_metadata, open(metadata_files.filename_override_metadata, 'wt+')) + # add to session and flush + sa_session.add(metadata_files) + sa_session.flush() + metadata_files_list.append(metadata_files) + args = '"%s" "%s" %s %s' % (metadata_path_on_compute(datatypes_config), + job_metadata, + " ".join(map(__metadata_files_list_to_cmd_line, metadata_files_list)), + max_metadata_value_size) + if include_command: + # return command required to build + fd, fp = tempfile.mkstemp(suffix='.py', dir=tmp_dir, prefix="set_metadata_") + metadata_script_file = abspath(fp) + os.fdopen(fd, 'w').write('from galaxy_ext.metadata.set_metadata import set_metadata; set_metadata()') + return 'python "%s" %s' % (metadata_path_on_compute(metadata_script_file), args) + else: + # return args to galaxy_ext.metadata.set_metadata required to build + return args + + def external_metadata_set_successfully(self, dataset, sa_session): + metadata_files = self.get_output_filenames_by_dataset(dataset, sa_session) + if not metadata_files: + return False # this file doesn't exist + rval, rstring = json.load(open(metadata_files.filename_results_code)) + if not rval: + log.debug('setting metadata externally failed for %s %s: %s' % (dataset.__class__.__name__, dataset.id, rstring)) + return rval + + def cleanup_external_metadata(self, sa_session): + log.debug('Cleaning up external metadata files') + for metadata_files in sa_session.query(galaxy.model.Job).get(self.job_id).external_output_metadata: + # we need to confirm that any MetadataTempFile files were removed, if not we need to remove them + # can occur if the job was stopped before completion, but a MetadataTempFile is used in the set_meta + MetadataTempFile.cleanup_from_JSON_dict_filename(metadata_files.filename_out) + dataset_key = self.get_dataset_metadata_key(metadata_files.dataset) + for key, fname in [('filename_in', metadata_files.filename_in), + ('filename_out', metadata_files.filename_out), + ('filename_results_code', metadata_files.filename_results_code), + ('filename_kwds', metadata_files.filename_kwds), + ('filename_override_metadata', metadata_files.filename_override_metadata)]: + try: + os.remove(fname) + except Exception as e: + log.debug('Failed to cleanup external metadata file (%s) for %s: %s' % (key, dataset_key, e)) + + def set_job_runner_external_pid(self, pid, sa_session): + for metadata_files in sa_session.query(galaxy.model.Job).get(self.job_id).external_output_metadata: + metadata_files.job_runner_external_pid = pid + sa_session.add(metadata_files) + sa_session.flush() diff --git a/lib/galaxy/model/metadata.py b/lib/galaxy/model/metadata.py index 834167dfa89c..417c81731c73 100644 --- a/lib/galaxy/model/metadata.py +++ b/lib/galaxy/model/metadata.py @@ -14,11 +14,10 @@ from os.path import abspath from six import string_types -from six.moves import cPickle from sqlalchemy.orm import object_session import galaxy.model -from galaxy.util import (in_directory, listify, string_as_bool, +from galaxy.util import (listify, string_as_bool, stringify_dictionary_keys) from galaxy.util.json import safe_dumps from galaxy.util.object_wrapper import sanitize_lists_to_string @@ -627,202 +626,6 @@ def cleanup_from_JSON_dict_filename(cls, filename): log.debug('Failed to cleanup MetadataTempFile temp files from %s: %s' % (filename, e)) -class JobExternalOutputMetadataWrapper(object): - """ - Class with methods allowing set_meta() to be called externally to the - Galaxy head. - This class allows access to external metadata filenames for all outputs - associated with a job. - We will use JSON as the medium of exchange of information, except for the - DatasetInstance object which will use pickle (in the future this could be - JSONified as well) - """ - - def __init__(self, job): - self.job_id = job.id - - def get_output_filenames_by_dataset(self, dataset, sa_session): - if isinstance(dataset, galaxy.model.HistoryDatasetAssociation): - return sa_session.query(galaxy.model.JobExternalOutputMetadata) \ - .filter_by(job_id=self.job_id, - history_dataset_association_id=dataset.id, - is_valid=True) \ - .first() # there should only be one or None - elif isinstance(dataset, galaxy.model.LibraryDatasetDatasetAssociation): - return sa_session.query(galaxy.model.JobExternalOutputMetadata) \ - .filter_by(job_id=self.job_id, - library_dataset_dataset_association_id=dataset.id, - is_valid=True) \ - .first() # there should only be one or None - return None - - def get_dataset_metadata_key(self, dataset): - # Set meta can be called on library items and history items, - # need to make different keys for them, since ids can overlap - return "%s_%d" % (dataset.__class__.__name__, dataset.id) - - def invalidate_external_metadata(self, datasets, sa_session): - for dataset in datasets: - jeom = self.get_output_filenames_by_dataset(dataset, sa_session) - # shouldn't be more than one valid, but you never know - while jeom: - jeom.is_valid = False - sa_session.add(jeom) - sa_session.flush() - jeom = self.get_output_filenames_by_dataset(dataset, sa_session) - - def setup_external_metadata(self, datasets, sa_session, exec_dir=None, - tmp_dir=None, dataset_files_path=None, - output_fnames=None, config_root=None, - config_file=None, datatypes_config=None, - job_metadata=None, compute_tmp_dir=None, - include_command=True, max_metadata_value_size=0, - kwds=None): - kwds = kwds or {} - assert tmp_dir is not None - - if not os.path.exists(tmp_dir): - os.makedirs(tmp_dir) - - # path is calculated for Galaxy, may be different on compute - rewrite - # for the compute server. - def metadata_path_on_compute(path): - compute_path = path - if compute_tmp_dir and tmp_dir and in_directory(path, tmp_dir): - path_relative = os.path.relpath(path, tmp_dir) - compute_path = os.path.join(compute_tmp_dir, path_relative) - return compute_path - - # fill in metadata_files_dict and return the command with args required to set metadata - def __metadata_files_list_to_cmd_line(metadata_files): - def __get_filename_override(): - if output_fnames: - for dataset_path in output_fnames: - if dataset_path.real_path == metadata_files.dataset.file_name: - return dataset_path.false_path or dataset_path.real_path - return "" - line = '"%s,%s,%s,%s,%s,%s"' % ( - metadata_path_on_compute(metadata_files.filename_in), - metadata_path_on_compute(metadata_files.filename_kwds), - metadata_path_on_compute(metadata_files.filename_out), - metadata_path_on_compute(metadata_files.filename_results_code), - __get_filename_override(), - metadata_path_on_compute(metadata_files.filename_override_metadata), - ) - return line - if not isinstance(datasets, list): - datasets = [datasets] - if exec_dir is None: - exec_dir = os.path.abspath(os.getcwd()) - if dataset_files_path is None: - dataset_files_path = galaxy.model.Dataset.file_path - if config_root is None: - config_root = os.path.abspath(os.getcwd()) - if datatypes_config is None: - raise Exception('In setup_external_metadata, the received datatypes_config is None.') - metadata_files_list = [] - for dataset in datasets: - key = self.get_dataset_metadata_key(dataset) - # future note: - # wonkiness in job execution causes build command line to be called more than once - # when setting metadata externally, via 'auto-detect' button in edit attributes, etc., - # we don't want to overwrite (losing the ability to cleanup) our existing dataset keys and files, - # so we will only populate the dictionary once - metadata_files = self.get_output_filenames_by_dataset(dataset, sa_session) - if not metadata_files: - job = sa_session.query(galaxy.model.Job).get(self.job_id) - metadata_files = galaxy.model.JobExternalOutputMetadata(job=job, dataset=dataset) - # we are using tempfile to create unique filenames, tempfile always returns an absolute path - # we will use pathnames relative to the galaxy root, to accommodate instances where the galaxy root - # is located differently, i.e. on a cluster node with a different filesystem structure - - # file to store existing dataset - metadata_files.filename_in = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_in_%s_" % key).name) - - # FIXME: HACK - # sqlalchemy introduced 'expire_on_commit' flag for sessionmaker at version 0.5x - # This may be causing the dataset attribute of the dataset_association object to no-longer be loaded into memory when needed for pickling. - # For now, we'll simply 'touch' dataset_association.dataset to force it back into memory. - dataset.dataset # force dataset_association.dataset to be loaded before pickling - # A better fix could be setting 'expire_on_commit=False' on the session, or modifying where commits occur, or ? - - # Touch also deferred column - dataset._metadata - - cPickle.dump(dataset, open(metadata_files.filename_in, 'wb+')) - # file to store metadata results of set_meta() - metadata_files.filename_out = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_out_%s_" % key).name) - open(metadata_files.filename_out, 'wt+') # create the file on disk, so it cannot be reused by tempfile (unlikely, but possible) - # file to store a 'return code' indicating the results of the set_meta() call - # results code is like (True/False - if setting metadata was successful/failed , exception or string of reason of success/failure ) - metadata_files.filename_results_code = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_results_%s_" % key).name) - # create the file on disk, so it cannot be reused by tempfile (unlikely, but possible) - json.dump((False, 'External set_meta() not called'), open(metadata_files.filename_results_code, 'wt+')) - # file to store kwds passed to set_meta() - metadata_files.filename_kwds = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_kwds_%s_" % key).name) - json.dump(kwds, open(metadata_files.filename_kwds, 'wt+'), ensure_ascii=True) - # existing metadata file parameters need to be overridden with cluster-writable file locations - metadata_files.filename_override_metadata = abspath(tempfile.NamedTemporaryFile(dir=tmp_dir, prefix="metadata_override_%s_" % key).name) - open(metadata_files.filename_override_metadata, 'wt+') # create the file on disk, so it cannot be reused by tempfile (unlikely, but possible) - override_metadata = [] - for meta_key, spec_value in dataset.metadata.spec.items(): - if isinstance(spec_value.param, FileParameter) and dataset.metadata.get(meta_key, None) is not None: - metadata_temp = MetadataTempFile() - metadata_temp.tmp_dir = tmp_dir - shutil.copy(dataset.metadata.get(meta_key, None).file_name, metadata_temp.file_name) - override_metadata.append((meta_key, metadata_temp.to_JSON())) - json.dump(override_metadata, open(metadata_files.filename_override_metadata, 'wt+')) - # add to session and flush - sa_session.add(metadata_files) - sa_session.flush() - metadata_files_list.append(metadata_files) - args = '"%s" "%s" %s %s' % (metadata_path_on_compute(datatypes_config), - job_metadata, - " ".join(map(__metadata_files_list_to_cmd_line, metadata_files_list)), - max_metadata_value_size) - if include_command: - # return command required to build - fd, fp = tempfile.mkstemp(suffix='.py', dir=tmp_dir, prefix="set_metadata_") - metadata_script_file = abspath(fp) - os.fdopen(fd, 'w').write('from galaxy_ext.metadata.set_metadata import set_metadata; set_metadata()') - return 'python "%s" %s' % (metadata_path_on_compute(metadata_script_file), args) - else: - # return args to galaxy_ext.metadata.set_metadata required to build - return args - - def external_metadata_set_successfully(self, dataset, sa_session): - metadata_files = self.get_output_filenames_by_dataset(dataset, sa_session) - if not metadata_files: - return False # this file doesn't exist - rval, rstring = json.load(open(metadata_files.filename_results_code)) - if not rval: - log.debug('setting metadata externally failed for %s %s: %s' % (dataset.__class__.__name__, dataset.id, rstring)) - return rval - - def cleanup_external_metadata(self, sa_session): - log.debug('Cleaning up external metadata files') - for metadata_files in sa_session.query(galaxy.model.Job).get(self.job_id).external_output_metadata: - # we need to confirm that any MetadataTempFile files were removed, if not we need to remove them - # can occur if the job was stopped before completion, but a MetadataTempFile is used in the set_meta - MetadataTempFile.cleanup_from_JSON_dict_filename(metadata_files.filename_out) - dataset_key = self.get_dataset_metadata_key(metadata_files.dataset) - for key, fname in [('filename_in', metadata_files.filename_in), - ('filename_out', metadata_files.filename_out), - ('filename_results_code', metadata_files.filename_results_code), - ('filename_kwds', metadata_files.filename_kwds), - ('filename_override_metadata', metadata_files.filename_override_metadata)]: - try: - os.remove(fname) - except Exception as e: - log.debug('Failed to cleanup external metadata file (%s) for %s: %s' % (key, dataset_key, e)) - - def set_job_runner_external_pid(self, pid, sa_session): - for metadata_files in sa_session.query(galaxy.model.Job).get(self.job_id).external_output_metadata: - metadata_files.job_runner_external_pid = pid - sa_session.add(metadata_files) - sa_session.flush() - - __all__ = ( "Statement", "MetadataElement", @@ -840,5 +643,4 @@ def set_job_runner_external_pid(self, pid, sa_session): "PythonObjectParameter", "FileParameter", "MetadataTempFile", - "JobExternalOutputMetadataWrapper", ) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 609314b13120..750d7960ea32 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -25,9 +25,9 @@ exceptions, model ) -from galaxy.datatypes.metadata import JobExternalOutputMetadataWrapper from galaxy.managers.jobs import JobSearch from galaxy.managers.tags import GalaxyTagManager +from galaxy.metadata import get_metadata_compute_strategy from galaxy.queue_worker import send_control_task from galaxy.tools.actions import DefaultToolAction from galaxy.tools.actions.data_manager import DataManagerToolAction @@ -2259,7 +2259,7 @@ def regenerate_imported_metadata_if_needed(self, hda, history, job): def exec_after_process(self, app, inp_data, out_data, param_dict, job=None): for name, dataset in inp_data.items(): - external_metadata = JobExternalOutputMetadataWrapper(job) + external_metadata = get_metadata_compute_strategy(app, job.id) if external_metadata.external_metadata_set_successfully(dataset, app.model.context): dataset.metadata.from_JSON_dict(external_metadata.get_output_filenames_by_dataset(dataset, app.model.context).filename_out) else: diff --git a/lib/galaxy/tools/actions/metadata.py b/lib/galaxy/tools/actions/metadata.py index 6f8d11468284..9038a7f2fb6d 100644 --- a/lib/galaxy/tools/actions/metadata.py +++ b/lib/galaxy/tools/actions/metadata.py @@ -2,8 +2,8 @@ import os from json import dumps -from galaxy.datatypes.metadata import JobExternalOutputMetadataWrapper from galaxy.jobs.datasets import DatasetPath +from galaxy.metadata import get_metadata_compute_strategy from galaxy.util.odict import odict from . import ToolAction @@ -74,7 +74,7 @@ def execute_via_app(self, tool, app, session_id, history_id, user=None, job_working_dir = app.object_store.get_filename(job, base_dir='job_work', dir_only=True, extra_dir=str(job.id)) datatypes_config = os.path.join(job_working_dir, 'registry.xml') app.datatypes_registry.to_xml_file(path=datatypes_config) - external_metadata_wrapper = JobExternalOutputMetadataWrapper(job) + external_metadata_wrapper = get_metadata_compute_strategy(app, job.id) cmd_line = external_metadata_wrapper.setup_external_metadata(dataset, sa_session, exec_dir=None, From 0aa7474bce58f3e5778330dc7abab3bd222e65ff Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 28 Nov 2018 13:50:18 -0500 Subject: [PATCH 23/88] Simplify metadata strategy interface - load_metadata entry point. Eliminates two methods from the "public interface" for this strategy and replaces them with one that exposes much less of what I'd consider to be internals of what is going on. --- lib/galaxy/jobs/__init__.py | 18 +----------------- lib/galaxy/metadata/__init__.py | 29 ++++++++++++++++++++++++----- lib/galaxy/tools/__init__.py | 8 ++++++-- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 85512ba37870..d0911bbc056c 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1363,23 +1363,7 @@ def finish( not self.external_output_metadata.external_metadata_set_successfully(dataset, self.sa_session)): dataset._state = model.Dataset.states.FAILED_METADATA else: - # load metadata from file - # we need to no longer allow metadata to be edited while the job is still running, - # since if it is edited, the metadata changed on the running output will no longer match - # the metadata that was stored to disk for use via the external process, - # and the changes made by the user will be lost, without warning or notice - output_filename = self.external_output_metadata.get_output_filenames_by_dataset(dataset, self.sa_session).filename_out - - def path_rewriter(path): - if not path: - return path - normalized_remote_metadata_directory = remote_metadata_directory and os.path.normpath(remote_metadata_directory) - normalized_path = os.path.normpath(path) - if remote_metadata_directory and normalized_path.startswith(normalized_remote_metadata_directory): - return normalized_path.replace(normalized_remote_metadata_directory, self.working_directory, 1) - return path - - dataset.metadata.from_JSON_dict(output_filename, path_rewriter=path_rewriter) + self.external_output_metadata.load_metadata(dataset, dataset_assoc.name, self.sa_session, working_directory=self.working_directory, remote_metadata_directory=remote_metadata_directory) line_count = context.get('line_count', None) try: # Certain datatype's set_peek methods contain a line_count argument diff --git a/lib/galaxy/metadata/__init__.py b/lib/galaxy/metadata/__init__.py index 06a6faf297ce..e483dc8ecaa9 100644 --- a/lib/galaxy/metadata/__init__.py +++ b/lib/galaxy/metadata/__init__.py @@ -34,7 +34,7 @@ class JobExternalOutputMetadataWrapper(object): def __init__(self, job_id): self.job_id = job_id - def get_output_filenames_by_dataset(self, dataset, sa_session): + def _get_output_filenames_by_dataset(self, dataset, sa_session): if isinstance(dataset, galaxy.model.HistoryDatasetAssociation): return sa_session.query(galaxy.model.JobExternalOutputMetadata) \ .filter_by(job_id=self.job_id, @@ -56,13 +56,13 @@ def get_dataset_metadata_key(self, dataset): def invalidate_external_metadata(self, datasets, sa_session): for dataset in datasets: - jeom = self.get_output_filenames_by_dataset(dataset, sa_session) + jeom = self._get_output_filenames_by_dataset(dataset, sa_session) # shouldn't be more than one valid, but you never know while jeom: jeom.is_valid = False sa_session.add(jeom) sa_session.flush() - jeom = self.get_output_filenames_by_dataset(dataset, sa_session) + jeom = self._get_output_filenames_by_dataset(dataset, sa_session) def setup_external_metadata(self, datasets, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, @@ -121,7 +121,7 @@ def __get_filename_override(): # when setting metadata externally, via 'auto-detect' button in edit attributes, etc., # we don't want to overwrite (losing the ability to cleanup) our existing dataset keys and files, # so we will only populate the dictionary once - metadata_files = self.get_output_filenames_by_dataset(dataset, sa_session) + metadata_files = self._get_output_filenames_by_dataset(dataset, sa_session) if not metadata_files: job = sa_session.query(galaxy.model.Job).get(self.job_id) metadata_files = galaxy.model.JobExternalOutputMetadata(job=job, dataset=dataset) @@ -184,7 +184,7 @@ def __get_filename_override(): return args def external_metadata_set_successfully(self, dataset, sa_session): - metadata_files = self.get_output_filenames_by_dataset(dataset, sa_session) + metadata_files = self._get_output_filenames_by_dataset(dataset, sa_session) if not metadata_files: return False # this file doesn't exist rval, rstring = json.load(open(metadata_files.filename_results_code)) @@ -214,3 +214,22 @@ def set_job_runner_external_pid(self, pid, sa_session): metadata_files.job_runner_external_pid = pid sa_session.add(metadata_files) sa_session.flush() + + def load_metadata(self, dataset, name, sa_session, working_directory, remote_metadata_directory=None): + # load metadata from file + # we need to no longer allow metadata to be edited while the job is still running, + # since if it is edited, the metadata changed on the running output will no longer match + # the metadata that was stored to disk for use via the external process, + # and the changes made by the user will be lost, without warning or notice + output_filename = self._get_output_filenames_by_dataset(dataset, sa_session).filename_out + + def path_rewriter(path): + if not path: + return path + normalized_remote_metadata_directory = remote_metadata_directory and os.path.normpath(remote_metadata_directory) + normalized_path = os.path.normpath(path) + if remote_metadata_directory and normalized_path.startswith(normalized_remote_metadata_directory): + return normalized_path.replace(normalized_remote_metadata_directory, working_directory, 1) + return path + + dataset.metadata.from_JSON_dict(output_filename, path_rewriter=path_rewriter) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 750d7960ea32..4570b68a68cd 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2258,10 +2258,14 @@ def regenerate_imported_metadata_if_needed(self, hda, history, job): ) def exec_after_process(self, app, inp_data, out_data, param_dict, job=None): + working_directory = app.object_store.get_filename( + job, base_dir='job_work', dir_only=True, obj_dir=True + ) for name, dataset in inp_data.items(): external_metadata = get_metadata_compute_strategy(app, job.id) - if external_metadata.external_metadata_set_successfully(dataset, app.model.context): - dataset.metadata.from_JSON_dict(external_metadata.get_output_filenames_by_dataset(dataset, app.model.context).filename_out) + sa_session = app.model.context + if external_metadata.external_metadata_set_successfully(dataset, sa_session): + external_metadata.load_metadata(dataset, name, sa_session, working_directory=working_directory) else: dataset._state = model.Dataset.states.FAILED_METADATA self.sa_session.add(dataset) From 31dd08dde248a3446f8dbf769221158f96f04580 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 28 Nov 2018 13:51:53 -0500 Subject: [PATCH 24/88] Simplify metadata strategy - make method "private". --- lib/galaxy/metadata/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/metadata/__init__.py b/lib/galaxy/metadata/__init__.py index e483dc8ecaa9..b790ec98f7a6 100644 --- a/lib/galaxy/metadata/__init__.py +++ b/lib/galaxy/metadata/__init__.py @@ -49,7 +49,7 @@ def _get_output_filenames_by_dataset(self, dataset, sa_session): .first() # there should only be one or None return None - def get_dataset_metadata_key(self, dataset): + def _get_dataset_metadata_key(self, dataset): # Set meta can be called on library items and history items, # need to make different keys for them, since ids can overlap return "%s_%d" % (dataset.__class__.__name__, dataset.id) @@ -115,7 +115,7 @@ def __get_filename_override(): raise Exception('In setup_external_metadata, the received datatypes_config is None.') metadata_files_list = [] for dataset in datasets: - key = self.get_dataset_metadata_key(dataset) + key = self._get_dataset_metadata_key(dataset) # future note: # wonkiness in job execution causes build command line to be called more than once # when setting metadata externally, via 'auto-detect' button in edit attributes, etc., @@ -198,7 +198,7 @@ def cleanup_external_metadata(self, sa_session): # we need to confirm that any MetadataTempFile files were removed, if not we need to remove them # can occur if the job was stopped before completion, but a MetadataTempFile is used in the set_meta MetadataTempFile.cleanup_from_JSON_dict_filename(metadata_files.filename_out) - dataset_key = self.get_dataset_metadata_key(metadata_files.dataset) + dataset_key = self._get_dataset_metadata_key(metadata_files.dataset) for key, fname in [('filename_in', metadata_files.filename_in), ('filename_out', metadata_files.filename_out), ('filename_results_code', metadata_files.filename_results_code), From 6f449107e4fcb180feda9854188939dea67dd270 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 29 Nov 2018 09:04:56 -0500 Subject: [PATCH 25/88] Formalize interface for metadata strategy. --- lib/galaxy/metadata/__init__.py | 42 ++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/metadata/__init__.py b/lib/galaxy/metadata/__init__.py index b790ec98f7a6..ebfca7994782 100644 --- a/lib/galaxy/metadata/__init__.py +++ b/lib/galaxy/metadata/__init__.py @@ -1,5 +1,6 @@ """Define abstraction for capturing the metadata of job's output datasets.""" +import abc import json import os import shutil @@ -7,6 +8,7 @@ from logging import getLogger from os.path import abspath +import six from six.moves import cPickle import galaxy.model @@ -20,7 +22,45 @@ def get_metadata_compute_strategy(app, job_id): return JobExternalOutputMetadataWrapper(job_id) -class JobExternalOutputMetadataWrapper(object): +@six.add_metaclass(abc.ABCMeta) +class MetadataCollectionStrategy(object): + """Interface describing the abstract process of writing out and collecting output metadata. + """ + + def invalidate_external_metadata(self, datasets, sa_session): + """Invalidate written files.""" + pass + + def set_job_runner_external_pid(self, pid, sa_session): + pass + + def cleanup_external_metadata(self, sa_session): + pass + + @abc.abstractmethod + def setup_external_metadata(self, datasets, sa_session, exec_dir=None, + tmp_dir=None, dataset_files_path=None, + output_fnames=None, config_root=None, + config_file=None, datatypes_config=None, + job_metadata=None, compute_tmp_dir=None, + include_command=True, max_metadata_value_size=0, + kwds=None): + """Setup files needed for external metadata collection. + + If include_command is True, return full Python command to externally compute metadata + otherwise just the arguments to galaxy_ext.metadata.set_metadata required to build. + """ + + @abc.abstractmethod + def external_metadata_set_successfully(self, dataset, sa_session): + """Return boolean indicating if metadata for specified dataset was written properly.""" + + @abc.abstractmethod + def load_metadata(self, dataset, name, sa_session, working_directory, remote_metadata_directory=None): + """Load metadata calculated externally into specified dataset.""" + + +class JobExternalOutputMetadataWrapper(MetadataCollectionStrategy): """ Class with methods allowing set_meta() to be called externally to the Galaxy head. From ecd6a9c054c8b203be2bc5a3799975b9a8579b94 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 29 Nov 2018 08:57:12 -0500 Subject: [PATCH 26/88] Refactor metadata strategy interface to consume dict of outputs. Exposing output names to the generation strategy should allow a more grok-able alternative metadata collection strategy to be implemented with simple output name keys and such. --- lib/galaxy/jobs/__init__.py | 11 ++++++++--- lib/galaxy/metadata/__init__.py | 8 ++++---- lib/galaxy/tools/actions/metadata.py | 5 ++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index d0911bbc056c..c2c062d2ae9c 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1752,9 +1752,14 @@ def setup_external_metadata(self, exec_dir=None, tmp_dir=None, if datatypes_config is None: datatypes_config = os.path.join(self.working_directory, 'registry.xml') self.app.datatypes_registry.to_xml_file(path=datatypes_config) - command = self.external_output_metadata.setup_external_metadata([output_dataset_assoc.dataset for - output_dataset_assoc in - job.output_datasets + job.output_library_datasets], + + output_datasets = {} + for output_dataset_assoc in job.output_datasets + job.output_library_datasets: + output_name = output_dataset_assoc.name + assert output_name not in output_datasets + output_datasets[output_dataset_assoc.name] = output_dataset_assoc.dataset + + command = self.external_output_metadata.setup_external_metadata(output_datasets, self.sa_session, exec_dir=exec_dir, tmp_dir=tmp_dir, diff --git a/lib/galaxy/metadata/__init__.py b/lib/galaxy/metadata/__init__.py index ebfca7994782..2c4fcfcda181 100644 --- a/lib/galaxy/metadata/__init__.py +++ b/lib/galaxy/metadata/__init__.py @@ -38,7 +38,7 @@ def cleanup_external_metadata(self, sa_session): pass @abc.abstractmethod - def setup_external_metadata(self, datasets, sa_session, exec_dir=None, + def setup_external_metadata(self, datasets_dict, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, output_fnames=None, config_root=None, config_file=None, datatypes_config=None, @@ -104,7 +104,7 @@ def invalidate_external_metadata(self, datasets, sa_session): sa_session.flush() jeom = self._get_output_filenames_by_dataset(dataset, sa_session) - def setup_external_metadata(self, datasets, sa_session, exec_dir=None, + def setup_external_metadata(self, datasets_dict, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, output_fnames=None, config_root=None, config_file=None, datatypes_config=None, @@ -143,8 +143,8 @@ def __get_filename_override(): metadata_path_on_compute(metadata_files.filename_override_metadata), ) return line - if not isinstance(datasets, list): - datasets = [datasets] + + datasets = list(datasets_dict.values()) if exec_dir is None: exec_dir = os.path.abspath(os.getcwd()) if dataset_files_path is None: diff --git a/lib/galaxy/tools/actions/metadata.py b/lib/galaxy/tools/actions/metadata.py index 9038a7f2fb6d..2b0afc46dec1 100644 --- a/lib/galaxy/tools/actions/metadata.py +++ b/lib/galaxy/tools/actions/metadata.py @@ -75,7 +75,10 @@ def execute_via_app(self, tool, app, session_id, history_id, user=None, datatypes_config = os.path.join(job_working_dir, 'registry.xml') app.datatypes_registry.to_xml_file(path=datatypes_config) external_metadata_wrapper = get_metadata_compute_strategy(app, job.id) - cmd_line = external_metadata_wrapper.setup_external_metadata(dataset, + output_datatasets_dict = { + dataset_name: dataset, + } + cmd_line = external_metadata_wrapper.setup_external_metadata(output_datatasets_dict, sa_session, exec_dir=None, tmp_dir=job_working_dir, From d2b7e8af32f60548b06abde87211bc24c3f07aa8 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 27 Dec 2018 16:58:43 -0500 Subject: [PATCH 27/88] Refactor set_metadata.py to simplify provided metadata access. --- lib/galaxy_ext/metadata/set_metadata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy_ext/metadata/set_metadata.py b/lib/galaxy_ext/metadata/set_metadata.py index a4f5b89476e7..5fbfe6fdb8e2 100644 --- a/lib/galaxy_ext/metadata/set_metadata.py +++ b/lib/galaxy_ext/metadata/set_metadata.py @@ -123,15 +123,15 @@ def set_metadata(): dataset.dataset.external_filename = dataset_filename_override files_path = os.path.abspath(os.path.join(tool_job_working_directory, "dataset_%s_files" % (dataset.dataset.id))) dataset.dataset.external_extra_files_path = files_path - if dataset.dataset.id in existing_job_metadata_dict: - dataset.extension = existing_job_metadata_dict[dataset.dataset.id].get('ext', dataset.extension) + file_dict = existing_job_metadata_dict.get(dataset.dataset.id, {}) + if 'ext' in file_dict: + dataset.extension = file_dict['ext'] # Metadata FileParameter types may not be writable on a cluster node, and are therefore temporarily substituted with MetadataTempFiles override_metadata = json.load(open(override_metadata)) for metadata_name, metadata_file_override in override_metadata: if galaxy.datatypes.metadata.MetadataTempFile.is_JSONified_value(metadata_file_override): metadata_file_override = galaxy.datatypes.metadata.MetadataTempFile.from_JSON(metadata_file_override) setattr(dataset.metadata, metadata_name, metadata_file_override) - file_dict = existing_job_metadata_dict.get(dataset.dataset.id, {}) set_meta_with_tool_provided(dataset, file_dict, set_meta_kwds, datatypes_registry, max_metadata_value_size) dataset.metadata.to_JSON_dict(filename_out) # write out results of set_meta json.dump((True, 'Metadata has been set successfully'), open(filename_results_code, 'wt+')) # setting metadata has succeeded From 8bcda83aad15200dd6e72988ef65bf256ac5c18b Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 27 Dec 2018 17:05:38 -0500 Subject: [PATCH 28/88] Bug fix for reading metadata and extension from galaxy.json in set_metadata.py. --- lib/galaxy_ext/metadata/set_metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy_ext/metadata/set_metadata.py b/lib/galaxy_ext/metadata/set_metadata.py index 5fbfe6fdb8e2..d0d1e6e1972d 100644 --- a/lib/galaxy_ext/metadata/set_metadata.py +++ b/lib/galaxy_ext/metadata/set_metadata.py @@ -103,7 +103,7 @@ def set_metadata(): try: line = stringify_dictionary_keys(json.loads(line)) if line['type'] == 'dataset': - existing_job_metadata_dict[line['dataset_id']] = line + existing_job_metadata_dict[int(line['dataset_id'])] = line elif line['type'] == 'new_primary_dataset': new_job_metadata_dict[line['filename']] = line except Exception: From a9ed02de64637748c43fd7744a47d09b80d01327 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 09:05:40 -0500 Subject: [PATCH 29/88] Add eslint, start setting up targets. Needs exclusions, rule tweaking, and a ton of quick error resolution. --- client/.eslintrc.js | 27 +++ client/package.json | 22 +- client/yarn.lock | 513 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 540 insertions(+), 22 deletions(-) create mode 100644 client/.eslintrc.js diff --git a/client/.eslintrc.js b/client/.eslintrc.js new file mode 100644 index 000000000000..ebbfa872f02d --- /dev/null +++ b/client/.eslintrc.js @@ -0,0 +1,27 @@ +module.exports = { + extends: ["eslint:recommended", "prettier", "plugin:vue/essential"], // airbnb-base, eventually + env: { + browser: true + }, + parserOptions: { parser: "babel-eslint" }, + plugins: ["prettier", "html"], + rules: { + //"no-console": "off", + //"no-useless-escape": "off", + //"no-debugger": "off", + //"no-unused-vars": ["error", { args: "none" }], + "prettier/prettier": [ + "error", + { + printWidth: 120, + tabWidth: 4 + } + ] + // "camelcase": [ + // "error", + // { + // "properties": "never" + // } + // ] + } +}; diff --git a/client/package.json b/client/package.json index 133224f129a6..f205622d4921 100644 --- a/client/package.json +++ b/client/package.json @@ -55,25 +55,26 @@ "build-production-maps": "NODE_ENV=production gulp staging && concurrently -r \"yarn run webpack-production-maps\" \"yarn run gulp clean && yarn run gulp-production-maps\" && yarn run save-build-hash", "build-stats": "webpack --profile --json > webpack-stats.json", "webpack": "webpack -d", - "save-build-hash": "(git rev-parse HEAD 2>/dev/null || echo '') >../static/client_build_hash.txt", "webpack-watch": "webpack -d --watch", "webpack-production": "webpack -p", "webpack-production-maps": "GXY_BUILD_SOURCEMAPS=1 webpack -p", - "test": "npm run test-mocha && npm run test-qunit", - "test-watch": "npm run test-mocha -- --no-single-run", - "test-qunit": "GALAXY_TEST_AS_SINGLE_PACK=true karma start karma/karma.config.qunit.js", - "test-mocha": "GALAXY_TEST_AS_SINGLE_PACK=true karma start karma/karma.config.mocha.js", "gulp": "gulp", "gulp-production": "NODE_ENV=production gulp", "gulp-production-maps": "GXY_BUILD_SOURCEMAPS=1 NODE_ENV=production gulp", - "jshint": "jshint --exclude='galaxy/scripts/libs/**' galaxy/scripts/**/*.js", + "save-build-hash": "(git rev-parse HEAD 2>/dev/null || echo '') >../static/client_build_hash.txt", "build-charts": "webpack -p --config ../config/plugins/visualizations/charts/webpack.config.js", "build-scatterplot": "NODE_PATH=./node_modules webpack -p --config ../config/plugins/visualizations/scatterplot/webpack.config.js", "prettier": "concurrently -r \"yarn run prettier-style\" \"yarn run prettier-scripts\"", "prettier-scripts": "prettier --write --tab-width 4 --print-width 120 \"galaxy/scripts/{,!(libs)/**/}/{*.js,*.vue}\"", "prettier-style": "prettier --write --tab-width 4 --print-width 120 \"galaxy/style/scss/**/*.scss\"", "styleguide": "vue-styleguidist server", - "styleguide:build": "vue-styleguidist build" + "styleguide:build": "vue-styleguidist build", + "test": "npm run test-mocha && npm run test-qunit", + "test-watch": "npm run test-mocha -- --no-single-run", + "test-qunit": "GALAXY_TEST_AS_SINGLE_PACK=true karma start karma/karma.config.qunit.js", + "test-mocha": "GALAXY_TEST_AS_SINGLE_PACK=true karma start karma/karma.config.mocha.js", + "jshint": "jshint --exclude='galaxy/scripts/libs/**' galaxy/scripts/**/*.js", + "eslint": "eslint -c .eslintrc.js galaxy/scripts/mvc" }, "devDependencies": { "babel-loader": "^8.0.4", @@ -84,6 +85,13 @@ "css-loader": "^1.0.0", "del": "^3.0.0", "duplicate-package-checker-webpack-plugin": "^3.0.0", + "eslint": "^5.12.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-config-prettier": "^3.3.0", + "eslint-plugin-html": "^5.0.0", + "eslint-plugin-import": "^2.14.0", + "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-vue": "^5.1.0", "expose-loader": "^0.7.5", "file-loader": "^2.0.0", "gulp": "^3.9.1", diff --git a/client/yarn.lock b/client/yarn.lock index 6164ac67288b..cf5bb958c742 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1079,6 +1079,16 @@ ajv@^6.1.0: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.5.3, ajv@^6.6.1: + version "6.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" + integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + alphanum-sort@^1.0.0, alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" @@ -1148,6 +1158,11 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= +ansi-regex@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" + integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1405,6 +1420,11 @@ ast-types@^0.7.2: resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.7.8.tgz#902d2e0d60d071bdcd46dc115e1809ed11c138a9" integrity sha1-kC0uDWDQcb3NRtwRXhgJ7RHBOKk= +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -2819,6 +2839,11 @@ callsite@1.0.0: resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -2975,6 +3000,11 @@ chardet@^0.4.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + check-error@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -3057,6 +3087,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== + clap@^1.0.9: version "1.2.3" resolved "https://registry.yarnpkg.com/clap/-/clap-1.2.3.tgz#4f36745b32008492557f46412d66d50cb99bce51" @@ -3555,6 +3590,11 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" @@ -4118,6 +4158,13 @@ debug@3.X, debug@^3.1.0: dependencies: ms "^2.1.1" +debug@^4.0.1, debug@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -4164,7 +4211,7 @@ defaults@^1.0.0, defaults@^1.0.3: dependencies: clone "^1.0.2" -define-properties@^1.1.2: +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -4337,6 +4384,14 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + doctrine@^2.0.0, doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -4652,6 +4707,18 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.12.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + es-abstract@^1.5.1, es-abstract@^1.6.1, es-abstract@^1.7.0: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" @@ -4663,7 +4730,7 @@ es-abstract@^1.5.1, es-abstract@^1.6.1, es-abstract@^1.7.0: is-callable "^1.1.3" is-regex "^1.0.4" -es-to-primitive@^1.1.1: +es-to-primitive@^1.1.1, es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== @@ -4740,6 +4807,80 @@ escodegen@^1.10.0: optionalDependencies: source-map "~0.6.1" +eslint-config-airbnb-base@^13.1.0: + version "13.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz#b5a1b480b80dfad16433d6c4ad84e6605052c05c" + integrity sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw== + dependencies: + eslint-restricted-globals "^0.1.1" + object.assign "^4.1.0" + object.entries "^1.0.4" + +eslint-config-prettier@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.3.0.tgz#41afc8d3b852e757f06274ed6c44ca16f939a57d" + integrity sha512-Bc3bh5bAcKNvs3HOpSi6EfGA2IIp7EzWcg2tS4vP7stnXu/J1opihHDM7jI9JCIckyIDTgZLSWn7J3HY0j2JfA== + dependencies: + get-stdin "^6.0.0" + +eslint-import-resolver-node@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-module-utils@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" + integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= + dependencies: + debug "^2.6.8" + pkg-dir "^1.0.0" + +eslint-plugin-html@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-html/-/eslint-plugin-html-5.0.0.tgz#396e30a60dedee0122fe08f11d13c5ab22f20d32" + integrity sha512-f7p/7YQdgQUFVAX3nB4dnMQbrDeTalcA01PDhuvTLk0ZadCwM4Pb+639SRuqEf1zMkIxckLY+ckCr0hVP5zl6A== + dependencies: + htmlparser2 "^3.10.0" + +eslint-plugin-import@^2.14.0: + version "2.14.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" + integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== + dependencies: + contains-path "^0.1.0" + debug "^2.6.8" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.2.0" + has "^1.0.1" + lodash "^4.17.4" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + resolve "^1.6.0" + +eslint-plugin-prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" + integrity sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-vue@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-5.1.0.tgz#d0d373334be8140d698ec4e1fb83f09faa48081b" + integrity sha512-C7avvbGLb9J1PyGiFolPcGR4ljUc+dKm5ZJdrUKXwXFxHHx4SqOmRI29AsFyW7PbCGcnOvIlaq7NJS6HDIak+g== + dependencies: + vue-eslint-parser "^4.0.2" + +eslint-restricted-globals@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7" + integrity sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc= + eslint-scope@3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -4756,11 +4897,59 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== +eslint@^5.12.0: + version "5.12.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.0.tgz#fab3b908f60c52671fb14e996a450b96c743c859" + integrity sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.5.3" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^2.1.0" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.0" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.1.0" + js-yaml "^3.12.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.5" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.0.2" + text-table "^0.2.0" + espower-location-detector@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/espower-location-detector/-/espower-location-detector-1.0.0.tgz#a17b7ecc59d30e179e2bef73fb4137704cb331b5" @@ -4771,6 +4960,24 @@ espower-location-detector@^1.0.0: source-map "^0.5.0" xtend "^4.0.0" +espree@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.1.0.tgz#728d5451e0fd156c04384a7ad89ed51ff54eb25f" + integrity sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w== + dependencies: + acorn "^6.0.2" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +espree@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.0.tgz#fc7f984b62b36a0f543b13fb9cd7b9f4a7f5b65c" + integrity sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA== + dependencies: + acorn "^6.0.2" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + esprima-extract-comments@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/esprima-extract-comments/-/esprima-extract-comments-0.2.1.tgz#9018d8df37ffd95dd615015a8c5f0475ed743423" @@ -4800,6 +5007,13 @@ espurify@^1.6.0: dependencies: core-js "^2.0.0" +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" @@ -5011,6 +5225,15 @@ external-editor@^2.0.1, external-editor@^2.0.4: iconv-lite "^0.4.17" tmp "^0.0.33" +external-editor@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -5096,6 +5319,11 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -5147,6 +5375,14 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + file-loader@^0.11.2: version "0.11.2" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.11.2.tgz#4ff1df28af38719a6098093b88c82c71d1794a34" @@ -5268,7 +5504,7 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.1.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= @@ -5331,6 +5567,16 @@ flagged-respawn@^1.0.0: resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.0.tgz#4e79ae9b2eb38bf86b3bb56bf3e0a56aa5fcabd7" integrity sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c= +flat-cache@^1.2.1: + version "1.3.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" + integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== + dependencies: + circular-json "^0.3.1" + graceful-fs "^4.1.2" + rimraf "~2.6.2" + write "^0.2.1" + flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" @@ -5500,6 +5746,11 @@ function.name-polyfill@^1.0.6: resolved "https://registry.yarnpkg.com/function.name-polyfill/-/function.name-polyfill-1.0.6.tgz#c54e37cae0a77dfcb49d47982815b0826b5c60d9" integrity sha512-ejQivNFbBPTY5O/waFta6D5AzV8GJiM/fMDaT6LrsYax1cb4eipxuQqKNlugF2jlcXIjifsqvju3wsgV35TELg== +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -5548,6 +5799,11 @@ get-stdin@^4.0.1: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -5723,6 +5979,11 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.8.0.tgz#c1ef45ee9bed6badf0663c5cb90e8d1adec1321d" integrity sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA== +globals@^11.7.0: + version "11.10.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" + integrity sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ== + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -6048,7 +6309,7 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has@^1.0.0, has@^1.0.1: +has@^1.0.0, has@^1.0.1, has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== @@ -6199,6 +6460,18 @@ htmlparser2@3.8.x: entities "1.0" readable-stream "1.1" +htmlparser2@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.0.tgz#5f5e422dcf6119c0d983ed36260ce9ded0bee464" + integrity sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ== + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.0.6" + htmlparser2@^3.9.2: version "3.9.2" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" @@ -6286,7 +6559,7 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -6337,6 +6610,11 @@ ignore@^3.3.5: resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -6344,6 +6622,14 @@ import-cwd@^2.0.0: dependencies: import-from "^2.1.0" +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -6469,6 +6755,25 @@ inquirer@3.3.0: strip-ansi "^4.0.0" through "^2.3.6" +inquirer@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.1.tgz#9943fc4882161bdb0b0c9276769c75b32dbfcd52" + integrity sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.0" + figures "^2.0.0" + lodash "^4.17.10" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.1.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + internal-ip@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-1.2.0.tgz#ae9fbf93b984878785d50a8de1b356956058cf5c" @@ -7187,6 +7492,11 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -7475,7 +7785,7 @@ leven@^2.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= -levn@~0.3.0: +levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= @@ -7513,6 +7823,16 @@ load-json-file@^1.0.0, load-json-file@^1.1.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + loader-runner@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.1.tgz#026f12fe7c3115992896ac02ba022ba92971b979" @@ -7707,7 +8027,7 @@ lodash@^3.8.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y= -lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0, lodash@~4.17.10: +lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0, lodash@~4.17.10: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -8126,7 +8446,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: +"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -8355,6 +8675,11 @@ natives@^1.1.0: resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb" integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA== +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + needle@^2.2.1: version "2.2.4" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" @@ -8672,7 +8997,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.12: +object-keys@^1.0.11, object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== @@ -8689,6 +9014,16 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + object.defaults@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" @@ -8699,6 +9034,16 @@ object.defaults@^1.1.0: for-own "^1.0.0" isobject "^3.0.0" +object.entries@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519" + integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -8848,7 +9193,7 @@ option-chain@^0.1.0: dependencies: object-assign "^4.0.1" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= @@ -9033,6 +9378,13 @@ param-case@2.1.x: dependencies: no-case "^2.2.0" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" @@ -9173,7 +9525,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= @@ -9183,7 +9535,7 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5: +path-parse@^1.0.5, path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== @@ -9221,6 +9573,13 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -9377,6 +9736,11 @@ plur@^2.0.0: dependencies: irregular-plurals "^1.0.0" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== + popper.js@^1.12.3, popper.js@^1.12.9, popper.js@^1.14.4: version "1.14.4" resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.4.tgz#8eec1d8ff02a5a3a152dd43414a15c7b79fd69b6" @@ -10091,6 +10455,13 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + prettier@1.13.7: version "1.13.7" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" @@ -10150,6 +10521,11 @@ progress@^1.1.8: resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -10583,6 +10959,14 @@ read-pkg-up@^1.0.1: find-up "^1.0.0" read-pkg "^1.0.0" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -10592,6 +10976,15 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + read-pkg@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" @@ -10634,6 +11027,15 @@ readable-stream@1.1: isarray "0.0.1" string_decoder "~0.10.x" +readable-stream@^3.0.6: + version "3.1.1" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.1.1.tgz#ed6bbc6c5ba58b090039ff18ce670515795aeb06" + integrity sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@~1.1.9: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" @@ -10759,6 +11161,11 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + regexpu-core@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" @@ -11041,6 +11448,11 @@ resolve-from@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -11060,6 +11472,13 @@ resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2, resolve@^1.8.1: dependencies: path-parse "^1.0.5" +resolve@^1.5.0, resolve@^1.6.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" + integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ== + dependencies: + path-parse "^1.0.6" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -11098,6 +11517,13 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1, rimraf@^2. dependencies: glob "^7.0.5" +rimraf@~2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -11144,7 +11570,7 @@ rxjs@6.2.2: dependencies: tslib "^1.9.0" -rxjs@^6.3.3: +rxjs@^6.1.0, rxjs@^6.3.3: version "6.3.3" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== @@ -11449,6 +11875,15 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= +slice-ansi@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.0.0.tgz#5373bdb8559b45676e8541c66916cdd6251612e7" + integrity sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + slide@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -11844,6 +12279,13 @@ string_decoder@^1.0.0, string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -11891,6 +12333,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" + integrity sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow== + dependencies: + ansi-regex "^4.0.0" + strip-ansi@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" @@ -11916,6 +12365,11 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-comments@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-0.4.4.tgz#b9caafc4fe905f96c091df89f9a7215f2aa629c6" @@ -11941,7 +12395,7 @@ strip-json-comments@1.0.x: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" integrity sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E= -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -12060,6 +12514,16 @@ symbol@^0.2.1: resolved "https://registry.yarnpkg.com/symbol/-/symbol-0.2.3.tgz#3b9873b8a901e47c6efe21526a3ac372ef28bbc7" integrity sha1-O5hzuKkB5Hxu/iFSajrDcu8ou8c= +table@^5.0.2: + version "5.1.1" + resolved "https://registry.yarnpkg.com/table/-/table-5.1.1.tgz#92030192f1b7b51b6eeab23ed416862e47b70837" + integrity sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw== + dependencies: + ajv "^6.6.1" + lodash "^4.17.11" + slice-ansi "2.0.0" + string-width "^2.1.1" + taffydb@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" @@ -12696,7 +13160,7 @@ useragent@^2.1.12: lru-cache "4.1.x" tmp "0.0.x" -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -12891,6 +13355,18 @@ vue-docgen-api@^2.5.2: vue "^2.4.2" vue-template-compiler "^2.4.2" +vue-eslint-parser@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-4.0.3.tgz#80cf162e484387b2640371ad21ba1f86e0c10a61" + integrity sha512-AUeQsYdO6+7QXCems+WvGlrXd37PHv/zcRQSQdY1xdOMwdFAPEnMBsv7zPvk0TPGulXkK/5p/ITgrjiYB7k3ag== + dependencies: + debug "^4.1.0" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + espree "^4.1.0" + esquery "^1.0.1" + lodash "^4.17.11" + vue-functional-data-merge@^2.0.5: version "2.0.7" resolved "https://registry.yarnpkg.com/vue-functional-data-merge/-/vue-functional-data-merge-2.0.7.tgz#bdee655181eacdcb1f96ce95a4cc14e75313d1da" @@ -13336,6 +13812,13 @@ write-pkg@^1.0.0: dependencies: write-json-file "^1.1.0" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= + dependencies: + mkdirp "^0.5.1" + ws@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.2.tgz#8a244fa052401e08c9886cf44a85189e1fd4067f" From 5811e7268256fc3364ad2e08388f82c42132ecc7 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 09:35:54 -0500 Subject: [PATCH 30/88] Sync formatting. --- .../scripts/galaxy.interactive_environments.js | 4 +--- .../galaxy/scripts/mvc/tool/tool-form-composite.js | 6 ++++-- client/galaxy/style/scss/base.scss | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/galaxy/scripts/galaxy.interactive_environments.js b/client/galaxy/scripts/galaxy.interactive_environments.js index 6ffb0ad5da67..c6781f99873b 100644 --- a/client/galaxy/scripts/galaxy.interactive_environments.js +++ b/client/galaxy/scripts/galaxy.interactive_environments.js @@ -18,9 +18,7 @@ export function clear_main_area() { } export function display_spinner() { - $("#main").append( - `
    ` - ); + $("#main").append(`
    `); } /* Create a spin_state object used by spin() and spin_again() */ diff --git a/client/galaxy/scripts/mvc/tool/tool-form-composite.js b/client/galaxy/scripts/mvc/tool/tool-form-composite.js index 4c7ec5e2ec4f..0427ea695a0f 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form-composite.js +++ b/client/galaxy/scripts/mvc/tool/tool-form-composite.js @@ -183,8 +183,10 @@ var View = Backbone.View.extend({ input.is_workflow = (data_ref.step_linked && !self._isDataStep(data_ref.step_linked)) || input.wp_linked; } - if (is_data_input || - (input.value && input.value.__class__ == "RuntimeValue" && !input.step_linked)) { + if ( + is_data_input || + (input.value && input.value.__class__ == "RuntimeValue" && !input.step_linked) + ) { step.collapsed = false; } if (is_runtime_value) { diff --git a/client/galaxy/style/scss/base.scss b/client/galaxy/style/scss/base.scss index 2f54fd7123eb..bdc70014e915 100644 --- a/client/galaxy/style/scss/base.scss +++ b/client/galaxy/style/scss/base.scss @@ -1995,11 +1995,11 @@ body.reports { /* Used in Galaxy IE for spinner loading TODO: Remove in IE entrypoint refactoring */ #ie-loading-spinner { - position:absolute; - margin:auto; - top:0; - left:0; - right:0; - bottom:0; + position: absolute; + margin: auto; + top: 0; + left: 0; + right: 0; + bottom: 0; background: url(../../images/largespinner.gif) no-repeat center center fixed; } From e5691776396a7b7d8a993e23ebf670960dc6284e Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 10:10:04 -0500 Subject: [PATCH 31/88] Upgrade prettier, simplify config/exclusion, haven't run it yet. --- client/package.json | 6 ++---- client/prettier.config.js | 4 ++++ client/yarn.lock | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 client/prettier.config.js diff --git a/client/package.json b/client/package.json index f205622d4921..c3f3e4e86c96 100644 --- a/client/package.json +++ b/client/package.json @@ -64,9 +64,7 @@ "save-build-hash": "(git rev-parse HEAD 2>/dev/null || echo '') >../static/client_build_hash.txt", "build-charts": "webpack -p --config ../config/plugins/visualizations/charts/webpack.config.js", "build-scatterplot": "NODE_PATH=./node_modules webpack -p --config ../config/plugins/visualizations/scatterplot/webpack.config.js", - "prettier": "concurrently -r \"yarn run prettier-style\" \"yarn run prettier-scripts\"", - "prettier-scripts": "prettier --write --tab-width 4 --print-width 120 \"galaxy/scripts/{,!(libs)/**/}/{*.js,*.vue}\"", - "prettier-style": "prettier --write --tab-width 4 --print-width 120 \"galaxy/style/scss/**/*.scss\"", + "prettier": "prettier --write 'galaxy/style/scss/**/*.scss' 'galaxy/scripts/**/{*.js,*.vue}' '!galaxy/scripts/libs/**'", "styleguide": "vue-styleguidist server", "styleguide:build": "vue-styleguidist build", "test": "npm run test-mocha && npm run test-qunit", @@ -112,7 +110,7 @@ "optimize-css-assets-webpack-plugin": "^5.0.1", "phantomjs-polyfill": "0.0.2", "phantomjs-prebuilt": "^2.1.7", - "prettier": "^1.14.3", + "prettier": "^1.15.3", "qunitjs": "^2.4.1", "sass-loader": "^7.1.0", "sinon": "^4.1.2", diff --git a/client/prettier.config.js b/client/prettier.config.js new file mode 100644 index 000000000000..5fb801d16319 --- /dev/null +++ b/client/prettier.config.js @@ -0,0 +1,4 @@ +module.exports = { + tabWidth: 4, + printWidth: 120 +}; diff --git a/client/yarn.lock b/client/yarn.lock index cf5bb958c742..23886d562b75 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -10467,10 +10467,10 @@ prettier@1.13.7: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" integrity sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w== -prettier@^1.14.3: - version "1.14.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" - integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg== +prettier@^1.15.3: + version "1.15.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a" + integrity sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg== pretty-error@^2.0.2: version "2.1.1" From 49eecece5b8398ec6552e32d1448bb1a51370223 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 11:13:52 -0500 Subject: [PATCH 32/88] Avoid empty catch/log error. --- .../scripts/mvc/visualization/chart/components/screenshot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js b/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js index 843fdd6246cf..1ab1ac5fa966 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js +++ b/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js @@ -188,7 +188,9 @@ function _inline($target) { $target.find(rules[idx].selectorText).each(function(i, elem) { elem.style.cssText += rules[idx].style.cssText; }); - } catch (err) {} + } catch (err) { + console.error(err); + } } } } From 89d3fc3c54ddf3bf09896b8d20c3d43dc0d70df1 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 11:47:09 -0500 Subject: [PATCH 33/88] Fix most import errors in scripts/mvc --- client/galaxy/scripts/mvc/annotation.js | 2 ++ client/galaxy/scripts/mvc/base-mvc.js | 3 ++- .../scripts/mvc/collection/base-creator.js | 1 + .../mvc/collection/collection-li-edit.js | 6 +++--- .../scripts/mvc/collection/collection-model.js | 7 ++++--- .../mvc/collection/collection-view-edit.js | 3 --- .../mvc/collection/list-collection-creator.js | 1 - .../list-of-pairs-collection-creator.js | 17 ++++++++--------- .../mvc/collection/pair-collection-creator.js | 5 ++++- .../scripts/mvc/dataset/dataset-choice.js | 5 ++++- client/galaxy/scripts/mvc/form/form-input.js | 4 +++- .../galaxy/scripts/mvc/form/form-parameters.js | 2 ++ client/galaxy/scripts/mvc/form/form-section.js | 5 ++++- client/galaxy/scripts/mvc/form/form-view.js | 1 + client/galaxy/scripts/mvc/grid/grid-model.js | 6 +++--- .../galaxy/scripts/mvc/history/hda-li-edit.js | 4 +++- client/galaxy/scripts/mvc/history/hda-li.js | 1 + client/galaxy/scripts/mvc/history/hda-model.js | 1 + client/galaxy/scripts/mvc/history/hdca-model.js | 1 + .../scripts/mvc/history/history-item-li.js | 1 + .../scripts/mvc/history/history-preferences.js | 1 + .../mvc/history/history-view-annotated.js | 2 ++ client/galaxy/scripts/mvc/history/job-dag.js | 1 + .../galaxy/scripts/mvc/history/options-menu.js | 1 + client/galaxy/scripts/mvc/job/job-li.js | 1 + client/galaxy/scripts/mvc/lazy/lazy-limited.js | 3 +++ .../mvc/library/library-librarylist-view.js | 1 + .../scripts/mvc/rules/rule-definitions.js | 1 + client/galaxy/scripts/mvc/ui/icon-button.js | 4 ++++ client/galaxy/scripts/mvc/ui/popup-menu.js | 5 ++++- client/galaxy/scripts/mvc/ui/ui-buttons.js | 10 +++++----- client/galaxy/scripts/mvc/ui/ui-color-picker.js | 2 ++ client/galaxy/scripts/mvc/ui/ui-drilldown.js | 2 ++ client/galaxy/scripts/mvc/ui/ui-list.js | 2 ++ client/galaxy/scripts/mvc/ui/ui-misc.js | 3 +++ client/galaxy/scripts/mvc/ui/ui-modal.js | 4 ++++ client/galaxy/scripts/mvc/ui/ui-portlet.js | 2 ++ .../galaxy/scripts/mvc/ui/ui-select-default.js | 3 +++ .../scripts/mvc/ui/ui-select-genomespace.js | 2 +- client/galaxy/scripts/mvc/ui/ui-slider.js | 4 ++++ client/galaxy/scripts/mvc/ui/ui-table.js | 2 ++ .../mvc/upload/collection/collection-row.js | 5 ++++- .../mvc/upload/composite/composite-row.js | 5 ++++- .../scripts/mvc/upload/default/default-row.js | 5 ++++- .../galaxy/scripts/mvc/upload/upload-button.js | 4 +++- .../scripts/mvc/upload/upload-extension.js | 2 ++ .../galaxy/scripts/mvc/upload/upload-model.js | 1 + .../scripts/mvc/upload/upload-settings.js | 3 +++ .../chart/components/screenshot.js | 2 +- .../mvc/visualization/chart/views/editor.js | 2 ++ .../mvc/visualization/chart/views/menu.js | 1 + .../mvc/visualization/chart/views/settings.js | 2 ++ .../mvc/visualization/chart/views/viewer.js | 2 ++ .../scripts/mvc/workflow/workflow-connector.js | 2 ++ .../scripts/mvc/workflow/workflow-terminals.js | 4 ++++ .../scripts/mvc/workflow/workflow-view-node.js | 3 +++ .../mvc/workflow/workflow-view-terminals.js | 3 +++ 57 files changed, 138 insertions(+), 40 deletions(-) diff --git a/client/galaxy/scripts/mvc/annotation.js b/client/galaxy/scripts/mvc/annotation.js index fd61f24abe80..1c4454d0681d 100644 --- a/client/galaxy/scripts/mvc/annotation.js +++ b/client/galaxy/scripts/mvc/annotation.js @@ -1,3 +1,5 @@ +import _ from "underscore"; +import Backbone from "backbone"; import baseMVC from "mvc/base-mvc"; import _l from "utils/localization"; import "ui/editable-text"; diff --git a/client/galaxy/scripts/mvc/base-mvc.js b/client/galaxy/scripts/mvc/base-mvc.js index a43c5ebb58e8..6d2fdca91091 100644 --- a/client/galaxy/scripts/mvc/base-mvc.js +++ b/client/galaxy/scripts/mvc/base-mvc.js @@ -1,3 +1,4 @@ +import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; import addLogging from "utils/add-logging"; @@ -302,7 +303,7 @@ var HiddenUntilActivatedViewMixin = /** @lends hiddenUntilActivatedMixin# */ { //TODO: flesh out options - show them all here this.HUAVOptions = { $elementShown: this.$el, - showFn: jQuery.prototype.toggle, + showFn: $.prototype.toggle, showSpeed: "fast" }; _.extend(this.HUAVOptions, options || {}); diff --git a/client/galaxy/scripts/mvc/collection/base-creator.js b/client/galaxy/scripts/mvc/collection/base-creator.js index dc3552aa1743..abe7c8dcdc59 100644 --- a/client/galaxy/scripts/mvc/collection/base-creator.js +++ b/client/galaxy/scripts/mvc/collection/base-creator.js @@ -1,6 +1,7 @@ /* For presentation-related functionality shared across collection creators. Particularily overlapping functionality related to name processing and help. */ +import _ from "underscore"; var CollectionCreatorMixin = { /** add (or clear if clear is truthy) a validation warning to the DOM element described in what */ _validationWarning: function(what, clear) { diff --git a/client/galaxy/scripts/mvc/collection/collection-li-edit.js b/client/galaxy/scripts/mvc/collection/collection-li-edit.js index b08e42a20884..f0605101dcb7 100644 --- a/client/galaxy/scripts/mvc/collection/collection-li-edit.js +++ b/client/galaxy/scripts/mvc/collection/collection-li-edit.js @@ -1,7 +1,7 @@ +import $ from "jquery"; +import _ from "underscore"; import DC_LI from "mvc/collection/collection-li"; import DATASET_LI_EDIT from "mvc/dataset/dataset-li-edit"; -import BASE_MVC from "mvc/base-mvc"; -import _l from "utils/localization"; //============================================================================== var DCListItemView = DC_LI.DCListItemView; @@ -68,7 +68,7 @@ var DatasetDCEListItemEdit = DATASET_LI_EDIT.DatasetListItemEdit.extend( if (view.model.inReadyState() && !view.model.hasDetails()) { return view.model.fetch({ silent: true }); } - return jQuery.when(); + return $.when(); }, /** Override to remove delete button */ diff --git a/client/galaxy/scripts/mvc/collection/collection-model.js b/client/galaxy/scripts/mvc/collection/collection-model.js index adc2c7499643..0562fef91cac 100644 --- a/client/galaxy/scripts/mvc/collection/collection-model.js +++ b/client/galaxy/scripts/mvc/collection/collection-model.js @@ -1,9 +1,10 @@ +import $ from "jquery"; import _ from "underscore"; +import Backbone from "backbone"; import { getAppRoot } from "onload/loadConfig"; import DATASET_MODEL from "mvc/dataset/dataset-model"; import BASE_MVC from "mvc/base-mvc"; import Utils from "utils/utils"; -import _l from "utils/localization"; //============================================================================== /* @@ -306,7 +307,7 @@ var DatasetCollection = Backbone.Model.extend(BASE_MVC.LoggableMixin) recursive = recursive || false; purge = purge || false; if (this.get("deleted")) { - return jQuery.when(); + return $.when(); } options = Utils.merge(options, { method: "delete" }); return this.save({ deleted: true, recursive: recursive, purge: purge }, options); @@ -314,7 +315,7 @@ var DatasetCollection = Backbone.Model.extend(BASE_MVC.LoggableMixin) /** save this collection, _Mark_ing it as undeleted */ undelete: function(options) { if (!this.get("deleted")) { - return jQuery.when(); + return $.when(); } return this.save({ deleted: false }, options); }, diff --git a/client/galaxy/scripts/mvc/collection/collection-view-edit.js b/client/galaxy/scripts/mvc/collection/collection-view-edit.js index 84b3134dff55..93e117d6055d 100644 --- a/client/galaxy/scripts/mvc/collection/collection-view-edit.js +++ b/client/galaxy/scripts/mvc/collection/collection-view-edit.js @@ -1,10 +1,7 @@ import { getGalaxyInstance } from "app"; import DC_VIEW from "mvc/collection/collection-view"; -import DC_MODEL from "mvc/collection/collection-model"; import DC_EDIT from "mvc/collection/collection-li-edit"; -import BASE_MVC from "mvc/base-mvc"; import TAGS from "mvc/tag"; -import faIconButton from "ui/fa-icon-button"; import _l from "utils/localization"; import "ui/editable-text"; diff --git a/client/galaxy/scripts/mvc/collection/list-collection-creator.js b/client/galaxy/scripts/mvc/collection/list-collection-creator.js index 15164fdb8211..acdead449e4b 100644 --- a/client/galaxy/scripts/mvc/collection/list-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/list-collection-creator.js @@ -6,7 +6,6 @@ import STATES from "mvc/dataset/states"; import BASE_MVC from "mvc/base-mvc"; import baseCreator from "mvc/collection/base-creator"; import UI_MODAL from "mvc/ui/ui-modal"; -import naturalSort from "utils/natural-sort"; import _l from "utils/localization"; import RuleCollectionBuilder from "components/RuleCollectionBuilder.vue"; import Vue from "vue"; diff --git a/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js b/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js index d91ce774b318..ff52309e86af 100644 --- a/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/list-of-pairs-collection-creator.js @@ -1,5 +1,5 @@ import _ from "underscore"; -import jQuery from "jquery"; +import $ from "jquery"; import Backbone from "backbone"; import { getAppRoot } from "onload/loadConfig"; import { getGalaxyInstance } from "app"; @@ -646,13 +646,12 @@ var PairedCollectionCreator = Backbone.View.extend(baseMVC.LoggableMixin) }; //this.debug( JSON.stringify( ajaxData ) ); self.blocking = true; - return jQuery - .ajax(url, { - type: "POST", - contentType: "application/json", - dataType: "json", - data: JSON.stringify(ajaxData) - }) + return $.ajax(url, { + type: "POST", + contentType: "application/json", + dataType: "json", + data: JSON.stringify(ajaxData) + }) .always(() => { self.blocking = false; }) @@ -1797,7 +1796,7 @@ var PairedCollectionCreator = Backbone.View.extend(baseMVC.LoggableMixin) /** a modal version of the paired collection creator */ var pairedCollectionCreatorModal = function _pairedCollectionCreatorModal(datasets, options) { var Galaxy = getGalaxyInstance(); - var deferred = jQuery.Deferred(); + var deferred = $.Deferred(); var creator; options = _.defaults(options || {}, { diff --git a/client/galaxy/scripts/mvc/collection/pair-collection-creator.js b/client/galaxy/scripts/mvc/collection/pair-collection-creator.js index b51c7a25c678..9842db8c164c 100644 --- a/client/galaxy/scripts/mvc/collection/pair-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/pair-collection-creator.js @@ -1,3 +1,6 @@ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import LIST_CREATOR from "mvc/collection/list-collection-creator"; import HDCA from "mvc/history/hdca-model"; import BASE_MVC from "mvc/base-mvc"; @@ -85,7 +88,7 @@ var PairCollectionCreator = _super.extend({ //precondition: there are two valid elements in workingElements var creator = this; - var $tmp = jQuery("
    "); + var $tmp = $("
    "); var $list = creator.$list(); // lose the original views, create the new, append all at once, then call their renders diff --git a/client/galaxy/scripts/mvc/dataset/dataset-choice.js b/client/galaxy/scripts/mvc/dataset/dataset-choice.js index b1370a2a8498..cf5d709442d7 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-choice.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-choice.js @@ -1,3 +1,6 @@ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import DATASET from "mvc/dataset/dataset-model"; import DATASET_LIST from "mvc/dataset/dataset-list"; import MODAL from "mvc/ui/ui-modal"; @@ -99,7 +102,7 @@ var DatasetChoiceModal = (datasetJSON, options) => { var modal; var list; var buttons; - var promise = jQuery.Deferred(); + var promise = $.Deferred(); var filterFn = options.filter || _filterDatasetJSON; // filter the given datasets and if none left return a rejected promise for use with fail() diff --git a/client/galaxy/scripts/mvc/form/form-input.js b/client/galaxy/scripts/mvc/form/form-input.js index 6781e5c50869..9a56b71edbcf 100644 --- a/client/galaxy/scripts/mvc/form/form-input.js +++ b/client/galaxy/scripts/mvc/form/form-input.js @@ -1,7 +1,9 @@ /** This class creates a form input element wrapper */ - +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; export default Backbone.View.extend({ initialize: function(app, options) { this.app = app; diff --git a/client/galaxy/scripts/mvc/form/form-parameters.js b/client/galaxy/scripts/mvc/form/form-parameters.js index fe2f3c9dd5b1..55f0a8d8df3e 100644 --- a/client/galaxy/scripts/mvc/form/form-parameters.js +++ b/client/galaxy/scripts/mvc/form/form-parameters.js @@ -1,6 +1,8 @@ /** This class creates input elements. New input parameter types should be added to the types dictionary. */ +import $ from "jquery"; +import Backbone from "backbone"; import { getGalaxyInstance } from "app"; import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 751119338179..1fbe4a5f4583 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -1,6 +1,9 @@ /** This class creates a form section and populates it with input elements. It also handles repeat blocks and conditionals by recursively creating new sub sections. */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; import Portlet from "mvc/ui/ui-portlet"; @@ -27,7 +30,7 @@ var View = Backbone.View.extend({ /** Add a new input element */ add: function(input) { - var input_def = jQuery.extend({}, input); + var input_def = $.extend({}, input); input_def.id = Utils.uid(); this.app.input_list[input_def.id] = input_def; switch (input_def.type) { diff --git a/client/galaxy/scripts/mvc/form/form-view.js b/client/galaxy/scripts/mvc/form/form-view.js index 6b9d2c018f03..36c17b832813 100644 --- a/client/galaxy/scripts/mvc/form/form-view.js +++ b/client/galaxy/scripts/mvc/form/form-view.js @@ -2,6 +2,7 @@ This is the main class of the form plugin. It is referenced as 'app' in lower level modules. */ import $ from "jquery"; +import _ from "underscore"; import Backbone from "backbone"; import Portlet from "mvc/ui/ui-portlet"; import Ui from "mvc/ui/ui-misc"; diff --git a/client/galaxy/scripts/mvc/grid/grid-model.js b/client/galaxy/scripts/mvc/grid/grid-model.js index 5961a9289e18..519ce4a67d30 100644 --- a/client/galaxy/scripts/mvc/grid/grid-model.js +++ b/client/galaxy/scripts/mvc/grid/grid-model.js @@ -1,6 +1,6 @@ -// dependencies - -// grid model +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; export default Backbone.Model.extend({ defaults: { url_base: "", diff --git a/client/galaxy/scripts/mvc/history/hda-li-edit.js b/client/galaxy/scripts/mvc/history/hda-li-edit.js index 8d0b0ec3a29a..ead623951e87 100644 --- a/client/galaxy/scripts/mvc/history/hda-li-edit.js +++ b/client/galaxy/scripts/mvc/history/hda-li-edit.js @@ -1,3 +1,5 @@ +import $ from "jquery"; +import _ from "underscore"; import DATASET_LI_EDIT from "mvc/dataset/dataset-li-edit"; import HDA_LI from "mvc/history/hda-li"; import BASE_MVC from "mvc/base-mvc"; @@ -30,7 +32,7 @@ var HDAListItemEdit = _super.extend( } }); } - return jQuery.when(); + return $.when(); }, /** event map */ diff --git a/client/galaxy/scripts/mvc/history/hda-li.js b/client/galaxy/scripts/mvc/history/hda-li.js index d2e4bc9dce9e..18962fa7f039 100644 --- a/client/galaxy/scripts/mvc/history/hda-li.js +++ b/client/galaxy/scripts/mvc/history/hda-li.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import DATASET_LI from "mvc/dataset/dataset-li"; import BASE_MVC from "mvc/base-mvc"; import HISTORY_ITEM_LI from "mvc/history/history-item-li"; diff --git a/client/galaxy/scripts/mvc/history/hda-model.js b/client/galaxy/scripts/mvc/history/hda-model.js index 568acc1c506f..e4e1c0d0e2f4 100644 --- a/client/galaxy/scripts/mvc/history/hda-model.js +++ b/client/galaxy/scripts/mvc/history/hda-model.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import DATASET from "mvc/dataset/dataset-model"; import HISTORY_CONTENT from "mvc/history/history-content-model"; import BASE_MVC from "mvc/base-mvc"; diff --git a/client/galaxy/scripts/mvc/history/hdca-model.js b/client/galaxy/scripts/mvc/history/hdca-model.js index f055be474475..87791a76e9f4 100644 --- a/client/galaxy/scripts/mvc/history/hdca-model.js +++ b/client/galaxy/scripts/mvc/history/hdca-model.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import DC_MODEL from "mvc/collection/collection-model"; import HISTORY_CONTENT from "mvc/history/history-content-model"; import _l from "utils/localization"; diff --git a/client/galaxy/scripts/mvc/history/history-item-li.js b/client/galaxy/scripts/mvc/history/history-item-li.js index 0208ffbfda91..268fd0226f7b 100644 --- a/client/galaxy/scripts/mvc/history/history-item-li.js +++ b/client/galaxy/scripts/mvc/history/history-item-li.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import Utils from "utils/utils"; function _templateNametag(tag) { diff --git a/client/galaxy/scripts/mvc/history/history-preferences.js b/client/galaxy/scripts/mvc/history/history-preferences.js index 8256de8cb96f..b9a4cd779f3b 100644 --- a/client/galaxy/scripts/mvc/history/history-preferences.js +++ b/client/galaxy/scripts/mvc/history/history-preferences.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import BASE_MVC from "mvc/base-mvc"; var logNamespace = "history"; diff --git a/client/galaxy/scripts/mvc/history/history-view-annotated.js b/client/galaxy/scripts/mvc/history/history-view-annotated.js index 463dc712832a..d5e0707c85e5 100644 --- a/client/galaxy/scripts/mvc/history/history-view-annotated.js +++ b/client/galaxy/scripts/mvc/history/history-view-annotated.js @@ -1,3 +1,5 @@ +import $ from "jquery"; +import _ from "underscore"; import HISTORY_VIEW from "mvc/history/history-view"; import HDA_LI from "mvc/history/hda-li"; import HDCA_LI from "mvc/history/hdca-li"; diff --git a/client/galaxy/scripts/mvc/history/job-dag.js b/client/galaxy/scripts/mvc/history/job-dag.js index 2418c2d3292a..095312c7d584 100644 --- a/client/galaxy/scripts/mvc/history/job-dag.js +++ b/client/galaxy/scripts/mvc/history/job-dag.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import GRAPH from "utils/graph"; import addLogging from "utils/add-logging"; diff --git a/client/galaxy/scripts/mvc/history/options-menu.js b/client/galaxy/scripts/mvc/history/options-menu.js index efc3f0e34b10..7c723423824a 100644 --- a/client/galaxy/scripts/mvc/history/options-menu.js +++ b/client/galaxy/scripts/mvc/history/options-menu.js @@ -102,6 +102,7 @@ var menu = [ html: _l("Make Data Private"), anon: true, func: function() { + let Galaxy = getGalaxyInstance(); if ( Galaxy && Galaxy.currHistoryPanel && diff --git a/client/galaxy/scripts/mvc/job/job-li.js b/client/galaxy/scripts/mvc/job/job-li.js index 191985843792..86b02f13dbb8 100644 --- a/client/galaxy/scripts/mvc/job/job-li.js +++ b/client/galaxy/scripts/mvc/job/job-li.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import LIST_ITEM from "mvc/list/list-item"; import DATASET_LIST from "mvc/dataset/dataset-list"; import BASE_MVC from "mvc/base-mvc"; diff --git a/client/galaxy/scripts/mvc/lazy/lazy-limited.js b/client/galaxy/scripts/mvc/lazy/lazy-limited.js index 1c3758ea32f3..abb3774fbeaf 100644 --- a/client/galaxy/scripts/mvc/lazy/lazy-limited.js +++ b/client/galaxy/scripts/mvc/lazy/lazy-limited.js @@ -1,4 +1,7 @@ /** Contains helpers to limit/lazy load views for backbone views */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; export default Backbone.View.extend({ initialize: function(options) { diff --git a/client/galaxy/scripts/mvc/library/library-librarylist-view.js b/client/galaxy/scripts/mvc/library/library-librarylist-view.js index 4c909a977329..f3a2bd893b42 100644 --- a/client/galaxy/scripts/mvc/library/library-librarylist-view.js +++ b/client/galaxy/scripts/mvc/library/library-librarylist-view.js @@ -1,3 +1,4 @@ +import $ from "jquery"; import _ from "libs/underscore"; import Backbone from "backbone"; import { getGalaxyInstance } from "app"; diff --git a/client/galaxy/scripts/mvc/rules/rule-definitions.js b/client/galaxy/scripts/mvc/rules/rule-definitions.js index e90efde31670..b825b5b8c79c 100644 --- a/client/galaxy/scripts/mvc/rules/rule-definitions.js +++ b/client/galaxy/scripts/mvc/rules/rule-definitions.js @@ -1,3 +1,4 @@ +import _ from "underscore"; import _l from "utils/localization"; import pyre from "pyre-to-regexp"; diff --git a/client/galaxy/scripts/mvc/ui/icon-button.js b/client/galaxy/scripts/mvc/ui/icon-button.js index 28d77d1ba662..5101a2c26d5e 100644 --- a/client/galaxy/scripts/mvc/ui/icon-button.js +++ b/client/galaxy/scripts/mvc/ui/icon-button.js @@ -2,6 +2,10 @@ /** * backbone model for icon buttons */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; + var IconButton = Backbone.Model.extend({ defaults: { title: "", diff --git a/client/galaxy/scripts/mvc/ui/popup-menu.js b/client/galaxy/scripts/mvc/ui/popup-menu.js index 6faa046288ab..4642a57288e3 100644 --- a/client/galaxy/scripts/mvc/ui/popup-menu.js +++ b/client/galaxy/scripts/mvc/ui/popup-menu.js @@ -2,6 +2,9 @@ /** * view for a popup menu */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; var PopupMenu = Backbone.View.extend({ //TODO: maybe better as singleton off the Galaxy obj /** Cache the desired button element and options, set up the button click handler @@ -220,7 +223,7 @@ PopupMenu.make_popupmenu = (button_element, initial_options) => { newOption.header = true; // keys with function values indicate: a menu option - } else if (jQuery.type(optionVal) === "function") { + } else if ($.type(optionVal) === "function") { newOption.func = optionVal; } //TODO:?? any other special optionVals? diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index 214b94053b9f..7d1437c79fde 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -183,11 +183,11 @@ var ButtonCheck = Backbone.View.extend({ }, /* Sets a new value and/or returns the value. - * @param{Integer} new_val - Set a new value 0=unchecked, 1=partial and 2=checked. - * OR: - * @param{Integer} new_val - Number of selected options. - * @param{Integer} total - Total number of available options. - */ + * @param{Integer} new_val - Set a new value 0=unchecked, 1=partial and 2=checked. + * OR: + * @param{Integer} new_val - Number of selected options. + * @param{Integer} total - Total number of available options. + */ value: function(new_val, total) { if (new_val !== undefined) { if (total && new_val !== 0) { diff --git a/client/galaxy/scripts/mvc/ui/ui-color-picker.js b/client/galaxy/scripts/mvc/ui/ui-color-picker.js index 55b33e63c2fa..85541709f1a9 100644 --- a/client/galaxy/scripts/mvc/ui/ui-color-picker.js +++ b/client/galaxy/scripts/mvc/ui/ui-color-picker.js @@ -1,4 +1,6 @@ /** Renders the color picker used e.g. in the tool form **/ +import $ from "jquery"; +import Backbone from "backbone"; import Utils from "utils/utils"; export default Backbone.View.extend({ colors: { diff --git a/client/galaxy/scripts/mvc/ui/ui-drilldown.js b/client/galaxy/scripts/mvc/ui/ui-drilldown.js index b2a7d5f4a8c8..03aaed057958 100644 --- a/client/galaxy/scripts/mvc/ui/ui-drilldown.js +++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js @@ -1,4 +1,6 @@ /** This class creates/wraps a drill down element. */ +import $ from "jquery"; +import _ from "underscore"; import Utils from "utils/utils"; import Options from "mvc/ui/ui-options"; var View = Options.BaseIcons.extend({ diff --git a/client/galaxy/scripts/mvc/ui/ui-list.js b/client/galaxy/scripts/mvc/ui/ui-list.js index b6d6b3190489..7627c935e5d9 100644 --- a/client/galaxy/scripts/mvc/ui/ui-list.js +++ b/client/galaxy/scripts/mvc/ui/ui-list.js @@ -1,3 +1,5 @@ +import $ from "jquery"; +import Backbone from "backbone"; import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; var View = Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/ui/ui-misc.js b/client/galaxy/scripts/mvc/ui/ui-misc.js index 4f48a0da4828..1e83c10575b3 100644 --- a/client/galaxy/scripts/mvc/ui/ui-misc.js +++ b/client/galaxy/scripts/mvc/ui/ui-misc.js @@ -1,6 +1,9 @@ /** * This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc. */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import Select from "mvc/ui/ui-select-default"; import Slider from "mvc/ui/ui-slider"; import Options from "mvc/ui/ui-options"; diff --git a/client/galaxy/scripts/mvc/ui/ui-modal.js b/client/galaxy/scripts/mvc/ui/ui-modal.js index d1f72323c335..6f494c74a91c 100644 --- a/client/galaxy/scripts/mvc/ui/ui-modal.js +++ b/client/galaxy/scripts/mvc/ui/ui-modal.js @@ -1,3 +1,7 @@ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; + export var View = Backbone.View.extend({ className: "ui-modal", diff --git a/client/galaxy/scripts/mvc/ui/ui-portlet.js b/client/galaxy/scripts/mvc/ui/ui-portlet.js index f374cb432729..433d16d5700b 100644 --- a/client/galaxy/scripts/mvc/ui/ui-portlet.js +++ b/client/galaxy/scripts/mvc/ui/ui-portlet.js @@ -1,3 +1,5 @@ +import $ from "jquery"; +import Backbone from "backbone"; import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; diff --git a/client/galaxy/scripts/mvc/ui/ui-select-default.js b/client/galaxy/scripts/mvc/ui/ui-select-default.js index 6e4281d6a608..91365a0b80ee 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select-default.js +++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js @@ -1,6 +1,9 @@ /** * This class creates/wraps a default html select field as backbone class. */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import Utils from "utils/utils"; import Buttons from "mvc/ui/ui-buttons"; var View = Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js b/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js index 6b73f7d53f63..81e7218c473b 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js +++ b/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js @@ -1,5 +1,5 @@ +import Backbone from "backbone"; import _l from "utils/localization"; -// dependencies import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; import GenomespaceBrowser from "mvc/tool/tool-genomespace"; diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index 7293c62a00e3..31ac598d5290 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -1,3 +1,7 @@ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; + import Utils from "utils/utils"; var View = Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/ui/ui-table.js b/client/galaxy/scripts/mvc/ui/ui-table.js index a0e416d3a3e0..03accd7a046b 100644 --- a/client/galaxy/scripts/mvc/ui/ui-table.js +++ b/client/galaxy/scripts/mvc/ui/ui-table.js @@ -1,4 +1,6 @@ /** This class creates a ui table element. */ +import $ from "jquery"; +import Backbone from "backbone"; import Utils from "utils/utils"; var View = Backbone.View.extend({ initialize: function(options) { diff --git a/client/galaxy/scripts/mvc/upload/collection/collection-row.js b/client/galaxy/scripts/mvc/upload/collection/collection-row.js index 4f838c030dde..3b20f6c4805e 100644 --- a/client/galaxy/scripts/mvc/upload/collection/collection-row.js +++ b/client/galaxy/scripts/mvc/upload/collection/collection-row.js @@ -1,5 +1,8 @@ -import _l from "utils/localization"; /** Renders the collection uploader rows */ +import _l from "utils/localization"; +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import Utils from "utils/utils"; import UploadModel from "mvc/upload/upload-model"; import UploadSettings from "mvc/upload/upload-settings"; diff --git a/client/galaxy/scripts/mvc/upload/composite/composite-row.js b/client/galaxy/scripts/mvc/upload/composite/composite-row.js index 1c58cd3d08fc..c71756b0698e 100644 --- a/client/galaxy/scripts/mvc/upload/composite/composite-row.js +++ b/client/galaxy/scripts/mvc/upload/composite/composite-row.js @@ -1,5 +1,8 @@ -import _l from "utils/localization"; /** Renders the composite upload row view */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; +import _l from "utils/localization"; import Utils from "utils/utils"; import UploadSettings from "mvc/upload/upload-settings"; import UploadFtp from "mvc/upload/upload-ftp"; diff --git a/client/galaxy/scripts/mvc/upload/default/default-row.js b/client/galaxy/scripts/mvc/upload/default/default-row.js index 9485ab1439f2..9d66ebc5719d 100644 --- a/client/galaxy/scripts/mvc/upload/default/default-row.js +++ b/client/galaxy/scripts/mvc/upload/default/default-row.js @@ -1,5 +1,8 @@ -import _l from "utils/localization"; /** Renders the default uploader rows */ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; +import _l from "utils/localization"; import Utils from "utils/utils"; import UploadModel from "mvc/upload/upload-model"; import UploadSettings from "mvc/upload/upload-settings"; diff --git a/client/galaxy/scripts/mvc/upload/upload-button.js b/client/galaxy/scripts/mvc/upload/upload-button.js index 413afe704dfd..a405726a0160 100644 --- a/client/galaxy/scripts/mvc/upload/upload-button.js +++ b/client/galaxy/scripts/mvc/upload/upload-button.js @@ -1,5 +1,7 @@ -import _l from "utils/localization"; /** View for upload/progress bar button */ +import $ from "jquery"; +import Backbone from "backbone"; +import _l from "utils/localization"; var View = Backbone.View.extend({ initialize: function(options) { diff --git a/client/galaxy/scripts/mvc/upload/upload-extension.js b/client/galaxy/scripts/mvc/upload/upload-extension.js index 170bf15b765e..167ab0bcde7b 100644 --- a/client/galaxy/scripts/mvc/upload/upload-extension.js +++ b/client/galaxy/scripts/mvc/upload/upload-extension.js @@ -1,4 +1,6 @@ /** This renders a popover with extension details **/ +import _ from "underscore"; +import Backbone from "backbone"; import Utils from "utils/utils"; import Popover from "mvc/ui/ui-popover"; export default Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/upload/upload-model.js b/client/galaxy/scripts/mvc/upload/upload-model.js index 6a51f38c69ba..96489cca8252 100644 --- a/client/galaxy/scripts/mvc/upload/upload-model.js +++ b/client/galaxy/scripts/mvc/upload/upload-model.js @@ -1,3 +1,4 @@ +import Backbone from "backbone"; var Model = Backbone.Model.extend({ defaults: { extension: "auto", diff --git a/client/galaxy/scripts/mvc/upload/upload-settings.js b/client/galaxy/scripts/mvc/upload/upload-settings.js index f32e102d5d10..327e0355c863 100644 --- a/client/galaxy/scripts/mvc/upload/upload-settings.js +++ b/client/galaxy/scripts/mvc/upload/upload-settings.js @@ -1,4 +1,7 @@ /** This renders the content of the settings popup, allowing users to specify flags i.e. for space-to-tab conversion **/ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import Utils from "utils/utils"; export default Backbone.View.extend({ options: { diff --git a/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js b/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js index 1ab1ac5fa966..d834364e7373 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js +++ b/client/galaxy/scripts/mvc/visualization/chart/components/screenshot.js @@ -1,7 +1,7 @@ /** This class enables users to export/download a chart as PNG, SVG or PDF. */ /** PNG export */ -/* global $ */ +import $ from "jquery"; function createPNG(options) { if (options.$el.find("svg").length > 0) { diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/editor.js b/client/galaxy/scripts/mvc/visualization/chart/views/editor.js index d59ed3a618cd..cedb9f241f20 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/editor.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/editor.js @@ -2,6 +2,8 @@ * The charts editor holds the tabs for selecting chart types, chart configuration * and data group selections. */ +import $ from "jquery"; +import Backbone from "backbone"; import Ui from "mvc/ui/ui-misc"; import Utils from "utils/utils"; import Tabs from "mvc/ui/ui-tabs"; diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/menu.js b/client/galaxy/scripts/mvc/visualization/chart/views/menu.js index 0f40698446ea..33e9b49dd747 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/menu.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/menu.js @@ -1,4 +1,5 @@ /** This class renders the chart menu options. */ +import Backbone from "backbone"; import Ui from "mvc/ui/ui-misc"; import Screenshot from "mvc/visualization/chart/components/screenshot"; import Utils from "utils/utils"; diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/settings.js b/client/galaxy/scripts/mvc/visualization/chart/views/settings.js index 00966d470f1c..073ef4d83a91 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/settings.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/settings.js @@ -1,4 +1,6 @@ /** This class renders the chart configuration form. */ +import _ from "underscore"; +import Backbone from "backbone"; import Utils from "utils/utils"; import Form from "mvc/form/form-view"; import FormData from "mvc/form/form-data"; diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/viewer.js b/client/galaxy/scripts/mvc/visualization/chart/views/viewer.js index b36df06a9afa..7c7ac58b9f9c 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/viewer.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/viewer.js @@ -2,6 +2,8 @@ * The viewer creates and manages the dom elements used by the visualization plugins to draw the chart. * This is the last class of the charts core classes before handing control over to the visualization plugins. */ +import $ from "jquery"; +import Backbone from "backbone"; import Utils from "utils/utils"; export default Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/workflow/workflow-connector.js b/client/galaxy/scripts/mvc/workflow/workflow-connector.js index 2a188559337d..059d496c9f4d 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-connector.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-connector.js @@ -1,3 +1,5 @@ +import $ from "jquery"; + import * as Toastr from "libs/toastr"; function Connector(handle1, handle2) { diff --git a/client/galaxy/scripts/mvc/workflow/workflow-terminals.js b/client/galaxy/scripts/mvc/workflow/workflow-terminals.js index e6c3d70cb61c..577cfa93e15b 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-terminals.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-terminals.js @@ -1,3 +1,7 @@ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; + // TODO; tie into Galaxy state? window.workflow_globals = window.workflow_globals || {}; diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view-node.js b/client/galaxy/scripts/mvc/workflow/workflow-view-node.js index f07e7a72ee69..2ec8b0202d81 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view-node.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view-node.js @@ -1,6 +1,9 @@ +import $ from "jquery"; import * as _ from "libs/underscore"; +import Backbone from "backbone"; import TerminalViews from "mvc/workflow/workflow-view-terminals"; import DataViews from "mvc/workflow/workflow-view-data"; + export default Backbone.View.extend({ initialize: function(options) { this.node = options.node; diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js b/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js index 10dddd640d35..3997c86b71a3 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js @@ -1,3 +1,6 @@ +import $ from "jquery"; +import _ from "underscore"; +import Backbone from "backbone"; import Terminals from "mvc/workflow/workflow-terminals"; import Connector from "mvc/workflow/workflow-connector"; From 86dd5f63b448d4e8a514ceca92d5745bf6350ad8 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 11:53:26 -0500 Subject: [PATCH 34/88] Relocate search function; should be refactored... --- client/galaxy/scripts/mvc/dataset/data.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/galaxy/scripts/mvc/dataset/data.js b/client/galaxy/scripts/mvc/dataset/data.js index de7eb7542d12..aae9edb60e25 100644 --- a/client/galaxy/scripts/mvc/dataset/data.js +++ b/client/galaxy/scripts/mvc/dataset/data.js @@ -354,6 +354,11 @@ var EmbeddedTabularDatasetChunkedView = TabularDatasetChunkedView.extend({ } }); +function search(str, array) { + for (var j = 0; j < array.length; j++) if (array[j].match(str)) return j; + return -1; +} + /** Button for trackster visualization */ var TabularButtonTracksterView = Backbone.View.extend({ // gene region columns @@ -424,10 +429,6 @@ var TabularButtonTracksterView = Backbone.View.extend({ // check for vcf-file format if (this.file_ext == "vcf") { // search array - function search(str, array) { - for (var j = 0; j < array.length; j++) if (array[j].match(str)) return j; - return -1; - } // load this.col.chrom = search("Chrom", metadata.get("column_names")); From b8e56700dbe55fe13b865122a9ac83d107306483 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 11:54:15 -0500 Subject: [PATCH 35/88] Fix no-useless-escape errors. --- client/galaxy/scripts/mvc/grid/grid-view.js | 2 +- client/galaxy/scripts/mvc/ui/ui-select.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/mvc/grid/grid-view.js b/client/galaxy/scripts/mvc/grid/grid-view.js index dc661a61dd3d..7bf12e0e71bf 100644 --- a/client/galaxy/scripts/mvc/grid/grid-view.js +++ b/client/galaxy/scripts/mvc/grid/grid-view.js @@ -93,7 +93,7 @@ export default Backbone.View.extend({ // strip protocol and domain var url = this.grid.get("url_base"); - url = url.replace(/^.*\/\/[^\/]+/, ""); + url = url.replace(/^.*\/\/[^/]+/, ""); this.grid.set("url_base", url); // append main template diff --git a/client/galaxy/scripts/mvc/ui/ui-select.js b/client/galaxy/scripts/mvc/ui/ui-select.js index 0b629e12bf4d..79a701dae49d 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select.js +++ b/client/galaxy/scripts/mvc/ui/ui-select.js @@ -157,7 +157,7 @@ var View = Backbone.View.extend({ if (value.text && value.text.length > mx) { let pos = value.text.indexOf(`(${value.id})`); pos = pos != -1 && pos < mx ? pos : mx; - let sub = value.text.substring(0, pos).replace(/[\ \.]*$/, ""); + let sub = value.text.substring(0, pos).replace(/[ .]*$/, ""); value.text = `${sub}...(${value.id})`; } }); From 9cc5a01b94caf4644442fb8081da6da408850a19 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 11:58:37 -0500 Subject: [PATCH 36/88] Fix Graph reference in job-dag. --- client/galaxy/scripts/mvc/history/job-dag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/history/job-dag.js b/client/galaxy/scripts/mvc/history/job-dag.js index 095312c7d584..d6eb32d1855c 100644 --- a/client/galaxy/scripts/mvc/history/job-dag.js +++ b/client/galaxy/scripts/mvc/history/job-dag.js @@ -315,7 +315,7 @@ JobDAG.prototype.weakComponentGraphArray = function() { } return 0; }); - return new Graph(dag.directed, component); + return new GRAPH.Graph(dag.directed, component); }); }; From 9174cb4b1df890a29d8341ad2705184b9becbb5d Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:00:15 -0500 Subject: [PATCH 37/88] Fix genomespace tool reference to config/errorcallback --- client/galaxy/scripts/mvc/tool/tool-genomespace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/tool/tool-genomespace.js b/client/galaxy/scripts/mvc/tool/tool-genomespace.js index 3f9ceefaec10..2c44b92cda76 100644 --- a/client/galaxy/scripts/mvc/tool/tool-genomespace.js +++ b/client/galaxy/scripts/mvc/tool/tool-genomespace.js @@ -22,6 +22,6 @@ export default { newWin.focus(); - if (options["errorCallback"] != null) newWin.setCallbackOnGSUploadError = config["errorCallback"]; + if (options["errorCallback"] != null) newWin.setCallbackOnGSUploadError = Galaxy.config["errorCallback"]; } }; From 02ccffb6801924b6f1d4dc6302e686bde28ef1ac Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:16:58 -0500 Subject: [PATCH 38/88] Fix reference to galaxy_main frame --- client/galaxy/scripts/mvc/history/options-menu.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/galaxy/scripts/mvc/history/options-menu.js b/client/galaxy/scripts/mvc/history/options-menu.js index 7c723423824a..639504990a79 100644 --- a/client/galaxy/scripts/mvc/history/options-menu.js +++ b/client/galaxy/scripts/mvc/history/options-menu.js @@ -260,9 +260,8 @@ function buildMenu(isAnon, purgeAllowed, urlRoot) { if (menuOption.confirm) { menuOption.func = () => { - if (confirm(menuOption.confirm)) { - /* galaxy_main is a global here: TODO: Fix it! */ - galaxy_main.location = menuOption.href; + if (confirm(menuOption.confirm) && window.parent.frames && window.parent.frames.galaxy_main) { + window.parent.frames.galaxy_main = menuOption.href; } }; } From 8c94cdf91518a21b79793b73473fe3937b4016e8 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:19:34 -0500 Subject: [PATCH 39/88] Drop unreachable code in colorpicker --- client/galaxy/scripts/mvc/ui/ui-color-picker.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-color-picker.js b/client/galaxy/scripts/mvc/ui/ui-color-picker.js index 85541709f1a9..3133c9edce9b 100644 --- a/client/galaxy/scripts/mvc/ui/ui-color-picker.js +++ b/client/galaxy/scripts/mvc/ui/ui-color-picker.js @@ -135,6 +135,5 @@ export default Backbone.View.extend({ '
    ' + "
    " ); - ("
    "); } }); From 8220705766dc3e23ddfbac45d887f82f8c36c85e Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:24:06 -0500 Subject: [PATCH 40/88] Fix color picker template (was missing a trailing div before, see previous commit), also fix inner definition of hex. --- .../galaxy/scripts/mvc/ui/ui-color-picker.js | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/ui-color-picker.js b/client/galaxy/scripts/mvc/ui/ui-color-picker.js index 3133c9edce9b..268da378d50e 100644 --- a/client/galaxy/scripts/mvc/ui/ui-color-picker.js +++ b/client/galaxy/scripts/mvc/ui/ui-color-picker.js @@ -2,6 +2,11 @@ import $ from "jquery"; import Backbone from "backbone"; import Utils from "utils/utils"; + +function hex(x) { + return `0${parseInt(x).toString(16)}`.slice(-2); +} + export default Backbone.View.extend({ colors: { standard: ["c00000", "ff0000", "ffc000", "ffff00", "92d050", "00b050", "00b0f0", "0070c0", "002060", "7030a0"], @@ -52,14 +57,12 @@ export default Backbone.View.extend({ return this._getValue(); }, + /** Get value from dom */ _getValue: function() { var rgb = this.$value.css("background-color"); rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); if (rgb) { - function hex(x) { - return `0${parseInt(x).toString(16)}`.slice(-2); - } return `#${hex(rgb[1])}${hex(rgb[2])}${hex(rgb[3])}`; } else { return null; @@ -126,14 +129,17 @@ export default Backbone.View.extend({ /** Main template */ _template: function() { return ( - '
    ' + - '
    ' + - '
    ' + - '
    Select a color
    ' + - "
    " + - '
    ' + - '
    ' + - "
    " + ` +
    +
    +
    +
    Select a color
    +
    +
    +
    +
    +
    + ` ); } }); From f0205d4103b1a49466e58061a066852c360a51ea Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:25:01 -0500 Subject: [PATCH 41/88] Fix noop catches, one final import in mvc. --- .../scripts/mvc/history/history-content-model.js | 4 +++- client/galaxy/scripts/mvc/ui/icon-button.js | 1 + client/galaxy/scripts/mvc/ui/popup-menu.js | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/client/galaxy/scripts/mvc/history/history-content-model.js b/client/galaxy/scripts/mvc/history/history-content-model.js index 4b35aa5ea45f..f79155fb33a3 100644 --- a/client/galaxy/scripts/mvc/history/history-content-model.js +++ b/client/galaxy/scripts/mvc/history/history-content-model.js @@ -9,7 +9,9 @@ import { getAppRoot } from "onload/loadConfig"; var collectionFuzzyCountDefault = 1000; try { collectionFuzzyCountDefault = localStorage.getItem("collectionFuzzyCountDefault") || collectionFuzzyCountDefault; -} catch (err) {} +} catch (err) { + console.debug(err); +} //============================================================================== /** @class Mixin for HistoryContents content (HDAs, HDCAs). diff --git a/client/galaxy/scripts/mvc/ui/icon-button.js b/client/galaxy/scripts/mvc/ui/icon-button.js index 5101a2c26d5e..d742aebad571 100644 --- a/client/galaxy/scripts/mvc/ui/icon-button.js +++ b/client/galaxy/scripts/mvc/ui/icon-button.js @@ -5,6 +5,7 @@ import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; +import { make_popupmenu } from "ui/popupmenu"; var IconButton = Backbone.Model.extend({ defaults: { diff --git a/client/galaxy/scripts/mvc/ui/popup-menu.js b/client/galaxy/scripts/mvc/ui/popup-menu.js index 4642a57288e3..4f9b72e21562 100644 --- a/client/galaxy/scripts/mvc/ui/popup-menu.js +++ b/client/galaxy/scripts/mvc/ui/popup-menu.js @@ -133,13 +133,17 @@ var PopupMenu = Backbone.View.extend({ if (window && window.parent !== window) { try { $(window.parent.document).off("click.close_popup"); - } catch (err) {} + } catch (err) { + console.debug(err); + } } else { try { $("iframe#galaxy_main") .contents() .off("click.close_popup"); - } catch (err) {} + } catch (err) { + console.debug(err); + } } menu.remove(); } @@ -150,13 +154,17 @@ var PopupMenu = Backbone.View.extend({ $(window.parent.document) .find("html") .one("click.close_popup", closePopup); - } catch (err) {} + } catch (err) { + console.debug(err); + } } else { try { $("iframe#galaxy_main") .contents() .one("click.close_popup", closePopup); - } catch (err) {} + } catch (err) { + console.debug(err); + } } }, From 56731df0f7ac43c6eaffe0c3a73ff685017973f6 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:33:02 -0500 Subject: [PATCH 42/88] Fix no-redeclares in scripts/mvc --- .../mvc/library/library-foldertoolbar-view.js | 12 ++++++------ client/galaxy/scripts/mvc/rules/rule-definitions.js | 2 +- client/galaxy/scripts/mvc/ui/ui-buttons.js | 2 +- .../scripts/mvc/workflow/workflow-connector.js | 12 ++++++------ client/galaxy/scripts/mvc/workflow/workflow-forms.js | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index 00b53ab88a35..569e9f87e084 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -296,8 +296,8 @@ var FolderToolbarView = Backbone.View.extend({ var items_to_import = []; // prepare the dataset objects to be imported for (let i = checked_items.dataset_ids.length - 1; i >= 0; i--) { - var library_dataset_id = checked_items.dataset_ids[i]; - var historyItem = new mod_library_model.HistoryItem(); + let library_dataset_id = checked_items.dataset_ids[i]; + let historyItem = new mod_library_model.HistoryItem(); historyItem.url = `${historyItem.urlRoot + history_id}/contents`; historyItem.content = library_dataset_id; historyItem.source = "library"; @@ -305,8 +305,8 @@ var FolderToolbarView = Backbone.View.extend({ } // prepare the folder objects to be imported for (let i = checked_items.folder_ids.length - 1; i >= 0; i--) { - var library_folder_id = checked_items.folder_ids[i]; - var historyItem = new mod_library_model.HistoryItem(); + let library_folder_id = checked_items.folder_ids[i]; + let historyItem = new mod_library_model.HistoryItem(); historyItem.url = `${historyItem.urlRoot + history_id}/contents`; historyItem.content = library_folder_id; historyItem.source = "library_folder"; @@ -719,7 +719,7 @@ var FolderToolbarView = Backbone.View.extend({ action: "adding_datasets" }); if (selection_type === "folder") { - var full_source = `${options.source}_folder`; + let full_source = `${options.source}_folder`; this.chainCallImportingFolders({ paths: paths, preserve_dirs: preserve_dirs, @@ -732,7 +732,7 @@ var FolderToolbarView = Backbone.View.extend({ tag_using_filenames: tag_using_filenames }); } else if (selection_type === "file") { - var full_source = `${options.source}_file`; + let full_source = `${options.source}_file`; this.chainCallImportingUserdirFiles({ paths: paths, file_type: file_type, diff --git a/client/galaxy/scripts/mvc/rules/rule-definitions.js b/client/galaxy/scripts/mvc/rules/rule-definitions.js index b825b5b8c79c..4b410cb2e55d 100644 --- a/client/galaxy/scripts/mvc/rules/rule-definitions.js +++ b/client/galaxy/scripts/mvc/rules/rule-definitions.js @@ -862,7 +862,7 @@ const colHeadersFor = function(data, columns) { }; const applyRules = function(data, sources, columns, rules, colHeadersPerRule) { - var colHeadersPerRule = colHeadersPerRule || []; + colHeadersPerRule = colHeadersPerRule || []; let hasRuleError = false; for (var ruleIndex in rules) { const ruleHeaders = colHeadersFor(data, columns); diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index 7d1437c79fde..49d7fead208a 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -166,7 +166,7 @@ var ButtonCheck = Backbone.View.extend({ }, render: function(options) { - var options = this.model.attributes; + options = this.model.attributes; this.$el .addClass("ui-button-check") .css("display", options.visible ? "inline-block" : "none") diff --git a/client/galaxy/scripts/mvc/workflow/workflow-connector.js b/client/galaxy/scripts/mvc/workflow/workflow-connector.js index 059d496c9f4d..a69f7e3795be 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-connector.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-connector.js @@ -107,16 +107,16 @@ $.extend(Connector.prototype, { var end_offsets = null; var num_offsets = 1; if (startRibbon) { - var start_offsets = [-6, -3, 0, 3, 6]; + start_offsets = [-6, -3, 0, 3, 6]; num_offsets = 5; } else { - var start_offsets = [0]; + start_offsets = [0]; } if (endRibbon) { - var end_offsets = [-6, -3, 0, 3, 6]; + end_offsets = [-6, -3, 0, 3, 6]; num_offsets = 5; } else { - var end_offsets = [0]; + end_offsets = [0]; } var connector = this; for (var i = 0; i < num_offsets; i++) { @@ -151,9 +151,9 @@ $.extend(Connector.prototype, { offset_start, offset_end ) { - var offset_start = offset_start || 0; - var offset_end = offset_end || 0; var c = this.canvas.getContext("2d"); + offset_start = offset_start || 0; + offset_end = offset_end || 0; c.lineCap = "round"; c.strokeStyle = this.outer_color; c.lineWidth = outer_width; diff --git a/client/galaxy/scripts/mvc/workflow/workflow-forms.js b/client/galaxy/scripts/mvc/workflow/workflow-forms.js index 37c709b52968..8bf330abe724 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-forms.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-forms.js @@ -224,10 +224,10 @@ function _makeSection(output_id, label, options) { var node = options.node; var workflow = options.workflow; - for (var key in datatypes) { + for (let key in datatypes) { extensions.push({ 0: datatypes[key], 1: datatypes[key] }); } - for (var key in node.input_terminals) { + for (let key in node.input_terminals) { name_label_map.push({ name: node.input_terminals[key].name, label: node.input_terminals[key].label }); } var rename_help = _makeRenameHelp(name_label_map); From f410a461bbd5b43ac855ebd2de666fa5d9113c83 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:44:36 -0500 Subject: [PATCH 43/88] Drop prettier plugin from eslint; we'll just run this -- no point in duplicating that check. Also set up a few rules that we can enable after the cleanup. --- client/.eslintrc.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/client/.eslintrc.js b/client/.eslintrc.js index ebbfa872f02d..0cb2bc45aa20 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -1,22 +1,13 @@ module.exports = { - extends: ["eslint:recommended", "prettier", "plugin:vue/essential"], // airbnb-base, eventually + extends: ["eslint:recommended", "plugin:vue/essential"], // airbnb-base, eventually env: { browser: true }, parserOptions: { parser: "babel-eslint" }, - plugins: ["prettier", "html"], + plugins: ["html"], rules: { - //"no-console": "off", - //"no-useless-escape": "off", - //"no-debugger": "off", - //"no-unused-vars": ["error", { args: "none" }], - "prettier/prettier": [ - "error", - { - printWidth: 120, - tabWidth: 4 - } - ] + "no-console": "off", + "no-unused-vars": ["error", {args: "none"}] // "camelcase": [ // "error", // { From 0a8edbb0643a00c1aabf643c6883fecff66e431f Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 12:53:10 -0500 Subject: [PATCH 44/88] Fix bug in collection moodel toString -- this was always literally --- client/galaxy/scripts/mvc/collection/collection-model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/collection/collection-model.js b/client/galaxy/scripts/mvc/collection/collection-model.js index 0562fef91cac..985407145d79 100644 --- a/client/galaxy/scripts/mvc/collection/collection-model.js +++ b/client/galaxy/scripts/mvc/collection/collection-model.js @@ -178,7 +178,7 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend( /** String representation. */ toString: function() { var objStr = this.get("element_identifier"); - return `DatasetDCE({objStr})`; + return `DatasetDCE(${objStr})`; } } ) From e69d540a8f28c5715822d432912d5c00d0c0ca81 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 13:21:08 -0500 Subject: [PATCH 45/88] Remove inadvertently(?) added job-params file, looks to never have been used (and is mostly commented out code) --- client/galaxy/scripts/mvc/job/job-params.js | 63 --------------------- 1 file changed, 63 deletions(-) delete mode 100644 client/galaxy/scripts/mvc/job/job-params.js diff --git a/client/galaxy/scripts/mvc/job/job-params.js b/client/galaxy/scripts/mvc/job/job-params.js deleted file mode 100644 index 8a878d5d7fde..000000000000 --- a/client/galaxy/scripts/mvc/job/job-params.js +++ /dev/null @@ -1,63 +0,0 @@ -/** Workflow view */ -import _ from "underscore"; -import Backbone from "backbone"; -// import { getAppRoot } from "onload/loadConfig"; -import Utils from "utils/utils"; - -/** Build messages after user action */ -function build_messages(self) { - var $el_message = self.$el.find(".response-message"); - var status = Utils.getQueryString("status"); - var message = Utils.getQueryString("message"); - - if (message && message !== "") { - $el_message.addClass(`${status}message`); - $el_message.html(`

    ${_.escape(message)}

    `); - } else { - $el_message.html(""); - } -} - -/** View of the main workflow list page */ -var View = Backbone.View.extend({ - initialize: function(options) { - var self = this; - this.options = options; - this.setElement("
    "); - this.render(); - }, - - render: function() { - console.log("HI"); - var self = this; - self.$el.empty().append("

    Testing

    "); - //var self = this, - //min_query_length = 3; - //$.getJSON( getAppRoot() + 'api/workflows/', function( workflows ) { - //var $el_workflow = null; - //// Add workflow header - //// Add user actions message if any - //build_messages( self ); - //$el_workflow = self.$el.find( '.user-workflows' ); - //// Add the actions buttons - //$el_workflow.append( self._templateActionButtons() ); - //if( workflows.length > 0) { - //$el_workflow.append( self._templateWorkflowTable( self, workflows) ); - //self.adjust_actiondropdown( $el_workflow ); - //// Register delete and run workflow events - //_.each( workflows, function( wf ) { - //self.confirm_delete( self, wf ); - //}); - //// Register search workflow event - //self.search_workflow( self, self.$el.find( '.search-wf' ), self.$el.find( '.workflow-search tr' ), min_query_length ); - //} - //else { - //$el_workflow.append( self._templateNoWorkflow() ); - //} - //}); - } -}); - -export default { - View: View -}; From 8004fad3e6614e24572d09648e40a88ece77b674 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 13:38:02 -0500 Subject: [PATCH 46/88] Drop unused getGalaxyInstance in library-foldertoolbar -- these vars are templated in elsewhere, not pulled from the context. --- client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index 569e9f87e084..09f774841503 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -1410,7 +1410,6 @@ var FolderToolbarView = Backbone.View.extend({ }, templateToolBar: function() { - let Galaxy = getGalaxyInstance(); return _.template( [ '
    ', // container start From 639c9cecc0cef3a2da332f57ac8f7c63d44ee75d Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 13:47:15 -0500 Subject: [PATCH 47/88] Fix final no-unused-vars for scripts/mvc --- .../mvc/collection/list-collection-creator.js | 10 +--------- client/galaxy/scripts/mvc/dataset/dataset-list.js | 1 - client/galaxy/scripts/mvc/form/form-section.js | 1 - client/galaxy/scripts/mvc/history/hda-model.js | 1 - client/galaxy/scripts/mvc/history/hdca-model.js | 1 - .../scripts/mvc/history/history-preferences.js | 2 -- .../scripts/mvc/history/history-view-annotated.js | 5 +---- client/galaxy/scripts/mvc/job/job-li.js | 2 ++ client/galaxy/scripts/mvc/lazy/lazy-limited.js | 4 ++-- .../scripts/mvc/library/library-folderrow-view.js | 1 - client/galaxy/scripts/mvc/tool/tool-form.js | 2 +- .../galaxy/scripts/mvc/toolshed/repository-view.js | 2 +- client/galaxy/scripts/mvc/ui/ui-list.js | 1 - .../galaxy/scripts/mvc/ui/ui-select-genomespace.js | 1 - client/galaxy/scripts/mvc/ui/ui-slider.js | 1 - .../mvc/upload/collection/collection-row.js | 7 +++---- .../mvc/upload/collection/collection-view.js | 3 --- .../scripts/mvc/upload/composite/composite-row.js | 1 - .../scripts/mvc/upload/default/default-row.js | 1 - client/galaxy/scripts/mvc/upload/upload-button.js | 1 - .../galaxy/scripts/mvc/upload/upload-extension.js | 2 -- .../galaxy/scripts/mvc/upload/upload-settings.js | 2 -- client/galaxy/scripts/mvc/user/user-model.js | 14 +++++++------- .../mvc/visualization/chart/utilities/series.js | 4 ---- .../mvc/visualization/chart/views/editor.js | 1 - .../mvc/visualization/chart/views/groups.js | 1 - .../scripts/mvc/visualization/chart/views/menu.js | 1 - .../scripts/mvc/workflow/workflow-connector.js | 2 -- .../galaxy/scripts/mvc/workflow/workflow-node.js | 3 ++- .../mvc/workflow/workflow-view-terminals.js | 2 -- 30 files changed, 20 insertions(+), 60 deletions(-) diff --git a/client/galaxy/scripts/mvc/collection/list-collection-creator.js b/client/galaxy/scripts/mvc/collection/list-collection-creator.js index acdead449e4b..822f2f576384 100644 --- a/client/galaxy/scripts/mvc/collection/list-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/list-collection-creator.js @@ -118,13 +118,6 @@ var DatasetCollectionElementView = Backbone.View.extend(BASE_MVC.LoggableMixin). ev.stopPropagation(); ev.preventDefault(); - var promptString = [ - _l("Enter a new name for the element"), - ":\n(", - _l("Note that changing the name here will not rename the dataset"), - ")" - ].join(""); - var response = prompt(`${_l("Enter a new name for the element")}:`, this.element.name); if (response) { @@ -267,7 +260,6 @@ var ListCollectionCreator = Backbone.View.extend(BASE_MVC.LoggableMixin) /** separate working list into valid and invalid elements for this collection */ _validateElements: function() { var creator = this; - var existingNames = {}; creator.invalidElements = []; this.workingElements = this.workingElements.filter(element => { @@ -1084,7 +1076,7 @@ var ruleBasedCollectionCreatorModal = function _ruleBasedCollectionCreatorModal( options = _.defaults(options || {}, { title: title }); - const { deferred, creatorOptions, showEl } = collectionCreatorModalSetup(options); + const { deferred, creatorOptions, showEl } = collectionCreatorModalSetup(options); // eslint-disable-line no-unused-vars var ruleCollectionBuilderInstance = Vue.extend(RuleCollectionBuilder); var vm = document.createElement("div"); showEl(vm); diff --git a/client/galaxy/scripts/mvc/dataset/dataset-list.js b/client/galaxy/scripts/mvc/dataset/dataset-list.js index 3fe8a88b9bb7..0ab655798aa2 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-list.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-list.js @@ -1,6 +1,5 @@ import LIST_VIEW from "mvc/list/list-view"; import DATASET_LI from "mvc/dataset/dataset-li"; -import BASE_MVC from "mvc/base-mvc"; import _l from "utils/localization"; var logNamespace = "dataset"; diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 1fbe4a5f4583..a8fe83d3f422 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -5,7 +5,6 @@ import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; import Utils from "utils/utils"; -import Ui from "mvc/ui/ui-misc"; import Portlet from "mvc/ui/ui-portlet"; import Repeat from "mvc/form/form-repeat"; import InputElement from "mvc/form/form-input"; diff --git a/client/galaxy/scripts/mvc/history/hda-model.js b/client/galaxy/scripts/mvc/history/hda-model.js index e4e1c0d0e2f4..60f230b8c3f2 100644 --- a/client/galaxy/scripts/mvc/history/hda-model.js +++ b/client/galaxy/scripts/mvc/history/hda-model.js @@ -2,7 +2,6 @@ import _ from "underscore"; import DATASET from "mvc/dataset/dataset-model"; import HISTORY_CONTENT from "mvc/history/history-content-model"; import BASE_MVC from "mvc/base-mvc"; -import _l from "utils/localization"; //============================================================================== var _super = DATASET.DatasetAssociation; diff --git a/client/galaxy/scripts/mvc/history/hdca-model.js b/client/galaxy/scripts/mvc/history/hdca-model.js index 87791a76e9f4..0a3a4dcf249c 100644 --- a/client/galaxy/scripts/mvc/history/hdca-model.js +++ b/client/galaxy/scripts/mvc/history/hdca-model.js @@ -1,7 +1,6 @@ import _ from "underscore"; import DC_MODEL from "mvc/collection/collection-model"; import HISTORY_CONTENT from "mvc/history/history-content-model"; -import _l from "utils/localization"; /*============================================================================== diff --git a/client/galaxy/scripts/mvc/history/history-preferences.js b/client/galaxy/scripts/mvc/history/history-preferences.js index b9a4cd779f3b..0ae63605903b 100644 --- a/client/galaxy/scripts/mvc/history/history-preferences.js +++ b/client/galaxy/scripts/mvc/history/history-preferences.js @@ -1,8 +1,6 @@ import _ from "underscore"; import BASE_MVC from "mvc/base-mvc"; -var logNamespace = "history"; - // ============================================================================ /** session storage for individual history preferences */ var HistoryPrefs = BASE_MVC.SessionStorageModel.extend( diff --git a/client/galaxy/scripts/mvc/history/history-view-annotated.js b/client/galaxy/scripts/mvc/history/history-view-annotated.js index d5e0707c85e5..3504b1301f89 100644 --- a/client/galaxy/scripts/mvc/history/history-view-annotated.js +++ b/client/galaxy/scripts/mvc/history/history-view-annotated.js @@ -1,9 +1,6 @@ import $ from "jquery"; import _ from "underscore"; import HISTORY_VIEW from "mvc/history/history-view"; -import HDA_LI from "mvc/history/hda-li"; -import HDCA_LI from "mvc/history/hdca-li"; -import BASE_MVC from "mvc/base-mvc"; import _l from "utils/localization"; /* ============================================================================= @@ -49,7 +46,7 @@ var AnnotatedHistoryView = _super.extend( var $controls = $whereTo.find("> .controls"); $controls.find(".contents-container.headers").remove(); - var $headers = $('
    ') + $('
    ') .append([ $('
    ').text(_l("Dataset")), $('
    ').text(_l("Annotation")) diff --git a/client/galaxy/scripts/mvc/job/job-li.js b/client/galaxy/scripts/mvc/job/job-li.js index 86b02f13dbb8..731af00b3d08 100644 --- a/client/galaxy/scripts/mvc/job/job-li.js +++ b/client/galaxy/scripts/mvc/job/job-li.js @@ -124,6 +124,8 @@ var JobListItemView = _super.extend( JobListItemView.prototype.templates = (() => { //TODO: move to require text! plugin + // TODO: Is this actually used? + // eslint-disable-next-line no-unused-vars var elTemplate = BASE_MVC.wrapTemplate([ '
    ', '
    <%- model.id %>
    ', diff --git a/client/galaxy/scripts/mvc/lazy/lazy-limited.js b/client/galaxy/scripts/mvc/lazy/lazy-limited.js index abb3774fbeaf..7acbe969a3ee 100644 --- a/client/galaxy/scripts/mvc/lazy/lazy-limited.js +++ b/client/galaxy/scripts/mvc/lazy/lazy-limited.js @@ -5,7 +5,6 @@ import Backbone from "backbone"; export default Backbone.View.extend({ initialize: function(options) { - var self = this; this.$container = options.$container; this.collection = options.collection; this.new_content = options.new_content; @@ -53,7 +52,8 @@ export default Backbone.View.extend({ if (!this._done()) { for (var i in this.collection.models) { var model = this.collection.models[i]; - var view = this.content_list[model.id]; + // TODO: View is unused here. + //var view = this.content_list[model.id]; if (!this.content_list[model.id]) { var content = this.new_content(model); this.content_list[model.id] = content; diff --git a/client/galaxy/scripts/mvc/library/library-folderrow-view.js b/client/galaxy/scripts/mvc/library/library-folderrow-view.js index 548f15114ab8..5398a5260f9b 100644 --- a/client/galaxy/scripts/mvc/library/library-folderrow-view.js +++ b/client/galaxy/scripts/mvc/library/library-folderrow-view.js @@ -146,7 +146,6 @@ var FolderRowView = Backbone.View.extend({ undeleteFolder: function(event) { let Galaxy = getGalaxyInstance(); $(".tooltip").hide(); - var that = this; var folder_id = $(event.target) .closest("tr") .data("id"); diff --git a/client/galaxy/scripts/mvc/tool/tool-form.js b/client/galaxy/scripts/mvc/tool/tool-form.js index b68dacd29c8b..f5e11bfeaedb 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form.js +++ b/client/galaxy/scripts/mvc/tool/tool-form.js @@ -235,7 +235,7 @@ var View = Backbone.View.extend({ // Show Webhook if job is running if (response.jobs && response.jobs.length > 0) { self.$el.append($("
    ", { id: "webhook-view" })); - var WebhookApp = new Webhooks.WebhookView({ + new Webhooks.WebhookView({ type: "tool", toolId: job_def.tool_id }); diff --git a/client/galaxy/scripts/mvc/toolshed/repository-view.js b/client/galaxy/scripts/mvc/toolshed/repository-view.js index 24a483cd94bc..96a2a7602e57 100644 --- a/client/galaxy/scripts/mvc/toolshed/repository-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repository-view.js @@ -2,7 +2,7 @@ import _ from "underscore"; import $ from "jquery"; import Backbone from "backbone"; import { getAppRoot } from "onload/loadConfig"; -import jstree from "libs/jquery/jstree"; +import "libs/jquery/jstree"; import toolshed_model from "mvc/toolshed/toolshed-model"; import Utils from "utils/utils"; import Modal from "mvc/ui/ui-modal"; diff --git a/client/galaxy/scripts/mvc/ui/ui-list.js b/client/galaxy/scripts/mvc/ui/ui-list.js index 7627c935e5d9..1fb56b0c6df0 100644 --- a/client/galaxy/scripts/mvc/ui/ui-list.js +++ b/client/galaxy/scripts/mvc/ui/ui-list.js @@ -4,7 +4,6 @@ import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; var View = Backbone.View.extend({ initialize: function(options) { - var self = this; this.options = options; this.name = options.name || "element"; this.multiple = options.multiple || false; diff --git a/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js b/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js index 81e7218c473b..64b0a232f0f8 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js +++ b/client/galaxy/scripts/mvc/ui/ui-select-genomespace.js @@ -1,6 +1,5 @@ import Backbone from "backbone"; import _l from "utils/localization"; -import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; import GenomespaceBrowser from "mvc/tool/tool-genomespace"; /** diff --git a/client/galaxy/scripts/mvc/ui/ui-slider.js b/client/galaxy/scripts/mvc/ui/ui-slider.js index 31ac598d5290..9dcc922e196e 100644 --- a/client/galaxy/scripts/mvc/ui/ui-slider.js +++ b/client/galaxy/scripts/mvc/ui/ui-slider.js @@ -1,5 +1,4 @@ import $ from "jquery"; -import _ from "underscore"; import Backbone from "backbone"; import Utils from "utils/utils"; diff --git a/client/galaxy/scripts/mvc/upload/collection/collection-row.js b/client/galaxy/scripts/mvc/upload/collection/collection-row.js index 3b20f6c4805e..b3eaf82a9d17 100644 --- a/client/galaxy/scripts/mvc/upload/collection/collection-row.js +++ b/client/galaxy/scripts/mvc/upload/collection/collection-row.js @@ -4,10 +4,8 @@ import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; import Utils from "utils/utils"; -import UploadModel from "mvc/upload/upload-model"; import UploadSettings from "mvc/upload/upload-settings"; import Popover from "mvc/ui/ui-popover"; -import Select from "mvc/ui/ui-select"; export default Backbone.View.extend({ /** Dictionary of upload states and associated icons */ status_classes: { @@ -42,8 +40,9 @@ export default Backbone.View.extend({ }); // identify default genome and extension values - var default_genome = this.app.select_genome.value(); - var default_extension = this.app.select_extension.value(); + // TODO: These appear unused. + //var default_genome = this.app.select_genome.value(); + //var default_extension = this.app.select_extension.value(); // handle click event this.$symbol.on("click", () => { diff --git a/client/galaxy/scripts/mvc/upload/collection/collection-view.js b/client/galaxy/scripts/mvc/upload/collection/collection-view.js index 5eff22f444f7..241327ad0766 100644 --- a/client/galaxy/scripts/mvc/upload/collection/collection-view.js +++ b/client/galaxy/scripts/mvc/upload/collection/collection-view.js @@ -5,7 +5,6 @@ import _ from "underscore"; import $ from "jquery"; import Backbone from "backbone"; import { getGalaxyInstance } from "app"; -import Utils from "utils/utils"; import UploadModel from "mvc/upload/upload-model"; import UploadRow from "mvc/upload/collection/collection-row"; import UploadFtp from "mvc/upload/upload-ftp"; @@ -13,7 +12,6 @@ import UploadExtension from "mvc/upload/upload-extension"; import Popover from "mvc/ui/ui-popover"; import Select from "mvc/ui/ui-select"; import Ui from "mvc/ui/ui-misc"; -import LIST_COLLECTION_CREATOR from "mvc/collection/list-collection-creator"; import "utils/uploadbox"; export default Backbone.View.extend({ @@ -401,7 +399,6 @@ export default Backbone.View.extend({ /** Update collection type */ updateCollectionType: function(collectionType) { - var self = this; this.collectionType = collectionType; }, diff --git a/client/galaxy/scripts/mvc/upload/composite/composite-row.js b/client/galaxy/scripts/mvc/upload/composite/composite-row.js index c71756b0698e..d8bb4852291e 100644 --- a/client/galaxy/scripts/mvc/upload/composite/composite-row.js +++ b/client/galaxy/scripts/mvc/upload/composite/composite-row.js @@ -8,7 +8,6 @@ import UploadSettings from "mvc/upload/upload-settings"; import UploadFtp from "mvc/upload/upload-ftp"; import Popover from "mvc/ui/ui-popover"; import Ui from "mvc/ui/ui-misc"; -import Select from "mvc/ui/ui-select"; import "utils/uploadbox"; export default Backbone.View.extend({ /** Dictionary of upload states and associated icons */ diff --git a/client/galaxy/scripts/mvc/upload/default/default-row.js b/client/galaxy/scripts/mvc/upload/default/default-row.js index 9d66ebc5719d..919fdddbcab8 100644 --- a/client/galaxy/scripts/mvc/upload/default/default-row.js +++ b/client/galaxy/scripts/mvc/upload/default/default-row.js @@ -4,7 +4,6 @@ import _ from "underscore"; import Backbone from "backbone"; import _l from "utils/localization"; import Utils from "utils/utils"; -import UploadModel from "mvc/upload/upload-model"; import UploadSettings from "mvc/upload/upload-settings"; import Popover from "mvc/ui/ui-popover"; import UploadExtension from "mvc/upload/upload-extension"; diff --git a/client/galaxy/scripts/mvc/upload/upload-button.js b/client/galaxy/scripts/mvc/upload/upload-button.js index a405726a0160..dad7c1f091a9 100644 --- a/client/galaxy/scripts/mvc/upload/upload-button.js +++ b/client/galaxy/scripts/mvc/upload/upload-button.js @@ -25,7 +25,6 @@ var View = Backbone.View.extend({ }, render: function() { - var self = this; var options = this.model.attributes; this.$el .off("click") diff --git a/client/galaxy/scripts/mvc/upload/upload-extension.js b/client/galaxy/scripts/mvc/upload/upload-extension.js index 167ab0bcde7b..766e1dfd1329 100644 --- a/client/galaxy/scripts/mvc/upload/upload-extension.js +++ b/client/galaxy/scripts/mvc/upload/upload-extension.js @@ -1,7 +1,6 @@ /** This renders a popover with extension details **/ import _ from "underscore"; import Backbone from "backbone"; -import Utils from "utils/utils"; import Popover from "mvc/ui/ui-popover"; export default Backbone.View.extend({ initialize: function(options) { @@ -11,7 +10,6 @@ export default Backbone.View.extend({ }, render: function() { - var self = this; var options = this.model.attributes; var description = _.findWhere(options.list, { id: options.extension diff --git a/client/galaxy/scripts/mvc/upload/upload-settings.js b/client/galaxy/scripts/mvc/upload/upload-settings.js index 327e0355c863..240a3452025a 100644 --- a/client/galaxy/scripts/mvc/upload/upload-settings.js +++ b/client/galaxy/scripts/mvc/upload/upload-settings.js @@ -2,7 +2,6 @@ import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; -import Utils from "utils/utils"; export default Backbone.View.extend({ options: { class_check: "fa-check-square-o", @@ -20,7 +19,6 @@ export default Backbone.View.extend({ }, initialize: function(options) { - var self = this; this.model = options.model; this.setElement($("
    ").addClass("upload-settings")); this.$el.append($("
    ").addClass("upload-settings-cover")); diff --git a/client/galaxy/scripts/mvc/user/user-model.js b/client/galaxy/scripts/mvc/user/user-model.js index ce94244c29f2..acb4f40ea898 100644 --- a/client/galaxy/scripts/mvc/user/user-model.js +++ b/client/galaxy/scripts/mvc/user/user-model.js @@ -119,13 +119,13 @@ User.getCurrentUserFromApi = options => { }; // (stub) collection for users (shouldn't be common unless admin UI) -var UserCollection = Backbone.Collection.extend(baseMVC.LoggableMixin).extend({ - model: User, - urlRoot: function() { - return `${getAppRoot()}api/users`; - } - //logger : console, -}); +//var UserCollection = Backbone.Collection.extend(baseMVC.LoggableMixin).extend({ +// model: User, +// urlRoot: function() { +// return `${getAppRoot()}api/users`; +// } +// //logger : console, +//}); //============================================================================== export default { diff --git a/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js b/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js index 61c2b73a74e1..69f4b5ceb368 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js +++ b/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js @@ -1,10 +1,6 @@ import * as _ from "underscore"; import * as d3 from "d3"; -// TODO: This d3 must(?) just be global because various charts use different -// versions, and we want to use whichever one that is. I think. I hope. -/* global d3 */ - /** Get domain boundaries value */ function getDomains(groups, keys) { function _apply(operator, key) { diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/editor.js b/client/galaxy/scripts/mvc/visualization/chart/views/editor.js index cedb9f241f20..4fac5d23ade1 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/editor.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/editor.js @@ -5,7 +5,6 @@ import $ from "jquery"; import Backbone from "backbone"; import Ui from "mvc/ui/ui-misc"; -import Utils from "utils/utils"; import Tabs from "mvc/ui/ui-tabs"; import Groups from "mvc/visualization/chart/views/groups"; import Settings from "mvc/visualization/chart/views/settings"; diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/groups.js b/client/galaxy/scripts/mvc/visualization/chart/views/groups.js index cbbdd839b6b7..0d4c6f31d014 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/groups.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/groups.js @@ -5,7 +5,6 @@ import $ from "jquery"; import Backbone from "backbone"; import { getAppRoot } from "onload/loadConfig"; import Utils from "utils/utils"; -import Ui from "mvc/ui/ui-misc"; import Form from "mvc/form/form-view"; import Repeat from "mvc/form/form-repeat"; import FormData from "mvc/form/form-data"; diff --git a/client/galaxy/scripts/mvc/visualization/chart/views/menu.js b/client/galaxy/scripts/mvc/visualization/chart/views/menu.js index 33e9b49dd747..04025678b67c 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/views/menu.js +++ b/client/galaxy/scripts/mvc/visualization/chart/views/menu.js @@ -2,7 +2,6 @@ import Backbone from "backbone"; import Ui from "mvc/ui/ui-misc"; import Screenshot from "mvc/visualization/chart/components/screenshot"; -import Utils from "utils/utils"; export default Backbone.View.extend({ initialize: function(app) { diff --git a/client/galaxy/scripts/mvc/workflow/workflow-connector.js b/client/galaxy/scripts/mvc/workflow/workflow-connector.js index a69f7e3795be..7199391cc8d4 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-connector.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-connector.js @@ -101,8 +101,6 @@ $.extend(Connector.prototype, { // Draw the line - var c = this.canvas.getContext("2d"); - var start_offsets = null; var end_offsets = null; var num_offsets = 1; diff --git a/client/galaxy/scripts/mvc/workflow/workflow-node.js b/client/galaxy/scripts/mvc/workflow/workflow-node.js index 6e8cb26c46a8..c1dbbdb23a2c 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-node.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-node.js @@ -5,7 +5,8 @@ import { getAppRoot } from "onload/loadConfig"; import Utils from "utils/utils"; import NodeView from "mvc/workflow/workflow-view-node"; -var StepParameterTypes = ["text", "integer", "float", "boolean", "color"]; +// unused +//var StepParameterTypes = ["text", "integer", "float", "boolean", "color"]; var Node = Backbone.Model.extend({ initialize: function(app, attr) { diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js b/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js index 3997c86b71a3..a43e1be25b57 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view-terminals.js @@ -287,8 +287,6 @@ var OutputParameterTerminalView = BaseOutputTerminalView.extend({ terminalMappingClass: Terminals.TerminalMapping, terminalMappingViewClass: TerminalMappingView, terminalForOutput: function(output) { - var collection_type = output.collection_type; - var collection_type_source = output.collection_type_source; var terminal = new Terminals.OutputCollectionTerminal({ element: this.el, type: output.type From 653452de56339c16017601fb5f5823bbe46771e8 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 14:14:43 -0500 Subject: [PATCH 48/88] Drop /* global blah */ directives, correctly supply sources for $, Galaxy, and more. Left out test dir and google analytics references. --- client/galaxy/scripts/layout/communication-server-view.js | 4 +++- client/galaxy/scripts/mvc/grid/grid-template.js | 4 +--- client/galaxy/scripts/mvc/history/hdca-li-edit.js | 3 +-- client/galaxy/scripts/mvc/library/library-dataset-view.js | 4 ++-- .../scripts/mvc/library/library-foldertoolbar-view.js | 4 ++-- client/galaxy/scripts/mvc/toolshed/repo-status-view.js | 3 +-- client/galaxy/scripts/mvc/ui/ui-buttons.js | 3 +-- client/galaxy/scripts/mvc/ui/ui-options.js | 3 +-- client/galaxy/scripts/mvc/ui/ui-popover.js | 2 +- client/galaxy/scripts/mvc/ui/ui-tabs.js | 2 +- client/galaxy/scripts/mvc/user/user-quotameter.js | 3 +-- client/galaxy/scripts/mvc/workflow/workflow-canvas.js | 2 +- client/galaxy/scripts/reports/run_stats.js | 2 +- client/galaxy/scripts/ui/autocom_tagging.js | 7 ++++--- client/galaxy/scripts/ui/pagination.js | 6 +----- client/galaxy/scripts/ui/peek-column-selector.js | 6 +----- client/galaxy/scripts/viz/phyloviz.js | 5 ++--- 17 files changed, 25 insertions(+), 38 deletions(-) diff --git a/client/galaxy/scripts/layout/communication-server-view.js b/client/galaxy/scripts/layout/communication-server-view.js index 11296718303c..e6f288e955bf 100644 --- a/client/galaxy/scripts/layout/communication-server-view.js +++ b/client/galaxy/scripts/layout/communication-server-view.js @@ -1,9 +1,10 @@ /** Real-time Communication feature **/ +import $ from "jquery"; import * as Backbone from "backbone"; import * as _ from "underscore"; import _l from "utils/localization"; import Modal from "mvc/ui/ui-modal"; -/* global $ */ +import { getGalaxyInstance } from "app"; export var CommunicationServerView = Backbone.View.extend({ initialize: function() { @@ -12,6 +13,7 @@ export var CommunicationServerView = Backbone.View.extend({ /** makes bootstrap modal and iframe inside it */ makeModalIframe: function(e) { + let Galaxy = getGalaxyInstance(); // make modal var host = Galaxy.config.communication_server_host; diff --git a/client/galaxy/scripts/mvc/grid/grid-template.js b/client/galaxy/scripts/mvc/grid/grid-template.js index 6cc4346b3401..4caaa0ec7f31 100644 --- a/client/galaxy/scripts/mvc/grid/grid-template.js +++ b/client/galaxy/scripts/mvc/grid/grid-template.js @@ -1,9 +1,7 @@ -// dependencies +import $ from "jquery"; import Utils from "utils/utils"; import * as _ from "underscore"; -/* global $ */ - // grid view templates export default { // template diff --git a/client/galaxy/scripts/mvc/history/hdca-li-edit.js b/client/galaxy/scripts/mvc/history/hdca-li-edit.js index a95f0554dd4b..6ccfe747300c 100644 --- a/client/galaxy/scripts/mvc/history/hdca-li-edit.js +++ b/client/galaxy/scripts/mvc/history/hdca-li-edit.js @@ -1,10 +1,9 @@ +import $ from "jquery"; import * as _ from "underscore"; import HDCA_LI from "mvc/history/hdca-li"; import DC_VIEW_EDIT from "mvc/collection/collection-view-edit"; import _l from "utils/localization"; -/* global $ */ - //============================================================================== var _super = HDCA_LI.HDCAListItemView; /** @class Editing view for HistoryDatasetCollectionAssociation. diff --git a/client/galaxy/scripts/mvc/library/library-dataset-view.js b/client/galaxy/scripts/mvc/library/library-dataset-view.js index 9752d87b2201..1869f0666ba9 100644 --- a/client/galaxy/scripts/mvc/library/library-dataset-view.js +++ b/client/galaxy/scripts/mvc/library/library-dataset-view.js @@ -1,4 +1,4 @@ -/* global $, jQuery */ +import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; import { getAppRoot } from "onload/loadConfig"; @@ -259,7 +259,7 @@ var LibraryDatasetView = Backbone.View.extend({ historyItem.url = `${historyItem.urlRoot + history_id}/contents`; // set the used history as current so user will see the last one // that he imported into in the history panel on the 'analysis' page - jQuery.getJSON(`${getAppRoot()}history/set_as_current?id=${history_id}`); + $.getJSON(`${getAppRoot()}history/set_as_current?id=${history_id}`); // save the dataset into selected history historyItem.save( { content: this.id, source: "library" }, diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index 09f774841503..4176034ce731 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -1,4 +1,4 @@ -/* global $, jQuery */ +import $ from "jquery"; import _ from "underscore"; import Backbone from "backbone"; import { getAppRoot } from "onload/loadConfig"; @@ -319,7 +319,7 @@ var FolderToolbarView = Backbone.View.extend({ }); // set the used history as current so user will see the last one // that he imported into in the history panel on the 'analysis' page - jQuery.getJSON(`${getAppRoot()}history/set_as_current?id=${history_id}`); + $.getJSON(`${getAppRoot()}history/set_as_current?id=${history_id}`); this.chainCallImportingIntoHistory(items_to_import, history_name); }, diff --git a/client/galaxy/scripts/mvc/toolshed/repo-status-view.js b/client/galaxy/scripts/mvc/toolshed/repo-status-view.js index 382f61f93246..b1e889c48ecb 100644 --- a/client/galaxy/scripts/mvc/toolshed/repo-status-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repo-status-view.js @@ -1,11 +1,10 @@ +import $ from "jquery"; import * as Backbone from "backbone"; import * as _ from "underscore"; import _l from "utils/localization"; import toolshed_model from "mvc/toolshed/toolshed-model"; import toolshed_util from "mvc/toolshed/util"; -/* global $ */ - var ToolShedRepoStatusView = Backbone.View.extend({ el: "#center", diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index 49d7fead208a..e2d9664c7610 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -1,9 +1,8 @@ /** This module contains all button views. */ +import $ from "jquery"; import Utils from "utils/utils"; import * as Backbone from "backbone"; -/* global $ */ - /** This renders the default button which is used e.g. at the bottom of the upload modal. */ var Button = Backbone.View.extend({ initialize: function(options) { diff --git a/client/galaxy/scripts/mvc/ui/ui-options.js b/client/galaxy/scripts/mvc/ui/ui-options.js index f06b9d96bd31..90482444e125 100644 --- a/client/galaxy/scripts/mvc/ui/ui-options.js +++ b/client/galaxy/scripts/mvc/ui/ui-options.js @@ -1,11 +1,10 @@ /** Base class for options based ui elements **/ +import $ from "jquery"; import * as Backbone from "backbone"; import * as _ from "underscore"; import Utils from "utils/utils"; import Buttons from "mvc/ui/ui-buttons"; -/* global $ */ - var Base = Backbone.View.extend({ initialize: function(options) { var self = this; diff --git a/client/galaxy/scripts/mvc/ui/ui-popover.js b/client/galaxy/scripts/mvc/ui/ui-popover.js index 0d2f68ac6df7..e0aaea587866 100644 --- a/client/galaxy/scripts/mvc/ui/ui-popover.js +++ b/client/galaxy/scripts/mvc/ui/ui-popover.js @@ -1,11 +1,11 @@ /** * Popover wrapper */ +import $ from "jquery"; import * as Backbone from "backbone"; import * as _ from "underscore"; import Utils from "utils/utils"; -/* global $ */ export default Backbone.View.extend({ initialize: function(options) { this.options = _.defaults(options || {}, { diff --git a/client/galaxy/scripts/mvc/ui/ui-tabs.js b/client/galaxy/scripts/mvc/ui/ui-tabs.js index 66bb7c0f1026..ef39c7ecccae 100644 --- a/client/galaxy/scripts/mvc/ui/ui-tabs.js +++ b/client/galaxy/scripts/mvc/ui/ui-tabs.js @@ -1,9 +1,9 @@ /** * Renders tabs e.g. used in the charts editor, behaves similar to repeat and section rendering */ +import $ from "jquery"; import * as Backbone from "backbone"; -/* global $ */ export var View = Backbone.View.extend({ initialize: function(options) { this.collection = new Backbone.Collection(); diff --git a/client/galaxy/scripts/mvc/user/user-quotameter.js b/client/galaxy/scripts/mvc/user/user-quotameter.js index 6d2e80720ec4..1bf1bceed61f 100644 --- a/client/galaxy/scripts/mvc/user/user-quotameter.js +++ b/client/galaxy/scripts/mvc/user/user-quotameter.js @@ -1,10 +1,9 @@ +import $ from "jquery"; import * as Backbone from "backbone"; import * as _ from "underscore"; import baseMVC from "mvc/base-mvc"; import _l from "utils/localization"; -/* global $ */ - var logNamespace = "user"; //============================================================================== /** @class View to display a user's disk/storage usage diff --git a/client/galaxy/scripts/mvc/workflow/workflow-canvas.js b/client/galaxy/scripts/mvc/workflow/workflow-canvas.js index 790b51740e7c..2f529d124d2b 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-canvas.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-canvas.js @@ -1,4 +1,4 @@ -/* global $ */ +import $ from "jquery"; // FIXME: merge scroll panel into CanvasManager, clean up hardcoded stuff. class ScrollPanel { diff --git a/client/galaxy/scripts/reports/run_stats.js b/client/galaxy/scripts/reports/run_stats.js index 58f60822d483..4c248b399974 100644 --- a/client/galaxy/scripts/reports/run_stats.js +++ b/client/galaxy/scripts/reports/run_stats.js @@ -1,4 +1,4 @@ -/* global $ */ +import $ from "jquery"; import * as d3 from "../libs/d3"; import { event as currentEvent } from "../libs/d3"; diff --git a/client/galaxy/scripts/ui/autocom_tagging.js b/client/galaxy/scripts/ui/autocom_tagging.js index 2d92f92e8629..c44d8cc3aa0e 100644 --- a/client/galaxy/scripts/ui/autocom_tagging.js +++ b/client/galaxy/scripts/ui/autocom_tagging.js @@ -1,4 +1,5 @@ -/* global jQuery, $ */ +import $ from "jquery"; +import _ from "underscore"; // ============================================================================ /** @@ -22,7 +23,7 @@ export function init_tag_click_function(tag_elt, click_func) { }); } -jQuery.fn.autocomplete_tagging = function(options) { +$.fn.autocomplete_tagging = function(options) { var defaults = { get_toggle_link_text_fn: function(tags) { var text = ""; @@ -50,7 +51,7 @@ jQuery.fn.autocomplete_tagging = function(options) { ajax_add_tag_url: "" }; - var settings = jQuery.extend(defaults, options); + var settings = $.extend(defaults, options); // // Initalize object's elements. diff --git a/client/galaxy/scripts/ui/pagination.js b/client/galaxy/scripts/ui/pagination.js index f3fa2cc94ed7..f416a3d11280 100644 --- a/client/galaxy/scripts/ui/pagination.js +++ b/client/galaxy/scripts/ui/pagination.js @@ -1,8 +1,4 @@ -//import $ from "jquery"; -// TODO: This manipulates whatever jquery is available -- needs restructuring, -// or removal (jquery plugins are a bad design choice for us at this point) -// It is *only* used in the scatterplot viz, so this is safe. -/* global $ */ +import $ from "jquery"; /** Builds (twitter bootstrap styled) pagination controls. * If the totalDataSize is not null, a horizontal list of page buttons is displayed. diff --git a/client/galaxy/scripts/ui/peek-column-selector.js b/client/galaxy/scripts/ui/peek-column-selector.js index dd091d6380c6..c17ab9685c9f 100644 --- a/client/galaxy/scripts/ui/peek-column-selector.js +++ b/client/galaxy/scripts/ui/peek-column-selector.js @@ -1,8 +1,4 @@ -//import $ from "jquery"; -// TODO: This manipulates whatever jquery is available -- needs restructuring, -// or removal (jquery plugins are a bad design choice for us at this point) -// It is *only* used in the scatterplot viz, so this is safe. -/* global $ */ +import $ from "jquery"; //============================================================================== /** Column selection using the peek display as the control. diff --git a/client/galaxy/scripts/viz/phyloviz.js b/client/galaxy/scripts/viz/phyloviz.js index 84eeb0175dbc..b2bc64ce6af1 100644 --- a/client/galaxy/scripts/viz/phyloviz.js +++ b/client/galaxy/scripts/viz/phyloviz.js @@ -1,6 +1,5 @@ -/* global Backbone */ -/* global $ */ - +import $ from "jquery"; +import Backbone from "backbone"; import _l from "utils/localization"; import * as d3 from "libs/d3"; import visualization_mod from "viz/visualization"; From d30b7dfbe0aba80b7d14446f208a395f2f1e7a61 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 14:28:21 -0500 Subject: [PATCH 49/88] Standardize backbone and underscore imports. --- client/galaxy/scripts/layout/communication-server-view.js | 4 ++-- client/galaxy/scripts/mvc/grid/grid-template.js | 2 +- client/galaxy/scripts/mvc/history/hdca-li-edit.js | 2 +- client/galaxy/scripts/mvc/toolshed/repo-status-view.js | 4 ++-- client/galaxy/scripts/mvc/toolshed/shed-list-view.js | 4 ++-- client/galaxy/scripts/mvc/ui/ui-buttons.js | 2 +- client/galaxy/scripts/mvc/ui/ui-options.js | 4 ++-- client/galaxy/scripts/mvc/ui/ui-popover.js | 4 ++-- client/galaxy/scripts/mvc/ui/ui-select.js | 4 ++-- client/galaxy/scripts/mvc/ui/ui-tabs.js | 2 +- client/galaxy/scripts/mvc/user/user-quotameter.js | 4 ++-- .../scripts/mvc/visualization/chart/components/model.js | 2 +- .../scripts/mvc/visualization/chart/utilities/series.js | 2 +- client/galaxy/scripts/mvc/workflow/workflow-view-node.js | 2 +- client/galaxy/scripts/ui/fa-icon-button.js | 2 +- client/galaxy/scripts/viz/trackster/filters.js | 2 +- client/galaxy/scripts/viz/trackster/painters.js | 2 +- client/galaxy/scripts/viz/trackster/slotting.js | 2 +- 18 files changed, 25 insertions(+), 25 deletions(-) diff --git a/client/galaxy/scripts/layout/communication-server-view.js b/client/galaxy/scripts/layout/communication-server-view.js index e6f288e955bf..a3baf9758c24 100644 --- a/client/galaxy/scripts/layout/communication-server-view.js +++ b/client/galaxy/scripts/layout/communication-server-view.js @@ -1,7 +1,7 @@ /** Real-time Communication feature **/ import $ from "jquery"; -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import _l from "utils/localization"; import Modal from "mvc/ui/ui-modal"; import { getGalaxyInstance } from "app"; diff --git a/client/galaxy/scripts/mvc/grid/grid-template.js b/client/galaxy/scripts/mvc/grid/grid-template.js index 4caaa0ec7f31..4facf6310943 100644 --- a/client/galaxy/scripts/mvc/grid/grid-template.js +++ b/client/galaxy/scripts/mvc/grid/grid-template.js @@ -1,6 +1,6 @@ import $ from "jquery"; import Utils from "utils/utils"; -import * as _ from "underscore"; +import _ from "underscore"; // grid view templates export default { diff --git a/client/galaxy/scripts/mvc/history/hdca-li-edit.js b/client/galaxy/scripts/mvc/history/hdca-li-edit.js index 6ccfe747300c..d9d8a6e5074f 100644 --- a/client/galaxy/scripts/mvc/history/hdca-li-edit.js +++ b/client/galaxy/scripts/mvc/history/hdca-li-edit.js @@ -1,5 +1,5 @@ import $ from "jquery"; -import * as _ from "underscore"; +import _ from "underscore"; import HDCA_LI from "mvc/history/hdca-li"; import DC_VIEW_EDIT from "mvc/collection/collection-view-edit"; import _l from "utils/localization"; diff --git a/client/galaxy/scripts/mvc/toolshed/repo-status-view.js b/client/galaxy/scripts/mvc/toolshed/repo-status-view.js index b1e889c48ecb..1b02292fcd35 100644 --- a/client/galaxy/scripts/mvc/toolshed/repo-status-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repo-status-view.js @@ -1,6 +1,6 @@ import $ from "jquery"; -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import _l from "utils/localization"; import toolshed_model from "mvc/toolshed/toolshed-model"; import toolshed_util from "mvc/toolshed/util"; diff --git a/client/galaxy/scripts/mvc/toolshed/shed-list-view.js b/client/galaxy/scripts/mvc/toolshed/shed-list-view.js index 3d8f2df2a97d..b2d9b6ea8bd3 100644 --- a/client/galaxy/scripts/mvc/toolshed/shed-list-view.js +++ b/client/galaxy/scripts/mvc/toolshed/shed-list-view.js @@ -1,5 +1,5 @@ -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import _l from "utils/localization"; import toolshed_model from "mvc/toolshed/toolshed-model"; import toolshed_util from "mvc/toolshed/util"; diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index e2d9664c7610..e4612492d8f6 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -1,7 +1,7 @@ /** This module contains all button views. */ import $ from "jquery"; import Utils from "utils/utils"; -import * as Backbone from "backbone"; +import Backbone from "backbone"; /** This renders the default button which is used e.g. at the bottom of the upload modal. */ var Button = Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/ui/ui-options.js b/client/galaxy/scripts/mvc/ui/ui-options.js index 90482444e125..7b7ab975cba6 100644 --- a/client/galaxy/scripts/mvc/ui/ui-options.js +++ b/client/galaxy/scripts/mvc/ui/ui-options.js @@ -1,7 +1,7 @@ /** Base class for options based ui elements **/ import $ from "jquery"; -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import Utils from "utils/utils"; import Buttons from "mvc/ui/ui-buttons"; diff --git a/client/galaxy/scripts/mvc/ui/ui-popover.js b/client/galaxy/scripts/mvc/ui/ui-popover.js index e0aaea587866..151be0c2694c 100644 --- a/client/galaxy/scripts/mvc/ui/ui-popover.js +++ b/client/galaxy/scripts/mvc/ui/ui-popover.js @@ -2,8 +2,8 @@ * Popover wrapper */ import $ from "jquery"; -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import Utils from "utils/utils"; export default Backbone.View.extend({ diff --git a/client/galaxy/scripts/mvc/ui/ui-select.js b/client/galaxy/scripts/mvc/ui/ui-select.js index 79a701dae49d..bc9d7be54850 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select.js +++ b/client/galaxy/scripts/mvc/ui/ui-select.js @@ -1,5 +1,5 @@ -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import Utils from "utils/utils"; /** * A plugin for initializing select2 input items. diff --git a/client/galaxy/scripts/mvc/ui/ui-tabs.js b/client/galaxy/scripts/mvc/ui/ui-tabs.js index ef39c7ecccae..b84d4d58b775 100644 --- a/client/galaxy/scripts/mvc/ui/ui-tabs.js +++ b/client/galaxy/scripts/mvc/ui/ui-tabs.js @@ -2,7 +2,7 @@ * Renders tabs e.g. used in the charts editor, behaves similar to repeat and section rendering */ import $ from "jquery"; -import * as Backbone from "backbone"; +import Backbone from "backbone"; export var View = Backbone.View.extend({ initialize: function(options) { diff --git a/client/galaxy/scripts/mvc/user/user-quotameter.js b/client/galaxy/scripts/mvc/user/user-quotameter.js index 1bf1bceed61f..1f8644ab6a82 100644 --- a/client/galaxy/scripts/mvc/user/user-quotameter.js +++ b/client/galaxy/scripts/mvc/user/user-quotameter.js @@ -1,6 +1,6 @@ import $ from "jquery"; -import * as Backbone from "backbone"; -import * as _ from "underscore"; +import Backbone from "backbone"; +import _ from "underscore"; import baseMVC from "mvc/base-mvc"; import _l from "utils/localization"; diff --git a/client/galaxy/scripts/mvc/visualization/chart/components/model.js b/client/galaxy/scripts/mvc/visualization/chart/components/model.js index 0adb2057d5c4..43e7e1269208 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/components/model.js +++ b/client/galaxy/scripts/mvc/visualization/chart/components/model.js @@ -1,4 +1,4 @@ -import * as Backbone from "backbone"; +import Backbone from "backbone"; import Utils from "utils/utils"; import { Visualization } from "mvc/visualization/visualization-model"; export default Backbone.Model.extend({ diff --git a/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js b/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js index 69f4b5ceb368..117d7fdc24d6 100644 --- a/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js +++ b/client/galaxy/scripts/mvc/visualization/chart/utilities/series.js @@ -1,4 +1,4 @@ -import * as _ from "underscore"; +import _ from "underscore"; import * as d3 from "d3"; /** Get domain boundaries value */ diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view-node.js b/client/galaxy/scripts/mvc/workflow/workflow-view-node.js index 2ec8b0202d81..b5dc65a05960 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view-node.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view-node.js @@ -1,5 +1,5 @@ import $ from "jquery"; -import * as _ from "libs/underscore"; +import _ from "libs/underscore"; import Backbone from "backbone"; import TerminalViews from "mvc/workflow/workflow-view-terminals"; import DataViews from "mvc/workflow/workflow-view-data"; diff --git a/client/galaxy/scripts/ui/fa-icon-button.js b/client/galaxy/scripts/ui/fa-icon-button.js index a08adcc87410..492c427c601f 100644 --- a/client/galaxy/scripts/ui/fa-icon-button.js +++ b/client/galaxy/scripts/ui/fa-icon-button.js @@ -1,5 +1,5 @@ import jQuery from "jquery"; -import * as _ from "underscore"; +import _ from "underscore"; var $ = jQuery; //============================================================================ diff --git a/client/galaxy/scripts/viz/trackster/filters.js b/client/galaxy/scripts/viz/trackster/filters.js index 3abc219a9838..80664817b883 100644 --- a/client/galaxy/scripts/viz/trackster/filters.js +++ b/client/galaxy/scripts/viz/trackster/filters.js @@ -1,5 +1,5 @@ import _l from "utils/localization"; -import * as _ from "libs/underscore"; +import _ from "libs/underscore"; var extend = _.extend; /** diff --git a/client/galaxy/scripts/viz/trackster/painters.js b/client/galaxy/scripts/viz/trackster/painters.js index 7e10407fe5ff..b3687502d694 100644 --- a/client/galaxy/scripts/viz/trackster/painters.js +++ b/client/galaxy/scripts/viz/trackster/painters.js @@ -1,4 +1,4 @@ -import * as _ from "libs/underscore"; +import _ from "libs/underscore"; // Constants specific to feature tracks moved here (HACKING, these should // basically all be configuration options) const BEFORE = 1001; diff --git a/client/galaxy/scripts/viz/trackster/slotting.js b/client/galaxy/scripts/viz/trackster/slotting.js index c4b4095ce934..cff791d64d04 100644 --- a/client/galaxy/scripts/viz/trackster/slotting.js +++ b/client/galaxy/scripts/viz/trackster/slotting.js @@ -1,4 +1,4 @@ -import * as _ from "libs/underscore"; +import _ from "libs/underscore"; var extend = _.extend; // HACK: LABEL_SPACING is currently duplicated between here and painters From 140d53f56477feeac1368cd662e4e13e4f8b0dcd Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 14:46:06 -0500 Subject: [PATCH 50/88] Enable vue linting and include verything but galaxy/scripts/libs --- client/.eslintignore | 1 + client/.eslintrc.js | 13 +++++++------ client/package.json | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 client/.eslintignore diff --git a/client/.eslintignore b/client/.eslintignore new file mode 100644 index 000000000000..4aa3f1036aeb --- /dev/null +++ b/client/.eslintignore @@ -0,0 +1 @@ +galaxy/scripts/libs diff --git a/client/.eslintrc.js b/client/.eslintrc.js index 0cb2bc45aa20..5b5c90440a8c 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -7,12 +7,13 @@ module.exports = { plugins: ["html"], rules: { "no-console": "off", - "no-unused-vars": ["error", {args: "none"}] - // "camelcase": [ - // "error", - // { - // "properties": "never" - // } + "no-unused-vars": ["error", { args: "none" }], + // I'd love to turn on camelcase, but it's a big shift with tons of current errors. + // camelcase: [ + // "error", + // { + // properties: "always" + // } // ] } }; diff --git a/client/package.json b/client/package.json index c3f3e4e86c96..3b674e4dc5fe 100644 --- a/client/package.json +++ b/client/package.json @@ -72,7 +72,7 @@ "test-qunit": "GALAXY_TEST_AS_SINGLE_PACK=true karma start karma/karma.config.qunit.js", "test-mocha": "GALAXY_TEST_AS_SINGLE_PACK=true karma start karma/karma.config.mocha.js", "jshint": "jshint --exclude='galaxy/scripts/libs/**' galaxy/scripts/**/*.js", - "eslint": "eslint -c .eslintrc.js galaxy/scripts/mvc" + "eslint": "eslint -c .eslintrc.js --ignore-path .eslintignore galaxy/scripts --ext .js,.vue" }, "devDependencies": { "babel-loader": "^8.0.4", From 62a65c448266ffae47ec72da087861bdbe14d433 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 10 Jan 2019 15:30:45 -0500 Subject: [PATCH 51/88] Fix most of the non-vue-specific linting issues in components --- client/galaxy/scripts/components/Citations.vue | 1 + client/galaxy/scripts/components/DataDialog.vue | 2 ++ client/galaxy/scripts/components/DisplayStructured.vue | 3 +++ client/galaxy/scripts/components/HistoryView.vue | 3 +++ client/galaxy/scripts/components/PluginList.vue | 1 + client/galaxy/scripts/components/RuleCollectionBuilder.vue | 3 ++- client/galaxy/scripts/components/RulesDisplay.vue | 1 - client/galaxy/scripts/components/Sharing.vue | 1 + 8 files changed, 13 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/components/Citations.vue b/client/galaxy/scripts/components/Citations.vue index aac7d1260844..162a6051794f 100644 --- a/client/galaxy/scripts/components/Citations.vue +++ b/client/galaxy/scripts/components/Citations.vue @@ -27,6 +27,7 @@ - + From 7b97bd3e1b97d02be8288bae0767ebbcde2c188e Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Jan 2019 19:34:08 -0500 Subject: [PATCH 76/88] Test specifying node version in travis config --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4e5b62275419..d56ce6449c0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,9 @@ matrix: language: generic env: TOX_ENV=py27-first_startup - env: TOX_ENV=eslint + language: node_js + node_js: + - 10 before_install: # Workaround for https://github.com/travis-ci/travis-ci/issues/7940 From 588e2d7460c74a103a8075a93fdfe6aab4d71ad5 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Jan 2019 20:24:22 -0500 Subject: [PATCH 77/88] Test building without tox --- .travis.yml | 61 +++++++++++++++++++++++++++++------------------------ tox.ini | 6 +----- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index d56ce6449c0c..40f4afb02437 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,36 +12,41 @@ env: matrix: include: - - env: TOX_ENV=qunit - addons: - chrome: stable - - env: TOX_ENV=py34-first_startup - addons: - &py3_addons - apt: - packages: - # For psutil, pyyaml, uwsgi... - - libpython3.4-dev - - env: TOX_ENV=validate_test_tools - addons: - apt: - packages: - - libxml2-utils - - env: TOX_ENV=check_py3_compatibility - addons: - apt: - packages: - - ack-grep - - env: TOX_ENV=py34-unit - addons: *py3_addons - - os: osx - # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 - language: generic - env: TOX_ENV=py27-first_startup - - env: TOX_ENV=eslint - language: node_js + #- env: TOX_ENV=qunit + # addons: + # chrome: stable + #- env: TOX_ENV=py34-first_startup + # addons: + # &py3_addons + # apt: + # packages: + # # For psutil, pyyaml, uwsgi... + # - libpython3.4-dev + #- env: TOX_ENV=validate_test_tools + # addons: + # apt: + # packages: + # - libxml2-utils + #- env: TOX_ENV=check_py3_compatibility + # addons: + # apt: + # packages: + # - ack-grep + #- env: TOX_ENV=py34-unit + # addons: *py3_addons + #- os: osx + # # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 + # language: generic + # env: TOX_ENV=py27-first_startup + - language: node_js node_js: - 10 + before_install: + - cd client + install: + - yarn + script: + - yarn run eslint before_install: # Workaround for https://github.com/travis-ci/travis-ci/issues/7940 diff --git a/tox.ini b/tox.ini index 4511bd26814f..03d5632475c3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # envlist is the list of environments that are tested when `tox` is run without any option # hyphens in an environment name are used to delimit factors -envlist = check_py3_compatibility, eslint, py27-first_startup, py27-lint, py27-lint_docstring_include_list, py27-unit, py34-first_startup, py34-lint, py34-unit, qunit, validate_test_tools +envlist = check_py3_compatibility, py27-first_startup, py27-lint, py27-lint_docstring_include_list, py27-unit, py34-first_startup, py34-lint, py34-unit, qunit, validate_test_tools skipsdist = True [testenv:check_py3_compatibility] @@ -75,10 +75,6 @@ deps = -rlib/galaxy/dependencies/pipfiles/flake8/pinned-requirements.txt commands = make client-test whitelist_externals = make -[testenv:eslint] -commands = make client-eslint -whitelist_externals = make - [testenv:validate_test_tools] commands = bash .ci/validate_test_tools.sh whitelist_externals = bash From 61774f5126c9eab5e3fe42e3b1cde1d12e5bf1b0 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Jan 2019 20:34:48 -0500 Subject: [PATCH 78/88] re-enable full matrix, overhaul qunit/lint implementations. --- .travis.yml | 59 +++++++++++++++++++++++++++++------------------------ Makefile | 5 +++-- tox.ini | 6 +----- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40f4afb02437..87d364a59fee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,38 +6,43 @@ env: - TOX_ENV=py34-lint - TOX_ENV=py27-lint - TOX_ENV=py27-unit - - TOX_ENV=qunit - TOX_ENV=py27-first_startup - TOX_ENV=py27-lint_docstring_include_list matrix: include: - #- env: TOX_ENV=qunit - # addons: - # chrome: stable - #- env: TOX_ENV=py34-first_startup - # addons: - # &py3_addons - # apt: - # packages: - # # For psutil, pyyaml, uwsgi... - # - libpython3.4-dev - #- env: TOX_ENV=validate_test_tools - # addons: - # apt: - # packages: - # - libxml2-utils - #- env: TOX_ENV=check_py3_compatibility - # addons: - # apt: - # packages: - # - ack-grep - #- env: TOX_ENV=py34-unit - # addons: *py3_addons - #- os: osx - # # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 - # language: generic - # env: TOX_ENV=py27-first_startup + - env: TOX_ENV=py34-first_startup + addons: + &py3_addons + apt: + packages: + # For psutil, pyyaml, uwsgi... + - libpython3.4-dev + - env: TOX_ENV=validate_test_tools + addons: + apt: + packages: + - libxml2-utils + - env: TOX_ENV=check_py3_compatibility + addons: + apt: + packages: + - ack-grep + - env: TOX_ENV=py34-unit + addons: *py3_addons + - os: osx + # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 + language: generic + env: TOX_ENV=py27-first_startup + - language: node_js + node_js: + - 10 + before_install: + - cd client + install: + - yarn + script: + - yarn run test - language: node_js node_js: - 10 diff --git a/Makefile b/Makefile index ecec0a001806..a6f046cb2119 100644 --- a/Makefile +++ b/Makefile @@ -166,9 +166,10 @@ _client-test-mocha: ## Run mocha tests via karma _client-test-qunit: ## Run qunit tests via karma cd client && yarn run test-qunit -client-test: client _client-test-mocha _client-test-qunit ## Run JS unit tests via Karma +client-test: node-deps ## Run JS unit tests via Karma + cd client && yarn run test -client-eslint: node-deps ## Run client linting +client-eslint: node-deps ## Run client linting cd client && yarn run eslint client-test-watch: client ## Watch and run qunit tests on changes via Karma diff --git a/tox.ini b/tox.ini index 03d5632475c3..6dcf0416f175 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # envlist is the list of environments that are tested when `tox` is run without any option # hyphens in an environment name are used to delimit factors -envlist = check_py3_compatibility, py27-first_startup, py27-lint, py27-lint_docstring_include_list, py27-unit, py34-first_startup, py34-lint, py34-unit, qunit, validate_test_tools +envlist = check_py3_compatibility, py27-first_startup, py27-lint, py27-lint_docstring_include_list, py27-unit, py34-first_startup, py34-lint, py34-unit, validate_test_tools skipsdist = True [testenv:check_py3_compatibility] @@ -71,10 +71,6 @@ commands = bash .ci/flake8_wrapper.sh whitelist_externals = bash deps = -rlib/galaxy/dependencies/pipfiles/flake8/pinned-requirements.txt -[testenv:qunit] -commands = make client-test -whitelist_externals = make - [testenv:validate_test_tools] commands = bash .ci/validate_test_tools.sh whitelist_externals = bash From b8347c0fb1729500002dfa272758ac62d8f2c3d0 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Jan 2019 20:50:15 -0500 Subject: [PATCH 79/88] Test adding a qunit js env --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87d364a59fee..bfc948ad5321 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - TOX_ENV=py27-unit - TOX_ENV=py27-first_startup - TOX_ENV=py27-lint_docstring_include_list + - js matrix: include: @@ -34,7 +35,8 @@ matrix: # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 language: generic env: TOX_ENV=py27-first_startup - - language: node_js + - env: js + language: node_js node_js: - 10 before_install: @@ -43,7 +45,8 @@ matrix: - yarn script: - yarn run test - - language: node_js + - env: js + language: node_js node_js: - 10 before_install: From 19af921845050d708a1bcc56882fa77cd2a1dc1e Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Jan 2019 20:55:38 -0500 Subject: [PATCH 80/88] DRop js primary env, use specific defs in matrix --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bfc948ad5321..8c0df7a5d741 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ env: - TOX_ENV=py27-unit - TOX_ENV=py27-first_startup - TOX_ENV=py27-lint_docstring_include_list - - js matrix: include: From 4986f62a8d14601c1eafb584a766e99180ca7577 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Jan 2019 21:20:14 -0500 Subject: [PATCH 81/88] qunit actually needs a build, because of base.css... (we should really fix this, should not be required) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8c0df7a5d741..03456916e4c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ matrix: - cd client install: - yarn + - yarn run build script: - yarn run test - env: js From 2025eab2184750611338600a1f22828b15847707 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Jan 2019 09:08:02 -0500 Subject: [PATCH 82/88] Use 'name' in the travis build matrix instead of env for javascript jobs --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03456916e4c1..6df141f0223a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ matrix: # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 language: generic env: TOX_ENV=py27-first_startup - - env: js + - name: js language: node_js node_js: - 10 @@ -45,7 +45,7 @@ matrix: - yarn run build script: - yarn run test - - env: js + - name: js language: node_js node_js: - 10 From 9ddcba91be81fcb7265c6fd449d4dc2a2825d647 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Jan 2019 09:09:07 -0500 Subject: [PATCH 83/88] Drop internal client-test-* makefile targets --- Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Makefile b/Makefile index a6f046cb2119..7d19740f0e50 100644 --- a/Makefile +++ b/Makefile @@ -160,12 +160,6 @@ client-format: node-deps ## Reformat client code client-watch: node-deps ## A useful target for parallel development building. cd client && yarn run watch -_client-test-mocha: ## Run mocha tests via karma - cd client && yarn run test-mocha - -_client-test-qunit: ## Run qunit tests via karma - cd client && yarn run test-qunit - client-test: node-deps ## Run JS unit tests via Karma cd client && yarn run test From b50e87ff2888ecac672740b0f68216ab8245736b Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Jan 2019 09:13:54 -0500 Subject: [PATCH 84/88] Better names for js travis jobs --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6df141f0223a..e69c5abc1053 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ matrix: # No version of Python is available via virtualenv on OS X workers, see https://github.com/travis-ci/travis-ci/issues/2312 language: generic env: TOX_ENV=py27-first_startup - - name: js + - name: js-unit language: node_js node_js: - 10 @@ -45,7 +45,7 @@ matrix: - yarn run build script: - yarn run test - - name: js + - name: js-lint language: node_js node_js: - 10 From 92323e05d64f6d50caa6ca57f6061ba387d77017 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Jan 2019 10:48:03 -0500 Subject: [PATCH 85/88] Document eslint exception, create issue for trackster filter/group functionality not working. --- client/galaxy/scripts/viz/trackster/filters.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/galaxy/scripts/viz/trackster/filters.js b/client/galaxy/scripts/viz/trackster/filters.js index adaa6bf34876..a3e0e6c71f2e 100644 --- a/client/galaxy/scripts/viz/trackster/filters.js +++ b/client/galaxy/scripts/viz/trackster/filters.js @@ -656,6 +656,8 @@ _.extend(FiltersManager.prototype, { filters = filters.slice(1); // DBTODO: This will never work, run_tool_url doesn't exist? + // https://github.com/galaxyproject/galaxy/issues/7224 + // eslint-disable-next-line no-undef $.getJSON(run_tool_url, url_params, response => { let Galaxy = getGalaxyInstance(); if (response.error) { From a482c5ce4cd70b208f07e79eb0f5c08ec1e67292 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Jan 2019 11:31:15 -0500 Subject: [PATCH 86/88] Swap hotData() from a computed property to a method, since it has side effects. see https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-side-effects-in-computed-properties.md and https://vuejs.org/v2/guide/computed.html#Computed-Caching-vs-Methods --- .../components/RuleCollectionBuilder.vue | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/client/galaxy/scripts/components/RuleCollectionBuilder.vue b/client/galaxy/scripts/components/RuleCollectionBuilder.vue index b07faa09b274..7136d150a548 100644 --- a/client/galaxy/scripts/components/RuleCollectionBuilder.vue +++ b/client/galaxy/scripts/components/RuleCollectionBuilder.vue @@ -1256,43 +1256,6 @@ export default { } return targets; }, - hotData() { - let data, sources, columns; - if ( - this.elementsType == "datasets" || - this.elementsType == "library_datasets" || - this.elementsType == "ftp" - ) { - data = this.initialElements.map(el => []); - sources = this.initialElements.slice(); - columns = []; - } else if (this.elementsType == "collection_contents") { - const collection = this.initialElements; - if (collection) { - const obj = this.populateElementsFromCollectionDescription( - collection.elements, - collection.collection_type - ); - data = obj.data; - sources = obj.sources; - columns = []; - } else { - data = []; - sources = []; - columns = []; - } - } else { - data = this.initialElements.slice(); - sources = data.map(el => null); - columns = []; - if (this.initialElements) { - this.initialElements[0].forEach(() => columns.push("new")); - } - } - - this.colHeadersPerRule = []; - return RuleDefs.applyRules(data, sources, columns, this.rules, this.colHeadersPerRule); - }, colHeaders() { const data = this.hotData["data"]; const columns = this.hotData["columns"]; @@ -1449,6 +1412,42 @@ export default { this.rules.push(rule); } }, + hotData() { + let data, sources, columns; + if ( + this.elementsType == "datasets" || + this.elementsType == "library_datasets" || + this.elementsType == "ftp" + ) { + data = this.initialElements.map(el => []); + sources = this.initialElements.slice(); + columns = []; + } else if (this.elementsType == "collection_contents") { + const collection = this.initialElements; + if (collection) { + const obj = this.populateElementsFromCollectionDescription( + collection.elements, + collection.collection_type + ); + data = obj.data; + sources = obj.sources; + columns = []; + } else { + data = []; + sources = []; + columns = []; + } + } else { + data = this.initialElements.slice(); + sources = data.map(el => null); + columns = []; + if (this.initialElements) { + this.initialElements[0].forEach(() => columns.push("new")); + } + } + this.colHeadersPerRule = []; + return RuleDefs.applyRules(data, sources, columns, this.rules, this.colHeadersPerRule); + }, viewSource() { this.resetSource(); this.ruleView = "source"; From 42be5b61f2bf67a579cc1841630328e6244003fe Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 17 Jan 2019 09:21:51 -0500 Subject: [PATCH 87/88] Add galaxycloudrunner as a conditional dependency. --- lib/galaxy/dependencies/__init__.py | 9 +++++++++ lib/galaxy/dependencies/conditional-requirements.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/lib/galaxy/dependencies/__init__.py b/lib/galaxy/dependencies/__init__.py index 11793f875b55..cedefa820e02 100644 --- a/lib/galaxy/dependencies/__init__.py +++ b/lib/galaxy/dependencies/__init__.py @@ -26,6 +26,7 @@ def __init__(self, config_file): self.object_stores = [] self.conditional_reqs = [] self.container_interface_types = [] + self.dynamic_destination_plugins = [] self.parse_configs() self.get_conditional_requirements() @@ -40,6 +41,11 @@ def parse_configs(self): self.job_runners.append(plugin.attrib['load']) except (OSError, IOError): pass + try: + for plugin in ElementTree.parse(job_conf_xml).findall('.//destination/param[@id="rules_module"]'): + self.dynamic_destination_plugins.append(plugin.text) + except (OSError, IOError): + pass object_store_conf_xml = self.config.get( "object_store_config_file", join(dirname(self.config_file), 'object_store_conf.xml')) @@ -92,6 +98,9 @@ def check_drmaa(self): "galaxy.jobs.runners.slurm:SlurmJobRunner" in self.job_runners or "galaxy.jobs.runners.drmaauniva:DRMAAUnivaJobRunner" in self.job_runners) + def check_galaxycloudrunner(self): + return ("galaxycloudrunner.rules" in self.dynamic_destination_plugins) + def check_pbs_python(self): return "galaxy.jobs.runners.pbs:PBSJobRunner" in self.job_runners diff --git a/lib/galaxy/dependencies/conditional-requirements.txt b/lib/galaxy/dependencies/conditional-requirements.txt index 77adc49c4ccc..92765c5d8679 100644 --- a/lib/galaxy/dependencies/conditional-requirements.txt +++ b/lib/galaxy/dependencies/conditional-requirements.txt @@ -14,6 +14,7 @@ azure-storage==0.32.0 python-ldap==2.4.44 python-pam cloudbridge==1.0.1 +galaxycloudrunner # Chronos client chronos-python==0.38.0 From c14c358ce23ae90b2e51c01802296d0a987e0295 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 17 Jan 2019 09:36:11 -0500 Subject: [PATCH 88/88] Rename dynamic_destination_plugins to job_rule_modules --- lib/galaxy/dependencies/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/dependencies/__init__.py b/lib/galaxy/dependencies/__init__.py index cedefa820e02..953aac5bf7d6 100644 --- a/lib/galaxy/dependencies/__init__.py +++ b/lib/galaxy/dependencies/__init__.py @@ -26,7 +26,7 @@ def __init__(self, config_file): self.object_stores = [] self.conditional_reqs = [] self.container_interface_types = [] - self.dynamic_destination_plugins = [] + self.job_rule_modules = [] self.parse_configs() self.get_conditional_requirements() @@ -43,7 +43,7 @@ def parse_configs(self): pass try: for plugin in ElementTree.parse(job_conf_xml).findall('.//destination/param[@id="rules_module"]'): - self.dynamic_destination_plugins.append(plugin.text) + self.job_rule_modules.append(plugin.text) except (OSError, IOError): pass object_store_conf_xml = self.config.get( @@ -99,7 +99,7 @@ def check_drmaa(self): "galaxy.jobs.runners.drmaauniva:DRMAAUnivaJobRunner" in self.job_runners) def check_galaxycloudrunner(self): - return ("galaxycloudrunner.rules" in self.dynamic_destination_plugins) + return ("galaxycloudrunner.rules" in self.job_rule_modules) def check_pbs_python(self): return "galaxy.jobs.runners.pbs:PBSJobRunner" in self.job_runners