diff --git a/client/galaxy/scripts/admin.toolshed.js b/client/galaxy/scripts/admin.toolshed.js index 8a94d153909..31cdba78fae 100644 --- a/client/galaxy/scripts/admin.toolshed.js +++ b/client/galaxy/scripts/admin.toolshed.js @@ -55,7 +55,7 @@ var GalaxyAdminToolshedApp = Backbone.View.extend({ }, initialize: function() { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.admintoolshedapp = this; this.admin_toolshed_router = new AdminToolshedRouter(); diff --git a/client/galaxy/scripts/app/galaxy.js b/client/galaxy/scripts/app/galaxy.js index 3a43a178877..48e2ce9c2fa 100644 --- a/client/galaxy/scripts/app/galaxy.js +++ b/client/galaxy/scripts/app/galaxy.js @@ -53,7 +53,7 @@ GalaxyApp.prototype._init = function(options, bootstrapped) { // Patch if this galaxy instance is replacing an existing one // _patchGalaxy depends on options.patchExisting // TODO: rethink this behavior - let existingGalaxy = getGalaxyInstance(); + const existingGalaxy = getGalaxyInstance(); if (existingGalaxy) { self._patchGalaxy(existingGalaxy); } @@ -212,7 +212,7 @@ GalaxyApp.prototype._initUserLocale = function _initUserLocale(options) { ? "__root" : (navigator.language || navigator.userLanguage || "__root").toLowerCase(); - let locale = user_locale || global_locale || nav_locale; + const locale = user_locale || global_locale || nav_locale; sessionStorage.setItem("currentLocale", locale); }; diff --git a/client/galaxy/scripts/app/singleton.js b/client/galaxy/scripts/app/singleton.js index 482ffbb6391..fa96b99f734 100644 --- a/client/galaxy/scripts/app/singleton.js +++ b/client/galaxy/scripts/app/singleton.js @@ -9,7 +9,7 @@ import { serverPath } from "utils/serverPath"; export function setGalaxyInstance(factory) { console.warn("setGalaxyInstance", serverPath()); - let storage = getStorage(); + const storage = getStorage(); let newInstance = factory(GalaxyApp); if (!(newInstance instanceof GalaxyApp)) { newInstance = new GalaxyApp(newInstance); @@ -24,12 +24,12 @@ export function setGalaxyInstance(factory) { } export function getGalaxyInstance() { - let storage = getStorage(); + const storage = getStorage(); return storage._galaxyInstance; } export function galaxyIsInitialized() { - let instance = getGalaxyInstance(); + const instance = getGalaxyInstance(); return instance !== null; } diff --git a/client/galaxy/scripts/bundleEntries.js b/client/galaxy/scripts/bundleEntries.js index be5c973607f..7b44c5245af 100644 --- a/client/galaxy/scripts/bundleEntries.js +++ b/client/galaxy/scripts/bundleEntries.js @@ -54,14 +54,14 @@ export function library(options) { } export function multiHistory(options) { - let histories = new HistoryCollection([], { + const histories = new HistoryCollection([], { includeDeleted: options.includingDeleted, order: options.order, limitOnFirstFetch: options.limit, limitPerFetch: options.limit, currentHistoryId: options.current_history_id }); - let multipanel = new MultiPanel.MultiPanelColumns({ + const multipanel = new MultiPanel.MultiPanelColumns({ el: $("#center").get(0), histories: histories }); @@ -88,7 +88,7 @@ export function chart(options) { return new Client(options); } -export let chartUtilities = { +export const chartUtilities = { Datasets: Datasets, Jobs: Jobs, Series: Series diff --git a/client/galaxy/scripts/components/DataDialog/model.js b/client/galaxy/scripts/components/DataDialog/model.js index 072445a0f5f..5163a01f469 100644 --- a/client/galaxy/scripts/components/DataDialog/model.js +++ b/client/galaxy/scripts/components/DataDialog/model.js @@ -10,7 +10,7 @@ export class Model { if (!this.multiple) { this.values = {}; } - let key = record && record.id; + const key = record && record.id; if (key) { if (!this.values[key]) { this.values[key] = record; diff --git a/client/galaxy/scripts/components/DataDialog/services.js b/client/galaxy/scripts/components/DataDialog/services.js index fc124d9720e..3b35d4915b0 100644 --- a/client/galaxy/scripts/components/DataDialog/services.js +++ b/client/galaxy/scripts/components/DataDialog/services.js @@ -12,7 +12,7 @@ export class Services { axios .get(url) .then(response => { - let items = this.getItems(response.data); + const items = this.getItems(response.data); resolve(items); }) .catch(e => { @@ -27,10 +27,10 @@ export class Services { /** Returns the formatted results **/ getItems(data) { - let items = []; - let stack = [data]; + const items = []; + const stack = [data]; while (stack.length > 0) { - let root = stack.pop(); + const root = stack.pop(); if (Array.isArray(root)) { root.forEach(element => { stack.push(element); @@ -40,7 +40,7 @@ export class Services { } else if (root.object) { stack.push(root.object); } else { - let record = this.getRecord(root); + const record = this.getRecord(root); if (record) { items.push(record); } diff --git a/client/galaxy/scripts/components/DataDialog/utilities.js b/client/galaxy/scripts/components/DataDialog/utilities.js index 8ebcd1c3132..becc62ffdf8 100644 --- a/client/galaxy/scripts/components/DataDialog/utilities.js +++ b/client/galaxy/scripts/components/DataDialog/utilities.js @@ -11,7 +11,7 @@ export class UrlTracker { this.navigation.push(url); } else { this.navigation.pop(); - let navigationLength = this.navigation.length; + const navigationLength = this.navigation.length; if (navigationLength > 0) { url = this.navigation[navigationLength - 1]; } else { diff --git a/client/galaxy/scripts/components/Masthead/initMasthead.js b/client/galaxy/scripts/components/Masthead/initMasthead.js index c8b69693cae..9df6e15e230 100644 --- a/client/galaxy/scripts/components/Masthead/initMasthead.js +++ b/client/galaxy/scripts/components/Masthead/initMasthead.js @@ -7,7 +7,7 @@ import Masthead from "components/Masthead"; export function initMasthead(config, container) { console.log("initMasthead"); - let Component = Vue.extend(Masthead); + const Component = Vue.extend(Masthead); return new Component({ props: Object.keys(config), propsData: config, diff --git a/client/galaxy/scripts/components/Tags/backboneTagService.js b/client/galaxy/scripts/components/Tags/backboneTagService.js index 7b162b5fd1c..60912fa3d62 100644 --- a/client/galaxy/scripts/components/Tags/backboneTagService.js +++ b/client/galaxy/scripts/components/Tags/backboneTagService.js @@ -12,7 +12,7 @@ export class BackboneTagService extends TagService { } async save(rawTag) { - let tag = createTag(rawTag); + const tag = createTag(rawTag); if (!tag.valid) { throw new Error("Invalid tag"); } @@ -27,7 +27,7 @@ export class BackboneTagService extends TagService { } async delete(rawTag) { - let tag = createTag(rawTag); + const tag = createTag(rawTag); let tags = new Set(this.model.attributes.tags); tags.delete(tag.text); diff --git a/client/galaxy/scripts/components/Tags/model.js b/client/galaxy/scripts/components/Tags/model.js index 2449e22ce0e..a9dd7c68eae 100644 --- a/client/galaxy/scripts/components/Tags/model.js +++ b/client/galaxy/scripts/components/Tags/model.js @@ -21,9 +21,9 @@ function TagModel(props = {}) { enumerable: true, get: function() { if (this.text.startsWith("name:")) { - let { primary, contrasting, darker } = keyedColorScheme(this.text); + const { primary, contrasting, darker } = keyedColorScheme(this.text); - let styles = { + const styles = { "background-color": primary, color: contrasting, "border-color": darker @@ -82,7 +82,7 @@ export function createTag(data) { // Returns tags in "newTags" that aren't present in "existingTags" export const diffTags = (newTags, existingTags) => { - let newModels = newTags.map(createTag); - let existingModels = existingTags.map(createTag); + const newModels = newTags.map(createTag); + const existingModels = existingTags.map(createTag); return newModels.filter(tag => !existingModels.some(st => st.equals(tag))); }; diff --git a/client/galaxy/scripts/components/Tags/mounts.js b/client/galaxy/scripts/components/Tags/mounts.js index ae502d87e9b..832bacd414a 100644 --- a/client/galaxy/scripts/components/Tags/mounts.js +++ b/client/galaxy/scripts/components/Tags/mounts.js @@ -14,17 +14,17 @@ import { BackboneTagService } from "./backboneTagService"; * by the tagging_common.mako file */ export const mountMakoTags = (options = {}, el) => { - let { id, itemClass, tags = [], disabled = false, context = "unspecified" } = options; + const { id, itemClass, tags = [], disabled = false, context = "unspecified" } = options; - let propData = { + const propData = { storeKey: `${itemClass}-${id}`, tagService: new TagService({ id, itemClass, context }), tags, disabled }; - let fn = mountVueComponent(Tags); - let vm = fn(propData, el); + const fn = mountVueComponent(Tags); + const vm = fn(propData, el); vm.$on("tag-click", makoClickHandler(options, vm)); return vm; }; @@ -40,15 +40,15 @@ const makoClickHandler = (options, vm) => return; } - let { tagClickFn = "none", clickUrl } = options; + const { tagClickFn = "none", clickUrl } = options; switch (tagClickFn) { // I made this match the existing behavior, but I am not clear on // the reason why this link redirects to a raw json page case "community_tag_click": if (undefined !== clickUrl) { - let suffix = tag.value ? `:${tag.value}` : ""; - let href = `${clickUrl}?f-tags=${tag.text}${suffix}`; + const suffix = tag.value ? `:${tag.value}` : ""; + const href = `${clickUrl}?f-tags=${tag.text}${suffix}`; redirectToUrl(href); } break; @@ -63,22 +63,22 @@ const makoClickHandler = (options, vm) => * Mount function when a backbone model is provided. */ export const mountModelTags = (options = {}, el) => { - let { model, disabled = false, context = "unspecified" } = options; + const { model, disabled = false, context = "unspecified" } = options; if (!model) { console.warn("Missing model in mountModelTags"); return; } - let { id, model_class: itemClass, tags = [] } = model.attributes; + const { id, model_class: itemClass, tags = [] } = model.attributes; - let propData = { + const propData = { storeKey: `${itemClass}-${id}`, tagService: new BackboneTagService({ id, itemClass, context, model }), tags, disabled }; - let fn = mountVueComponent(Tags); + const fn = mountVueComponent(Tags); return fn(propData, el); }; diff --git a/client/galaxy/scripts/components/Tags/tagService.js b/client/galaxy/scripts/components/Tags/tagService.js index 9a0e6f36228..7d600e1b451 100644 --- a/client/galaxy/scripts/components/Tags/tagService.js +++ b/client/galaxy/scripts/components/Tags/tagService.js @@ -52,13 +52,13 @@ export class TagService { * @returns Promise yielding new tag model */ async save(rawTag) { - let { id, itemClass, context } = this; - let tag = createTag(rawTag); + const { id, itemClass, context } = this; + const tag = createTag(rawTag); if (!tag.valid) { throw new Error("Invalid tag"); } - let url = `/tag/add_tag_async?item_id=${id}&item_class=${itemClass}&context=${context}&new_tag=${tag.text}`; - let response = await axios.get(url); + const url = `/tag/add_tag_async?item_id=${id}&item_class=${itemClass}&context=${context}&new_tag=${tag.text}`; + const response = await axios.get(url); if (response.status !== 200) { throw new Error(`Unable to save tag: ${tag}`); } @@ -71,10 +71,10 @@ export class TagService { * @returns Promise yielding deleted tag model */ async delete(rawTag) { - let { id, itemClass, context } = this; - let tag = createTag(rawTag); - let url = `/tag/remove_tag_async?item_id=${id}&item_class=${itemClass}&context=${context}&tag_name=${tag.text}`; - let response = await axios.get(url); + const { id, itemClass, context } = this; + const tag = createTag(rawTag); + const url = `/tag/remove_tag_async?item_id=${id}&item_class=${itemClass}&context=${context}&tag_name=${tag.text}`; + const response = await axios.get(url); if (response.status !== 200) { throw new Error(`Unable to delete tag: ${tag}`); } @@ -87,9 +87,9 @@ export class TagService { * @returns Promise yielding an array of tag models */ async autocomplete(searchText) { - let { id, itemClass } = this; - let url = `/tag/tag_autocomplete_data?item_id=${id}&item_class=${itemClass}&q=${searchText}`; - let response = await axios.get(url); + const { id, itemClass } = this; + const url = `/tag/tag_autocomplete_data?item_id=${id}&item_class=${itemClass}&q=${searchText}`; + const response = await axios.get(url); if (response.status !== 200) { throw new Error(`Unable to retrieve autocomplete tags for search string: ${searchText}`); } diff --git a/client/galaxy/scripts/components/admin/AdminServices.js b/client/galaxy/scripts/components/admin/AdminServices.js index 22c0c1c2e33..64701d52816 100644 --- a/client/galaxy/scripts/components/admin/AdminServices.js +++ b/client/galaxy/scripts/components/admin/AdminServices.js @@ -2,16 +2,16 @@ import { getAppRoot } from "onload/loadConfig"; import axios from "axios"; export function getErrorStack() { - let url = `${getAppRoot()}api/tools/error_stack`; + const url = `${getAppRoot()}api/tools/error_stack`; return axios.get(url); } export function getDisplayApplications() { - let url = `${getAppRoot()}api/display_applications`; + const url = `${getAppRoot()}api/display_applications`; return axios.get(url); } export function reloadDisplayApplications(ids) { - let url = `${getAppRoot()}api/display_applications/reload`; + const url = `${getAppRoot()}api/display_applications/reload`; return axios.post(url, { ids: ids }); } diff --git a/client/galaxy/scripts/entry/admin/AdminRouter.js b/client/galaxy/scripts/entry/admin/AdminRouter.js index 1eeae6a2138..3379920a6aa 100644 --- a/client/galaxy/scripts/entry/admin/AdminRouter.js +++ b/client/galaxy/scripts/entry/admin/AdminRouter.js @@ -15,7 +15,7 @@ import DisplayApplications from "components/admin/DisplayApplications.vue"; import Vue from "vue"; export const getAdminRouter = (Galaxy, options) => { - let galaxyRoot = getAppRoot(); + const galaxyRoot = getAppRoot(); return Router.extend({ routes: { @@ -38,7 +38,7 @@ export const getAdminRouter = (Galaxy, options) => { }, authenticate: function() { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); return Galaxy.user && Galaxy.user.id && Galaxy.user.get("is_admin"); }, @@ -57,8 +57,8 @@ export const getAdminRouter = (Galaxy, options) => { }, show_users_create: function() { - let instance = Vue.extend(Register); - let vm = document.createElement("div"); + const instance = Vue.extend(Register); + const vm = document.createElement("div"); this.page.display(vm); new instance({ propsData: { @@ -91,7 +91,7 @@ export const getAdminRouter = (Galaxy, options) => { }, _show_grid_view: function(urlSuffix) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); this.page.display( new GridView({ url_base: `${galaxyRoot}${urlSuffix}`, @@ -101,8 +101,8 @@ export const getAdminRouter = (Galaxy, options) => { }, _display_vue_helper: function(component, props) { - let instance = Vue.extend(component); - let vm = document.createElement("div"); + const instance = Vue.extend(component); + const vm = document.createElement("div"); this.page.display(vm); new instance(props).$mount(vm); }, @@ -124,9 +124,9 @@ export const getAdminRouter = (Galaxy, options) => { }, show_data_manager: function(path) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); console.log("show_data_manager"); - let vueMount = document.createElement("div"); + const vueMount = document.createElement("div"); this.page.display(vueMount); // always set the route back to the base, i.e. // `${galaxyRoot}admin/data_manager` diff --git a/client/galaxy/scripts/entry/admin/index.js b/client/galaxy/scripts/entry/admin/index.js index 570e68aa356..7268210f20d 100644 --- a/client/galaxy/scripts/entry/admin/index.js +++ b/client/galaxy/scripts/entry/admin/index.js @@ -11,7 +11,7 @@ addInitialization((Galaxy, { options }) => { active_view: "admin" }); - let pageOptions = Object.assign({}, options, { + const pageOptions = Object.assign({}, options, { Left: AdminPanel, Router: getAdminRouter(Galaxy, options) }); diff --git a/client/galaxy/scripts/entry/analysis/AnalysisRouter.js b/client/galaxy/scripts/entry/analysis/AnalysisRouter.js index 3fc93a5cb39..201fe9cdd31 100644 --- a/client/galaxy/scripts/entry/analysis/AnalysisRouter.js +++ b/client/galaxy/scripts/entry/analysis/AnalysisRouter.js @@ -78,13 +78,13 @@ export const getAnalysisRouter = Galaxy => require_login: ["show_user", "show_user_form", "show_workflows"], authenticate: function(args, name) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); return (Galaxy.user && Galaxy.user.id) || this.require_login.indexOf(name) == -1; }, _display_vue_helper: function(component, props) { - let instance = Vue.extend(component); - let vm = document.createElement("div"); + const instance = Vue.extend(component); + const vm = document.createElement("div"); this.page.display(vm); new instance(props).$mount(vm); }, @@ -102,7 +102,7 @@ export const getAnalysisRouter = Galaxy => }, show_user_form: function(form_id) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); var model = new UserPreferences.Model({ user_id: Galaxy.params.id }); @@ -165,14 +165,14 @@ export const getAnalysisRouter = Galaxy => }, show_history_structure: function() { - let displayStructureInstance = Vue.extend(DisplayStructure); - let vm = document.createElement("div"); + const displayStructureInstance = Vue.extend(DisplayStructure); + const vm = document.createElement("div"); this.page.display(vm); new displayStructureInstance({ propsData: { id: QueryStringParsing.get(" id: ") } }).$mount(vm); }, show_histories: function(action_id) { - let view = new HistoryList.View({ action_id: action_id }); + const view = new HistoryList.View({ action_id: action_id }); this.page.display(view); }, diff --git a/client/galaxy/scripts/entry/analysis/index.js b/client/galaxy/scripts/entry/analysis/index.js index a36a61c5a07..1bac19b9eb1 100644 --- a/client/galaxy/scripts/entry/analysis/index.js +++ b/client/galaxy/scripts/entry/analysis/index.js @@ -7,7 +7,7 @@ import Page from "layout/page"; addInitialization((Galaxy, { options = {} }) => { console.log("Analysis custom page setup"); - let pageOptions = Object.assign({}, options, { + const pageOptions = Object.assign({}, options, { config: Object.assign({}, options.config, { hide_panels: Galaxy.params.hide_panels, hide_masthead: Galaxy.params.hide_masthead diff --git a/client/galaxy/scripts/entry/panels/tool-panel.js b/client/galaxy/scripts/entry/panels/tool-panel.js index 49b36eb9414..f4e2a83b401 100644 --- a/client/galaxy/scripts/entry/panels/tool-panel.js +++ b/client/galaxy/scripts/entry/panels/tool-panel.js @@ -11,8 +11,8 @@ import Buttons from "mvc/ui/ui-buttons"; var ToolPanel = Backbone.View.extend({ initialize: function(page, options) { - let Galaxy = getGalaxyInstance(); - let appRoot = getAppRoot(); + const Galaxy = getGalaxyInstance(); + const appRoot = getAppRoot(); // access configuration options var config = options.config; @@ -96,7 +96,7 @@ var ToolPanel = Backbone.View.extend({ /** build a link to one tool */ _templateTool: function(tool) { - let appRoot = getAppRoot(); + const appRoot = getAppRoot(); return `
${tool.title} @@ -106,7 +106,7 @@ var ToolPanel = Backbone.View.extend({ /** build a link to 'All Workflows' */ _templateAllWorkflow: function(tool) { - let appRoot = getAppRoot(); + const appRoot = getAppRoot(); return `
${tool.title} @@ -116,7 +116,7 @@ var ToolPanel = Backbone.View.extend({ /** build links to workflows in toolpanel */ _templateWorkflowLink: function(wf) { - let appRoot = getAppRoot(); + const appRoot = getAppRoot(); return `
${_.escape(wf.title)} diff --git a/client/galaxy/scripts/galaxy.library.js b/client/galaxy/scripts/galaxy.library.js index 3cf8fb8f63c..d1d9a9672b7 100644 --- a/client/galaxy/scripts/galaxy.library.js +++ b/client/galaxy/scripts/galaxy.library.js @@ -110,7 +110,7 @@ var GalaxyLibrary = Backbone.View.extend({ initialize: function() { // This should go upstream in the js app once available - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.config.ga_code) { ((i, s, o, g, r, a, m) => { i["GoogleAnalyticsObject"] = r; diff --git a/client/galaxy/scripts/galaxy.pages.js b/client/galaxy/scripts/galaxy.pages.js index d2f2d2888c2..d9a1cf470fd 100644 --- a/client/galaxy/scripts/galaxy.pages.js +++ b/client/galaxy/scripts/galaxy.pages.js @@ -327,7 +327,7 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm url_base: item_info.list_ajax_url, embedded: true }); - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.modal.show({ title: `Insert Link to ${item_info.singular}`, body: $("
") @@ -416,11 +416,11 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm break; } - let grid = new GridView({ + const grid = new GridView({ url_base: item_info.list_ajax_url, embedded: true }); - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.modal.show({ title: `Insert Link to ${item_info.singular}`, body: $("
") diff --git a/client/galaxy/scripts/layout/communication-server-view.js b/client/galaxy/scripts/layout/communication-server-view.js index b54030873a6..6da787d7abc 100644 --- a/client/galaxy/scripts/layout/communication-server-view.js +++ b/client/galaxy/scripts/layout/communication-server-view.js @@ -13,7 +13,7 @@ export var CommunicationServerView = Backbone.View.extend({ /** makes bootstrap modal and iframe inside it */ makeModalIframe: function(e) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); // make modal var host = Galaxy.config.communication_server_host; diff --git a/client/galaxy/scripts/layout/data.js b/client/galaxy/scripts/layout/data.js index 44f4cad5b6e..9fc52cf212c 100644 --- a/client/galaxy/scripts/layout/data.js +++ b/client/galaxy/scripts/layout/data.js @@ -10,8 +10,8 @@ export default class Data { * @param {function} callback - Result function called with selection */ dialog(callback, options = {}) { - let galaxy = getGalaxyInstance(); - let host = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`; + const galaxy = getGalaxyInstance(); + const host = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`; Object.assign(options, { callback: callback, history: galaxy.currHistoryPanel && galaxy.currHistoryPanel.model.id, @@ -30,8 +30,8 @@ export default class Data { * Creates a history dataset by submitting an upload request */ create(options) { - let Galaxy = getGalaxyInstance(); - let history_panel = Galaxy.currHistoryPanel; + const Galaxy = getGalaxyInstance(); + const history_panel = Galaxy.currHistoryPanel; let history_id = options.history_id; if (!history_id && history_panel) { history_id = history_panel.model.get("id"); diff --git a/client/galaxy/scripts/layout/masthead.js b/client/galaxy/scripts/layout/masthead.js index 61b48a899c0..13a33161e97 100644 --- a/client/galaxy/scripts/layout/masthead.js +++ b/client/galaxy/scripts/layout/masthead.js @@ -8,7 +8,7 @@ import { getGalaxyInstance } from "app"; /** Masthead **/ var View = Backbone.View.extend({ initialize: function(options) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); var self = this; this.options = options; diff --git a/client/galaxy/scripts/layout/menu.js b/client/galaxy/scripts/layout/menu.js index 6dcf85a8403..be37421f08a 100644 --- a/client/galaxy/scripts/layout/menu.js +++ b/client/galaxy/scripts/layout/menu.js @@ -11,9 +11,9 @@ import Webhooks from "mvc/webhooks"; import Utils from "utils/utils"; function logoutClick() { - let galaxy = getGalaxyInstance(); - let session_csrf_token = galaxy.session_csrf_token; - let url = `${galaxy.root}user/logout?session_csrf_token=${session_csrf_token}`; + const galaxy = getGalaxyInstance(); + const session_csrf_token = galaxy.session_csrf_token; + const url = `${galaxy.root}user/logout?session_csrf_token=${session_csrf_token}`; axios.get(url).then(() => { if (galaxy.user) { galaxy.user.clearSessionStorage(); @@ -33,7 +33,7 @@ var Collection = Backbone.Collection.extend({ options = options || {}; this.reset(); - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); // // Chat server tab @@ -141,7 +141,7 @@ var Collection = Backbone.Collection.extend({ }; // Galaxy.page is undefined for data libraries, workflows pages - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.page) { Galaxy.page.masthead.collection.add(obj); } else if (Galaxy.masthead) { @@ -403,7 +403,7 @@ var Tab = Backbone.View.extend({ if (options.onclick) { options.onclick(); } else { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (options.target == "__use_router__" && typeof Galaxy.page != "undefined") { Galaxy.page.router.executeUseRouter(options.url); } else { @@ -442,7 +442,7 @@ var Tab = Backbone.View.extend({ if (model.get("onclick")) { model.get("onclick")(); } else { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (model.attributes.target == "__use_router__" && typeof Galaxy.page != "undefined") { Galaxy.page.router.executeUseRouter(model.attributes.url); } else { diff --git a/client/galaxy/scripts/layout/page.js b/client/galaxy/scripts/layout/page.js index d7e7b9f2a10..b72acb0071a 100644 --- a/client/galaxy/scripts/layout/page.js +++ b/client/galaxy/scripts/layout/page.js @@ -27,7 +27,7 @@ var View = Backbone.View.extend({ }); // attach global objects, build mastheads - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.modal = this.modal = new Modal.View(); Galaxy.router = this.router = options.Router && new options.Router(self, options); Galaxy.data = this.data = new Data(this); @@ -190,7 +190,7 @@ var View = Backbone.View.extend({ /** Check if the communication server is online and show the icon otherwise hide the icon */ _checkCommunicationServerOnline: function() { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); var host = Galaxy.config.communication_server_host; var port = Galaxy.config.communication_server_port; var preferences = Galaxy.user.attributes.preferences; diff --git a/client/galaxy/scripts/layout/panel.js b/client/galaxy/scripts/layout/panel.js index d277923eb98..48303d06217 100644 --- a/client/galaxy/scripts/layout/panel.js +++ b/client/galaxy/scripts/layout/panel.js @@ -231,7 +231,7 @@ var CenterPanel = Backbone.View.extend({ /** Display a view in the center panel, hide iframe */ display: function(view) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); let contentWindow = this.$frame[0].contentWindow || {}; let message; try { diff --git a/client/galaxy/scripts/layout/router.js b/client/galaxy/scripts/layout/router.js index dd5f6a6df3d..ea8329195b8 100644 --- a/client/galaxy/scripts/layout/router.js +++ b/client/galaxy/scripts/layout/router.js @@ -14,7 +14,7 @@ var Router = Backbone.Router.extend({ }, executeUseRouter: function(url) { - let prefix = getAppRoot(); + const prefix = getAppRoot(); if (url.startsWith(prefix)) { url = url.replace(prefix, "/"); } @@ -28,9 +28,9 @@ var Router = Backbone.Router.extend({ .toString(36) .substr(2); url += url.indexOf("?") == -1 ? "?" : "&"; - let bustParam = $.param(data, true); + const bustParam = $.param(data, true); url += bustParam; - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.params = data; this.navigate(url, { trigger: true }); window.history.replaceState(window.history.state, "", window.location.pathname.replace(bustParam, "")); @@ -38,7 +38,7 @@ var Router = Backbone.Router.extend({ /** override to parse query string into obj and send to each route */ execute: function(callback, args, name) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.debug("router execute:", callback, args, name); var queryObj = QUERY_STRING.parse(args.pop()); args.push(queryObj); diff --git a/client/galaxy/scripts/layout/scratchbook.js b/client/galaxy/scripts/layout/scratchbook.js index e36466546e5..016362f05c5 100644 --- a/client/galaxy/scripts/layout/scratchbook.js +++ b/client/galaxy/scripts/layout/scratchbook.js @@ -74,7 +74,7 @@ export default Backbone.View.extend({ addDataset: function(dataset_id) { var self = this; var current_dataset = null; - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy && Galaxy.currHistoryPanel) { var history_id = Galaxy.currHistoryPanel.collection.historyId; this.history_cache[history_id] = { diff --git a/client/galaxy/scripts/mvc/base/controlled-fetch-collection.js b/client/galaxy/scripts/mvc/base/controlled-fetch-collection.js index d3e483cfead..9b5af96b2ac 100644 --- a/client/galaxy/scripts/mvc/base/controlled-fetch-collection.js +++ b/client/galaxy/scripts/mvc/base/controlled-fetch-collection.js @@ -28,14 +28,14 @@ var ControlledFetchCollection = Backbone.Collection.extend({ */ fetch: function(options) { options = this._buildFetchOptions(options); - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.debug("fetch options:", options); return Backbone.Collection.prototype.fetch.call(this, options); }, /** build ajax data/parameters from options */ _buildFetchOptions: function(options) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); // note: we normally want options passed in to override the defaults built here // so most of these fns will generate defaults @@ -271,7 +271,7 @@ var InfinitelyScrollingCollection = ControlledFetchCollection.extend({ /** fetch the first 'page' of data */ fetchFirst: function(options) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.debug("ControlledFetchCollection.fetchFirst:", options); options = options ? _.clone(options) : {}; this.allFetched = false; @@ -286,7 +286,7 @@ var InfinitelyScrollingCollection = ControlledFetchCollection.extend({ /** fetch the next page of data */ fetchMore: function(options) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.debug("ControlledFetchCollection.fetchMore:", options); options = _.clone(options || {}); diff --git a/client/galaxy/scripts/mvc/collection/collection-view-edit.js b/client/galaxy/scripts/mvc/collection/collection-view-edit.js index f90e13f37ef..c77e59cc217 100644 --- a/client/galaxy/scripts/mvc/collection/collection-view-edit.js +++ b/client/galaxy/scripts/mvc/collection/collection-view-edit.js @@ -49,7 +49,7 @@ var CollectionViewEdit = _super.extend( } // anon users shouldn't have access to any of the following - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (!Galaxy.user || Galaxy.user.isAnonymous()) { return; } @@ -78,22 +78,22 @@ var CollectionViewEdit = _super.extend( } }); - let el = $where.find(".tags-display")[0]; - let propsData = { + const el = $where.find(".tags-display")[0]; + const propsData = { model: this.model, disabled: false, context: "collection-view-edit" }; - let vm = mountModelTags(propsData, el); + const vm = mountModelTags(propsData, el); - let toggleEditor = () => { + const toggleEditor = () => { $(vm.$el).toggleClass("active"); this.tagsEditorShown = $(vm.$el).hasClass("active"); }; if (this.tagsEditorShown) { - let editorIsOpen = $(vm.$el).hasClass("active"); + const editorIsOpen = $(vm.$el).hasClass("active"); if (!editorIsOpen) { toggleEditor(); } diff --git a/client/galaxy/scripts/mvc/collection/list-collection-creator.js b/client/galaxy/scripts/mvc/collection/list-collection-creator.js index ba77f2d039e..4721ae4ae2d 100644 --- a/client/galaxy/scripts/mvc/collection/list-collection-creator.js +++ b/client/galaxy/scripts/mvc/collection/list-collection-creator.js @@ -1011,7 +1011,7 @@ var ListCollectionCreator = Backbone.View.extend(BASE_MVC.LoggableMixin) const collectionCreatorModalSetup = function _collectionCreatorModalSetup(options) { const deferred = jQuery.Deferred(); - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); const modal = Galaxy.modal || new UI_MODAL.View(); const creatorOptions = _.defaults(options || {}, { diff --git a/client/galaxy/scripts/mvc/dataset/data.js b/client/galaxy/scripts/mvc/dataset/data.js index 690f643d909..c054946753d 100644 --- a/client/galaxy/scripts/mvc/dataset/data.js +++ b/client/galaxy/scripts/mvc/dataset/data.js @@ -405,7 +405,7 @@ var TabularButtonTracksterView = Backbone.View.extend({ // backbone initialize initialize: function(options) { // check if environment is available - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); // link galaxy modal or create one if (Galaxy && Galaxy.modal) { diff --git a/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js b/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js index fca53d24b16..9420974a77d 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-edit-attributes.js @@ -12,7 +12,7 @@ import Form from "mvc/form/form-view"; var View = Backbone.View.extend({ initialize: function() { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); this.setElement("
"); this.model = new Backbone.Model({ dataset_id: Galaxy.params.dataset_id @@ -214,7 +214,7 @@ var View = Backbone.View.extend({ /** reload Galaxy's history after updating dataset's attributes */ _reloadHistory: function() { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy) { Galaxy.currHistoryPanel.loadCurrentHistory(); } diff --git a/client/galaxy/scripts/mvc/dataset/dataset-error.js b/client/galaxy/scripts/mvc/dataset/dataset-error.js index 21f395dca7a..efb2af6a857 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-error.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-error.js @@ -11,7 +11,7 @@ import Form from "mvc/form/form-view"; /** Dataset edit attributes view */ var View = Backbone.View.extend({ initialize: function() { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); this.setElement("
"); this.model = new Backbone.Model({ dataset_id: Galaxy.params.dataset_id @@ -132,7 +132,7 @@ var View = Backbone.View.extend({ var message = "

Error Details

"; if (job_messages) { message += "

Execution resulted in the following messages:

"; - for (let job_message of job_messages) { + for (const job_message of job_messages) { message += `

${_.escape(job_message["desc"])}

`; } } @@ -172,7 +172,7 @@ var View = Backbone.View.extend({ /** Convert tab template */ _getBugFormTemplate: function(dataset, job) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); var inputs = [ { help: _l("Your email address"), diff --git a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js index 26928c06936..f1029313fb3 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js @@ -63,7 +63,7 @@ var DatasetListItemEdit = _super.extend( faIcon: "fa-pencil", classes: "edit-btn", onclick: function(ev) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.router) { ev.preventDefault(); Galaxy.router.push("datasets/edit", { @@ -164,7 +164,7 @@ var DatasetListItemEdit = _super.extend( }); }; - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.user.id === null) { return null; } @@ -226,7 +226,7 @@ var DatasetListItemEdit = _super.extend( classes: "report-error-btn", faIcon: "fa-bug", onclick: function(ev) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.router) { ev.preventDefault(); Galaxy.router.push("datasets/error", { @@ -248,7 +248,7 @@ var DatasetListItemEdit = _super.extend( target: this.linkTarget, faIcon: "fa-refresh", onclick: function(ev) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.router) { ev.preventDefault(); Galaxy.router.push("/", { @@ -273,15 +273,15 @@ var DatasetListItemEdit = _super.extend( } if (visualizations.length >= 1) { - let dsid = this.model.get("id"); - let url = getAppRoot() + "visualizations?dataset_id=" + dsid; + const dsid = this.model.get("id"); + const url = getAppRoot() + "visualizations?dataset_id=" + dsid; return faIconButton({ title: _l("Visualize this data"), href: url, classes: "visualization-link", faIcon: "fa-bar-chart-o", onclick: ev => { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.frame && Galaxy.frame.active) { ev.preventDefault(); Galaxy.frame.add({ url: url, title: "Visualization" }); @@ -303,24 +303,24 @@ var DatasetListItemEdit = _super.extend( return; } - let el = $where.find(".tags-display")[0]; + const el = $where.find(".tags-display")[0]; - let propsData = { + const propsData = { model: this.model, disabled: false, context: "dataset-li-edit" }; - let vm = mountModelTags(propsData, el); + const vm = mountModelTags(propsData, el); // tag icon button open/closes - let activator = faIconButton({ + const activator = faIconButton({ title: _l("Edit dataset tags"), classes: "tag-btn", faIcon: "fa-tags" }).appendTo($where.find(".actions .right")); - let toggleEditor = () => { + const toggleEditor = () => { $(vm.$el).toggleClass("active"); this.tagsEditorShown = $(vm.$el).hasClass("active"); }; @@ -328,7 +328,7 @@ var DatasetListItemEdit = _super.extend( activator.on("click", toggleEditor); if (this.tagsEditorShown) { - let editorIsOpen = $(vm.$el).hasClass("active"); + const editorIsOpen = $(vm.$el).hasClass("active"); if (!editorIsOpen) { toggleEditor(); } diff --git a/client/galaxy/scripts/mvc/dataset/dataset-li.js b/client/galaxy/scripts/mvc/dataset/dataset-li.js index 99a01609568..02e4fd8bfa7 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-li.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-li.js @@ -45,15 +45,15 @@ export var DatasetListItemView = _super.extend( // mount new vue component for tags render: function() { - let result = _super.prototype.render.apply(this, arguments); + const result = _super.prototype.render.apply(this, arguments); this._mountVueNametags(); return result; }, _mountVueNametags: function() { - let container = this.$(".nametags")[0]; - let { id, model_class, tags } = this.model.attributes; - let storeKey = `${model_class}-${id}`; + const container = this.$(".nametags")[0]; + const { id, model_class, tags } = this.model.attributes; + const storeKey = `${model_class}-${id}`; mountNametags({ storeKey, tags }, container); }, @@ -181,7 +181,7 @@ export var DatasetListItemView = _super.extend( // add frame manager option onclick event var self = this; displayBtnData.onclick = ev => { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.frame && Galaxy.frame.active) { // Add dataset to frames. Galaxy.frame.addDataset(self.model.get("id")); @@ -279,7 +279,7 @@ export var DatasetListItemView = _super.extend( target: this.linkTarget, faIcon: "fa-info-circle", onclick: function(ev) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (Galaxy.frame && Galaxy.frame.active) { Galaxy.frame.add({ title: _l("Dataset details"), diff --git a/client/galaxy/scripts/mvc/form/form-data.js b/client/galaxy/scripts/mvc/form/form-data.js index 34206c529b4..ddee9476119 100644 --- a/client/galaxy/scripts/mvc/form/form-data.js +++ b/client/galaxy/scripts/mvc/form/form-data.js @@ -214,7 +214,7 @@ export var visitInputs = (inputs, callback, prefix, context) => { } }); for (var key in inputs) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); var node = inputs[key]; node.name = node.name || key; var name = prefix ? `${prefix}|${node.name}` : node.name; diff --git a/client/galaxy/scripts/mvc/form/form-parameters.js b/client/galaxy/scripts/mvc/form/form-parameters.js index 37791931046..bae5a5a10be 100644 --- a/client/galaxy/scripts/mvc/form/form-parameters.js +++ b/client/galaxy/scripts/mvc/form/form-parameters.js @@ -42,7 +42,7 @@ export default Backbone.Model.extend({ /** Returns an input field for a given field type */ create: function(input_def) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); var fieldClass = this.types[input_def.type]; var field = typeof this[fieldClass] === "function" ? this[fieldClass].call(this, input_def) : null; if (!field) { diff --git a/client/galaxy/scripts/mvc/form/form-repeat.js b/client/galaxy/scripts/mvc/form/form-repeat.js index 872db3b6795..3adbe7905e4 100644 --- a/client/galaxy/scripts/mvc/form/form-repeat.js +++ b/client/galaxy/scripts/mvc/form/form-repeat.js @@ -42,7 +42,7 @@ export var View = Backbone.View.extend({ /** Add new repeat block */ add: function(options) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (!options.id || this.list[options.id]) { Galaxy.emit.debug("form-repeat::add()", "Duplicate or invalid repeat block id."); return; @@ -75,7 +75,7 @@ export var View = Backbone.View.extend({ /** Delete repeat block */ del: function(id) { - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); if (!this.list[id]) { Galaxy.emit.debug("form-repeat::del()", "Invalid repeat block id."); return; diff --git a/client/galaxy/scripts/mvc/form/form-view.js b/client/galaxy/scripts/mvc/form/form-view.js index 36c17b83281..6d2416fc7a3 100644 --- a/client/galaxy/scripts/mvc/form/form-view.js +++ b/client/galaxy/scripts/mvc/form/form-view.js @@ -33,7 +33,7 @@ export default Backbone.View.extend({ if (field.update) { field.update(node); field.trigger("change"); - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.emit.debug("form-view::update()", `Updating input: ${input_id}`); } }); @@ -157,7 +157,7 @@ export default Backbone.View.extend({ message: options.message }); } - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); Galaxy.emit.debug("form-view::initialize()", "Completed"); } }); diff --git a/client/galaxy/scripts/mvc/grid/grid-shared.js b/client/galaxy/scripts/mvc/grid/grid-shared.js index 307aff1b921..d73f06e2697 100644 --- a/client/galaxy/scripts/mvc/grid/grid-shared.js +++ b/client/galaxy/scripts/mvc/grid/grid-shared.js @@ -10,7 +10,7 @@ import LoadingIndicator from "ui/loading-indicator"; var View = Backbone.View.extend({ initialize: function(options) { var self = this; - let Galaxy = getGalaxyInstance(); + const Galaxy = getGalaxyInstance(); LoadingIndicator.markViewAsLoading(this); this.model = new Backbone.Model(options); this.item = this.model.get("item"); diff --git a/client/galaxy/scripts/mvc/grid/grid-template.js b/client/galaxy/scripts/mvc/grid/grid-template.js index 4facf631094..a9975babc93 100644 --- a/client/galaxy/scripts/mvc/grid/grid-template.js +++ b/client/galaxy/scripts/mvc/grid/grid-template.js @@ -67,7 +67,7 @@ export default { '
  • Actions
  • ' + '
    '; } - for (let action of options.global_actions) { + for (const action of options.global_actions) { tmpl += `
  • ${action.label}
  • `; @@ -106,7 +106,7 @@ export default { } // create header elements - for (let column of options.columns) { + for (const column of options.columns) { if (column.visible) { tmpl += ``; if (column.sortable) { @@ -140,7 +140,7 @@ export default { } // create rows - for (let item of options.items) { + for (const item of options.items) { // Tag current tmpl += "" + ''; - for (let operation of options.operations) { + for (const operation of options.operations) { if (operation.global_operation) { tmpl += `${operation.label}`; } @@ -368,7 +368,7 @@ export default { // identify columns with advanced filtering var show_advanced_search_link = false; - for (let column of options.columns) { + for (const column of options.columns) { if (column.filterable == "advanced") { var column_key = column.key; var f_key = filters[column_key]; @@ -392,7 +392,7 @@ export default { var tmpl = `