diff --git a/.ci/flake8_blacklist.txt b/.ci/flake8_blacklist.txt index 33db66f40a0..26ece30af32 100644 --- a/.ci/flake8_blacklist.txt +++ b/.ci/flake8_blacklist.txt @@ -2,6 +2,10 @@ .tox .venv .venv3 +packages/*/.venv +packages/*/build +packages/*/dist +packages/venv node_modules database doc/build diff --git a/.ci/jenkins/selenium-compose/Dockerfile b/.ci/jenkins/selenium-compose/Dockerfile index a453ac6d215..d9f3def9761 100644 --- a/.ci/jenkins/selenium-compose/Dockerfile +++ b/.ci/jenkins/selenium-compose/Dockerfile @@ -1,5 +1,5 @@ FROM toolshed/requirements -MAINTAINER John Chilton, jmchilton@gmail.com +LABEL maintainer="John Chilton " RUN apt-get -qq update && \ apt-get install --no-install-recommends -y postgresql-client python-pip libffi-dev python-cffi && \ diff --git a/client/galaxy/scripts/admin.toolshed.js b/client/galaxy/scripts/admin.toolshed.js index 31cdba78fae..04182abfda5 100644 --- a/client/galaxy/scripts/admin.toolshed.js +++ b/client/galaxy/scripts/admin.toolshed.js @@ -9,19 +9,6 @@ import mod_repo_status_view from "mvc/toolshed/repo-status-view"; import mod_workflows_view from "mvc/toolshed/workflows-view"; var AdminToolshedRouter = Backbone.Router.extend({ - initialize: function() { - this.routesHit = 0; - // keep count of number of routes handled by the application - Backbone.history.on( - "route", - function() { - this.routesHit++; - }, - this - ); - this.bind("route", this.trackPageview); - }, - routes: { "": "toolsheds", sheds: "toolsheds", @@ -32,20 +19,6 @@ var AdminToolshedRouter = Backbone.Router.extend({ "categories/s/:tool_shed": "categories", "category/s/:tool_shed/c/:category_id/k/:sort_key/p/:page/t/:sort_order": "repositories", "repository/s/:tool_shed/r/:repository_id": "repository" - }, - - /** - * If more than one route has been hit the user did not land on current - * page directly so we can go back safely. Otherwise go to the home page. - * Use replaceState if available so the navigation doesn't create an - * extra history entry - */ - back: function() { - if (this.routesHit > 1) { - window.history.back(); - } else { - this.navigate("#", { trigger: true, replace: true }); - } } }); diff --git a/client/galaxy/scripts/components/JobMetrics/JobMetrics.vue b/client/galaxy/scripts/components/JobMetrics/JobMetrics.vue index 67fcd9c829e..039e3c9a9f9 100644 --- a/client/galaxy/scripts/components/JobMetrics/JobMetrics.vue +++ b/client/galaxy/scripts/components/JobMetrics/JobMetrics.vue @@ -16,8 +16,8 @@ diff --git a/client/galaxy/scripts/components/JobMetrics/mount.js b/client/galaxy/scripts/components/JobMetrics/mount.js index 52206d987fe..04b1bfe0c57 100644 --- a/client/galaxy/scripts/components/JobMetrics/mount.js +++ b/client/galaxy/scripts/components/JobMetrics/mount.js @@ -2,18 +2,17 @@ * Endpoint for mounting job metrics from non-Vue environment. */ import $ from "jquery"; -import Vue from "vue"; import JobMetrics from "./JobMetrics.vue"; +import { mountVueComponent } from "utils/mountVueComponent"; export const mountJobMetrics = (propsData = {}) => { $(".job-metrics").each((index, el) => { const jobId = $(el).attr("job_id"); const datasetId = $(el).attr("dataset_id"); const datasetType = $(el).attr("dataset_type") || "hda"; - const component = Vue.extend(JobMetrics); propsData.jobId = jobId; propsData.datasetId = datasetId; propsData.datasetType = datasetType; - return new component({ propsData: propsData }).$mount(el); + mountVueComponent(JobMetrics)(propsData, el); }); }; diff --git a/client/galaxy/scripts/mvc/history/multi-panel.js b/client/galaxy/scripts/mvc/history/multi-panel.js index 6b5d664d5cd..104bcbab12e 100644 --- a/client/galaxy/scripts/mvc/history/multi-panel.js +++ b/client/galaxy/scripts/mvc/history/multi-panel.js @@ -756,7 +756,6 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ "click .order .set-order": "_chooseOrder", "click #toggle-deleted": "_clickToggleDeletedDatasets", "click #toggle-hidden": "_clickToggleHiddenDatasets" - //'dragstart .list-item .title-bar' : function( e ){ console.debug( 'ok' ); } }, close: function(ev) { @@ -768,6 +767,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ this.toggleDeletedHistories($(ev.currentTarget).is(":checked")); this.toggleOptionsPopover(); }, + /** Include deleted histories in the collection */ toggleDeletedHistories: function(show) { if (show) { @@ -835,7 +835,19 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ /** Set up any view plugins */ setUpBehaviors: function() { this._moreOptionsPopover(); - + const searchHistories = searchFor => { + const multipanel = this; + this.historySearch = searchFor; + this.filters = [ + function() { + // This is intentionally a function where 'this' gets + // bound, applying the filter to the model of the + // caller. + return this.model.matchesAll(multipanel.historySearch); + } + ]; + this.renderColumns(0); + }; // input to search histories this.$("#search-histories").searchInput({ name: "search-histories", @@ -847,17 +859,11 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({ this.collection.fetchAll().done(() => { this.$("#search-histories").searchInput("toggle-loading"); this.renderInfo(""); + searchHistories(searchFor); }); }, - onsearch: searchFor => { - this.historySearch = searchFor; - this.filters = [ - () => { - return this.model.matchesAll(this.historySearch); - } - ]; - this.renderColumns(0); - }, + + onsearch: searchHistories, onclear: searchFor => { this.historySearch = null; //TODO: remove specifically not just reset diff --git a/client/galaxy/scripts/mvc/tool/tool-form.js b/client/galaxy/scripts/mvc/tool/tool-form.js index 9ebde5ebcc5..f36fa0bf8e3 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form.js +++ b/client/galaxy/scripts/mvc/tool/tool-form.js @@ -14,23 +14,22 @@ import Webhooks from "mvc/webhooks"; import Vue from "vue"; import ToolEntryPoints from "components/ToolEntryPoints/ToolEntryPoints"; -var View = Backbone.View.extend({ +const View = Backbone.View.extend({ initialize: function(options) { const Galaxy = getGalaxyInstance(); - const self = this; this.modal = Galaxy.modal || new Modal.View(); this.form = new ToolFormBase( Utils.merge( { listen_to_history: true, always_refresh: false, - buildmodel: function(process, form) { - var options = form.model.attributes; + buildmodel: (process, form) => { + const options = form.model.attributes; // build request url - var build_url = ""; - var build_data = {}; - var job_id = options.job_id; + let build_url = ""; + let build_data = {}; + const job_id = options.job_id; if (job_id) { build_url = `${getAppRoot()}api/jobs/${job_id}/build_for_rerun`; } else { @@ -44,18 +43,18 @@ var View = Backbone.View.extend({ Utils.get({ url: build_url, data: build_data, - success: function(data) { + success: data => { if (!data.display) { window.location = getAppRoot(); return; } form.model.set(data); - self._customize(form); + this._customize(form); Galaxy.emit.debug("tool-form-base::_buildModel()", "Initial tool model ready.", data); process.resolve(); }, - error: function(response, status) { - var error_message = (response && response.err_msg) || "Uncaught error."; + error: (response, status) => { + const error_message = (response && response.err_msg) || "Uncaught error."; if (status == 401) { window.location = `${getAppRoot()}user/login?${$.param({ redirect: `${getAppRoot()}?tool_id=${options.id}` @@ -74,7 +73,7 @@ var View = Backbone.View.extend({ title: _l("Tool request failed"), body: error_message, buttons: { - Close: function() { + Close: () => { Galaxy.modal.hide(); } } @@ -89,8 +88,8 @@ var View = Backbone.View.extend({ } }); }, - postchange: function(process, form) { - var current_state = { + postchange: (process, form) => { + const current_state = { tool_id: form.model.get("id"), tool_version: form.model.get("version"), inputs: $.extend(true, {}, form.data.create()) @@ -101,13 +100,13 @@ var View = Backbone.View.extend({ type: "POST", url: `${getAppRoot()}api/tools/${form.model.get("id")}/build`, data: current_state, - success: function(data) { + success: data => { form.update(data); form.wait(false); Galaxy.emit.debug("tool-form::postchange()", "Received new model.", data); process.resolve(); }, - error: function(response) { + error: response => { Galaxy.emit.debug("tool-form::postchange()", "Refresh request failed.", response); process.reject(); } @@ -123,19 +122,18 @@ var View = Backbone.View.extend({ }, _customize: function(form) { - var self = this; - var options = form.model.attributes; + const options = form.model.attributes; // build execute button - var execute_button = new Ui.Button({ + const execute_button = new Ui.Button({ icon: "fa-check", tooltip: `Execute: ${options.name} (${options.version})`, title: _l("Execute"), cls: "btn btn-primary", wait_cls: "btn btn-info", - onclick: function() { + onclick: () => { execute_button.wait(); form.portlet.disable(); - self.submit(options, () => { + this.submit(options, () => { execute_button.unwait(); form.portlet.enable(); }); @@ -145,7 +143,7 @@ var View = Backbone.View.extend({ // remap feature if (options.job_id && options.job_remap) { - var label, help; + let label, help; if (options.job_remap === "job_produced_collection_elements") { label = "Replace elements in collection ?"; help = @@ -169,11 +167,11 @@ var View = Backbone.View.extend({ // Job Re-use Options const Galaxy = getGalaxyInstance(); - var extra_user_preferences = {}; + let extra_user_preferences = {}; if (Galaxy.user.attributes.preferences && "extra_user_preferences" in Galaxy.user.attributes.preferences) { extra_user_preferences = JSON.parse(Galaxy.user.attributes.preferences.extra_user_preferences); } - var use_cached_job = + const use_cached_job = "use_cached_job|use_cached_job_checkbox" in extra_user_preferences ? extra_user_preferences["use_cached_job|use_cached_job_checkbox"] : false; @@ -198,7 +196,6 @@ var View = Backbone.View.extend({ submit: function(options, callback) { const Galaxy = getGalaxyInstance(); const history_id = Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model.id; - const self = this; const job_def = { history_id: history_id, tool_id: options.id, @@ -206,7 +203,7 @@ var View = Backbone.View.extend({ inputs: this.form.data.create() }; this.form.trigger("reset"); - if (!self.validate(job_def)) { + if (!this.validate(job_def)) { Galaxy.emit.debug("tool-form::submit()", "Submission canceled. Validation failed."); callback && callback(); return; @@ -232,14 +229,14 @@ var View = Backbone.View.extend({ type: "POST", url: `${getAppRoot()}api/tools`, data: job_def, - success: function(response) { + success: response => { callback && callback(); - self.$el.children().hide(); + this.$el.children().hide(); if (response.produces_entry_points) { for (const job of response.jobs) { const toolEntryPointsInstance = Vue.extend(ToolEntryPoints); const vm = document.createElement("div"); - self.$el.append(vm); + this.$el.append(vm); const instance = new toolEntryPointsInstance({ propsData: { jobId: job.id @@ -248,39 +245,40 @@ var View = Backbone.View.extend({ instance.$mount(vm); } } - self.$el.append(self._templateSuccess(response, job_def)); + this.$el.append(this._templateSuccess(response, job_def)); + this.$el.parent().scrollTop(0); // Show Webhook if job is running if (response.jobs && response.jobs.length > 0) { - self.$el.append($("
", { id: "webhook-view" })); + this.$el.append($("
", { id: "webhook-view" })); new Webhooks.WebhookView({ type: "tool", toolId: job_def.tool_id }); } if (Galaxy.currHistoryPanel) { - self.form.stopListening(Galaxy.currHistoryPanel.collection); + this.form.stopListening(Galaxy.currHistoryPanel.collection); Galaxy.currHistoryPanel.refreshContents(); } }, - error: function(response) { + error: response => { callback && callback(); Galaxy.emit.debug("tool-form::submit", "Submission failed.", response); let input_found = false; if (response && response.err_data) { - const error_messages = self.form.data.matchResponse(response.err_data); + const error_messages = this.form.data.matchResponse(response.err_data); for (const input_id in error_messages) { - self.form.highlight(input_id, error_messages[input_id]); + this.form.highlight(input_id, error_messages[input_id]); input_found = true; break; } } if (!input_found) { - self.modal.show({ + this.modal.show({ title: _l("Job submission failed"), - body: self._templateError(job_def, response && response.err_msg), + body: this._templateError(job_def, response && response.err_msg), buttons: { - Close: function() { - self.modal.hide(); + Close: () => { + this.modal.hide(); } } }); @@ -294,14 +292,14 @@ var View = Backbone.View.extend({ */ validate: function(job_def) { const Galaxy = getGalaxyInstance(); - var job_inputs = job_def.inputs; - var batch_n = -1; - var batch_src = null; - for (var job_input_id in job_inputs) { - var input_value = job_inputs[job_input_id]; - var input_id = this.form.data.match(job_input_id); - var input_field = this.form.field_list[input_id]; - var input_def = this.form.input_list[input_id]; + const job_inputs = job_def.inputs; + let batch_n = -1; + let batch_src = null; + for (const job_input_id in job_inputs) { + const input_value = job_inputs[job_input_id]; + const input_id = this.form.data.match(job_input_id); + const input_field = this.form.field_list[input_id]; + const input_def = this.form.input_list[input_id]; if (!input_id || !input_def || !input_field) { Galaxy.emit.debug("tool-form::validate()", "Retrieving input objects failed."); continue; @@ -318,8 +316,8 @@ var View = Backbone.View.extend({ } } if (input_value && input_value.batch) { - var n = input_value.values.length; - var src = n > 0 && input_value.values[0] && input_value.values[0].src; + const n = input_value.values.length; + const src = n > 0 && input_value.values[0] && input_value.values[0].src; if (src) { if (batch_src === null) { batch_src = src; @@ -346,8 +344,8 @@ var View = Backbone.View.extend({ }, _getInputs: function(job_def) { - var inputs = []; - var index = {}; + const inputs = []; + const index = {}; for (const i in job_def.inputs) { const input = job_def.inputs[i]; if (input && $.isArray(input.values)) { @@ -362,36 +360,33 @@ var View = Backbone.View.extend({ return inputs; }, - _templateRow: function(list, title, max = 3) { - var blurb = ""; - list.sort(function(a, b) { - return b.hid - a.hid; - }); + _templateRow: function(list, title) { + let blurb = ""; if (list.length > 0) { blurb += `

