mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Merge pull request #7860 from dannon/preferconst
Add linting and enforce prefer-const rule for client codebase
This commit is contained in:
@@ -8,6 +8,7 @@ module.exports = {
|
||||
rules: {
|
||||
"no-console": "off",
|
||||
"no-unused-vars": ["error", { args: "none" }],
|
||||
"prefer-const": "error",
|
||||
// I'd love to turn on camelcase, but it's a big shift with tons of current errors.
|
||||
// camelcase: [
|
||||
// "error",
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -99,7 +99,7 @@ export default {
|
||||
},
|
||||
/** Add highlighting for record variations, i.e. datasets vs. libraries/collections **/
|
||||
formatRows() {
|
||||
for (let item of this.items) {
|
||||
for (const item of this.items) {
|
||||
let _rowVariant = "active";
|
||||
if (item.isDataset) {
|
||||
_rowVariant = this.model.exists(item.id) ? "success" : "default";
|
||||
@@ -121,7 +121,7 @@ export default {
|
||||
},
|
||||
/** Called when selection is complete, values are formatted and parsed to external callback **/
|
||||
finalize: function() {
|
||||
let results = this.model.finalize();
|
||||
const results = this.model.finalize();
|
||||
this.modalShow = false;
|
||||
this.callback(results);
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -32,8 +32,8 @@ export default {
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
let historyId = this.id,
|
||||
url = "";
|
||||
const historyId = this.id;
|
||||
let url = "";
|
||||
if (historyId !== undefined && historyId !== "" && historyId !== null) {
|
||||
url = getAppRoot() + "history/display_structured?id=" + historyId;
|
||||
} else {
|
||||
@@ -56,13 +56,13 @@ export default {
|
||||
});
|
||||
},
|
||||
_updateHistoryData: function(response) {
|
||||
let historyItems = response.data;
|
||||
const historyItems = response.data;
|
||||
this.historyTemplate = historyItems.template;
|
||||
this.historyJSON = historyItems.history_json;
|
||||
},
|
||||
makeHistoryView: function(historyDict) {
|
||||
window.hdas = historyDict.map(hda => {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
return new HDAListItemEdit.HDAListItemEdit({
|
||||
model: new HDAModel.HistoryDatasetAssociation(hda),
|
||||
el: $("#hda-" + hda.id),
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
// toggle the body section of each item in the structure
|
||||
$(function() {
|
||||
$(".workflow, .tool").each((index, element) => {
|
||||
let body = $(element).children(".body");
|
||||
const body = $(element).children(".body");
|
||||
$(element)
|
||||
.children(".header")
|
||||
.click(e => {
|
||||
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
if (!this.sourceFile && !this.sourceURL) {
|
||||
this.errorMessage = "You must provide a history archive URL or file.";
|
||||
} else {
|
||||
let formData = new FormData();
|
||||
const formData = new FormData();
|
||||
formData.append("archive_file", this.sourceFile);
|
||||
formData.append("archive_source", this.sourceURL);
|
||||
axios
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
}&status=success`;
|
||||
})
|
||||
.catch(error => {
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.errorMessage = message || "Import failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
let url = getAppRoot() + "history/view/" + this.id;
|
||||
const url = getAppRoot() + "history/view/" + this.id;
|
||||
this.ajaxCall(url, this.updateHistoryView);
|
||||
},
|
||||
methods: {
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
},
|
||||
makeHistoryView: function(history) {
|
||||
$(function() {
|
||||
let options = {
|
||||
const options = {
|
||||
hasMasthead: history.use_panels ? "true" : "false",
|
||||
userIsOwner: history.user_is_owner ? "true" : "false",
|
||||
isCurrent: history.history_is_current ? "true" : "false",
|
||||
@@ -104,14 +104,14 @@ export default {
|
||||
});
|
||||
},
|
||||
showStructure: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
let displayStructureInstance = Vue.extend(DisplayStructure),
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const displayStructureInstance = Vue.extend(DisplayStructure),
|
||||
mountView = document.createElement("div");
|
||||
Galaxy.page.center.display(mountView);
|
||||
new displayStructureInstance({ propsData: { id: QueryStringParsing.get("id") } }).$mount(mountView);
|
||||
},
|
||||
switchHistory: function() {
|
||||
let url = getAppRoot() + "history/switch_to_history?hist_id=" + this.historyHistory["id"];
|
||||
const url = getAppRoot() + "history/switch_to_history?hist_id=" + this.historyHistory["id"];
|
||||
this.ajaxCall(url, this.reloadPage);
|
||||
},
|
||||
reloadPage: function() {
|
||||
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
let galaxy = getGalaxyInstance();
|
||||
const galaxy = getGalaxyInstance();
|
||||
|
||||
// old backbone view
|
||||
if (!galaxy.masthead) {
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
}
|
||||
|
||||
// bolt the rendered DOM onto the vue component's element
|
||||
let backboneDom = galaxy.masthead.render();
|
||||
const backboneDom = galaxy.masthead.render();
|
||||
this.$el.appendChild(backboneDom.$el[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
return this.tag.startsWith("name:") ? this.tag.replace("name:", "") : this.tag;
|
||||
},
|
||||
tagStyles() {
|
||||
let { primary, contrasting, darker } = keyedColorScheme(this.tag);
|
||||
const { primary, contrasting, darker } = keyedColorScheme(this.tag);
|
||||
return {
|
||||
"background-color": primary,
|
||||
color: contrasting,
|
||||
|
||||
@@ -73,9 +73,9 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
let url = `${getAppRoot()}api/plugins`;
|
||||
let dataset_id = Galaxy.params.dataset_id;
|
||||
const dataset_id = Galaxy.params.dataset_id;
|
||||
if (dataset_id) {
|
||||
this.fixed = true;
|
||||
this.selected = dataset_id;
|
||||
@@ -95,8 +95,8 @@ export default {
|
||||
if (this.fixed) {
|
||||
this.create(plugin);
|
||||
} else {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
let history_id = Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model.id;
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const history_id = Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model.id;
|
||||
if (history_id) {
|
||||
axios
|
||||
.get(`${getAppRoot()}api/plugins/${plugin.name}?history_id=${history_id}`)
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
}
|
||||
},
|
||||
create: function(plugin) {
|
||||
let href = `${plugin.href}?dataset_id=${this.selected}`;
|
||||
const href = `${plugin.href}?dataset_id=${this.selected}`;
|
||||
if (plugin.target == "_top") {
|
||||
window.location.href = href;
|
||||
} else {
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
);
|
||||
},
|
||||
_errorMessage: function(e) {
|
||||
let message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
const message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
return message || "Request failed for an unknown reason.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ const ColumnSelector = {
|
||||
return colHeaders;
|
||||
}
|
||||
const remaining = {};
|
||||
for (let key in colHeaders) {
|
||||
for (const key in colHeaders) {
|
||||
if (this.target.indexOf(parseInt(key)) === -1) {
|
||||
remaining[key] = colHeaders[key];
|
||||
}
|
||||
@@ -685,7 +685,7 @@ const ColumnSelector = {
|
||||
handleInput(value) {
|
||||
if (this.multiple) {
|
||||
// https://stackoverflow.com/questions/262427/why-does-parseint-yield-nan-with-arraymap
|
||||
let val = value.map(idx => parseInt(idx));
|
||||
const val = value.map(idx => parseInt(idx));
|
||||
this.$emit("update:target", val);
|
||||
} else {
|
||||
let val = parseInt(value);
|
||||
@@ -951,7 +951,7 @@ export default {
|
||||
if (this.initialElements !== null) {
|
||||
const collectionType = this.initialElements.collection_type;
|
||||
const collectionTypeRanks = collectionType.split(":");
|
||||
for (let index in collectionTypeRanks) {
|
||||
for (const index in collectionTypeRanks) {
|
||||
rules.push({
|
||||
type: "add_column_metadata",
|
||||
value: "identifier" + index
|
||||
@@ -1187,7 +1187,7 @@ export default {
|
||||
},
|
||||
mappedTargets() {
|
||||
const targets = [];
|
||||
for (let mapping of this.mapping) {
|
||||
for (const mapping of this.mapping) {
|
||||
targets.push(mapping.type);
|
||||
}
|
||||
return targets;
|
||||
@@ -1195,7 +1195,7 @@ export default {
|
||||
unmappedTargets() {
|
||||
const targets = [];
|
||||
const mappedTargets = this.mappedTargets;
|
||||
for (let target in MAPPING_TARGETS) {
|
||||
for (const target in MAPPING_TARGETS) {
|
||||
const targetModes = MAPPING_TARGETS[target].modes;
|
||||
|
||||
if (targetModes && targetModes.indexOf(this.elementsType) < 0) {
|
||||
@@ -1217,16 +1217,16 @@ export default {
|
||||
return targets;
|
||||
},
|
||||
colHeaders() {
|
||||
let { data, columns } = this.hotData;
|
||||
const { data, columns } = this.hotData;
|
||||
return RuleDefs.colHeadersFor(data, columns);
|
||||
},
|
||||
colHeadersDisplay() {
|
||||
const formattedHeaders = [];
|
||||
for (let colIndex in this.colHeaders) {
|
||||
for (const colIndex in this.colHeaders) {
|
||||
const colHeader = this.colHeaders[colIndex];
|
||||
formattedHeaders[colIndex] = `<b>${_.escape(colHeader)}</b>`;
|
||||
const mappingDisplay = [];
|
||||
for (let mapping of this.mapping) {
|
||||
for (const mapping of this.mapping) {
|
||||
if (mapping.columns.indexOf(parseInt(colIndex)) !== -1) {
|
||||
const mappingDef = MAPPING_TARGETS[mapping.type];
|
||||
mappingDisplay.push(`<i>${_.escape(mappingDef.columnHeader || mappingDef.label)}</i>`);
|
||||
@@ -1245,7 +1245,7 @@ export default {
|
||||
},
|
||||
mappingAsDict() {
|
||||
const asDict = {};
|
||||
for (let mapping of this.mapping) {
|
||||
for (const mapping of this.mapping) {
|
||||
asDict[mapping.type] = mapping;
|
||||
}
|
||||
return asDict;
|
||||
@@ -1261,7 +1261,7 @@ export default {
|
||||
collectionType = "list:list:list:paired";
|
||||
}
|
||||
const collectionTypeRanks = collectionType.split(":");
|
||||
for (let index in collectionTypeRanks) {
|
||||
for (const index in collectionTypeRanks) {
|
||||
const collectionTypeRank = collectionTypeRanks[index];
|
||||
if (collectionTypeRank == "list") {
|
||||
// TODO: drop the numeral at the end if only flat list
|
||||
@@ -1487,7 +1487,7 @@ export default {
|
||||
this.mapping.splice(index, 1);
|
||||
},
|
||||
refreshAndWait(response) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel) {
|
||||
Galaxy.currHistoryPanel.refreshContents();
|
||||
}
|
||||
@@ -1506,7 +1506,7 @@ export default {
|
||||
"Unknown error encountered while running your upload job, this could be a server issue or a problem with the upload definition.";
|
||||
this.doFullJobCheck(jobId);
|
||||
} else {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const history = Galaxy && Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model;
|
||||
history.refresh();
|
||||
this.oncreate();
|
||||
@@ -1592,13 +1592,13 @@ export default {
|
||||
this.oncreate();
|
||||
}
|
||||
} else {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const historyId = Galaxy.currHistoryPanel.model.id;
|
||||
let elements, targets;
|
||||
if (collectionType) {
|
||||
targets = [];
|
||||
const elementsByCollectionName = this.creationElementsForFetch();
|
||||
for (let collectionName in elementsByCollectionName) {
|
||||
for (const collectionName in elementsByCollectionName) {
|
||||
const target = {
|
||||
destination: { type: "hdca" },
|
||||
elements: elementsByCollectionName[collectionName],
|
||||
@@ -1656,11 +1656,11 @@ export default {
|
||||
const collectionType = this.collectionType;
|
||||
const elementsByName = {};
|
||||
|
||||
let dataByCollection = {};
|
||||
const dataByCollection = {};
|
||||
const collectionNameMap = this.mappingAsDict.collection_name;
|
||||
if (collectionNameMap) {
|
||||
const collectionNameTarget = collectionNameMap.columns[0];
|
||||
for (let dataIndex in data) {
|
||||
for (const dataIndex in data) {
|
||||
const row = data[dataIndex];
|
||||
const name = row[collectionNameTarget];
|
||||
if (!dataByCollection[name]) {
|
||||
@@ -1673,11 +1673,11 @@ export default {
|
||||
dataByCollection[this.collectionName] = data;
|
||||
}
|
||||
|
||||
for (let collectionName in dataByCollection) {
|
||||
for (const collectionName in dataByCollection) {
|
||||
const elements = [];
|
||||
const identifiers = [];
|
||||
|
||||
for (let dataIndex in dataByCollection[collectionName]) {
|
||||
for (const dataIndex in dataByCollection[collectionName]) {
|
||||
const rowData = data[dataIndex];
|
||||
|
||||
// For each row, find place in depth for this element.
|
||||
@@ -1724,7 +1724,7 @@ export default {
|
||||
.slice(1)
|
||||
.join(":");
|
||||
let found = false;
|
||||
for (let element of elementsAtDepth) {
|
||||
for (const element of elementsAtDepth) {
|
||||
if (element["name"] == identifier) {
|
||||
elementsAtDepth = element[subElementProp];
|
||||
identifiersAtDepth = identifiersAtDepth[identifier];
|
||||
@@ -1795,7 +1795,7 @@ export default {
|
||||
|
||||
const datasets = [];
|
||||
|
||||
for (let dataIndex in data) {
|
||||
for (const dataIndex in data) {
|
||||
const res = this._datasetFor(dataIndex, data, mappingAsDict);
|
||||
datasets.push(res);
|
||||
}
|
||||
@@ -1806,7 +1806,7 @@ export default {
|
||||
const parentIdentifiers = parentIdentifiers_ ? parentIdentifiers_ : [];
|
||||
let data = [];
|
||||
let sources = [];
|
||||
for (let element of elements) {
|
||||
for (const element of elements) {
|
||||
const elementObject = element.object;
|
||||
const identifiers = parentIdentifiers.concat([element.element_identifier]);
|
||||
const collectionTypeLevelSepIndex = collectionType.indexOf(":");
|
||||
@@ -1818,7 +1818,7 @@ export default {
|
||||
sources.push(source);
|
||||
} else {
|
||||
const restCollectionType = collectionType.slice(collectionTypeLevelSepIndex + 1);
|
||||
let elementObj = this.populateElementsFromCollectionDescription(
|
||||
const elementObj = this.populateElementsFromCollectionDescription(
|
||||
elementObject.elements,
|
||||
restCollectionType,
|
||||
identifiers
|
||||
@@ -1919,7 +1919,7 @@ export default {
|
||||
if (this.elementsType !== "collection_contents") {
|
||||
let columnCount = null;
|
||||
if (this.elementsType == "datasets") {
|
||||
for (let element of this.initialElements) {
|
||||
for (const element of this.initialElements) {
|
||||
if (element.history_content_type == "dataset_collection") {
|
||||
this.errorMessage =
|
||||
"This component can only be used with datasets, you have specified one or more collections.";
|
||||
@@ -1927,7 +1927,7 @@ export default {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let row of this.initialElements) {
|
||||
for (const row of this.initialElements) {
|
||||
if (columnCount == null) {
|
||||
columnCount = row.length;
|
||||
} else {
|
||||
|
||||
@@ -175,8 +175,8 @@ export default {
|
||||
}`;
|
||||
},
|
||||
item_url_parts() {
|
||||
let str = this.item_url;
|
||||
let index = str.lastIndexOf("/");
|
||||
const str = this.item_url;
|
||||
const index = str.lastIndexOf("/");
|
||||
return [str.substring(0, index + 1), str.substring(index + 1)];
|
||||
},
|
||||
published_url() {
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
return {
|
||||
ready: false,
|
||||
has_username: Galaxy.user.get("username"),
|
||||
@@ -232,7 +232,7 @@ export default {
|
||||
.catch(error => (this.err_msg = error.response.data.err_msg));
|
||||
},
|
||||
setUsername: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
axios
|
||||
.put(`${getAppRoot()}api/users/${Galaxy.user.id}/information/inputs`, {
|
||||
username: this.new_username || ""
|
||||
@@ -245,7 +245,7 @@ export default {
|
||||
.catch(error => (this.err_msg = error.response.data.err_msg));
|
||||
},
|
||||
setSharing: function(action, user_id) {
|
||||
let data = {
|
||||
const data = {
|
||||
action: action,
|
||||
user_id: user_id
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
// initialize toggle value
|
||||
let isClosed = this.useToggleLink && this.value.length > this.maxVisibleTags;
|
||||
const isClosed = this.useToggleLink && this.value.length > this.maxVisibleTags;
|
||||
|
||||
return {
|
||||
tagText: "",
|
||||
@@ -92,13 +92,13 @@ export default {
|
||||
},
|
||||
beforeAddingTag($event) {
|
||||
if (!this.emitHookEvent("before-adding-tag", $event)) {
|
||||
let { tag, addTag } = $event;
|
||||
const { tag, addTag } = $event;
|
||||
addTag(tag);
|
||||
}
|
||||
},
|
||||
beforeDeletingTag($event) {
|
||||
if (!this.emitHookEvent("before-deleting-tag", $event)) {
|
||||
let { tag, deleteTag } = $event;
|
||||
const { tag, deleteTag } = $event;
|
||||
deleteTag(tag);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)));
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ Vue.use(BootstrapVue);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
return {
|
||||
sourceFile: null,
|
||||
sourceURL: null,
|
||||
@@ -52,7 +52,7 @@ export default {
|
||||
if (!this.sourceFile && !this.sourceURL) {
|
||||
this.errorMessage = "You must provide a workflow archive URL or file.";
|
||||
} else {
|
||||
let formData = new FormData();
|
||||
const formData = new FormData();
|
||||
formData.append("archive_file", this.sourceFile);
|
||||
formData.append("archive_source", this.sourceURL);
|
||||
axios
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
}&status=success`;
|
||||
})
|
||||
.catch(error => {
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.errorMessage = message || "Import failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ export default {
|
||||
];
|
||||
},
|
||||
tableFields() {
|
||||
let tableFields = this.fields.slice(0);
|
||||
const tableFields = this.fields.slice(0);
|
||||
if (this.showCommandLine) {
|
||||
tableFields.splice(5, 0, {
|
||||
key: "commandLine",
|
||||
@@ -143,9 +143,9 @@ export default {
|
||||
return tableFields;
|
||||
},
|
||||
tableItems() {
|
||||
let tableItems = this.jobs.slice(0);
|
||||
const tableItems = this.jobs.slice(0);
|
||||
|
||||
for (let item of tableItems) {
|
||||
for (const item of tableItems) {
|
||||
// Nicer time formatting
|
||||
item["updateTime"] = item["updateTime"].replace("T", "\n");
|
||||
|
||||
|
||||
@@ -58,15 +58,15 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
applicationsIndex: function() {
|
||||
let result = {};
|
||||
for (let app of this.applications) {
|
||||
const result = {};
|
||||
for (const app of this.applications) {
|
||||
result[app.id] = app;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
applicationsAll: function() {
|
||||
let result = [];
|
||||
for (let app of this.applications) {
|
||||
const result = [];
|
||||
for (const app of this.applications) {
|
||||
result.push(app.id);
|
||||
}
|
||||
return result;
|
||||
@@ -99,8 +99,8 @@ export default {
|
||||
this._reload([id]);
|
||||
},
|
||||
reloadAll: function() {
|
||||
let ids = [];
|
||||
for (let app of this.applications) {
|
||||
const ids = [];
|
||||
for (const app of this.applications) {
|
||||
ids.push(app.id);
|
||||
}
|
||||
this._reload(ids);
|
||||
@@ -119,15 +119,15 @@ export default {
|
||||
});
|
||||
},
|
||||
_highlightRows: function(appList, status) {
|
||||
for (let appIndex of appList) {
|
||||
let app = this.applicationsIndex[appIndex];
|
||||
for (const appIndex of appList) {
|
||||
const app = this.applicationsIndex[appIndex];
|
||||
if (app) {
|
||||
app._rowVariant = status;
|
||||
}
|
||||
}
|
||||
},
|
||||
_errorMessage: function(e) {
|
||||
let message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
const message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
this.messageText = message || "Request failed for an unknown reason.";
|
||||
this.messageVariant = "danger";
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
this.errorStackLoaded = true;
|
||||
})
|
||||
.catch(e => {
|
||||
let message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
const message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
this.messageText = message || "Request failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
let galaxy = getGalaxyInstance();
|
||||
let oidc_idps = galaxy.config.oidc;
|
||||
const galaxy = getGalaxyInstance();
|
||||
const oidc_idps = galaxy.config.oidc;
|
||||
// Icons to use for each IdP
|
||||
let oidc_idps_icons = { google: "fa fa-google" };
|
||||
const oidc_idps_icons = { google: "fa fa-google" };
|
||||
// Add default icons to IdPs without icons
|
||||
oidc_idps
|
||||
.filter(function(key) {
|
||||
@@ -99,7 +99,7 @@ export default {
|
||||
}
|
||||
},
|
||||
submitGalaxyLogin: function(method) {
|
||||
let rootUrl = getAppRoot();
|
||||
const rootUrl = getAppRoot();
|
||||
axios
|
||||
.post(`${rootUrl}user/login`, this.$data)
|
||||
.then(response => {
|
||||
@@ -116,12 +116,12 @@ export default {
|
||||
})
|
||||
.catch(error => {
|
||||
this.messageVariant = "danger";
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.messageText = message || "Login failed for an unknown reason.";
|
||||
});
|
||||
},
|
||||
submitOIDCLogin: function(idp) {
|
||||
let rootUrl = getAppRoot();
|
||||
const rootUrl = getAppRoot();
|
||||
axios
|
||||
.post(`${rootUrl}authnz/${idp}/login`)
|
||||
.then(response => {
|
||||
@@ -132,12 +132,12 @@ export default {
|
||||
})
|
||||
.catch(error => {
|
||||
this.messageVariant = "danger";
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.messageText = message || "Login failed for an unknown reason.";
|
||||
});
|
||||
},
|
||||
reset: function(ev) {
|
||||
let rootUrl = getAppRoot();
|
||||
const rootUrl = getAppRoot();
|
||||
ev.preventDefault();
|
||||
axios
|
||||
.post(`${rootUrl}user/reset_password`, { email: this.login })
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
})
|
||||
.catch(error => {
|
||||
this.messageVariant = "danger";
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.messageText = message || "Password reset failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ Vue.use(BootstrapVue);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
return {
|
||||
token: Galaxy.params.token,
|
||||
user: Galaxy.params.expired_user,
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
submit: function(ev) {
|
||||
let urlRoot = getAppRoot();
|
||||
const urlRoot = getAppRoot();
|
||||
ev.preventDefault();
|
||||
axios
|
||||
.post(`${urlRoot}user/change_password`, {
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
})
|
||||
.catch(error => {
|
||||
this.messageVariant = "danger";
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.messageText = message || "Password change failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
let galaxy = getGalaxyInstance();
|
||||
const galaxy = getGalaxyInstance();
|
||||
return {
|
||||
email: null,
|
||||
password: null,
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
}
|
||||
},
|
||||
submit: function(method) {
|
||||
let rootUrl = getAppRoot();
|
||||
const rootUrl = getAppRoot();
|
||||
axios
|
||||
.post(`${rootUrl}user/create`, this.$data)
|
||||
.then(response => {
|
||||
@@ -106,7 +106,7 @@ export default {
|
||||
})
|
||||
.catch(error => {
|
||||
this.messageVariant = "danger";
|
||||
let message = error.response.data && error.response.data.err_msg;
|
||||
const message = error.response.data && error.response.data.err_msg;
|
||||
this.messageText = message || "Registration failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 `<div class="toolTitle">
|
||||
<a href="${appRoot}${tool.href}" target="galaxy_main">
|
||||
${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 `<div class="toolTitle">
|
||||
<a href="${appRoot}${tool.href}">
|
||||
${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 `<div class="toolTitle">
|
||||
<a class="${wf.cls}" href="${appRoot}${wf.href}">
|
||||
${_.escape(wf.title)}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: $("<div/>")
|
||||
@@ -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: $("<div/>")
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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] = {
|
||||
|
||||
@@ -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 || {});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 || {}, {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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("<div/>");
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -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("<div/>");
|
||||
this.model = new Backbone.Model({
|
||||
dataset_id: Galaxy.params.dataset_id
|
||||
@@ -132,7 +132,7 @@ var View = Backbone.View.extend({
|
||||
var message = "<h3>Error Details</h3>";
|
||||
if (job_messages) {
|
||||
message += "<p>Execution resulted in the following messages:</p>";
|
||||
for (let job_message of job_messages) {
|
||||
for (const job_message of job_messages) {
|
||||
message += `<p><pre>${_.escape(job_message["desc"])}</pre></p>`;
|
||||
}
|
||||
}
|
||||
@@ -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"),
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
'<li><a class="action-button" id="popup-global-actions" class="menubutton">Actions</a></li>' +
|
||||
'<div popupmenu="popup-global-actions">';
|
||||
}
|
||||
for (let action of options.global_actions) {
|
||||
for (const action of options.global_actions) {
|
||||
tmpl += `<li><a class="action-button use-target" target="${action.target}" href="${
|
||||
action.url_args
|
||||
}" onclick="return false;" >${action.label}</a></li>`;
|
||||
@@ -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 += `<th id="${column.key}-header">`;
|
||||
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 += "<tr ";
|
||||
if (options.current_item_id == item.id) {
|
||||
@@ -156,7 +156,7 @@ export default {
|
||||
}
|
||||
|
||||
// Data columns
|
||||
for (let column of options.columns) {
|
||||
for (const column of options.columns) {
|
||||
if (column.visible) {
|
||||
// Nowrap
|
||||
var nowrap = "";
|
||||
@@ -302,7 +302,7 @@ export default {
|
||||
`;
|
||||
|
||||
// configure buttons for operations
|
||||
for (let operation of options.operations) {
|
||||
for (const operation of options.operations) {
|
||||
if (operation.allow_multiple) {
|
||||
tmpl += `<input type="button" value="${
|
||||
operation.label
|
||||
@@ -316,7 +316,7 @@ export default {
|
||||
|
||||
// count global operations
|
||||
var found_global = false;
|
||||
for (let operation of options.operations) {
|
||||
for (const operation of options.operations) {
|
||||
if (operation.global_operation) {
|
||||
found_global = true;
|
||||
break;
|
||||
@@ -326,7 +326,7 @@ export default {
|
||||
// add global operations
|
||||
if (found_global) {
|
||||
tmpl += "<tr>" + '<td colspan="100">';
|
||||
for (let operation of options.operations) {
|
||||
for (const operation of options.operations) {
|
||||
if (operation.global_operation) {
|
||||
tmpl += `<a class="action-button" href="${operation.global_operation}">${operation.label}</a>`;
|
||||
}
|
||||
@@ -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 = `<div id="standard-search" style="display: ${standard_search_display};"><table><tr><td style="padding: 0;"><table>`;
|
||||
|
||||
// add standard filters
|
||||
for (let column of options.columns) {
|
||||
for (const column of options.columns) {
|
||||
if (column.filterable == "standard") {
|
||||
tmpl += this.grid_column_filter(options, column);
|
||||
}
|
||||
@@ -415,7 +415,7 @@ export default {
|
||||
tmpl += `<div id="advanced-search" style="display: ${advanced_search_display}; margin-top: 5px;"><table><tr><td style="text-align: left" colspan="100"><a href="" class="advanced-search-toggle">Close Advanced Search</a></td></tr>`;
|
||||
|
||||
// add advanced filters
|
||||
for (let column of options.columns) {
|
||||
for (const column of options.columns) {
|
||||
if (column.filterable == "advanced") {
|
||||
tmpl += this.grid_column_filter(options, column);
|
||||
}
|
||||
@@ -448,7 +448,7 @@ export default {
|
||||
if (column.is_text) {
|
||||
tmpl += `<form class="text-filter-form" column_key="${column_key}" action="${options.url}" method="get" >`;
|
||||
// Carry forward filtering criteria with hidden inputs.
|
||||
for (let column of options.columns) {
|
||||
for (const column of options.columns) {
|
||||
var filter_value = filters[column.key];
|
||||
if (filter_value) {
|
||||
if (filter_value != "All") {
|
||||
@@ -480,7 +480,7 @@ export default {
|
||||
|
||||
// multiple filter values
|
||||
if (type == "array") {
|
||||
for (let i in column_filter) {
|
||||
for (const i in column_filter) {
|
||||
// copy filters and remove entry
|
||||
var params = column_filter;
|
||||
params = params.slice(i);
|
||||
|
||||
@@ -34,7 +34,7 @@ export default Backbone.View.extend({
|
||||
store.watch(
|
||||
state => state.gridSearch.searchTags,
|
||||
newTags => {
|
||||
let tagArray = Array.from(newTags);
|
||||
const tagArray = Array.from(newTags);
|
||||
self.grid.add_filter("tags", tagArray, false);
|
||||
self.openAdvancedSearch();
|
||||
self.render_filter_button("tags", tagArray);
|
||||
@@ -84,7 +84,7 @@ export default Backbone.View.extend({
|
||||
handle_refresh: function(refresh_frames) {
|
||||
if (refresh_frames) {
|
||||
if ($.inArray("history", refresh_frames) > -1) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel) {
|
||||
Galaxy.currHistoryPanel.loadCurrentHistory();
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ var CopyDialog = {
|
||||
}
|
||||
|
||||
var originalClosingCallback = options.closing_callback;
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
modal.show(
|
||||
_.extend(options, {
|
||||
title: this.title({ name: history.get("name") }),
|
||||
@@ -229,7 +229,7 @@ var ImportDialog = _.extend({}, CopyDialog, {
|
||||
* {String} allDatasets default initial checked radio button: 'copy-all' or 'copy-non-deleted',
|
||||
*/
|
||||
var historyCopyDialog = (history, options) => {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
options = options || {};
|
||||
// create our own modal if Galaxy doesn't have one (mako tab without use_panels)
|
||||
var modal = Galaxy.modal || new MODAL.View({});
|
||||
|
||||
@@ -14,7 +14,7 @@ var HDCAListItemView = _super.extend(
|
||||
className: `${_super.prototype.className} history-content`,
|
||||
|
||||
render: function() {
|
||||
let result = _super.prototype.render.apply(this, arguments);
|
||||
const result = _super.prototype.render.apply(this, arguments);
|
||||
this._mountNametags("initialize");
|
||||
return result;
|
||||
},
|
||||
@@ -36,10 +36,10 @@ var HDCAListItemView = _super.extend(
|
||||
},
|
||||
|
||||
_mountNametags(context) {
|
||||
let container = this.$el.find(".nametags")[0];
|
||||
const container = this.$el.find(".nametags")[0];
|
||||
if (container) {
|
||||
let { id, model_class, tags } = this.model.attributes;
|
||||
let storeKey = `${model_class}-${id}`;
|
||||
const { id, model_class, tags } = this.model.attributes;
|
||||
const storeKey = `${model_class}-${id}`;
|
||||
mountNametags({ storeKey, tags }, container);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -394,7 +394,7 @@ export var HistoryContents = _super.extend(BASE_MVC.LoggableMixin).extend({
|
||||
progressivelyFetchDetails: function(options) {
|
||||
// TODO: only fetch tags and annotations if specifically requested
|
||||
options = options || {};
|
||||
let deferred = jQuery.Deferred();
|
||||
const deferred = jQuery.Deferred();
|
||||
this._recursivelyFetch(
|
||||
options,
|
||||
HDA_MODEL.HistoryDatasetAssociation.prototype.searchAttributes.join(","),
|
||||
|
||||
@@ -32,7 +32,7 @@ var HistoryGridView = GridView.extend({
|
||||
options.success = req => {
|
||||
const contentsStates = req.contents_states;
|
||||
let stateHtml = "";
|
||||
for (let state of ["ok", "running", "queued", "new", "error"]) {
|
||||
for (const state of ["ok", "running", "queued", "new", "error"]) {
|
||||
const stateCount = contentsStates[state];
|
||||
if (stateCount) {
|
||||
stateHtml += `<div class="count-box state-color-${state}" title="Datasets in ${state} state">${stateCount}</div> `;
|
||||
@@ -67,7 +67,7 @@ var HistoryGridView = GridView.extend({
|
||||
})
|
||||
.done(() => {
|
||||
historyCopyDialog(history, {}).done(() => {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel) {
|
||||
Galaxy.currHistoryPanel.loadCurrentHistory();
|
||||
}
|
||||
@@ -89,7 +89,7 @@ var HistoryGridView = GridView.extend({
|
||||
var View = Backbone.View.extend({
|
||||
title: _l("Histories"),
|
||||
initialize: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
LoadingIndicator.markViewAsLoading(this);
|
||||
|
||||
if (options.action_id == "list_published") {
|
||||
|
||||
@@ -138,7 +138,7 @@ export var History = Backbone.Model.extend(BASE_MVC.LoggableMixin).extend(
|
||||
* Note: that this will return false for an anon user even if the history is theirs.
|
||||
*/
|
||||
ownedByCurrUser: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// no currUser
|
||||
if (!Galaxy || !Galaxy.user) {
|
||||
return false;
|
||||
|
||||
@@ -117,7 +117,7 @@ var CurrentHistoryView = _super.extend(
|
||||
|
||||
/** loads a history & contents w/ details and makes them the current history */
|
||||
switchToHistory: function(historyId, attributes) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy.user.isAnonymous()) {
|
||||
this.trigger("error", _l("You must be logged in to switch histories"), _l("Anonymous user"));
|
||||
return $.when();
|
||||
@@ -129,7 +129,7 @@ var CurrentHistoryView = _super.extend(
|
||||
|
||||
/** creates a new history on the server and sets it as the user's current history */
|
||||
createNewHistory: function(attributes) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy.user.isAnonymous()) {
|
||||
this.trigger("error", _l("You must be logged in to create histories"), _l("Anonymous user"));
|
||||
return $.when();
|
||||
@@ -344,7 +344,7 @@ var CurrentHistoryView = _super.extend(
|
||||
events: _.extend(_.clone(_super.prototype.events), {
|
||||
// the two links in the empty message
|
||||
"click .uploader-link": function(ev) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
Galaxy.upload.show(ev);
|
||||
},
|
||||
"click .get-data-link": function(ev) {
|
||||
@@ -384,7 +384,7 @@ var CurrentHistoryView = _super.extend(
|
||||
// when the center panel is given a new view, clear the current indicator
|
||||
"center-panel:load": function(view) {
|
||||
try {
|
||||
let hdaId = view.model.attributes.dataset_id || null;
|
||||
const hdaId = view.model.attributes.dataset_id || null;
|
||||
if (hdaId === null) {
|
||||
throw "Invalid id";
|
||||
}
|
||||
|
||||
@@ -155,18 +155,18 @@ var HistoryViewEdit = _super.extend(
|
||||
|
||||
/** render the tags sub-view controller */
|
||||
_renderTags: function($where) {
|
||||
let el = $where.find(".controls .tags-display")[0];
|
||||
const el = $where.find(".controls .tags-display")[0];
|
||||
|
||||
let propsData = {
|
||||
const propsData = {
|
||||
model: this.model,
|
||||
disabled: false,
|
||||
context: "history-view-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 history tags"),
|
||||
classes: "history-tag-btn",
|
||||
faIcon: "fa-tags",
|
||||
@@ -283,7 +283,7 @@ var HistoryViewEdit = _super.extend(
|
||||
|
||||
var xhr = jQuery.ajax(options);
|
||||
xhr.done((message, status, responseObj) => {
|
||||
for (let updated of message) {
|
||||
for (const updated of message) {
|
||||
const typeId = updated.history_content_type + "-" + updated.id;
|
||||
actionModels[typeId].set(updated);
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ export function historyEntry(options) {
|
||||
$("#switch").click(function() {
|
||||
//##HACK:ity hack hack
|
||||
//##TODO: remove when out of iframe
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var hview = Galaxy.currHistoryPanel ? Galaxy.currHistoryPanel : null;
|
||||
if (hview) {
|
||||
hview.switchToHistory("${ history[ 'id' ] }");
|
||||
@@ -649,12 +649,12 @@ export function historyEntry(options) {
|
||||
$("#center").addClass("flex-vertical-container");
|
||||
}
|
||||
|
||||
let viewClass = options.userIsOwner ? HistoryViewEdit.HistoryViewEdit : HistoryView.HistoryView;
|
||||
let history = new History(options.historyJSON);
|
||||
const viewClass = options.userIsOwner ? HistoryViewEdit.HistoryViewEdit : HistoryView.HistoryView;
|
||||
const history = new History(options.historyJSON);
|
||||
|
||||
// attach the copy dialog to the import button now that we have a history
|
||||
$("#import").click(function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
HistoryCopyDialog(history, {
|
||||
useImport: true,
|
||||
// use default datasets option to match the toggle-deleted button
|
||||
@@ -668,7 +668,7 @@ export function historyEntry(options) {
|
||||
});
|
||||
});
|
||||
|
||||
let historyView = new viewClass({
|
||||
const historyView = new viewClass({
|
||||
el: $("#history-" + options.historyJSON.id),
|
||||
className: viewClass.prototype.className + " wide",
|
||||
$scrollContainer: options.hasMasthead
|
||||
|
||||
@@ -473,7 +473,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({
|
||||
|
||||
/** create a column and its panel and set up any listeners to them */
|
||||
createColumn: function createColumn(history, options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// options passed can be re-used, so extend them before adding the model to prevent pollution for the next
|
||||
options = _.extend({}, options, {
|
||||
model: history,
|
||||
|
||||
@@ -31,7 +31,7 @@ var menu = [
|
||||
{
|
||||
html: _l("Copy History"),
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
historyCopyDialog(Galaxy.currHistoryPanel.model).done(() => {
|
||||
Galaxy.currHistoryPanel.loadCurrentHistory();
|
||||
});
|
||||
@@ -40,7 +40,7 @@ var menu = [
|
||||
{
|
||||
html: _l("Share or Publish"),
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel && Galaxy.router) {
|
||||
Galaxy.router.push(`/histories/sharing?id=${Galaxy.currHistoryPanel.model.id}`);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ var menu = [
|
||||
html: _l("Show Structure"),
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel && Galaxy.router) {
|
||||
Galaxy.router.push("/histories/show_structure");
|
||||
}
|
||||
@@ -64,7 +64,7 @@ var menu = [
|
||||
html: _l("Delete"),
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel && confirm(_l("Really delete the current history?"))) {
|
||||
Galaxy.currHistoryPanel.model._delete().done(() => {
|
||||
Galaxy.currHistoryPanel.loadCurrentHistory();
|
||||
@@ -77,7 +77,7 @@ var menu = [
|
||||
purge: true,
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (
|
||||
Galaxy &&
|
||||
Galaxy.currHistoryPanel &&
|
||||
@@ -93,7 +93,7 @@ var menu = [
|
||||
html: _l("Make Data Private"),
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (
|
||||
Galaxy &&
|
||||
Galaxy.currHistoryPanel &&
|
||||
@@ -121,7 +121,7 @@ var menu = [
|
||||
{
|
||||
html: _l("Dataset Security"),
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel && Galaxy.router) {
|
||||
Galaxy.router.push(`/histories/permissions?id=${Galaxy.currHistoryPanel.model.id}`);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ var menu = [
|
||||
{
|
||||
html: _l("Collapse Expanded Datasets"),
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel) {
|
||||
Galaxy.currHistoryPanel.collapseAll();
|
||||
}
|
||||
@@ -145,7 +145,7 @@ var menu = [
|
||||
html: _l("Unhide Hidden Datasets"),
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// TODO: Deprecate this functionality and replace with group dataset selector and action combination
|
||||
if (Galaxy && Galaxy.currHistoryPanel && confirm(_l("Really unhide all hidden datasets?"))) {
|
||||
$.post(`${getAppRoot()}history/adjust_hidden`, { user_action: "unhide" }, () => {
|
||||
@@ -158,7 +158,7 @@ var menu = [
|
||||
html: _l("Delete Hidden Datasets"),
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// TODO: Deprecate this functionality and replace with group dataset selector and action combination
|
||||
if (Galaxy && Galaxy.currHistoryPanel && confirm(_l("Really delete all hidden datasets?"))) {
|
||||
$.post(`${getAppRoot()}history/adjust_hidden`, { user_action: "delete" }, () => {
|
||||
@@ -183,7 +183,7 @@ var menu = [
|
||||
html: _l("Export Tool Citations"),
|
||||
anon: true,
|
||||
func: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel && Galaxy.router) {
|
||||
Galaxy.router.push(`/histories/citations?id=${Galaxy.currHistoryPanel.model.id}`);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
fetchDataset: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.options = _.extend(this.options, options);
|
||||
this.model = new mod_library_model.Item({
|
||||
id: this.options.id
|
||||
@@ -184,7 +184,7 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
|
||||
importIntoHistory: function() {
|
||||
this.refreshUserHistoriesList(self => {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var template = self.templateBulkImportInModal();
|
||||
self.modal = Galaxy.modal;
|
||||
self.modal.show({
|
||||
@@ -255,7 +255,7 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
processImportToHistory: function(history_id) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var historyItem = new mod_library_model.HistoryItem();
|
||||
historyItem.url = `${historyItem.urlRoot + history_id}/contents`;
|
||||
// set the used history as current so user will see the last one
|
||||
@@ -285,7 +285,7 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
showPermissions: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var template = this.templateDatasetPermissions();
|
||||
var self = this;
|
||||
this.options = _.extend(this.options, options);
|
||||
@@ -400,7 +400,7 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
detectDatatype: function(options) {
|
||||
let ld = this.model;
|
||||
const ld = this.model;
|
||||
ld.set("file_ext", "auto");
|
||||
this._submitModification(ld);
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ var FolderView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
fetchFolder: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.options = _.extend(this.options, options);
|
||||
this.model = new mod_library_model.FolderAsModel({
|
||||
id: this.options.id
|
||||
@@ -57,7 +57,7 @@ var FolderView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
showPermissions: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.options = _.extend(this.options, options);
|
||||
$(".tooltip").remove();
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ var FolderListView = Backbone.View.extend({
|
||||
self.render();
|
||||
},
|
||||
error: function(model, response) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (typeof response.responseJSON !== "undefined") {
|
||||
Toast.error(`${response.responseJSON.err_msg} Click this to go back.`, "", {
|
||||
onclick: function() {
|
||||
@@ -141,7 +141,7 @@ var FolderListView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
paginate: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.options = _.extend(this.options, options);
|
||||
|
||||
if (this.options.show_page === null || this.options.show_page < 1) {
|
||||
@@ -181,7 +181,7 @@ var FolderListView = Backbone.View.extend({
|
||||
* be added to the view's collection.
|
||||
*/
|
||||
addAll: function(models) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
_.each(models, model => {
|
||||
Galaxy.libraries.folderListView.collection.add(model, {
|
||||
current_sort_order: false
|
||||
@@ -198,7 +198,7 @@ var FolderListView = Backbone.View.extend({
|
||||
* and that event will be bound on all subviews.
|
||||
*/
|
||||
postRender: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var fetched_metadata = this.folderContainer.attributes.metadata;
|
||||
fetched_metadata.contains_file_or_folder =
|
||||
typeof this.collection.findWhere({ type: "file" }) !== "undefined" ||
|
||||
|
||||
@@ -36,7 +36,7 @@ var FolderRowView = Backbone.View.extend({
|
||||
this.options = _.extend(this.options, options);
|
||||
var folder_item = this.options.model;
|
||||
var template = null;
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
|
||||
if (folder_item.get("type") === "folder" || folder_item.get("model_class") === "LibraryFolder") {
|
||||
this.options.type = "folder";
|
||||
@@ -105,14 +105,14 @@ var FolderRowView = Backbone.View.extend({
|
||||
|
||||
/* Show the page with dataset details. */
|
||||
showDatasetDetails: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
Galaxy.libraries.datasetView = new mod_library_dataset_view.LibraryDatasetView({ id: this.id });
|
||||
},
|
||||
|
||||
/* Undelete the dataset on server and render the row again. */
|
||||
undeleteDataset: function(event) {
|
||||
$(".tooltip").hide();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var that = this;
|
||||
var dataset_id = $(event.target)
|
||||
.closest("tr")
|
||||
@@ -144,7 +144,7 @@ var FolderRowView = Backbone.View.extend({
|
||||
|
||||
/* Undelete the folder on server and render the row again. */
|
||||
undeleteFolder: function(event) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
$(".tooltip").hide();
|
||||
var folder_id = $(event.target)
|
||||
.closest("tr")
|
||||
@@ -182,7 +182,7 @@ var FolderRowView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
saveModifications: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var folder = Galaxy.libraries.folderListView.collection.get(this.$el.data("id"));
|
||||
var is_changed = false;
|
||||
var new_name = this.$el.find(".input_folder_name").val();
|
||||
|
||||
@@ -78,7 +78,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
|
||||
render: function(options) {
|
||||
this.options = _.extend(this.options, options);
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var toolbar_template = this.templateToolBar();
|
||||
var template_defaults = {
|
||||
id: this.options.id,
|
||||
@@ -107,7 +107,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
*/
|
||||
renderPaginator: function(options) {
|
||||
this.options = _.extend(this.options, options);
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var paginator_template = this.templatePaginator();
|
||||
$("body")
|
||||
.find(".folder-paginator")
|
||||
@@ -125,7 +125,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
|
||||
configureElements: function(options) {
|
||||
this.options = _.extend(this.options, options);
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
|
||||
if (this.options.can_add_library_item === true) {
|
||||
$(".add-library-items").show();
|
||||
@@ -155,7 +155,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
createFolderFromModal: function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var template = this.templateNewFolderInModal();
|
||||
this.modal = Galaxy.modal;
|
||||
this.modal.show({
|
||||
@@ -174,7 +174,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
createNewFolderEvent: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var folderDetails = this.serializeNewFolder();
|
||||
if (this.validateNewFolder(folderDetails)) {
|
||||
var folder = new mod_library_model.FolderAsModel();
|
||||
@@ -222,7 +222,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
|
||||
importToHistoryModal: function(e) {
|
||||
e.preventDefault();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var $checkedValues = this.findCheckedRows();
|
||||
var template = this.templateImportIntoHistoryModal();
|
||||
if ($checkedValues.length === 0) {
|
||||
@@ -296,8 +296,8 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
var items_to_import = [];
|
||||
// prepare the dataset objects to be imported
|
||||
for (let i = checked_items.dataset_ids.length - 1; i >= 0; i--) {
|
||||
let library_dataset_id = checked_items.dataset_ids[i];
|
||||
let historyItem = new mod_library_model.HistoryItem();
|
||||
const library_dataset_id = checked_items.dataset_ids[i];
|
||||
const historyItem = new mod_library_model.HistoryItem();
|
||||
historyItem.url = `${historyItem.urlRoot + history_id}/contents`;
|
||||
historyItem.content = library_dataset_id;
|
||||
historyItem.source = "library";
|
||||
@@ -305,8 +305,8 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
}
|
||||
// prepare the folder objects to be imported
|
||||
for (let i = checked_items.folder_ids.length - 1; i >= 0; i--) {
|
||||
let library_folder_id = checked_items.folder_ids[i];
|
||||
let historyItem = new mod_library_model.HistoryItem();
|
||||
const library_folder_id = checked_items.folder_ids[i];
|
||||
const historyItem = new mod_library_model.HistoryItem();
|
||||
historyItem.url = `${historyItem.urlRoot + history_id}/contents`;
|
||||
historyItem.content = library_folder_id;
|
||||
historyItem.source = "library_folder";
|
||||
@@ -373,7 +373,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
addFilesFromHistoryModal: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.histories = new mod_library_model.GalaxyHistories();
|
||||
this.histories
|
||||
.fetch()
|
||||
@@ -416,7 +416,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* Create modal for importing from Galaxy path.
|
||||
*/
|
||||
importFilesFromPathModal: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.modal = Galaxy.modal;
|
||||
var template_modal = this.templateImportPathModal();
|
||||
this.modal.show({
|
||||
@@ -450,7 +450,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
url: `${getAppRoot()}api/datatypes?extension_only=False`,
|
||||
success: datatypes => {
|
||||
this.list_extensions = [];
|
||||
for (let key in datatypes) {
|
||||
for (const key in datatypes) {
|
||||
this.list_extensions.push({
|
||||
id: datatypes[key].extension,
|
||||
text: datatypes[key].extension,
|
||||
@@ -467,7 +467,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
url: `${getAppRoot()}api/genomes`,
|
||||
success: genomes => {
|
||||
this.list_genomes = [];
|
||||
for (let key in genomes) {
|
||||
for (const key in genomes) {
|
||||
this.list_genomes.push({
|
||||
id: genomes[key][1],
|
||||
text: genomes[key][0]
|
||||
@@ -480,7 +480,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
renderSelectBoxes: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// This won't work properly unlesss we already have the data fetched.
|
||||
// See this.fetchExtAndGenomes()
|
||||
this.select_genome = new mod_select.View({
|
||||
@@ -503,7 +503,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
*/
|
||||
importFilesFromGalaxyFolderModal: function(options) {
|
||||
var template_modal = this.templateBrowserModal();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.modal = Galaxy.modal;
|
||||
this.modal.show({
|
||||
closing_events: true,
|
||||
@@ -650,7 +650,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* @param {int} length The number of items in the chain call.
|
||||
*/
|
||||
initChainCallControl: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var template;
|
||||
switch (options.action) {
|
||||
case "adding_datasets":
|
||||
@@ -719,7 +719,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
action: "adding_datasets"
|
||||
});
|
||||
if (selection_type === "folder") {
|
||||
let full_source = `${options.source}_folder`;
|
||||
const full_source = `${options.source}_folder`;
|
||||
this.chainCallImportingFolders({
|
||||
paths: paths,
|
||||
preserve_dirs: preserve_dirs,
|
||||
@@ -732,7 +732,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
tag_using_filenames: tag_using_filenames
|
||||
});
|
||||
} else if (selection_type === "file") {
|
||||
let full_source = `${options.source}_file`;
|
||||
const full_source = `${options.source}_file`;
|
||||
this.chainCallImportingUserdirFiles({
|
||||
paths: paths,
|
||||
file_type: file_type,
|
||||
@@ -827,7 +827,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* @param {str} history_name name of the history to import to
|
||||
*/
|
||||
chainCallImportingIntoHistory: function(history_item_set, history_name) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var popped_item = history_item_set.pop();
|
||||
if (typeof popped_item == "undefined") {
|
||||
if (this.options.chain_call_control.failed_number === 0) {
|
||||
@@ -878,8 +878,8 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* @param {boolean} tag_using_filenames add tags to datasets using names of files
|
||||
*/
|
||||
chainCallImportingUserdirFiles: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
let popped_item = options.paths.pop();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const popped_item = options.paths.pop();
|
||||
if (typeof popped_item === "undefined") {
|
||||
if (this.options.chain_call_control.failed_number === 0) {
|
||||
Toast.success("Selected files imported into the current folder");
|
||||
@@ -889,8 +889,8 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
}
|
||||
return true;
|
||||
}
|
||||
let post_url = `${getAppRoot()}api/libraries/datasets`;
|
||||
let post_data = {
|
||||
const post_url = `${getAppRoot()}api/libraries/datasets`;
|
||||
const post_data = {
|
||||
encoded_folder_id: this.id,
|
||||
source: options.source,
|
||||
path: popped_item,
|
||||
@@ -901,7 +901,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
dbkey: options.dbkey,
|
||||
tag_using_filenames: options.tag_using_filenames
|
||||
};
|
||||
let promise = $.when($.post(post_url, post_data));
|
||||
const promise = $.when($.post(post_url, post_data));
|
||||
promise
|
||||
.done(response => {
|
||||
this.updateProgress();
|
||||
@@ -927,9 +927,9 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* @param {boolean} tag_using_filenames add tags to datasets using names of files
|
||||
*/
|
||||
chainCallImportingFolders: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// TODO need to check which paths to call
|
||||
let popped_item = options.paths.pop();
|
||||
const popped_item = options.paths.pop();
|
||||
if (typeof popped_item == "undefined") {
|
||||
if (this.options.chain_call_control.failed_number === 0) {
|
||||
Toast.success("Selected folders and their contents imported into the current folder.");
|
||||
@@ -940,8 +940,8 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
}
|
||||
return true;
|
||||
}
|
||||
let post_url = `${getAppRoot()}api/libraries/datasets`;
|
||||
let post_data = {
|
||||
const post_url = `${getAppRoot()}api/libraries/datasets`;
|
||||
const post_data = {
|
||||
encoded_folder_id: this.id,
|
||||
source: options.source,
|
||||
path: popped_item,
|
||||
@@ -953,7 +953,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
dbkey: options.dbkey,
|
||||
tag_using_filenames: options.tag_using_filenames
|
||||
};
|
||||
let promise = $.when($.post(post_url, post_data));
|
||||
const promise = $.when($.post(post_url, post_data));
|
||||
promise
|
||||
.done(response => {
|
||||
this.updateProgress();
|
||||
@@ -972,7 +972,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* @param {array} hdas_set array of empty hda objects
|
||||
*/
|
||||
chainCallAddingHdas: function(hdas_set) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.added_hdas = new mod_library_model.Folder();
|
||||
var popped_item = hdas_set.pop();
|
||||
if (typeof popped_item == "undefined") {
|
||||
@@ -1011,7 +1011,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* @param {array} lddas_set array of lddas to delete
|
||||
*/
|
||||
chainCallDeletingItems: function(items_to_delete) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.deleted_items = new mod_library_model.Folder();
|
||||
var item_to_delete = items_to_delete.pop();
|
||||
if (typeof item_to_delete === "undefined") {
|
||||
@@ -1060,7 +1060,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* Handles the click on 'show deleted' checkbox
|
||||
*/
|
||||
checkIncludeDeleted: function(event) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (event.target.checked) {
|
||||
Galaxy.libraries.folderListView.fetchFolder({
|
||||
include_deleted: true
|
||||
@@ -1076,7 +1076,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* Delete the selected items. Atomic. One by one.
|
||||
*/
|
||||
deleteSelectedItems: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var dataset_ids = [];
|
||||
var folder_ids = [];
|
||||
var $checkedValues = this.findCheckedRows();
|
||||
@@ -1138,7 +1138,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
showLocInfo: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var library = null;
|
||||
if (Galaxy.libraries.libraryListView !== null) {
|
||||
library = Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id);
|
||||
@@ -1163,7 +1163,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
showLocInfoModal: function(library) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var template = this.templateLocInfoInModal();
|
||||
this.modal = Galaxy.modal;
|
||||
this.modal.show({
|
||||
@@ -1179,7 +1179,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
showImportModal: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
switch (options.source) {
|
||||
case "history":
|
||||
this.addFilesFromHistoryModal();
|
||||
@@ -1209,7 +1209,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
*/
|
||||
showPageSizePrompt: function(e) {
|
||||
e.preventDefault();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var folder_page_size = prompt(
|
||||
"How many items per page do you want to see?",
|
||||
Galaxy.libraries.preferences.get("folder_page_size")
|
||||
@@ -1248,7 +1248,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
|
||||
showCollectionSelect: function(e) {
|
||||
e.preventDefault();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var checked_items = this.findCheckedItems();
|
||||
var template = this.templateCollectionSelectModal();
|
||||
this.modal = Galaxy.modal;
|
||||
@@ -1317,13 +1317,13 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
* The code below overwrites the id with ldda_id for this reason.
|
||||
*/
|
||||
showCollectionBuilder: function(checked_items) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
let collection_elements = [];
|
||||
let elements_source = this.modal.$('input[type="radio"]:checked').val();
|
||||
const elements_source = this.modal.$('input[type="radio"]:checked').val();
|
||||
if (elements_source === "selection") {
|
||||
for (let i = checked_items.length - 1; i >= 0; i--) {
|
||||
let collection_item = {};
|
||||
let dataset = Galaxy.libraries.folderListView.folder_container.get("folder").get(checked_items[i]);
|
||||
const collection_item = {};
|
||||
const dataset = Galaxy.libraries.folderListView.folder_container.get("folder").get(checked_items[i]);
|
||||
collection_item.id = dataset.get("ldda_id");
|
||||
collection_item.name = dataset.get("name");
|
||||
collection_item.deleted = dataset.get("deleted");
|
||||
@@ -1331,13 +1331,13 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
collection_elements.push(collection_item);
|
||||
}
|
||||
} else if (elements_source === "folder") {
|
||||
let all_datasets = Galaxy.libraries.folderListView.folder_container.get("folder").where({ type: "file" });
|
||||
const all_datasets = Galaxy.libraries.folderListView.folder_container.get("folder").where({ type: "file" });
|
||||
collection_elements = new Backbone.Collection(all_datasets).toJSON();
|
||||
for (var i = collection_elements.length - 1; i >= 0; i--) {
|
||||
collection_elements[i].id = collection_elements[i].ldda_id;
|
||||
}
|
||||
}
|
||||
let new_history_name = this.modal.$("input[name=history_name]").val();
|
||||
const new_history_name = this.modal.$("input[name=history_name]").val();
|
||||
if (new_history_name !== "") {
|
||||
this.createNewHistory(new_history_name)
|
||||
.done(new_history => {
|
||||
@@ -1348,14 +1348,14 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
Toast.error("An error occurred.");
|
||||
});
|
||||
} else {
|
||||
let selected_history_id = this.select_collection_history.value();
|
||||
let selected_history_name = this.select_collection_history.text();
|
||||
const selected_history_id = this.select_collection_history.value();
|
||||
const selected_history_name = this.select_collection_history.text();
|
||||
this.collectionImport(collection_elements, selected_history_id, selected_history_name);
|
||||
}
|
||||
},
|
||||
|
||||
collectionImport: function(collection_elements, history_id, history_name) {
|
||||
let modal_title = `Creating Collection in ${history_name}`;
|
||||
const modal_title = `Creating Collection in ${history_name}`;
|
||||
let creator_class;
|
||||
let creationFn;
|
||||
if (this.collectionType === "list") {
|
||||
@@ -1388,7 +1388,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
creator_class
|
||||
);
|
||||
} else if (this.collectionType === "list:paired") {
|
||||
let elements = collection_elements.map(element => ({
|
||||
const elements = collection_elements.map(element => ({
|
||||
id: element.id,
|
||||
name: element.name,
|
||||
src: "ldda"
|
||||
@@ -1410,7 +1410,7 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
createHDCA: function(elementIdentifiers, collectionType, name, hideSourceItems, history_id, options) {
|
||||
let hdca = new HDCA_MODEL.HistoryDatasetCollection({
|
||||
const hdca = new HDCA_MODEL.HistoryDatasetCollection({
|
||||
history_content_type: "dataset_collection",
|
||||
collection_type: collectionType,
|
||||
history_id: history_id,
|
||||
|
||||
@@ -38,7 +38,7 @@ var LibraryView = Backbone.View.extend({
|
||||
}
|
||||
},
|
||||
error: function(model, response) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (typeof response.responseJSON !== "undefined") {
|
||||
Toast.error(`${response.responseJSON.err_msg} Click this to go back.`, "", {
|
||||
onclick: function() {
|
||||
@@ -68,7 +68,7 @@ var LibraryView = Backbone.View.extend({
|
||||
}
|
||||
}
|
||||
var is_admin = false;
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy.user) {
|
||||
is_admin = Galaxy.user.isAdmin();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ var LibraryListView = Backbone.View.extend({
|
||||
* or render an empty list in case no data is given.
|
||||
*/
|
||||
render: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.options = _.extend(this.options, options);
|
||||
this.setElement("#libraries_element");
|
||||
var template = this.templateLibraryList();
|
||||
@@ -182,7 +182,7 @@ var LibraryListView = Backbone.View.extend({
|
||||
* @return {[type]} [description]
|
||||
*/
|
||||
sort_clicked: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy.libraries.preferences.get("sort_order") === "asc") {
|
||||
Galaxy.libraries.preferences.set({ sort_order: "desc" });
|
||||
} else {
|
||||
@@ -196,7 +196,7 @@ var LibraryListView = Backbone.View.extend({
|
||||
* Currently supports only sorting by name.
|
||||
*/
|
||||
sortLibraries: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy.libraries.preferences.get("sort_by") === "name") {
|
||||
if (Galaxy.libraries.preferences.get("sort_order") === "asc") {
|
||||
this.collection.sortLibraries("name", "asc");
|
||||
|
||||
@@ -32,7 +32,7 @@ var LibraryRowView = Backbone.View.extend({
|
||||
|
||||
render: function(library) {
|
||||
if (typeof library === "undefined") {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
library = Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));
|
||||
console.log(library);
|
||||
}
|
||||
@@ -122,7 +122,7 @@ var LibraryRowView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
save_library_modification: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var library = Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));
|
||||
var is_changed = false;
|
||||
|
||||
@@ -174,7 +174,7 @@ var LibraryRowView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
delete_library: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var library = Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));
|
||||
var row_view = this;
|
||||
// mark the library deleted
|
||||
@@ -204,7 +204,7 @@ var LibraryRowView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
undelete_library: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var library = Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));
|
||||
var row_view = this;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
render: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var toolbar_template = this.templateToolBar();
|
||||
var is_admin = false;
|
||||
var is_anonym = true;
|
||||
@@ -52,7 +52,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
* Renders the element that shows pages into its div within the toolbar.
|
||||
*/
|
||||
renderPaginator: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.options = _.extend(this.options, options);
|
||||
var paginator_template = this.templatePaginator();
|
||||
this.$el.find(".library-paginator").html(
|
||||
@@ -73,7 +73,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
createLibraryFromModal: function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var self = this;
|
||||
this.modal = Galaxy.modal;
|
||||
this.modal.show({
|
||||
@@ -95,7 +95,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
* Create the new library using the API asynchronously.
|
||||
*/
|
||||
createNewLibrary: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var libraryDetails = this.serializeNewLibrary();
|
||||
if (this.validateNewLibrary(libraryDetails)) {
|
||||
var library = new mod_library_model.Library();
|
||||
@@ -127,7 +127,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
*/
|
||||
showPageSizePrompt: function(e) {
|
||||
e.preventDefault();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var library_page_size = prompt(
|
||||
"How many libraries per page do you want to see?",
|
||||
Galaxy.libraries.preferences.get("library_page_size")
|
||||
@@ -171,7 +171,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
* Include or exclude deleted libraries in the view.
|
||||
*/
|
||||
includeDeletedChecked: function(event) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (event.target.checked) {
|
||||
Galaxy.libraries.preferences.set({ with_deleted: true });
|
||||
Galaxy.libraries.libraryListView.fetchDeleted();
|
||||
@@ -185,7 +185,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
* Include or exclude restricted libraries in the view.
|
||||
*/
|
||||
excludeRestrictedChecked: function(event) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (event.target.checked) {
|
||||
Galaxy.libraries.preferences.set({ without_restricted: true });
|
||||
} else {
|
||||
@@ -199,7 +199,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
* to query the collection of libraries.
|
||||
*/
|
||||
searchLibraries: function(event) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var search_term = $(".library-search-input").val();
|
||||
this.options.search_term = search_term;
|
||||
Galaxy.libraries.libraryListView.searchLibraries(search_term);
|
||||
|
||||
@@ -91,7 +91,7 @@ var FolderContainer = Backbone.Model.extend({
|
||||
id: "unknown"
|
||||
},
|
||||
parse: function(obj) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// empty the collection
|
||||
this.get("folder").reset();
|
||||
// response is not a simple array, it contains metadata
|
||||
|
||||
@@ -18,7 +18,7 @@ const multiColumnsToString = function(targetColumns, colHeaders) {
|
||||
|
||||
const removeColumns = function(columns, targetColumns) {
|
||||
const newColumns = [];
|
||||
for (let index in columns) {
|
||||
for (const index in columns) {
|
||||
if (targetColumns.indexOf(index) === -1) {
|
||||
newColumns.push(columns[index]);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ const RULES = {
|
||||
const tags = sources[index]["tags"];
|
||||
tags.sort();
|
||||
let groupTagValue = rule.default_value;
|
||||
for (let index in tags) {
|
||||
for (const index in tags) {
|
||||
const tag = tags[index];
|
||||
if (tag.indexOf(groupTagPrefix) == 0) {
|
||||
groupTagValue = tag.substr(groupTagPrefix.length);
|
||||
@@ -402,7 +402,7 @@ const RULES = {
|
||||
const targets = rule.target_columns;
|
||||
function newRow(row) {
|
||||
const newRow = [];
|
||||
for (let index in row) {
|
||||
for (const index in row) {
|
||||
if (targets.indexOf(parseInt(index)) == -1) {
|
||||
newRow.push(row[index]);
|
||||
}
|
||||
@@ -862,7 +862,7 @@ const colHeadersFor = function(data, columns) {
|
||||
};
|
||||
|
||||
const applyRules = function(data, sources, columns, rules, headersPerRule = []) {
|
||||
let colHeadersPerRule = Array.from(headersPerRule);
|
||||
const colHeadersPerRule = Array.from(headersPerRule);
|
||||
let hasRuleError = false;
|
||||
for (var ruleIndex in rules) {
|
||||
const ruleHeaders = colHeadersFor(data, columns);
|
||||
|
||||
@@ -142,7 +142,7 @@ var TagsEditor = Backbone.View.extend(baseMVC.LoggableMixin)
|
||||
|
||||
/** @returns {String[]} all tags used by the current user */
|
||||
_getTagsUsed: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var self = this;
|
||||
return _.map(Galaxy.user.get("tags_used"), self._nameToHash);
|
||||
},
|
||||
@@ -168,7 +168,7 @@ var TagsEditor = Backbone.View.extend(baseMVC.LoggableMixin)
|
||||
* @param {String} newTag the tag to add to the list of used
|
||||
*/
|
||||
_addNewTagToTagsUsed: function(newTag) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var tagsUsed = Galaxy.user.get("tags_used");
|
||||
if (!_.contains(tagsUsed, newTag)) {
|
||||
tagsUsed.push(newTag);
|
||||
|
||||
@@ -17,7 +17,7 @@ import axios from "axios";
|
||||
|
||||
export default FormBase.extend({
|
||||
initialize: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var self = this;
|
||||
this.deferred = new Deferred();
|
||||
FormBase.prototype.initialize.call(this, options);
|
||||
@@ -60,7 +60,7 @@ export default FormBase.extend({
|
||||
this.$el.off().hide();
|
||||
this.deferred.execute(() => {
|
||||
FormBase.prototype.remove.call(self);
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
Galaxy.emit.debug("tool-form-base::_destroy()", "Destroy view.");
|
||||
});
|
||||
},
|
||||
@@ -75,7 +75,7 @@ export default FormBase.extend({
|
||||
`<b>${options.name}</b> ${options.description} (Galaxy Version ${options.version})`,
|
||||
operations: !options.hide_operations && this._operations(),
|
||||
onchange: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
self.deferred.reset();
|
||||
self.deferred.execute(process => {
|
||||
self.model.get("postchange")(process, self);
|
||||
@@ -114,10 +114,10 @@ export default FormBase.extend({
|
||||
_operations: function() {
|
||||
var self = this;
|
||||
var options = this.model.attributes;
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
|
||||
// Buttons for adding and removing favorite.
|
||||
let in_favorites = Galaxy.user.getFavorites().tools.indexOf(options.id) >= 0;
|
||||
const in_favorites = Galaxy.user.getFavorites().tools.indexOf(options.id) >= 0;
|
||||
var favorite_button = new Ui.Button({
|
||||
icon: "fa-star-o",
|
||||
title: options.narrow ? null : "Favorite",
|
||||
|
||||
@@ -17,7 +17,7 @@ import WorkflowIcons from "mvc/workflow/workflow-icons";
|
||||
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.modal = Galaxy.modal || new Modal.View();
|
||||
this.model = (options && options.model) || new Backbone.Model(options);
|
||||
this.deferred = new Deferred();
|
||||
@@ -39,7 +39,7 @@ var View = Backbone.View.extend({
|
||||
/** Configures form/step options for each workflow step */
|
||||
_configure: function() {
|
||||
var self = this;
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
this.forms = [];
|
||||
this.steps = [];
|
||||
this.links = [];
|
||||
@@ -336,7 +336,7 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Render job caching option */
|
||||
_renderUseCachedJob: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var 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);
|
||||
@@ -370,7 +370,7 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Render step */
|
||||
_renderStep: function(step) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var self = this;
|
||||
var form = null;
|
||||
this.deferred.execute(promise => {
|
||||
@@ -529,7 +529,7 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Refresh the history after job submission while form is shown */
|
||||
_refreshHistory: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var self = this;
|
||||
var history = Galaxy && Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model;
|
||||
if (this._refresh_history) {
|
||||
@@ -561,7 +561,7 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Validate and submit workflow */
|
||||
_submit: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var self = this;
|
||||
var history_form_data = this.history_form.data.create();
|
||||
var job_def = {
|
||||
@@ -716,13 +716,13 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Templates */
|
||||
_templateSuccess: function(response) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if ($.isArray(response) && response.length > 0) {
|
||||
let timesExecuted = "";
|
||||
// Default destination blurb, used for a single execution, same history.
|
||||
let destinationBlurb =
|
||||
"You can check the status of queued jobs and view the resulting data by refreshing the History pane, if this has not already happened automatically.";
|
||||
let newHistoryTarget =
|
||||
const newHistoryTarget =
|
||||
(response[0].history_id &&
|
||||
Galaxy.currHistoryPanel &&
|
||||
Galaxy.currHistoryPanel.model.id != response[0].history_id) ||
|
||||
|
||||
@@ -14,8 +14,8 @@ import Webhooks from "mvc/webhooks";
|
||||
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
let self = this;
|
||||
const Galaxy = getGalaxyInstance();
|
||||
const self = this;
|
||||
this.modal = Galaxy.modal || new Modal.View();
|
||||
this.form = new ToolFormBase(
|
||||
Utils.merge(
|
||||
@@ -166,7 +166,7 @@ var View = Backbone.View.extend({
|
||||
}
|
||||
|
||||
// Job Re-use Options
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var 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);
|
||||
@@ -194,10 +194,10 @@ var View = Backbone.View.extend({
|
||||
* @param{function} callback - Called when request has completed
|
||||
*/
|
||||
submit: function(options, callback) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
let history_id = Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model.id;
|
||||
let self = this;
|
||||
let job_def = {
|
||||
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,
|
||||
tool_version: options.version,
|
||||
@@ -210,7 +210,7 @@ var View = Backbone.View.extend({
|
||||
return;
|
||||
}
|
||||
if (options.action !== `${getAppRoot()}tool_runner/index`) {
|
||||
let $f = $("<form/>").attr({
|
||||
const $f = $("<form/>").attr({
|
||||
action: options.action,
|
||||
method: options.method,
|
||||
enctype: options.enctype
|
||||
@@ -249,8 +249,8 @@ var View = Backbone.View.extend({
|
||||
Galaxy.emit.debug("tool-form::submit", "Submission failed.", response);
|
||||
let input_found = false;
|
||||
if (response && response.err_data) {
|
||||
let error_messages = self.form.data.matchResponse(response.err_data);
|
||||
for (let input_id in error_messages) {
|
||||
const error_messages = self.form.data.matchResponse(response.err_data);
|
||||
for (const input_id in error_messages) {
|
||||
self.form.highlight(input_id, error_messages[input_id]);
|
||||
input_found = true;
|
||||
break;
|
||||
@@ -275,7 +275,7 @@ var View = Backbone.View.extend({
|
||||
* @param{dict} job_def - Job execution dictionary
|
||||
*/
|
||||
validate: function(job_def) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var job_inputs = job_def.inputs;
|
||||
var batch_n = -1;
|
||||
var batch_src = null;
|
||||
@@ -330,10 +330,10 @@ var View = Backbone.View.extend({
|
||||
_getInputs: function(job_def) {
|
||||
var inputs = [];
|
||||
var index = {};
|
||||
for (let i in job_def.inputs) {
|
||||
let input = job_def.inputs[i];
|
||||
for (const i in job_def.inputs) {
|
||||
const input = job_def.inputs[i];
|
||||
if (input && $.isArray(input.values)) {
|
||||
for (let j of input.values) {
|
||||
for (const j of input.values) {
|
||||
if (j.src && !index[j.id]) {
|
||||
inputs.push(j);
|
||||
index[j.id] = true;
|
||||
@@ -351,8 +351,8 @@ var View = Backbone.View.extend({
|
||||
});
|
||||
if (list.length > 0) {
|
||||
blurb += `<p>${title}:</p>`;
|
||||
for (let item of list) {
|
||||
let rowString = max > 0 ? `${item.hid}: ${_.escape(item.name)}` : "...";
|
||||
for (const item of list) {
|
||||
const rowString = max > 0 ? `${item.hid}: ${_.escape(item.name)}` : "...";
|
||||
blurb += `<p class="messagerow">
|
||||
<b>${rowString}</b>
|
||||
</p>`;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getGalaxyInstance } from "app";
|
||||
// tool form templates
|
||||
export default {
|
||||
openFileBrowser: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var GS_UI_URL = Galaxy.config.genomespace_ui_url;
|
||||
var GS_UPLOAD_URL = `${GS_UI_URL}upload/loadUrlToGenomespace.html?getLocation=true`;
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ var ToolSearch = Backbone.Model.extend({
|
||||
* Do the search and update the results.
|
||||
*/
|
||||
do_search: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var query = this.attributes.query;
|
||||
|
||||
// If query is too short, do not search.
|
||||
@@ -436,20 +436,20 @@ var ToolPanel = Backbone.Model.extend({
|
||||
|
||||
var // Helper to recursively parse tool panel.
|
||||
parse_elt = elt_dict => {
|
||||
let type = elt_dict.model_class;
|
||||
const type = elt_dict.model_class;
|
||||
// There are many types of tools; for now, anything that ends in 'Tool'
|
||||
// and is not a ExpressionTool is treated as a generic tool.
|
||||
if (type.indexOf("Tool") === type.length - 4) {
|
||||
let tool = self.attributes.tools.get(elt_dict.id);
|
||||
const tool = self.attributes.tools.get(elt_dict.id);
|
||||
if (type === 'ExpressionTool') {
|
||||
tool.hide();
|
||||
}
|
||||
return tool;
|
||||
} else if (type === "ToolSection") {
|
||||
// Parse elements.
|
||||
let elems = _.map(elt_dict.elems, parse_elt).filter(el => el.is_visible());
|
||||
const elems = _.map(elt_dict.elems, parse_elt).filter(el => el.is_visible());
|
||||
elt_dict.elems = elems;
|
||||
let section = new ToolSection(elt_dict);
|
||||
const section = new ToolSection(elt_dict);
|
||||
if (elems.length == 0) {
|
||||
section.hide();
|
||||
}
|
||||
@@ -537,7 +537,7 @@ var ToolLinkView = BaseView.extend({
|
||||
if (this.model.id === "upload1") {
|
||||
$link.find("a").on("click", e => {
|
||||
e.preventDefault();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
Galaxy.upload.show();
|
||||
});
|
||||
} else if (formStyle === "regular") {
|
||||
@@ -545,7 +545,7 @@ var ToolLinkView = BaseView.extend({
|
||||
var self = this;
|
||||
$link.find("a").on("click", e => {
|
||||
e.preventDefault();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
Galaxy.router.push("/", {
|
||||
tool_id: self.model.id,
|
||||
version: self.model.get("version")
|
||||
|
||||
@@ -376,7 +376,7 @@ var ToolShedRepositoryView = Backbone.View.extend({
|
||||
|
||||
toolTPSSelectionEvents: function() {
|
||||
$(".tool_panel_section_picker").on("change", ev => {
|
||||
let element = $(ev.target);
|
||||
const element = $(ev.target);
|
||||
var new_value = element.find("option:selected").val();
|
||||
var default_tps = $("#tool_panel_section_select")
|
||||
.find("option:selected")
|
||||
|
||||
@@ -12,7 +12,7 @@ import { getAppRoot } from "onload/loadConfig";
|
||||
import "libs/bootstrap-tour";
|
||||
|
||||
// bootstrap-tour configures a window.Tour object; keep a local ref.
|
||||
let Tour = window.Tour;
|
||||
const Tour = window.Tour;
|
||||
|
||||
// For buttons to show, we need to add them to bootstrap/popper's sanitizing filters.
|
||||
$.fn.tooltip.Constructor.Default.whiteList.button = ["data-role"];
|
||||
@@ -206,10 +206,10 @@ export var ToursView = Backbone.View.extend({
|
||||
});
|
||||
|
||||
export function giveTourWithData(data) {
|
||||
let hookedTourData = hooked_tour_from_data(data);
|
||||
const hookedTourData = hooked_tour_from_data(data);
|
||||
window.sessionStorage.setItem("activeGalaxyTour", JSON.stringify(data));
|
||||
// Store tour steps in sessionStorage to easily persist w/o hackery.
|
||||
let tour = new Tour(_.extend({ steps: hookedTourData.steps }, tour_opts));
|
||||
const tour = new Tour(_.extend({ steps: hookedTourData.steps }, tour_opts));
|
||||
// Always clean restart, since this is a new, explicit execution.
|
||||
tour.init();
|
||||
tour.goTo(0);
|
||||
|
||||
@@ -35,7 +35,7 @@ var DETAILS_MSG = _l("The following information can assist the developers in fin
|
||||
|
||||
/** private helper that builds the modal and handles adding details */
|
||||
function _errorModal(message, title, details) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
// create and return the modal, adding details button only if needed
|
||||
Galaxy.modal.show({
|
||||
title: title,
|
||||
@@ -75,7 +75,7 @@ function errorModal(message, title, details) {
|
||||
return;
|
||||
}
|
||||
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
message = _l(message);
|
||||
title = _l(title) || _l("Error:");
|
||||
if (Galaxy && Galaxy.modal) {
|
||||
@@ -113,7 +113,7 @@ function ajaxErrorModal(model, xhr, options, message, title) {
|
||||
|
||||
/** build details which may help debugging the ajax call */
|
||||
function _ajaxDetails(model, xhr, options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
return {
|
||||
//TODO: still can't manage Raven id
|
||||
raven: _.result(window.Raven, "lastEventId"),
|
||||
|
||||
@@ -156,7 +156,7 @@ var View = Backbone.View.extend({
|
||||
* argument that is the frame's content DOM element
|
||||
*/
|
||||
add: function(options) {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (this.frame_counter >= this.options.frame_max) {
|
||||
Galaxy.modal.show({
|
||||
title: _l("Warning"),
|
||||
|
||||
@@ -257,13 +257,13 @@ export var Upload = Backbone.View.extend({
|
||||
* what we need where we need it, allowing for better package optimization.
|
||||
*/
|
||||
|
||||
export let Button = Buttons.Button;
|
||||
export let ButtonCheck = Buttons.ButtonCheck;
|
||||
export let ButtonMenu = Buttons.ButtonMenu;
|
||||
export let ButtonLink = Buttons.ButtonLink;
|
||||
export let Checkbox = Options.Checkbox;
|
||||
export let RadioButton = Options.RadioButton;
|
||||
export let Radio = Options.Radio;
|
||||
export const Button = Buttons.Button;
|
||||
export const ButtonCheck = Buttons.ButtonCheck;
|
||||
export const ButtonMenu = Buttons.ButtonMenu;
|
||||
export const ButtonLink = Buttons.ButtonLink;
|
||||
export const Checkbox = Options.Checkbox;
|
||||
export const RadioButton = Options.RadioButton;
|
||||
export const Radio = Options.Radio;
|
||||
export { Select, Slider, Drilldown };
|
||||
|
||||
export default {
|
||||
|
||||
@@ -21,7 +21,7 @@ export default Backbone.View.extend({
|
||||
* Show popover
|
||||
*/
|
||||
show: function($content) {
|
||||
let btn = "<i class='fa fa-times-circle'/>";
|
||||
const btn = "<i class='fa fa-times-circle'/>";
|
||||
$(this.$target).popover({
|
||||
title: `${this.options.title} ${btn}`,
|
||||
placement: this.options.placement,
|
||||
@@ -33,7 +33,7 @@ export default Backbone.View.extend({
|
||||
|
||||
// add event to hide if click is outside of popup and not on container
|
||||
var self = this;
|
||||
let $popover = $(this.$target.data("bs.popover").tip);
|
||||
const $popover = $(this.$target.data("bs.popover").tip);
|
||||
$popover.find(".popover-header > i").on("click", () => this.hide());
|
||||
$("body").on(`mousedown.${this.uid}`, e => {
|
||||
if (!$($popover).is(e.target) && $($popover).has(e.target).length === 0) {
|
||||
|
||||
@@ -72,7 +72,7 @@ var View = Backbone.View.extend({
|
||||
_showRuleEditor: function(elements) {
|
||||
const elementsType = "collection_contents";
|
||||
const importType = "collections";
|
||||
let value = this._value;
|
||||
const value = this._value;
|
||||
const options = {
|
||||
saveRulesFn: rules => this._handleRulesSave(rules),
|
||||
initialRules: value
|
||||
@@ -142,7 +142,7 @@ var View = Backbone.View.extend({
|
||||
} else if (value.mapping.length === 0) {
|
||||
message = "No collection identifiers defined, specify at least one collection identifier.";
|
||||
} else {
|
||||
for (let rule of value.rules) {
|
||||
for (const rule of value.rules) {
|
||||
if (rule.error) {
|
||||
message = "One or more rules in error.";
|
||||
break;
|
||||
|
||||
@@ -157,7 +157,7 @@ var View = Backbone.View.extend({
|
||||
};
|
||||
|
||||
// add drag-drop event handlers
|
||||
let element = this.$el.get(0);
|
||||
const element = this.$el.get(0);
|
||||
element.addEventListener("dragenter", e => {
|
||||
this.lastenter = e.target;
|
||||
self.$el.addClass("ui-dragover");
|
||||
@@ -171,7 +171,7 @@ var View = Backbone.View.extend({
|
||||
element.addEventListener("drop", e => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
let drop_data = JSON.parse(e.dataTransfer.getData("text"))[0];
|
||||
const drop_data = JSON.parse(e.dataTransfer.getData("text"))[0];
|
||||
this._handleDropValues(drop_data);
|
||||
} catch (e) {
|
||||
this._handleDropStatus("danger");
|
||||
@@ -223,19 +223,19 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Return the currently selected dataset values */
|
||||
value: function(new_value) {
|
||||
let galaxy = getGalaxyInstance();
|
||||
const galaxy = getGalaxyInstance();
|
||||
new_value !== undefined && this.model.set("value", new_value);
|
||||
let current = this.model.get("current");
|
||||
const current = this.model.get("current");
|
||||
if (this.config[current]) {
|
||||
let id_list = this.fields[current].value();
|
||||
if (id_list !== null) {
|
||||
id_list = $.isArray(id_list) ? id_list : [id_list];
|
||||
if (id_list.length > 0) {
|
||||
let result = this._batch({ values: [] });
|
||||
for (let i in id_list) {
|
||||
let details = this.cache[`${id_list[i]}_${this.config[current].src}`];
|
||||
const result = this._batch({ values: [] });
|
||||
for (const i in id_list) {
|
||||
const details = this.cache[`${id_list[i]}_${this.config[current].src}`];
|
||||
if (details) {
|
||||
let unpatchedValue = this._unpatchValue(details);
|
||||
const unpatchedValue = this._unpatchValue(details);
|
||||
result.values.push(unpatchedValue);
|
||||
} else {
|
||||
galaxy.emit.debug(
|
||||
@@ -259,7 +259,7 @@ var View = Backbone.View.extend({
|
||||
_changeCurrent: function() {
|
||||
var self = this;
|
||||
_.each(this.fields, (field, i) => {
|
||||
let cnf = self.config[i];
|
||||
const cnf = self.config[i];
|
||||
if (self.model.get("current") == i) {
|
||||
field.$el.show();
|
||||
_.each(self.$batch, ($batchfield, batchmode) => {
|
||||
@@ -288,8 +288,8 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Change of type */
|
||||
_changeType: function() {
|
||||
let self = this;
|
||||
let galaxy = getGalaxyInstance();
|
||||
const self = this;
|
||||
const galaxy = getGalaxyInstance();
|
||||
|
||||
// identify selector type identifier i.e. [ flavor ]_[ type ]_[ multiple ]
|
||||
var config_id =
|
||||
@@ -347,8 +347,8 @@ var View = Backbone.View.extend({
|
||||
tooltip: "Browse Datasets",
|
||||
cls: "ml-2",
|
||||
onclick: () => {
|
||||
let current = this.model.get("current");
|
||||
let cnf = this.config[current];
|
||||
const current = this.model.get("current");
|
||||
const cnf = this.config[current];
|
||||
galaxy.data.dialog(
|
||||
response => {
|
||||
this._handleDropValues(response, false);
|
||||
@@ -363,7 +363,7 @@ var View = Backbone.View.extend({
|
||||
});
|
||||
|
||||
// append views
|
||||
let $fields = $("<div/>").addClass("w-100");
|
||||
const $fields = $("<div/>").addClass("w-100");
|
||||
this.$el
|
||||
.empty()
|
||||
.addClass("d-flex flex-row")
|
||||
@@ -458,7 +458,7 @@ var View = Backbone.View.extend({
|
||||
/** Restores original value e.g. after patching library datasets **/
|
||||
_unpatchValue: function(v) {
|
||||
if (v.origin) {
|
||||
let d = Object.assign({}, v);
|
||||
const d = Object.assign({}, v);
|
||||
d.id = d.id.substr(d.origin.length);
|
||||
d.src = d.origin;
|
||||
return d;
|
||||
@@ -468,20 +468,20 @@ var View = Backbone.View.extend({
|
||||
|
||||
/** Add values from drag/drop */
|
||||
_handleDropValues: function(drop_data, drop_partial = true) {
|
||||
let self = this;
|
||||
let data = this.model.get("data");
|
||||
let current = this.model.get("current");
|
||||
let config = this.config[current];
|
||||
let field = this.fields[current];
|
||||
const self = this;
|
||||
const data = this.model.get("data");
|
||||
const current = this.model.get("current");
|
||||
const config = this.config[current];
|
||||
const field = this.fields[current];
|
||||
if (data) {
|
||||
let values = $.isArray(drop_data) ? drop_data : [drop_data];
|
||||
const values = $.isArray(drop_data) ? drop_data : [drop_data];
|
||||
if (values.length > 0) {
|
||||
let data_changed = false;
|
||||
_.each(values, v => {
|
||||
self._patchValue(v);
|
||||
let new_id = v.id;
|
||||
let new_src = (v.src = this._getSource(v));
|
||||
let new_value = { id: new_id, src: new_src };
|
||||
const new_id = v.id;
|
||||
const new_src = (v.src = this._getSource(v));
|
||||
const new_value = { id: new_id, src: new_src };
|
||||
if (!_.findWhere(data[new_src], new_value)) {
|
||||
data_changed = true;
|
||||
data[new_src].push({
|
||||
@@ -498,8 +498,8 @@ var View = Backbone.View.extend({
|
||||
if (data_changed) {
|
||||
this._changeData();
|
||||
}
|
||||
let first_id = values[0].id;
|
||||
let first_src = values[0].src;
|
||||
const first_id = values[0].id;
|
||||
const first_src = values[0].src;
|
||||
if (config.src == first_src && drop_partial) {
|
||||
var current_value = field.value();
|
||||
if (current_value && config.multiple) {
|
||||
|
||||
@@ -165,7 +165,7 @@ var View = Backbone.View.extend({
|
||||
this.data2 = [];
|
||||
this.data2index = {};
|
||||
_.each(this.data, (option, index) => {
|
||||
let d = {
|
||||
const d = {
|
||||
order: index,
|
||||
id: option.value,
|
||||
text: option.label,
|
||||
@@ -201,7 +201,7 @@ var View = Backbone.View.extend({
|
||||
},
|
||||
formatResult: result => {
|
||||
let extraTagWarning = "";
|
||||
let filteredTags = _.filter(result.tags, t => this.matched_tags.hasOwnProperty(t));
|
||||
const filteredTags = _.filter(result.tags, t => this.matched_tags.hasOwnProperty(t));
|
||||
if (filteredTags.length > 5) {
|
||||
extraTagWarning = ` <div class="label label-warning">${filteredTags.length -
|
||||
5} more tags</div>`;
|
||||
|
||||
@@ -153,11 +153,11 @@ var View = Backbone.View.extend({
|
||||
if (!this.options.multiple) {
|
||||
if (this.select_data) {
|
||||
this.select_data.map(value => {
|
||||
let mx = this.options.maximumTextLength + 3;
|
||||
const mx = this.options.maximumTextLength + 3;
|
||||
if (value.text && value.text.length > mx) {
|
||||
let pos = value.text.indexOf(`(${value.id})`);
|
||||
pos = pos != -1 && pos < mx ? pos : mx;
|
||||
let sub = value.text.substring(0, pos).replace(/[ .]*$/, "");
|
||||
const sub = value.text.substring(0, pos).replace(/[ .]*$/, "");
|
||||
value.text = `${sub}...(${value.id})`;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -107,9 +107,9 @@ var View = Backbone.View.extend({
|
||||
/** Set and return the current value */
|
||||
value: function(new_val) {
|
||||
if (new_val !== undefined) {
|
||||
let options = this.model.attributes;
|
||||
let original_val = new_val;
|
||||
let is_value = new_val !== null && new_val !== "" && !this._isParameter(new_val);
|
||||
const options = this.model.attributes;
|
||||
const original_val = new_val;
|
||||
const is_value = new_val !== null && new_val !== "" && !this._isParameter(new_val);
|
||||
if (is_value) {
|
||||
if (isNaN(new_val)) {
|
||||
new_val = 0;
|
||||
@@ -127,8 +127,8 @@ var View = Backbone.View.extend({
|
||||
this.model.set("value", new_val);
|
||||
this.model.trigger("change");
|
||||
options.onchange(new_val);
|
||||
let has_changed = is_value && parseInt(original_val) !== parseInt(new_val);
|
||||
let message = has_changed ? "This value was invalid or out-of-range. It has been auto-corrected." : null;
|
||||
const has_changed = is_value && parseInt(original_val) !== parseInt(new_val);
|
||||
const message = has_changed ? "This value was invalid or out-of-range. It has been auto-corrected." : null;
|
||||
this.model.trigger("error", message);
|
||||
}
|
||||
return this.model.get("value");
|
||||
|
||||
@@ -248,7 +248,7 @@ export default Backbone.View.extend({
|
||||
this.counter.announce--;
|
||||
this.counter.success++;
|
||||
this._updateScreen();
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
Galaxy.currHistoryPanel.refreshContents();
|
||||
},
|
||||
|
||||
@@ -276,7 +276,7 @@ export default Backbone.View.extend({
|
||||
},
|
||||
|
||||
_eventBuild: function() {
|
||||
let Galaxy = getGalaxyInstance();
|
||||
const Galaxy = getGalaxyInstance();
|
||||
var allHids = [];
|
||||
_.forEach(this.collection.models, upload => {
|
||||
allHids.push.apply(allHids, upload.get("hids"));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user