Merge pull request #8275 from WilliamHolden/fix_small_issues

Fix small issues
This commit is contained in:
Martin Cech
2019-07-06 17:43:19 +02:00
committed by GitHub
41 changed files with 61 additions and 121 deletions
-1
View File
@@ -89,7 +89,6 @@ Disabled
</div>
</div>
</div>
</div>
```
```vue
@@ -14,7 +14,7 @@
<table v-if="match(plugin)">
<tr class="ui-thumbnails-item" @click="select(plugin)">
<td>
<img v-if="plugin.logo" class="ui-thumbnails-image" :src="plugin.logo" />
<img v-if="plugin.logo" alt="ui thumbnails" class="ui-thumbnails-image" :src="plugin.logo" />
<div v-else class="ui-thumbnails-icon fa fa-eye" />
</td>
<td>
@@ -50,8 +50,8 @@ function TagModel(props = {}) {
enumerable: false,
get: function() {
if (!this.text.length) return false;
if (this.text == "name:") return false;
return true;
return this.text != "name:";
}
});
}
@@ -88,8 +88,7 @@ export const getAnalysisRouter = Galaxy =>
const instance = Vue.extend(component);
const container = document.createElement("div");
this.page.display(container);
const vm = new instance(props).$mount(container);
return vm;
return new instance(props).$mount(container);
},
show_tours: function(tour_id) {
@@ -92,13 +92,12 @@ export const CommunicationServerView = Backbone.View.extend({
/**renders the chat icon as a nav item*/
render: function() {
const navItem = {
return {
id: "show-chat-online",
icon: "fa-comment-o",
tooltip: _l("Chat online"),
visible: false,
onclick: this.makeModalIframe
};
return navItem;
}
});
+1 -1
View File
@@ -99,7 +99,7 @@ const View = Backbone.View.extend({
return `
<nav id="masthead" class="navbar navbar-expand justify-content-center navbar-dark">
<a class="navbar-brand">
<img class="navbar-brand-image"/>
<img alt="navigation brand image" class="navbar-brand-image"/>
<span class="navbar-brand-title"/>
</a>
<ul class="navbar-nav"/>
@@ -134,8 +134,7 @@ var DatasetDCE = DATASET_MODEL.DatasetAssociation.extend(
return `${getAppRoot()}api/datasets`;
}
const datasetId = this._getDatasetId();
const url = `${getAppRoot()}api/histories/${this.get("history_id")}/contents/${datasetId}`;
return url;
return `${getAppRoot()}api/histories/${this.get("history_id")}/contents/${datasetId}`;
},
_getDatasetId: function() {
@@ -1491,8 +1491,7 @@ var PairedCollectionCreator = Backbone.View.extend(baseMVC.LoggableMixin)
//this.debug( '_pairDragstart', ev, pair )
// auto select the pair causing the event and move all selected
pair.$el.addClass("selected");
var $selected = this.$(".paired-columns .dataset.selected");
this.$dragging = $selected;
this.$dragging = this.$(".paired-columns .dataset.selected");
},
/** drag communication with pair sub-views: dragend - remove the placeholder */
_pairDragend: function(ev, pair) {
@@ -78,8 +78,7 @@ export var HistoryContents = _super.extend(BASE_MVC.LoggableMixin).extend({
history_id: this.history_id,
collection_id: historyContent.attributes.id
});
var jobStatesSummary = this.jobStateSummariesCollection.get(jobSourceId);
historyContent.jobStatesSummary = jobStatesSummary;
historyContent.jobStatesSummary = this.jobStateSummariesCollection.get(jobSourceId);
}
}
});
@@ -50,8 +50,7 @@ var HistoryGridView = GridView.extend({
$(`.delayed-value-datasets_by_state[data-id='${historyId}']`).html(stateHtml);
$(`.delayed-value-disk_size[data-id='${historyId}']`).html(req.nice_size);
};
var xhr = $.ajax(options);
return xhr;
return $.ajax(options);
};
})
);
@@ -469,8 +469,7 @@ var HistoryView = _super.extend(
// if sent two strings (and possibly details as 'options'), use those as message and title
if (_.isString(model) && _.isString(xhr)) {
var message = model;
var title = xhr;
return ERROR_MODAL.errorModal(message, title, options);
return ERROR_MODAL.errorModal(message, xhr, options);
}
// bad gateway
// TODO: possibly to global handler
@@ -94,10 +94,8 @@ var HistoryViewColumn = Backbone.View.extend(baseMVC.LoggableMixin).extend({
if (columnRight < viewLeft) {
return false;
}
if (columnLeft > viewRight) {
return false;
}
return true;
return columnLeft <= viewRight;
},
/** shortcut to the panel */
@@ -438,8 +436,7 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({
// if sent two strings (and possibly details as 'options'), use those as message and title
if (_.isString(model) && _.isString(xhr)) {
var message = model;
var title = xhr;
return ERROR_MODAL.errorModal(message, title, options);
return ERROR_MODAL.errorModal(message, xhr, options);
}
// bad gateway
// TODO: possibly to global handler
@@ -600,15 +597,13 @@ var MultiPanelColumns = Backbone.View.extend(baseMVC.LoggableMixin).extend({
return this.sortedColumns();
}
return this.sortedColumns().filter((column, index) => {
var filtered = column.currentHistory || _.every(filters.map(filter => filter.call(column)));
return filtered;
return column.currentHistory || _.every(filters.map(filter => filter.call(column)));
});
},
/** return array of Columns sorted to match the collection */
sortedColumns: function() {
var sorted = this.collection.map((history, index) => this.columnMap[history.id]);
return sorted;
return this.collection.map((history, index) => this.columnMap[history.id]);
},
// ------------------------------------------------------------------------ render
+3 -4
View File
@@ -107,8 +107,7 @@ var JobListItemView = _super.extend(
return undefined;
}
var subMatch = _.find(partialMatch.inputs, i => name.indexOf(i.name) !== -1);
return subMatch;
return _.find(partialMatch.inputs, i => name.indexOf(i.name) !== -1);
},
// ........................................................................ misc
@@ -154,7 +153,7 @@ JobListItemView.prototype.templates = (() => {
'<span class="name"><%- view.tool.name %></span>',
"</div>",
'<div class="subtitle">',
'<span class="description"><%- view.tool.description %></span',
'<span class="description"><%- view.tool.description %></span>',
'<span class="create-time">',
" ",
_l("Created"),
@@ -169,7 +168,7 @@ JobListItemView.prototype.templates = (() => {
var subtitleTemplate = BASE_MVC.wrapTemplate(
[
'<div class="subtitle">',
'<span class="description"><%- view.tool.description %></span',
'<span class="description"><%- view.tool.description %></span>',
//'<span class="create-time">',
// ' ', _l( 'Created' ), ': <%= new Date( job.create_time ).toString() %>, ',
//'</span',
@@ -55,8 +55,7 @@ export default Backbone.View.extend({
// TODO: View is unused here.
//var view = this.content_list[model.id];
if (!this.content_list[model.id]) {
var content = this.new_content(model);
this.content_list[model.id] = content;
this.content_list[model.id] = this.new_content(model);
if (this._done()) {
break;
}
@@ -210,10 +210,12 @@ var FolderToolbarView = Backbone.View.extend({
}
},
/**
* This function returns a promise
*/
fetchUserHistories: function() {
this.histories = new mod_library_model.GalaxyHistories();
var promise = this.histories.fetch();
return promise;
return this.histories.fetch();
},
importAllIntoHistory: function() {
@@ -238,9 +240,11 @@ var FolderToolbarView = Backbone.View.extend({
}
},
/**
* This function returns a promise
*/
createNewHistory: function(new_history_name) {
var promise = $.post(`${getAppRoot()}api/histories`, { name: new_history_name });
return promise;
return $.post(`${getAppRoot()}api/histories`, { name: new_history_name });
},
processImportToHistory: function(history_id, history_name) {
@@ -51,9 +51,7 @@ var Libraries = Backbone.Collection.extend({
*/
getVisible: function(show_deleted, filters) {
filters = filters || [];
var filteredLibraries = new Libraries(this.filter(item => item.isVisible(show_deleted)));
return filteredLibraries;
return new Libraries(this.filter(item => item.isVisible(show_deleted)));
},
sortLibraries: function(sort_key, sort_order) {
+1 -3
View File
@@ -421,13 +421,11 @@ export var FoldoutListItemView = ListItemView.extend({
var FoldoutClass = this._getFoldoutPanelClass(model);
var options = this._getFoldoutPanelOptions(model);
var foldout = new FoldoutClass(
return new FoldoutClass(
_.extend(options, {
model: model
})
);
return foldout;
},
/** Stub to return proper foldout panel class */
+1 -2
View File
@@ -367,8 +367,7 @@ var ListPanel = Backbone.View.extend(BASE_MVC.LoggableMixin).extend(
// console.log( 'models filtered:', shownModels );
panel.views = shownModels.map(itemModel => {
var view = panel._createItemView(itemModel);
return view;
return panel._createItemView(itemModel);
});
$list.empty();
@@ -865,8 +865,7 @@ const applyRules = function(data, sources, columns, rules, headersPerRule = [])
const colHeadersPerRule = Array.from(headersPerRule);
let hasRuleError = false;
for (var ruleIndex in rules) {
const ruleHeaders = colHeadersFor(data, columns);
colHeadersPerRule[ruleIndex] = ruleHeaders;
colHeadersPerRule[ruleIndex] = colHeadersFor(data, columns);
const rule = rules[ruleIndex];
rule.error = null;
rule.warn = null;
+1 -1
View File
@@ -117,7 +117,7 @@ var TagsEditor = Backbone.View.extend(baseMVC.LoggableMixin)
});
if (renderedArray.length === 0) {
// If there are no tags to render we just show the add-tag-button
renderedArray.push(`<img src=${addButton} class="add-tag-button" title="Add tags"/>`);
renderedArray.push(`<img alt="add tag button" src=${addButton} class="add-tag-button" title="Add tags"/>`);
}
return renderedArray.join(" ");
},
@@ -320,10 +320,9 @@ var ToolShedRepositoryView = Backbone.View.extend({
},
selectedChangeset: function() {
var changeset = $("#changeset")
return $("#changeset")
.find("option:selected")
.val();
return changeset;
},
showToolTPSCreate: function(guid, changeset) {
+1 -2
View File
@@ -40,8 +40,7 @@ var addToQueue = metadata => {
var queueLength = () => {
if (window.localStorage.hasOwnProperty("repositories")) {
var repo_queue = JSON.parse(window.localStorage.repositories);
var queue_length = Object.keys(repo_queue).length;
return queue_length;
return Object.keys(repo_queue).length;
} else {
return 0;
}
@@ -28,7 +28,7 @@ export default Backbone.View.extend({
<table>
<tr>
<td class="charts-description-image-td">
<img class="charts-description-image"/>
<img alt="charts description" class="charts-description-image"/>
</td>
<td>
<div class="charts-description-title"/>
@@ -317,8 +317,7 @@ var Node = Backbone.Model.extend({
var new_body = nodeView.newInputsDiv();
var newTerminalViews = {};
_.each(data.inputs, input => {
var terminalView = node.nodeView.addDataInput(input, new_body);
newTerminalViews[input.name] = terminalView;
newTerminalViews[input.name] = node.nodeView.addDataInput(input, new_body);
});
// Cleanup any leftover terminals
_.each(_.difference(_.values(nodeView.terminalViews), _.values(newTerminalViews)), unusedView => {
@@ -292,13 +292,9 @@ var BaseInputTerminal = Terminal.extend({
inputFilled = false;
} else {
if (this.multiple) {
if (this._collectionAttached()) {
// Can only attach one collection to multiple input
// data parameter.
inputFilled = true;
} else {
inputFilled = false;
}
// Can only attach one collection to multiple input
// data parameter.
inputFilled = !!this._collectionAttached();
} else {
inputFilled = true;
}
@@ -91,21 +91,19 @@ export default Backbone.View.extend({
} else if (output.parameter) {
terminalViewClass = TerminalViews.OutputParameterTerminalView;
}
const terminalView = new terminalViewClass({
return new terminalViewClass({
node: this.node,
output: output
});
return terminalView;
},
outputViewforOutput: function(output, terminalView) {
const outputViewClass = output.parameter ? DataViews.ParameterOutputView : DataViews.DataOutputView;
const outputView = new outputViewClass({
return new outputViewClass({
output: output,
terminalElement: terminalView.el,
nodeView: this
});
return outputView;
},
addDataOutput: function(output) {
@@ -289,12 +289,11 @@ var OutputTerminalView = BaseOutputTerminalView.extend({
terminalMappingViewClass: TerminalMappingView,
terminalForOutput: function(output) {
var type = output.extensions;
var terminal = new Terminals.OutputTerminal({
return new Terminals.OutputTerminal({
element: this.el,
datatypes: type,
force_datatype: output.force_datatype
});
return terminal;
}
});
@@ -304,14 +303,13 @@ var OutputCollectionTerminalView = BaseOutputTerminalView.extend({
terminalForOutput: function(output) {
var collection_type = output.collection_type;
var collection_type_source = output.collection_type_source;
var terminal = new Terminals.OutputCollectionTerminal({
return new Terminals.OutputCollectionTerminal({
element: this.el,
collection_type: collection_type,
collection_type_source: collection_type_source,
datatypes: output.extensions,
force_datatype: output.force_datatype
});
return terminal;
}
});
@@ -319,11 +317,10 @@ var OutputParameterTerminalView = BaseOutputTerminalView.extend({
terminalMappingClass: Terminals.TerminalMapping,
terminalMappingViewClass: TerminalMappingView,
terminalForOutput: function(output) {
var terminal = new Terminals.OutputCollectionTerminal({
return new Terminals.OutputCollectionTerminal({
element: this.el,
type: output.type
});
return terminal;
}
});
@@ -771,7 +771,7 @@ export default Backbone.View.extend({
var node = new Node(this, { element: $f });
node.type = type;
node.content_id = content_id;
var tmp = `<div><img height='16' align='middle' src='${getAppRoot()}static/images/loading_small_white_bg.gif'/> loading tool info...</div>`;
var tmp = `<div><img alt="loading" height='16' align='middle' src='${getAppRoot()}static/images/loading_small_white_bg.gif'/> loading tool info...</div>`;
$f.find(".toolFormBody").append(tmp);
// Fix width to computed width
// Now add floats
@@ -54,8 +54,7 @@ QUnit.module("Input terminal model test", {
test_connector: function() {
var outputTerminal = new Terminals.OutputTerminal({ datatypes: ["input"] });
var inputTerminal = this.input_terminal;
var connector = new Connector(outputTerminal, inputTerminal);
return connector;
return new Connector(outputTerminal, inputTerminal);
},
with_test_connector: function(f) {
this.test_connector();
@@ -557,9 +556,7 @@ QUnit.module("Node view ", {
disableMapOver: function() {},
mapOver: Terminals.NULL_COLLECTION_TYPE_DESCRIPTION
};
var c = new Connector(outputTerminal, terminal);
return c;
return new Connector(outputTerminal, terminal);
},
connectAttachedMultiInputTerminal: function(inputType, outputType) {
this.view.addDataInput({ name: "TestName", extensions: [inputType], multiple: true });
@@ -580,9 +577,7 @@ QUnit.module("Node view ", {
disableMapOver: function() {},
mapOver: new Terminals.CollectionTypeDescription("list")
};
var c = new Connector(outputTerminal, terminal);
return c;
return new Connector(outputTerminal, terminal);
},
connectAttachedMappedOutput: function() {
this.view.addDataInput({ name: "TestName", extensions: ["txt"], input_type: "dataset_collection" });
@@ -603,9 +598,7 @@ QUnit.module("Node view ", {
disableMapOver: function() {},
mapOver: new Terminals.CollectionTypeDescription("list")
};
var c = new Connector(outputTerminal, terminal);
return c;
return new Connector(outputTerminal, terminal);
}
});
@@ -917,8 +910,7 @@ QUnit.module("terminal mapping logic", {
},
newNode: function() {
var nodeEl = $("<div>")[0];
var node = new Node(create_app(), { element: nodeEl });
return node;
return new Node(create_app(), { element: nodeEl });
},
_addExistingOutput: function(terminal, output, connected) {
var self = this;
+4 -12
View File
@@ -178,9 +178,7 @@ export function create_chart(inp_data, name, time, title) {
var m_x = margin.left;
var m_y = margin.top + height;
var l_x = m_x + width;
var l_y = m_y;
return `M${m_x} ${m_y} L ${l_x} ${l_y}`;
return `M${m_x} ${m_y} L ${l_x} ${m_y}`;
});
// Declare how high the y axis goes
@@ -212,9 +210,7 @@ export function create_chart(inp_data, name, time, title) {
var axis = d3.select(`#y_${name}`).node();
var left_pad = margin.left - axis.getBoundingClientRect().width - 5;
var top_pad = margin.top + axis.getBoundingClientRect().height / 2 - 30;
var trans = `translate(${left_pad},${top_pad})rotate(-90)`;
return trans;
return `translate(${left_pad},${top_pad})rotate(-90)`;
})
.text("Number of Jobs");
@@ -625,9 +621,7 @@ export function create_histogram(inp_data, name, title) {
var axis = d3.select(`#x_${name}`).node();
var left_pad = margin.left + axis.getBoundingClientRect().width / 2 + 30;
var top_pad = margin.top + height + axis.getBoundingClientRect().height + 10;
var trans = `translate(${left_pad},${top_pad})`;
return trans;
return `translate(${left_pad},${top_pad})`;
})
.text("ETA - hrs:mins");
@@ -654,9 +648,7 @@ export function create_histogram(inp_data, name, title) {
var axis = d3.select(`#y_${name}`).node();
var left_pad = margin.left - axis.getBoundingClientRect().width - 5;
var top_pad = margin.top + axis.getBoundingClientRect().height / 2 - 30;
var trans = `translate(${left_pad},${top_pad})rotate(-90)`;
return trans;
return `translate(${left_pad},${top_pad})rotate(-90)`;
})
.text("Number of Jobs");
@@ -175,8 +175,7 @@ function buildSingleSelectCell(control, columnIndex) {
var eventData = {};
var key = $cell.parent().attr("id");
var val = $cell.data(COLUMN_INDEX_DATA_KEY);
eventData[key] = val;
eventData[key] = $cell.data(COLUMN_INDEX_DATA_KEY);
$cell.parents(".peek").trigger(CHANGE_EVENT, eventData);
}
});
@@ -209,8 +208,7 @@ function buildMultiSelectCell(control, columnIndex) {
var eventData = {};
var key = $cell.parent().attr("id");
var val = $.makeArray(selectedColumnIndeces);
eventData[key] = val;
eventData[key] = $.makeArray(selectedColumnIndeces);
$cell.parents(".peek").trigger(CHANGE_EVENT, eventData);
});
}
+1 -1
View File
@@ -54,7 +54,7 @@ export function make_popupmenu(button_element, initial_options) {
);
}
});
var wrapper = $("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>")
var wrapper = $("<div class='popmenu-wrapper' style='position: absolute;left: 0;'></div>")
.append(menu_element)
.appendTo("body");
@@ -102,8 +102,7 @@ export function showMonitorToggles() {
// retrieve toggle list from the session storage
function getToggles() {
const json = sessionStorage.getItem("global_monitors");
const existinglist = json ? JSON.parse(json) : {};
return existinglist;
return json ? JSON.parse(json) : {};
}
// put the toggle list back in session storage
@@ -322,10 +322,8 @@ _.extend(NumberFilter.prototype, {
* Returns true if filter can be applied to element.
*/
applies_to: function(element) {
if (element.length > this.index) {
return true;
}
return false;
return element.length > this.index;
},
/**
* Helper function: returns true if value in in filter's [low, high] range.
@@ -85,7 +85,6 @@
.toggle-link {
font-weight: normal;
padding: 0.3em;
margin-bottom: 1em;
width: 100%;
padding: 0.2em 0em 0.2em 0em;
-3
View File
@@ -746,7 +746,6 @@ button {
padding-right: 14px;
margin-bottom: 0;
@include border-radius(14px);
max-width: auto;
background: $brand-white;
}
.search-query:focus {
@@ -1348,8 +1347,6 @@ div.permissionContainer {
.text-content {
hr {
display: block;
background: black;
color: black;
width: 100%;
height: 1px;
border: none;
-2
View File
@@ -147,8 +147,6 @@ $frame-default-border: $border-default-color;
width: 16px;
height: 16px;
color: $brand-dark;
right: 0px;
bottom: 0px;
text-align: center;
line-height: 16px;
border: 0px;
-1
View File
@@ -514,7 +514,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-height: 22px;
}
&.control-column-right {
text-align: right;
-1
View File
@@ -33,7 +33,6 @@ pre {
}
.dropdown-menu {
max-width: auto;
.dropdown-item {
text-decoration: none;
}
-1
View File
@@ -26,7 +26,6 @@ $separator-color: #888;
padding: 0 0;
color: #333;
font-weight: bold;
background: #cccccc;
display: inline-block;
top: -2em;
background: transparent;
-1
View File
@@ -154,7 +154,6 @@ $ui-margin-horizontal-large: $margin-v * 2;
font-style: italic;
}
.ui-form-backdrop {
display: none;
z-index: 10;
position: absolute;
top: 0px;