${title}:

`; + list.sort((a, b) => { + b.hid - a.hid; + }); + blurb += `
    `; for (const item of list) { - const rowString = max > 0 ? `${item.hid}: ${_.escape(item.name)}` : "..."; - blurb += `

    - ${rowString} -

    `; - if (max-- <= 0) { - break; - } + const rowString = `${item.hid}: ${_.escape(item.name)}`; + blurb += `
  • ${rowString}
  • `; } + blurb += `
`; } return blurb; }, _templateSuccess: function(response, job_def) { - var njobs = response && response.jobs ? response.jobs.length : 0; + const njobs = response && response.jobs ? response.jobs.length : 0; if (njobs > 0) { - var inputs = this._getInputs(job_def); - var ninputs = inputs.length; - var noutputs = response.outputs.length; - var njobsText = njobs > 1 ? `${njobs} jobs` : `1 job`; - var ninputsText = ninputs > 1 ? `${ninputs} inputs` : `this input`; - var noutputsText = noutputs > 1 ? `${noutputs} outputs` : `this output`; - var tool_name = this.form.model.get("name"); + const inputs = this._getInputs(job_def); + const ninputs = inputs.length; + const noutputs = response.outputs.length; + const njobsText = njobs > 1 ? `${njobs} jobs` : `1 job`; + const ninputsText = ninputs > 1 ? `${ninputs} inputs` : `this input`; + const noutputsText = noutputs > 1 ? `${noutputs} outputs` : `this output`; + const tool_name = this.form.model.get("name"); return `

