From ab1e519189465defda1b98805a58758810d45c38 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 29 Aug 2017 19:58:23 +0200 Subject: [PATCH] lint issues --- .../main/js/gui/export/AbstractExportPanel.js | 28 +++++++++---------- .../src/main/js/map/data/UserPreferences.js | 2 +- frontend-js/src/test/js/helper.js | 1 + .../test/js/map/data/UserPreferences-test.js | 7 ++--- frontend-js/src/test/js/minerva-test.js | 2 -- 5 files changed, 18 insertions(+), 22 deletions(-) diff --git a/frontend-js/src/main/js/gui/export/AbstractExportPanel.js b/frontend-js/src/main/js/gui/export/AbstractExportPanel.js index 1f0cb52ca9..bb1055d376 100644 --- a/frontend-js/src/main/js/gui/export/AbstractExportPanel.js +++ b/frontend-js/src/main/js/gui/export/AbstractExportPanel.js @@ -38,16 +38,16 @@ AbstractExportPanel.prototype._createMiriamTypeDiv = function (annotations) { var typeDiv = Functions.createElement({ type: "div", name: "miriamSelectDiv", - className: "minerva-export-dual-listbox-container", + className: "minerva-export-dual-listbox-container" }); typeDiv.appendChild(Functions.createElement({ type: "h4", - content: " Annotations:", + content: " Annotations:" })); var selectElement = Functions.createElement({ type: "select", - className: "minerva-multi-select", + className: "minerva-multi-select" }); typeDiv.appendChild(selectElement); @@ -94,7 +94,7 @@ AbstractExportPanel.prototype.createDualListbox = function (selectElement) { AbstractExportPanel.prototype._createSelectTypeDiv = function (elementTypes) { var typeDiv = Functions.createElement({ type: "div", - name: "typeSelectDiv", + name: "typeSelectDiv" }); typeDiv.appendChild(Functions.createElement({ type: "h4", @@ -156,11 +156,11 @@ AbstractExportPanel.prototype.getMiriamTypesDualListbox = function () { AbstractExportPanel.prototype._createSelectColumnDiv = function (columnTypes) { var columnDiv = Functions.createElement({ type: "div", - name: "columnSelectDiv", + name: "columnSelectDiv" }); columnDiv.appendChild(Functions.createElement({ type: "h4", - content: " COLUMN:", + content: " COLUMN:" })); var choicesContainer = Functions.createElement({ type: "ul", @@ -279,7 +279,7 @@ AbstractExportPanel.prototype._createDownloadButton = function () { var downloadDiv = Functions.createElement({ type: "div", name: "downloadDiv", - style: "clear:both; padding: 10px;", + style: "clear:both; padding: 10px;" }); var button = Functions.createElement({ type: "button", @@ -299,7 +299,7 @@ AbstractExportPanel.prototype._createDownloadButton = function () { GuiConnector.hideProcessing(); GuiConnector.alert(error); }); - }, + } }); downloadDiv.appendChild(button); @@ -316,18 +316,18 @@ AbstractExportPanel.prototype._createSelectIncludedCompartmentDiv = function () var typeDiv = Functions.createElement({ type: "div", name: "includedCompartmentSelectDiv", - className: "minerva-export-dual-listbox-container", + className: "minerva-export-dual-listbox-container" }); typeDiv.appendChild(Functions.createElement({ type: "h4", - content: " Included compartment/pathways:", + content: " Included compartment/pathways:" })); return self._getCompartmentNames().then(function (compartmentNames) { var selectElement = Functions.createElement({ type: "select", - className: "minerva-multi-select", + className: "minerva-multi-select" }); typeDiv.appendChild(selectElement); @@ -349,18 +349,18 @@ AbstractExportPanel.prototype._createSelectExcludedCompartmentDiv = function () var typeDiv = Functions.createElement({ type: "div", name: "excludedCompartmentSelectDiv", - className: "minerva-export-dual-listbox-container", + className: "minerva-export-dual-listbox-container" }); typeDiv.appendChild(Functions.createElement({ type: "h4", - content: " Excluded compartment/pathways:", + content: " Excluded compartment/pathways:" })); return self._getCompartmentNames().then(function (compartmentNames) { var selectElement = Functions.createElement({ type: "select", - className: "minerva-multi-select", + className: "minerva-multi-select" }); typeDiv.appendChild(selectElement); diff --git a/frontend-js/src/main/js/map/data/UserPreferences.js b/frontend-js/src/main/js/map/data/UserPreferences.js index 4612cdb866..ac5cc24f62 100644 --- a/frontend-js/src/main/js/map/data/UserPreferences.js +++ b/frontend-js/src/main/js/map/data/UserPreferences.js @@ -59,7 +59,7 @@ UserPreferences.prototype.getElementValidAnnotations = function (className) { return this._elementValidAnnotations[className]; }; -UserPreferences.prototype.toExport = function (className) { +UserPreferences.prototype.toExport = function () { return { "project-upload": { "auto-resize": this._projectUpload.autoResize, diff --git a/frontend-js/src/test/js/helper.js b/frontend-js/src/test/js/helper.js index 47c121d93f..4fa3e08f1e 100644 --- a/frontend-js/src/test/js/helper.js +++ b/frontend-js/src/test/js/helper.js @@ -26,6 +26,7 @@ var User = require("../../main/js/map/data/User"); var Cookies = require('js-cookie'); var fs = require('fs'); +var Promise = require('bluebird'); var GuiConnector = require('../../main/js/GuiConnector'); diff --git a/frontend-js/src/test/js/map/data/UserPreferences-test.js b/frontend-js/src/test/js/map/data/UserPreferences-test.js index 2f9c8e86e4..6a940f7717 100644 --- a/frontend-js/src/test/js/map/data/UserPreferences-test.js +++ b/frontend-js/src/test/js/map/data/UserPreferences-test.js @@ -1,6 +1,6 @@ "use strict"; -require("../../mocha-config") +require("../../mocha-config"); /* exported logger */ var UserPreferences = require('../../../../main/js/map/data/UserPreferences'); @@ -10,9 +10,6 @@ var logger = require('../../logger'); var chai = require('chai'); var assert = chai.assert; -var fs = require('fs'); -var Promise = require('fs'); - describe('UserPreferences', function () { it("constructor", function () { return helper.readFile("testFiles/preferences.json").then(function (content) { @@ -25,6 +22,6 @@ describe('UserPreferences', function () { assert.ok(object.getElementValidAnnotations("lcsb.mapviewer.model.map.species.Protein").length > 0); assert.ok(object.getElementRequiredAnnotations("lcsb.mapviewer.model.map.species.Protein").requiredAtLeastOnce); assert.ok(object.getElementRequiredAnnotations("lcsb.mapviewer.model.map.species.Protein").list.length > 0); - }) + }); }); }); diff --git a/frontend-js/src/test/js/minerva-test.js b/frontend-js/src/test/js/minerva-test.js index 088b40668b..b80acc556c 100644 --- a/frontend-js/src/test/js/minerva-test.js +++ b/frontend-js/src/test/js/minerva-test.js @@ -4,8 +4,6 @@ require("./mocha-config"); var Alias = require('../../main/js/map/data/Alias'); var minerva = require('../../main/js/minerva'); -var GuiConnectorMock = require('./GuiConnector-mock'); -var ServerConnectorMock = require('./ServerConnector-mock'); var ServerConnectorMock = require('./ServerConnector-mock'); var chai = require('chai'); -- GitLab