You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2016/01/26 20:11:47 UTC

[16/24] allura git commit: [#8035] ESLINT FIX: require-jsdoc, valid-jsdoc

[#8035] ESLINT FIX: require-jsdoc, valid-jsdoc


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/bf0029de
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/bf0029de
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/bf0029de

Branch: refs/heads/hs/8035
Commit: bf0029de2b4ff8bab01d39a65117f29354443aa3
Parents: a56b71a
Author: Heith Seewald <he...@gmail.com>
Authored: Thu Jan 21 19:18:12 2016 -0500
Committer: Heith Seewald <he...@gmail.com>
Committed: Tue Jan 26 14:11:04 2016 -0500

----------------------------------------------------------------------
 .eslintrc                                |  8 +++++++-
 Allura/allura/public/nf/js/navbar.es6.js | 27 ++++++++++++---------------
 2 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/bf0029de/.eslintrc
----------------------------------------------------------------------
diff --git a/.eslintrc b/.eslintrc
index ff25e9d..835cf29 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -4,7 +4,13 @@
     "indent": [2, 4],
     "jsx-quotes": [0],
     "quotes": [0],
-    "operator-linebreak": [2, "before", { "overrides": { "?": "after", "&&": "after" } }]
+    "operator-linebreak": [2, "before", { "overrides": { "?": "after", "&&": "after" } }],
+    "require-jsdoc": [2, {"require": {
+        "FunctionDeclaration": true,
+        "MethodDefinition": false,
+        "ClassDeclaration": false
+    }
+  }]
   },
   "globals": {
     "ReactDOM": true,

http://git-wip-us.apache.org/repos/asf/allura/blob/bf0029de/Allura/allura/public/nf/js/navbar.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/navbar.es6.js b/Allura/allura/public/nf/js/navbar.es6.js
index 2d0201e..d83f1f0 100644
--- a/Allura/allura/public/nf/js/navbar.es6.js
+++ b/Allura/allura/public/nf/js/navbar.es6.js
@@ -21,18 +21,17 @@
 'use strict';
 
 /**
- * Gets the current project url.
-
- * @constructor
- * @param {bool} rest - Return a "rest" version of the url.
- * @returns {string}
- */
-function _getProjectUrl(rest = true) {
+* Gets the current project url.
+* @param {boolean} rest - Return a "rest" version of the url.
+* @returns {string} - Project Url
+*/
+var _getProjectUrl = function(rest = true) {
     var nbhd;
     var proj;
     var nbhd_proj;
-    var ident_classes = document.getElementById('page-body').className.split(' ');
-    for (var cls of ident_classes) {
+    var identClasses = document.getElementById('page-body').className.split(' ');
+    var basePath = rest ? '/rest/' : '/';
+    for (var cls of identClasses) {
         if (cls.indexOf('project-') === 0) {
             proj = cls.slice('project-'.length);
         }
@@ -43,8 +42,8 @@ function _getProjectUrl(rest = true) {
     } else {
         nbhd_proj = `${nbhd}/${proj}`;
     }
-    return (rest ? '/rest/' : '/') + nbhd_proj;
-}
+    return basePath + nbhd_proj;
+};
 
 const ToolsPropType = React.PropTypes.shape({
     mount_point: React.PropTypes.string,
@@ -469,8 +468,8 @@ var Main = React.createClass({
 
     /**
      * Handles the changing of the NavBars grouping threshold.
-
-     * @param {object} event
+     * @param {object} event Fired when the threshold changes
+     * @return {boolean} False
      */
     onUpdateThreshold: function(event) {
         var thres = event.target.value;
@@ -486,8 +485,6 @@ var Main = React.createClass({
 
     /**
      * Handles the sending and updating tool ordinals.
-
-     * @param {array} data - Array of tools
      */
     onToolReorder: function() {
         $('.react-drag.dragging').removeClass('dragging');