Executed ${tool_name} and successfully added ${njobsText} to the queue. diff --git a/client/galaxy/scripts/mvc/toolshed/categories-view.js b/client/galaxy/scripts/mvc/toolshed/categories-view.js index f54d0375609..226da29c9bc 100644 --- a/client/galaxy/scripts/mvc/toolshed/categories-view.js +++ b/client/galaxy/scripts/mvc/toolshed/categories-view.js @@ -9,28 +9,23 @@ import "libs/jquery/jquery-ui"; var ToolShedCategories = Backbone.View.extend({ el: "#center", - defaults: { - tool_shed: "https://toolshed.g2.bx.psu.edu/" - }, - initialize: function(options) { - var shed = options.tool_shed.replace(/\//g, "%2f"); this.options = _.defaults(this.options || options, this.defaults); this.model = new toolshed_model.Categories(); - this.listenTo(this.model, "sync", this.render); this.model.url = `${this.model.url}?tool_shed_url=${this.options.tool_shed}`; - this.model.tool_shed = shed; + this.model.tool_shed = options.tool_shed.replace(/\//g, "%2f"); this.model.fetch(); + this.listenTo(this.model, "sync", this.render); }, render: function(options) { + const category_list_template = this.templateCategoryList(); this.options = _.extend(this.options, options); this.options.categories = this.model.models; this.options.queue = toolshed_util.queueLength(); - var category_list_template = this.templateCategoryList; this.$el.html(category_list_template(this.options)); - $("#center").css("overflow", "auto"); this.bindEvents(); + $("#center").css("overflow", "auto"); }, bindEvents: function() { @@ -60,44 +55,42 @@ var ToolShedCategories = Backbone.View.extend({ }); }, - templateCategoryList: _.template( - [ - '", - '

', - '
Categories in <%= tool_shed.replace(/%2f/g, "/") %>Repository Queue (<%= queue %>)
', - "
", - '
', - '", - '
', - '', - '', - "", - "", - "", - "", - "", - "", - "<% _.each(categories, function(category) { %>", - "", - "", - '', - '', - "", - "<% }); %>", - "
NameDescriptionRepositories
", - '/k/name/p/1/t/asc"><%= category.get("name") %>', - "<%= category.get("description") %><%= category.get("repositories") %>
", - "
", - "
" - ].join("") - ) + templateCategoryList: function() { + return _.template( + `
+
+

Categories in <%= tool_shed.replace(/%2f/g, '/') %>

+ Repository Queue (<%= queue %>) + +
+ +
+ + + + + + + + + <% _.each(categories, function(category) { %> + + + + + + <% }); %> +
NameDescriptionRepositories
+ /k/name/p/1/t/asc'><%= category.get('name') %> + <%= category.get('description') %><%= category.get('repositories') %>
+
+
` + ); + } }); export default { diff --git a/client/galaxy/scripts/mvc/toolshed/repo-status-view.js b/client/galaxy/scripts/mvc/toolshed/repo-status-view.js index 1b02292fcd3..ebdd99624b5 100644 --- a/client/galaxy/scripts/mvc/toolshed/repo-status-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repo-status-view.js @@ -38,7 +38,7 @@ var ToolShedRepoStatusView = Backbone.View.extend({ render: function(options) { this.options = _.extend(this.options, options); - var repo_status_template = this.templateRepoStatus; + var repo_status_template = this.templateRepoStatus(); this.$el.html( repo_status_template({ title: _l("Repository Status"), @@ -49,80 +49,82 @@ var ToolShedRepoStatusView = Backbone.View.extend({ $("#center").css("overflow", "auto"); }, - templateRepoStatus: _.template( - [ - '
', - '', - "
", - '", - '', - '', - "", - '', - '', - '', - '', - '', - "", - "", - '', - "<% _.each(repositories, function(repository) { %>", - "", - "", - "", - "", - "", - "", - "", - "<% }); %>", - "", - '', - "
NameDescriptionOwnerRevisionInstallation Status
", - '
', - '", - "
", - "
", - '
', - '", - "
", - "
", - '
', - '", - "
", - "
", - '
', - '", - "
", - "
", - '
', - '", - "
", - "
" - ].join("") - ) + templateRepoStatus: function() { + return _.template( + `
+ +
+ + + + + + + + + + + + + <% _.each(repositories, function(repository) { %> + + + + + + + + <% }); %> + + +
NameDescriptionOwnerRevisionInstallation Status
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
` + ); + } }); export default { diff --git a/client/galaxy/scripts/mvc/toolshed/repositories-view.js b/client/galaxy/scripts/mvc/toolshed/repositories-view.js index 3ee678dab4a..fca581d61f3 100644 --- a/client/galaxy/scripts/mvc/toolshed/repositories-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repositories-view.js @@ -14,9 +14,11 @@ var ToolShedCategoryContentsView = Backbone.View.extend({ this.model = new toolshed_model.CategoryCollection(); this.listenTo(this.model, "sync", this.render); var shed = params.tool_shed.replace(/\//g, "%2f"); - this.model.url += `?tool_shed_url=${shed}&category_id=${params.category_id}&sort_key=${ - params.sort_key - }&sort_order=${params.sort_order}&page=${params.page}`; + this.model.url += `?tool_shed_url=${shed}`; + this.model.url += `&category_id=${params.category_id}`; + this.model.url += `&sort_key=${params.sort_key}`; + this.model.url += `&sort_order=${params.sort_order}`; + this.model.url += `&page=${params.page}`; this.model.tool_shed = shed; this.model.category = params.category_id; this.model.fetch(); @@ -24,8 +26,8 @@ var ToolShedCategoryContentsView = Backbone.View.extend({ render: function(options) { this.options = _.defaults(this.options || {}, options); - var category_contents_template = this.templateCategoryContents; - var page_navigation_template = this.templatePageNavigation; + var category_contents_template = this.templateCategoryContents(); + var page_navigation_template = this.templatePageNavigation(); var sorting = { class: { owner: "fa-sort", description: "fa-sort", name: "fa-sort" }, direction: { owner: "asc", description: "asc", name: "asc" } @@ -81,7 +83,7 @@ var ToolShedCategoryContentsView = Backbone.View.extend({ }); }, minLength: 3, - select: function(event, ui) { + select: (event, ui) => { var tsr_id = ui.item.value; var new_route = `repository/s/${this.model.tool_shed}/r/${tsr_id}`; Backbone.history.navigate(new_route, { @@ -114,105 +116,105 @@ var ToolShedCategoryContentsView = Backbone.View.extend({ }); }, - templatePageNavigation: _.template( - [ - '" - ].join("") - ), + templatePageNavigation: function() { + return _.template( + `` + ); + }, - templateCategoryContents: _.template( - [ - '", - '", - '
', - '", - "<% if (category.get('repository_count') > 25) { %>", - "<%= page_navigation %>", - "<% } %>", - '
', - '', - '', - "", - '', - '', - '', - '', - "", - "", - '<% _.each(category.get("repositories"), function(repository) { %>', - "", - "", - "", - "", - "", - "", - "<% }); %>", - "
OwnerNameSynopsisType
<%= repository.owner %>", - '", - "<%= repository.description %><%= repository.type %>
", - "
", - "
" - ].join("") - ) + templateCategoryContents: function() { + return _.template( + ` +
+
Repositories in <%= category.get("name") %>Repository Queue (<%= queue %>)
+
+
+ + <% if (category.get('repository_count') > 25) { %> + <%= page_navigation %> + <% } %> +
+ + + + + + + + + + <% _.each(category.get("repositories"), function(repository) { %> + + + + + + + <% }); %> +
OwnerNameSynopsisType
<%= repository.owner %> + + <%= repository.description %><%= repository.type %>
+
+
` + ); + } }); export default { diff --git a/client/galaxy/scripts/mvc/toolshed/repository-queue-view.js b/client/galaxy/scripts/mvc/toolshed/repository-queue-view.js index 67104e85111..a00f7948c31 100644 --- a/client/galaxy/scripts/mvc/toolshed/repository-queue-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repository-queue-view.js @@ -19,13 +19,11 @@ var View = Backbone.View.extend({ }, render: function(options) { - var repo_queue_template = this.templateRepoQueue; + var repo_queue_template = this.templateRepoQueue(); var repositories = this.model.models; this.$el.html( repo_queue_template({ - title: _l("Repository Installation Queue"), repositories: repositories, - empty: _l("No repositories in queue."), queue: toolshed_util.queueLength() }) ); @@ -35,20 +33,23 @@ var View = Backbone.View.extend({ bindEvents: function() { $(".install_one").on("click", ev => { - var repository_metadata = this.loadFromQueue($(ev.target).attr("data-repokey")); + const repository_metadata = this.loadFromQueue($(ev.target).attr("data-repokey")); this.installFromQueue(repository_metadata, $(ev.target).attr("data-repokey")); }); $(".remove_one").on("click", ev => { - var queue_key = $(ev.target).attr("data-repokey"); - var repo_queue = JSON.parse(window.localStorage.repositories); + const queue_key = $(ev.target).attr("data-repokey"); + const repo_queue = JSON.parse(window.localStorage.repositories); if (repo_queue.hasOwnProperty(queue_key)) { - var repository_id = repo_queue[queue_key].repository.id; + this.removeRow(repo_queue[queue_key].id); delete repo_queue[queue_key]; - $(`#queued_repository_${repository_id}`).remove(); } window.localStorage.repositories = JSON.stringify(repo_queue); }); $("#clear_queue").on("click", () => { + const repo_queue = JSON.parse(window.localStorage.repositories); + for (const key of Object.keys(repo_queue)) { + this.removeRow(repo_queue[key].id); + } window.localStorage.repositories = "{}"; }); $("#from_workflow").on("click", () => { @@ -59,6 +60,10 @@ var View = Backbone.View.extend({ }); }, + removeRow: function(row_id) { + $(`#queued_repository_${row_id}`).remove(); + }, + installFromQueue: function(repository_metadata, queue_key) { var params = {}; params.install_tool_dependencies = repository_metadata.install_tool_dependencies; @@ -107,48 +112,53 @@ var View = Backbone.View.extend({ return this.defaults; }, - templateRepoQueue: _.template( - [ - '
', - '', - "
", - '
', - '', - '', - "", - '', - '', - '', - '', - '', - '', - "", - "", - "", - "<% if (repositories.length > 0) { %>", - "<% _.each(repositories, function(repository) { %>", - '">', - '', - '', - '', - '', - '", - '", - "", - "<% }); %>", - "<% } else { %>", - '', - "<% } %>", - "", - "
NameOwnerRevisionToolShedInstall
<%= repository.get("repository").name %><%= repository.get("repository").owner %><%= repository.get("changeset_revision") %><%= repository.get("tool_shed_url") %>', - '" type="submit" id="install_repository_<%= repository.get("id") %>" name="install_repository" value="Install now" />', - "', - '" type="submit" id="unqueue_repository_<%= repository.get("id") %>" name="unqueue_repository" value="Remove from queue" />', - "
<%= empty %>
", - '', - "
" - ].join("") - ) + templateRepoQueue: function() { + return _.template( + `
+

+ ${_l("Repository Queue")} +

+
+ + + + + + + + + + + + + <% if (repositories.length > 0) { %> + <% _.each(repositories, function(repository) { %> + '> + + + + + + + + <% }); %> + <% } else { %> + + <% } %> + +
NameOwnerRevisionToolShedInstall
<%= repository.get('repository').name %><%= repository.get('repository').owner %><%= repository.get('changeset_revision') %><%= repository.get('tool_shed_url') %> + ' type='submit' id='install_repository_<%= repository.get('id') %>' name='install_repository' value='Install now' /> + + ' type='submit' id='unqueue_repository_<%= repository.get('id') %>' name='unqueue_repository' value='Remove from queue' /> +
+ ${_l("No repositories in queue.")} +
+ + +
+
` + ); + } }); export default { diff --git a/client/galaxy/scripts/mvc/toolshed/repository-view.js b/client/galaxy/scripts/mvc/toolshed/repository-view.js index 85ba0e2465f..b5ab7af65b5 100644 --- a/client/galaxy/scripts/mvc/toolshed/repository-view.js +++ b/client/galaxy/scripts/mvc/toolshed/repository-view.js @@ -25,7 +25,7 @@ var ToolShedRepositoryView = Backbone.View.extend({ }, render: function(options) { - var repo_details_template = this.templateRepoDetails; + var repo_details_template = this.templateRepoDetails(); var models = this.model.models[0]; this.options = { repository: models.get("repository"), @@ -45,13 +45,13 @@ var ToolShedRepositoryView = Backbone.View.extend({ this.options.current_metadata = this.options.repository.metadata[this.options.current_changeset]; this.options.current_metadata.tool_shed_url = this.model.tool_shed_url; this.options.tools = this.options.current_metadata.tools; - this.options.repository_dependencies_template = this.templateRepoDependencies; - this.options.repository_dependency_template = this.templateRepoDependency; - this.options.tps_template_global_select = this.templateGlobalSectionSelect; - this.options.tps_template_global_create = this.templateGlobalSectionCreate; - this.options.tps_template_tool_select = this.templateToolSectionSelect; - this.options.tps_template_tool_create = this.templateToolSectionCreate; - this.options.panel_section_options = this.templatePanelSelectOptions; + this.options.repository_dependencies_template = this.templateRepoDependencies(); + this.options.repository_dependency_template = this.templateRepoDependency(); + this.options.tps_template_global_select = this.templateGlobalSectionSelect(); + this.options.tps_template_global_create = this.templateGlobalSectionCreate(); + this.options.tps_template_tool_select = this.templateToolSectionSelect(); + this.options.tps_template_tool_create = this.templateToolSectionCreate(); + this.options.panel_section_options = this.templatePanelSelectOptions(); this.options.tool_dependencies = models.get("tool_dependencies"); this.options.shed_tool_conf = this.templateShedToolConf({ shed_tool_confs: models.get("shed_conf") @@ -389,248 +389,248 @@ var ToolShedRepositoryView = Backbone.View.extend({ }); }, - templateRepoDetails: _.template( - [ - '
', - '
Repository information for <%= repository.name %> from <%= repository.owner %>Repository Queue (<%= queue %>)
', - "
", - '
', - '
', - '', - '', - '
', - '
Changeset
', - '
', - '", - '', - '', - '
Please select a revision and review the settings below before installing.
', - "
", - "
", - "<%= shed_tool_conf %>", - "<% if (current_metadata.has_repository_dependencies) { %>", - '
Repository dependencies for <%= current_changeset %>
', - '
', - '

', - '', - '', - "

", - "<% current_metadata.repository_dependency_template = repository_dependency_template; %>", - '
', - '", - "<%= repository_dependencies_template(current_metadata) %>", - "
", - "
", - "<% } %>", - "<% if (current_metadata.includes_tool_dependencies) { %>", - '
Tool dependencies
', - '
', - '

', - '', - '', - "

", - '

', - '', - '', - "

", - '
', - '", - '', - "", - '', - '', - "", - "", - "", - "", - '', - "<% _.each(tool_dependencies[current_changeset], function(dependency) { %>", - '', - '", - "", - "", - "", - "<% }); %>", - "", - "
NameVersionType
', - "<%= dependency.name %><%= dependency.version %><%= dependency.type %>
", - "
", - "
", - "<% } %>", - "<% if (current_metadata.includes_tools_for_display_in_tool_panel) { %>", - '
Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
', - '
', - '
', - '', - "", - '', - '', - "", - "", - "", - "", - '', - "<% _.each(current_metadata.tools, function(tool) { %>", - '', - '", - "", - '', - '", - "", - "<% }); %>", - "", - "
NameDescriptionVersion<%= tps_template_global_select({panel_section_dict: panel_section_dict, panel_section_options: panel_section_options}) %>
', - '", - "<%= tool.description %><%= tool.version %>', - "<%= tps_template_tool_select({tool: tool, panel_section_dict: panel_section_dict, panel_section_options: panel_section_options}) %>", - "
", - "
", - "
", - "<% } %>", - "
", - "
" - ].join("") - ), + templateRepoDetails: function() { + return _.template( + `
+
Repository information for <%= repository.name %> from <%= repository.owner %>Repository Queue (<%= queue %>)
+
+
+
+ + +
+
Changeset
+
+ + + +
Please select a revision and review the settings below before installing.
+
+
+ <%= shed_tool_conf %> + <% if (current_metadata.has_repository_dependencies) { %> +
Repository dependencies for <%= current_changeset %>
+
+

+ + +

+ <% current_metadata.repository_dependency_template = repository_dependency_template; %> +
+ + <%= repository_dependencies_template(current_metadata) %> +
+
+ <% } %> + <% if (current_metadata.includes_tool_dependencies) { %> +
Tool dependencies
+
+

+ + +

+

+ + +

+
+ + + + + + + + + + + <% _.each(tool_dependencies[current_changeset], function(dependency) { %> + + + + + + <% }); %> + +
NameVersionType
+ <%= dependency.name %><%= dependency.version %><%= dependency.type %>
+
+
+ <% } %> + <% if (current_metadata.includes_tools_for_display_in_tool_panel) { %> +
Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
+
+
+ + + + + + + + + + <% _.each(current_metadata.tools, function(tool) { %> + + + + + + + <% }); %> + +
NameDescriptionVersion<%= tps_template_global_select({panel_section_dict: panel_section_dict, panel_section_options: panel_section_options}) %>
+ + <%= tool.description %><%= tool.version %> + <%= tps_template_tool_select({tool: tool, panel_section_dict: panel_section_dict, panel_section_options: panel_section_options}) %> +
+
+
+ <% } %> +
+
` + ); + }, - templateRepoDependencies: _.template( - [ - '
Repository Dependencies
', - '
', - "
    ", - "
  • Repository installation requires the following", - "<% if (has_repository_dependencies) { %>", - "<% _.each(repository_dependencies, function(dependency) { %>", - "<% dependency.repository_dependency_template = repository_dependency_template; %>", - "<%= repository_dependency_template(dependency) %>", - "<% }); %>", - "<% } %>", - "
  • ", - "
", - "
" - ].join("") - ), + templateRepoDependencies: function() { + return _.template( + `
Repository Dependencies
+
+
    +
  • Repository installation requires the following + <% if (has_repository_dependencies) { %> + <% _.each(repository_dependencies, function(dependency) { %> + <% dependency.repository_dependency_template = repository_dependency_template; %> + <%= repository_dependency_template(dependency) %> + <% }); %> + <% } %> +
  • +
+
` + ); + }, - templateRepoDependency: _.template( - [ - '
  • ', - "Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %>", - "<% if (has_repository_dependencies) { %>", - '
      ', - "<% _.each(repository_dependencies, function(dependency) { %>", - "<% dependency.repository_dependency_template = repository_dependency_template; %>", - "<%= repository_dependency_template(dependency) %>", - "<% }); %>", - "
    ", - "<% } %>", - "
  • " - ].join("") - ), + templateRepoDependency: function() { + return _.template( + `
  • + Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %> + <% if (has_repository_dependencies) { %> +
      + <% _.each(repository_dependencies, function(dependency) { %> + <% dependency.repository_dependency_template = repository_dependency_template; %> + <%= repository_dependency_template(dependency) %> + <% }); %> +
    + <% } %> +
  • ` + ); + }, - templateShedToolConf: _.template( - [ - '
    Shed tool configuration file:
    ', - '
    ', - '
    ', - '", - '
    Select the file whose tool_path setting you want used for installing repositories.
    ', - "
    ", - "
    " - ].join("") - ), + templateShedToolConf: function() { + return _.template( + `
    Shed tool configuration file:
    +
    +
    + +
    Select the file whose tool_path setting you want used for installing repositories.
    +
    +
    ` + ); + }, - templateToolDependency: _.template( - [ - "<% if (has_repository_dependencies) { %>", - "<% _.each(repository_dependencies, function(dependency) { %>", - "<% if (dependency.includes_tool_dependencies) { %>", - "<% dependency.tool_dependency_template = tool_dependency_template %>", - "<%= tool_dependency_template(dependency) %>", - "<% } %>", - "<% }); %>", - "<% } %>" - ].join("") - ), + // templateToolDependency: function(){ + // return _.template( + // `<% if (has_repository_dependencies) { %> + // <% _.each(repository_dependencies, function(dependency) { %> + // <% if (dependency.includes_tool_dependencies) { %> + // <% dependency.tool_dependency_template = tool_dependency_template %> + // <%= tool_dependency_template(dependency) %> + // <% } %> + // <% }); %> + // <% } %>` + // ); + // }, - templateGlobalSectionCreate: _.template( - [ - '
    ', - '
    ', - '', - '', - '
    ', - "Add a new tool panel section to contain the installed tools (optional).", - "
    ", - "
    ", - "
    " - ].join("") - ), + templateGlobalSectionCreate: function() { + return _.template( + `
    +
    + + +
    + Add a new tool panel section to contain the installed tools (optional). +
    +
    +
    ` + ); + }, - templateGlobalSectionSelect: _.template( - [ - '
    ', - '
    Tool Panel Section
    ', - '
    ', - '
    ', - '", - '', - '
    ', - "Select an existing tool panel section to contain the installed tools (optional).", - "
    ", - "
    ", - "
    ", - "
    " - ].join("") - ), + templateGlobalSectionSelect: function() { + return _.template( + `
    +
    Tool Panel Section
    +
    +
    + + +
    + Select an existing tool panel section to contain the installed tools (optional). +
    +
    +
    +
    ` + ); + }, - templateToolSectionCreate: _.template( - [ - '
    ', - '', - '', - "
    " - ].join("") - ), + templateToolSectionCreate: function() { + return _.template( + `
    + + +
    ` + ); + }, - templateToolSectionSelect: _.template( - [ - '
    ', - '", - '', - '
    ', - "
    " - ].join("") - ), + templateToolSectionSelect: function() { + return _.template( + `
    + + +
    +
    ` + ); + }, - templatePanelSelectOptions: _.template( - [ - "<% _.each(sections, function(section) { %>", - '', - "<% }); %>" - ].join("") - ) + templatePanelSelectOptions: function() { + return _.template( + `<% _.each(sections, function(section) { %> + + <% }); %>` + ); + } }); export default { diff --git a/client/galaxy/scripts/mvc/toolshed/shed-list-view.js b/client/galaxy/scripts/mvc/toolshed/shed-list-view.js index b2d9b6ea8bd..e092ffae6f8 100644 --- a/client/galaxy/scripts/mvc/toolshed/shed-list-view.js +++ b/client/galaxy/scripts/mvc/toolshed/shed-list-view.js @@ -1,19 +1,11 @@ import Backbone from "backbone"; +import $ from "jquery"; import _ from "underscore"; import _l from "utils/localization"; import toolshed_model from "mvc/toolshed/toolshed-model"; import toolshed_util from "mvc/toolshed/util"; -var View = Backbone.View.extend({ - defaults: { - tool_sheds: [ - { - url: "https://toolshed.g2.bx.psu.edu/", - name: "Galaxy Main Tool Shed" - } - ] - }, - +var ShedListView = Backbone.View.extend({ initialize: function(options) { this.options = _.defaults(this.options || {}, this.defaults); this.model = new toolshed_model.ShedsCollection(); @@ -25,7 +17,7 @@ var View = Backbone.View.extend({ render: function(options) { this.options = _.defaults(this.options || {}, options, this.defaults); - var toolshed_list_template = this.templateToolshedList; + var toolshed_list_template = this.templateToolshedList(); this.$el.html( toolshed_list_template({ title: _l("Configured Galaxy Tool Sheds"), @@ -33,33 +25,29 @@ var View = Backbone.View.extend({ queue: toolshed_util.queueLength() }) ); + $("#center").css("overflow", "auto"); }, - templateToolshedList: _.template( - [ - '
    ', - '', - "
    ", - '
    ', - '
    ', - '', - "<% _.each(tool_sheds, function(shed) { %>", - '', - "", - "", - "<% }); %>", - "
    ", - '", - "
    ", - "
    ", - '
    ', - "
    " - ].join("") - ) + templateToolshedList: function() { + return _.template( + `
    +
    +

    + ${_l("Configured Tool Sheds")} +

    + Repository Queue (<%= queue %>) +
    + + <% _.each(tool_sheds, function(shed) { %> + + <% }); %> +
    ` + ); + } }); export default { - ShedListView: View + ShedListView: ShedListView }; diff --git a/client/galaxy/scripts/mvc/toolshed/workflows-view.js b/client/galaxy/scripts/mvc/toolshed/workflows-view.js index cf662a3916e..e88192ce711 100644 --- a/client/galaxy/scripts/mvc/toolshed/workflows-view.js +++ b/client/galaxy/scripts/mvc/toolshed/workflows-view.js @@ -19,7 +19,7 @@ var View = Backbone.View.extend({ }, render: function(options) { - var workflows_missing_tools = this.templateWorkflows; + var workflows_missing_tools = this.templateWorkflows(); var workflows = this.model.models; this.$el.html( workflows_missing_tools({ @@ -75,57 +75,57 @@ var View = Backbone.View.extend({ $("#from_workflow").on("click", this.loadWorkflows); }, - templateWorkflows: _.template( - [ - '
    ', - '', - "
    ", - '", - '', - '', - "", - '', - '', - '', - '', - '', - '', - "", - "", - "", - "<% _.each(workflows, function(workflow) { %>", - "", - '", - '", - '', - '', - '', - '", - "", - "<% }); %>", - "", - "" - ].join("") - ) + templateWorkflows: function() { + _.template( + ` + +
    WorkflowsTool IDsShedNameOwnerActions
    ', - '
      ', - '<% _.each(workflow.get("workflows"), function(name) { %>', - '
    • <%= name %>
    • ', - "<% }); %>", - "
    ", - "
    ', - '
      ', - '<% _.each(workflow.get("tools"), function(tool) { %>', - '
    • <%= tool %>
    • ', - "<% }); %>", - "
    ", - "
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>', - '
      ', - '
    • ', - '" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • ', - "
    ", - "
    + + + + + + + + + + + + <% _.each(workflows, function(workflow) { %> + + + + + + + + + <% }); %> + + ` + ); + } }); export default { diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view-data.js b/client/galaxy/scripts/mvc/workflow/workflow-view-data.js index ca686143779..0d57a097973 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow-view-data.js +++ b/client/galaxy/scripts/mvc/workflow/workflow-view-data.js @@ -5,7 +5,7 @@ import Backbone from "backbone"; // TODO; tie into Galaxy state? window.workflow_globals = window.workflow_globals || {}; -var DataInputView = Backbone.View.extend({ +const DataInputView = Backbone.View.extend({ className: "form-row dataRow input-data-row", initialize: function(options) { @@ -35,7 +35,7 @@ var DataInputView = Backbone.View.extend({ } }); -var DataOutputView = Backbone.View.extend({ +const DataOutputView = Backbone.View.extend({ className: "form-row dataRow", initialize: function(options) { @@ -43,18 +43,18 @@ var DataOutputView = Backbone.View.extend({ this.terminalElement = options.terminalElement; this.nodeView = options.nodeView; - var output = this.output; - var label = output.label || output.name; - var node = this.nodeView.node; + const output = this.output; + let label = output.label || output.name; + const node = this.nodeView.node; - var isInput = output.extensions.indexOf("input") >= 0 || output.extensions.indexOf("input_collection") >= 0; + const isInput = output.extensions.indexOf("input") >= 0 || output.extensions.indexOf("input_collection") >= 0; if (!isInput) { label = `${label} (${output.force_datatype || output.extensions.join(", ")})`; } this.$el.html(label); this.calloutView = null; if (["tool", "subworkflow"].indexOf(node.type) >= 0) { - var calloutView = new OutputCalloutView({ + const calloutView = new OutputCalloutView({ label: label, output: output, node: node @@ -86,7 +86,7 @@ var DataOutputView = Backbone.View.extend({ } }); -var ParameterOutputView = Backbone.View.extend({ +const ParameterOutputView = Backbone.View.extend({ className: "form-row dataRow", initialize: function(options) { @@ -94,28 +94,20 @@ var ParameterOutputView = Backbone.View.extend({ this.terminalElement = options.terminalElement; this.nodeView = options.nodeView; - var output = this.output; - var label = output.label || output.name; - var node = this.nodeView.node; + const output = this.output; + const label = output.label || output.name; + const node = this.nodeView.node; this.$el.html(label); this.calloutView = null; if (["tool", "subworkflow"].indexOf(node.type) >= 0) { - var calloutView = new OutputCalloutView({ + const calloutView = new OutputCalloutView({ label: label, output: output, node: node }); this.calloutView = calloutView; this.$el.append(calloutView.el); - this.$el.hover( - () => { - calloutView.hoverImage(); - }, - () => { - calloutView.resetImage(); - } - ); } this.$el.css({ position: "absolute", @@ -141,21 +133,21 @@ var ParameterOutputView = Backbone.View.extend({ } }); -var OutputCalloutView = Backbone.View.extend({ +const OutputCalloutView = Backbone.View.extend({ tagName: "div", initialize: function(options) { this.label = options.label; this.node = options.node; this.output = options.output; - var view = this; - var node = this.node; + const view = this; + const node = this.node; this.$el .attr("class", `callout-terminal ${this.label}`) .css({ display: "none" }) .append( $("").click(() => { - var outputName = view.output.name; + const outputName = view.output.name; if (node.isWorkflowOutput(outputName)) { node.removeWorkflowOutput(outputName); view.$("icon").removeClass("mark-terminal-active"); diff --git a/client/galaxy/scripts/nls/fr/locale.js b/client/galaxy/scripts/nls/fr/locale.js index 8c0c3ecfaf8..3e0f8c1ad91 100644 --- a/client/galaxy/scripts/nls/fr/locale.js +++ b/client/galaxy/scripts/nls/fr/locale.js @@ -306,9 +306,9 @@ define({ // ---------------------------------------------------------------------------- history-list Histories: false, // ---------------------------------------------------------------------------- shed-list-view - "Configured Galaxy Tool Sheds": false, + "Configured Tool Sheds": false, // ---------------------------------------------------------------------------- repository-queue-view - "Repository Installation Queue": false, + "Repository Queue": false, // ---------------------------------------------------------------------------- repo-status-view "Repository Status": false, // ---------------------------------------------------------------------------- workflows-view diff --git a/client/galaxy/scripts/nls/locale.js b/client/galaxy/scripts/nls/locale.js index 285a390b929..bd635ce8e4b 100644 --- a/client/galaxy/scripts/nls/locale.js +++ b/client/galaxy/scripts/nls/locale.js @@ -306,9 +306,9 @@ define({ // ---------------------------------------------------------------------------- history-list Histories: false, // ---------------------------------------------------------------------------- shed-list-view - "Configured Galaxy Tool Sheds": false, + "Configured Tool Sheds": false, // ---------------------------------------------------------------------------- repository-queue-view - "Repository Installation Queue": false, + "Repository Queue": false, // ---------------------------------------------------------------------------- repo-status-view "Repository Status": false, // ---------------------------------------------------------------------------- workflows-view diff --git a/client/galaxy/scripts/store/index.js b/client/galaxy/scripts/store/index.js index 3ab28141579..57f2183f151 100644 --- a/client/galaxy/scripts/store/index.js +++ b/client/galaxy/scripts/store/index.js @@ -4,14 +4,19 @@ import Vue from "vue"; import Vuex from "vuex"; +import createCache from "vuex-cache"; + import { gridSearchStore } from "./gridSearchStore"; import { tagStore } from "./tagStore"; +import { jobMetricsStore } from "./jobMetricsStore"; Vue.use(Vuex); export default new Vuex.Store({ + plugins: [createCache()], modules: { gridSearch: gridSearchStore, - tags: tagStore + tags: tagStore, + jobMetrics: jobMetricsStore } }); diff --git a/client/galaxy/scripts/store/jobMetricsStore.js b/client/galaxy/scripts/store/jobMetricsStore.js new file mode 100644 index 00000000000..cc3be4d399d --- /dev/null +++ b/client/galaxy/scripts/store/jobMetricsStore.js @@ -0,0 +1,47 @@ +export const state = { + jobMetricsByHdaId: {}, + jobMetricsByLddaId: {}, + jobMetricsByJobId: {} +}; + +import Vue from "vue"; +import { getAppRoot } from "onload/loadConfig"; +import axios from "axios"; + +const getters = { + getJobMetricsByDatasetId: state => (datasetId, datasetType = "hda") => { + const jobMetricsObject = datasetType == "hda" ? state.jobMetricsByHdaId : state.jobMetricsByLddaId; + return jobMetricsObject[datasetId] || []; + }, + getJobMetricsByJobId: state => jobId => { + return state.jobMetricsByJobId[jobId] || []; + } +}; + +const actions = { + fetchJobMetricsForDatasetId: async ({ commit }, { datasetId, datasetType }) => { + const { data } = await axios.get(`${getAppRoot()}api/datasets/${datasetId}/metrics?hda_ldda=${datasetType}`); + commit("saveJobMetricsForDatasetId", { datasetId, datasetType, jobMetrics: data }); + }, + fetchJobMetricsForJobId: async ({ commit }, jobId) => { + const { data } = await axios.get(`${getAppRoot()}api/jobs/${jobId}/metrics`); + commit("saveJobMetricsForJobId", { jobId, jobMetrics: data }); + } +}; + +const mutations = { + saveJobMetricsForDatasetId: (state, { datasetId, datasetType, jobMetrics }) => { + const jobMetricsObject = datasetType == "hda" ? state.jobMetricsByHdaId : state.jobMetricsByLddaId; + Vue.set(jobMetricsObject, datasetId, jobMetrics); + }, + saveJobMetricsForJobId: (state, { jobId, jobMetrics }) => { + Vue.set(state.jobMetricsByJobId, jobId, jobMetrics); + } +}; + +export const jobMetricsStore = { + state, + getters, + actions, + mutations +}; diff --git a/client/galaxy/style/scss/base.scss b/client/galaxy/style/scss/base.scss index 4fac6fe4fff..cabf4d7071d 100644 --- a/client/galaxy/style/scss/base.scss +++ b/client/galaxy/style/scss/base.scss @@ -36,6 +36,7 @@ $fa-font-path: "../../../node_modules/font-awesome/fonts/"; @import "flex.scss"; @import "charts.scss"; @import "message.scss"; +@import "toolshed.scss"; // Mixins @mixin user-select($select) { diff --git a/client/galaxy/style/scss/toolshed.scss b/client/galaxy/style/scss/toolshed.scss new file mode 100644 index 00000000000..329a37b3261 --- /dev/null +++ b/client/galaxy/style/scss/toolshed.scss @@ -0,0 +1,21 @@ +@import "theme/blue.scss"; +.shed-style-container { + width: 95%; + margin: auto; + margin-top: 1em; + overflow: auto !important; + .header { + h2 { + float: left; + } + span { + float: right; + } + } +} +.ui-autocomplete { + background-color: #fff; + li.ui-menu-item { + list-style-type: none; + } +} diff --git a/client/package.json b/client/package.json index 99e6b5a7201..ac7e51c809e 100644 --- a/client/package.json +++ b/client/package.json @@ -15,7 +15,7 @@ "@handsontable/vue": "^2.0.0-beta1", "@johmun/vue-tags-input": "^2.0.1", "@vue/test-utils": "1.0.0-beta.29", - "axios": "^0.18.0", + "axios": "^0.19.0", "backbone": "1.4.0", "bibtex-parse-js": "^0.0.24", "bootstrap": "4.3.1", @@ -47,7 +47,8 @@ "vue": "^2.6.10", "vue-router": "^3.0.2", "vue-rx": "^6.1.0", - "vuex": "^3.1.0" + "vuex": "^3.1.0", + "vuex-cache": "^3.1.0" }, "scripts": { "watch": "gulp && yarn run save-build-hash && yarn run webpack-watch", diff --git a/client/yarn.lock b/client/yarn.lock index 8562dc2841f..76424381eee 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1717,13 +1717,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -axios@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" - integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= +axios@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8" + integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ== dependencies: - follow-redirects "^1.3.0" - is-buffer "^1.1.5" + follow-redirects "1.5.10" + is-buffer "^2.0.2" babel-code-frame@^6.26.0, babel-code-frame@^6.7.5: version "6.26.0" @@ -5556,7 +5556,14 @@ fn-name@^2.0.0: resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= -follow-redirects@^1.0.0, follow-redirects@^1.3.0: +follow-redirects@1.5.10: + version "1.5.10" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" + integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== + dependencies: + debug "=3.1.0" + +follow-redirects@^1.0.0: version "1.5.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.9.tgz#c9ed9d748b814a39535716e531b9196a845d89c6" integrity sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w== @@ -6753,7 +6760,7 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.0: +is-buffer@^2.0.0, is-buffer@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== @@ -13067,6 +13074,11 @@ vue@^2.6.10, vue@^2.6.9: resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637" integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ== +vuex-cache@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/vuex-cache/-/vuex-cache-3.1.0.tgz#aad576cfb39b325cc7a43ea9a42414e356374c4b" + integrity sha512-XDzQ/jddmErZVquyHhbOHc6DPhVSt5bU8433Fzsai3XydU3cxyYTUd3PH2Ww5sesB9yu5f0wKk6MFIqgjSa3Yw== + vuex@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.1.0.tgz#634b81515cf0cfe976bd1ffe9601755e51f843b9" diff --git a/config/job_conf.xml.sample_advanced b/config/job_conf.xml.sample_advanced index c7fbea173e7..e1e72044eb6 100644 --- a/config/job_conf.xml.sample_advanced +++ b/config/job_conf.xml.sample_advanced @@ -950,12 +950,12 @@ my-tool latest --> - 3 + 3
    WorkflowsTool IDsShedNameOwnerActions
    +
      + <% _.each(workflow.get("workflows"), function(name) { %> +
    • <%= name %>
    • + <% }); %> +
    +
    +
      + <% _.each(workflow.get("tools"), function(tool) { %> +
    • <%= tool %>
    • + <% }); %> +
    +
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %> +
      +
    • + " data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • +
    +