diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-29 11:37:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 11:37:28 +0100 |
commit | c85948205409283fa7dec4ab1db9764acc0d3ce9 (patch) | |
tree | b4fbd692e4ce6cc93ccf417173242398adecf9c1 /server/sonar-web/src/main/js/apps/code | |
parent | 5595c2f862cca1d07312c9219013f836e45a5f90 (diff) | |
download | sonarqube-c85948205409283fa7dec4ab1db9764acc0d3ce9.tar.gz sonarqube-c85948205409283fa7dec4ab1db9764acc0d3ce9.zip |
remove explicit _ and $ dependecies (#1487)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/code')
-rw-r--r-- | server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.js | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/code/components/ComponentName.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.js b/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.js index 4938464a414..edd64644a41 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.js +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentMeasure.js @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import _ from 'underscore'; import React from 'react'; import Measure from '../../component-measures/components/Measure'; @@ -28,7 +27,8 @@ const ComponentMeasure = ({ component, metricKey, metricType }) => { const finalMetricKey = (isProject && isReleasability) ? 'alert_status' : metricKey; const finalMetricType = (isProject && isReleasability) ? 'LEVEL' : metricType; - const measure = _.findWhere(component.measures, { metric: finalMetricKey }); + const measure = Array.isArray(component.measures) && + component.measures.find(measure => measure.metric === finalMetricKey); if (!measure) { return <span/>; diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentName.js b/server/sonar-web/src/main/js/apps/code/components/ComponentName.js index 9a11b7e103f..f1d89ae560a 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentName.js +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentName.js @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import _ from 'underscore'; import React from 'react'; import { Link } from 'react-router'; import Truncated from './Truncated'; @@ -42,7 +41,8 @@ function mostCommitPrefix (strings) { i++; } const prefix = firstString.substr(0, i); - const lastPrefixPart = _.last(prefix.split(/[\s\\\/]/)); + const prefixTokens = prefix.split(/[\s\\\/]/); + const lastPrefixPart = prefixTokens[prefixTokens.length - 1]; return prefix.substr(0, prefix.length - lastPrefixPart.length); } |