Skip to content

Commit

Permalink
ConDec-77: Replace deprecated rules in ESLint config file and improve…
Browse files Browse the repository at this point in the history
… code quality
  • Loading branch information
kleebaum committed Jun 28, 2018
1 parent a14fca3 commit 4408c1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"no-multiple-empty-lines": 0, // disallow multiple empty lines (off by default)
"no-nested-ternary": 0, // disallow nested ternary expressions (off by default)
"no-new-object": 0, // disallow use of the Object constructor
"no-space-before-semi": 1, // disallow space before semicolon
"semi-spacing": 1, // enforce consistent spacing before and after semicolons
"no-spaced-func": 0, // disallow space between function identifier and application
"no-ternary": 0, // disallow the use of ternary operators (off by default)
"no-trailing-spaces": 0, // disallow trailing whitespace at the end of lines
Expand All @@ -202,8 +202,8 @@

////////// ECMAScript 6 //////////

"no-var": 0, // require let or const instead of var (off by default)
"generator-star": 1, // enforce the position of the * in generator functions (off by default)
"no-var": 0, // require let or const instead of var (off by default)
"generator-star-spacing": 1, // enforce consistent spacing around * operators in generator functions (off by default)


////////// Legacy //////////
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/js/controller/decdoc.rest.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function deleteJSON(url, data, callback) {
xhr.responseType = "json";
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status);
Expand Down
14 changes: 5 additions & 9 deletions src/main/resources/js/view/decdoc.tree.viewer.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
function buildTreeViewer(nodeId) {
getTreeViewer(function(core) {
if ($('#evts').jstree(true)) {
var tree = $('#evts').jstree(true);
tree.destroy();
}
$('#evts').on("ready.jstree", function() {
if (nodeId) {
var tree = $('#evts').jstree(true);
if (tree) {
tree.select_node("" + nodeId)
tree.select_node("" + nodeId);
console.log("select_node");
} else {
console.log("set_back");
Expand All @@ -32,22 +28,22 @@ function buildTreeViewer(nodeId) {
});

$('#evts').on('move_node.jstree', function(object, node) {
if (node.node.id != 0 && node.parent != 0 && node.old_parent != 0) {
if (node.node.id !== 0 && node.parent !== 0 && node.old_parent !== 0) {
addDragAndDropSupportForTreeViewer(node.node.id, node.parent, node.old_parent);
}
});
}

function addDragAndDropSupportForTreeViewer(nodeId, parentId, oldParentId) {
if (oldParentId == "#") {
if (oldParentId === "#") {
showFlag("error", "Decisions cannot be linked to another decision knowledge element.");
document.location.reload();
}
if (parentId == "#") {
if (parentId === "#") {
showFlag("error", "This decision knowledge element cannot be a root element.");
document.location.reload();
}
if (parentId != '#' && oldParentId != '#') {
if (parentId !== '#' && oldParentId !== '#') {
deleteLinkToExistingElement(oldParentId, nodeId);
createLinkToExistingElement(parentId, nodeId);
}
Expand Down

0 comments on commit 4408c1b

Please sign in to comment.