diff --git a/src/main/java/de/uhd/ifi/se/decision/documentation/jira/config/SettingsOfSingleProject.java b/src/main/java/de/uhd/ifi/se/decision/documentation/jira/config/SettingsOfSingleProject.java index 40ce8c0728..97b4102db6 100644 --- a/src/main/java/de/uhd/ifi/se/decision/documentation/jira/config/SettingsOfSingleProject.java +++ b/src/main/java/de/uhd/ifi/se/decision/documentation/jira/config/SettingsOfSingleProject.java @@ -20,7 +20,8 @@ import de.uhd.ifi.se.decision.documentation.jira.persistence.ConfigPersistence; /** - * @description Renders the administration page to change the plug-in configuration of a single project + * @description Renders the administration page to change the plug-in + * configuration of a single project */ public class SettingsOfSingleProject extends AbstractSettingsServlet { @@ -29,7 +30,7 @@ public class SettingsOfSingleProject extends AbstractSettingsServlet { @Inject public SettingsOfSingleProject(@ComponentImport UserManager userManager, - @ComponentImport LoginUriProvider loginUriProvider, @ComponentImport TemplateRenderer renderer) { + @ComponentImport LoginUriProvider loginUriProvider, @ComponentImport TemplateRenderer renderer) { super(userManager, loginUriProvider, renderer); } @@ -37,10 +38,7 @@ protected boolean isValidUser(HttpServletRequest request) { String projectKey = request.getParameter("projectKey"); String username = userManager.getRemoteUsername(request); - if (isProjectAdmin(username, projectKey)) { - return true; - } - return false; + return isProjectAdmin(username, projectKey); } private boolean isProjectAdmin(String username, String projectKey) { diff --git a/src/main/java/de/uhd/ifi/se/decision/documentation/jira/persistence/ConfigPersistence.java b/src/main/java/de/uhd/ifi/se/decision/documentation/jira/persistence/ConfigPersistence.java index d13d9b98ce..31e92df2b9 100644 --- a/src/main/java/de/uhd/ifi/se/decision/documentation/jira/persistence/ConfigPersistence.java +++ b/src/main/java/de/uhd/ifi/se/decision/documentation/jira/persistence/ConfigPersistence.java @@ -19,10 +19,7 @@ public Object doInTransaction() { return settings.get(pluginStorageKey + ".isIssueStrategy"); } }); - if (isIssueStrategy instanceof String && isIssueStrategy.equals("true")) { - return true; - } - return false; + return isIssueStrategy instanceof String && "true".equals(isIssueStrategy); } public static void setIssueStrategy(String projectKey, boolean isIssueStrategy) { @@ -37,10 +34,7 @@ public Object doInTransaction() { return settings.get(pluginStorageKey + ".isActivated"); } }); - if (isActivated instanceof String && isActivated.equals("true")) { - return true; - } - return false; + return isActivated instanceof String && "true".equals(isActivated); } public static void setActivated(String projectKey, boolean isActivated) { diff --git a/src/main/resources/js/controller/decdoc.rest.client.js b/src/main/resources/js/controller/decdoc.rest.client.js index 718382f209..5bab01be17 100644 --- a/src/main/resources/js/controller/decdoc.rest.client.js +++ b/src/main/resources/js/controller/decdoc.rest.client.js @@ -109,7 +109,7 @@ function getLinkedDecisionComponents(id, callback) { function getUnlinkedDecisionComponents(id, callback) { getJSON(AJS.contextPath() + "/rest/decisions/latest/decisions/getUnlinkedDecisionComponents.json?projectKey=" + getProjectKey() + "&id=" + id, function(error, unlinkedDecisionComponents) { - if (error == null) { + if (error === null) { callback(unlinkedDecisionComponents); } else { showFlag("error", diff --git a/src/main/resources/js/view/decdoc.accordion.editor.js b/src/main/resources/js/view/decdoc.accordion.editor.js index c7cd247080..8978dc7d60 100644 --- a/src/main/resources/js/view/decdoc.accordion.editor.js +++ b/src/main/resources/js/view/decdoc.accordion.editor.js @@ -61,7 +61,7 @@ function showDetailsOfChildren(parentId) { function showDetailsOfSingleChild(decisionKnowledgeElement) { var type = decisionKnowledgeElement.type; for (var i = 0; i < simpleKnowledgeTypes.length; i++) { - if (simpleKnowledgeTypes[i].toLocaleLowerCase() == type.toLocaleLowerCase()) { + if (simpleKnowledgeTypes[i].toLocaleLowerCase() === type.toLocaleLowerCase()) { document.getElementById(simpleKnowledgeTypes[i]).insertAdjacentHTML( 'beforeend', '
' + type + ' / ' + decisionKnowledgeElement.summary + '
' @@ -87,7 +87,7 @@ function addOptionToAddDecisionComponent(type, id) { function setUpEditorContentForAddingComponent(type) { var radioButtons = ""; - if (type == "Argument") { + if (type === "Argument") { radioButtons = "Pro" + "Contra" + "Comment"; diff --git a/src/main/resources/js/view/decdoc.context.menu.js b/src/main/resources/js/view/decdoc.context.menu.js index 9bb7bc8fca..ded5dc52e4 100644 --- a/src/main/resources/js/view/decdoc.context.menu.js +++ b/src/main/resources/js/view/decdoc.context.menu.js @@ -52,7 +52,7 @@ function setUpModal() { for (var counter = 0; counter < elementsWithCloseFunction.length; counter++) { elementsWithCloseFunction[counter].onclick = function() { closeModal(); - } + }; } // closes modal window if user clicks anywhere outside of the modal @@ -112,7 +112,7 @@ var contextMenuLinkAction = { var id = getSelectedTreantNodeId(options); setUpContextMenuContentForLinkAction(id); } -} +}; function setUpContextMenuContentForLinkAction(id) { setUpModal(); @@ -155,7 +155,7 @@ var contextMenuEditAction = { var id = getSelectedTreantNodeId(options); setUpContextMenuContentForEditAction(id); } -} +}; function setUpContextMenuContentForEditAction(id) { isIssueStrategy(id, function(isIssueStrategy) { @@ -173,6 +173,7 @@ function setUpContextMenuContentForEditAction(id) { var description = decisionKnowledgeElement.description; var type = decisionKnowledgeElement.type; setUpContextMenuContent(summary, description, type, editKnowledgeElementText); + var submitButton = document.getElementById("form-input-submit"); submitButton.onclick = function() { var summary = document.getElementById("form-input-summary").value; @@ -198,7 +199,7 @@ var contextMenuDeleteAction = { var id = getSelectedTreantNodeId(options); setUpContextMenuContentForDeleteAction(id); } -} +}; function setUpContextMenuContentForDeleteAction(id) { setUpModal(); @@ -229,7 +230,7 @@ var contextMenuActions = { "link" : contextMenuLinkAction, "edit" : contextMenuEditAction, "delete" : contextMenuDeleteAction -} +}; function closeModal() { var modal = document.getElementById("ContextMenuModal"); diff --git a/src/main/resources/js/view/decdoc.treant.js b/src/main/resources/js/view/decdoc.treant.js index 0907013f21..7dd066a518 100644 --- a/src/main/resources/js/view/decdoc.treant.js +++ b/src/main/resources/js/view/decdoc.treant.js @@ -59,7 +59,7 @@ function findOldParentNode(dragId) { var nodes = treantTree.tree.nodeDB.db; var i; for (i = 0; i < nodes.length; i++) { - if (nodes[i].nodeHTMLid == dragId) { + if (nodes[i].nodeHTMLid === dragId) { var parentElement = treantTree.tree.getNodeDb().get(nodes[i].parentId); oldParentId = parentElement.nodeHTMLid; }