aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-11-25 16:17:31 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-11-28 13:39:04 +0100
commit33438e241399738e667745434a353d40cfc8c19b (patch)
tree3ee00ba229356d6e94794c852538ca0ffc89bdfe /server/sonar-web/src/main/js/app
parent3a34147be1e725f71b8e102ba53b1f5b9bd10b13 (diff)
downloadsonarqube-33438e241399738e667745434a353d40cfc8c19b.tar.gz
sonarqube-33438e241399738e667745434a353d40cfc8c19b.zip
fix quality flaws
Diffstat (limited to 'server/sonar-web/src/main/js/app')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/app.js2
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/component-nav-menu.js20
2 files changed, 7 insertions, 15 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/app.js b/server/sonar-web/src/main/js/app/components/nav/app.js
index 629c686c071..2a5526bbbe3 100644
--- a/server/sonar-web/src/main/js/app/components/nav/app.js
+++ b/server/sonar-web/src/main/js/app/components/nav/app.js
@@ -32,7 +32,7 @@ export default class App {
require('../../../components/workspace/main');
- return new Promise((resolve) => {
+ return new Promise(resolve => {
const response = {};
const requests = [];
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/component-nav-menu.js b/server/sonar-web/src/main/js/app/components/nav/component/component-nav-menu.js
index 3321670d281..e00f58efa03 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/component-nav-menu.js
+++ b/server/sonar-web/src/main/js/app/components/nav/component/component-nav-menu.js
@@ -64,6 +64,10 @@ export default React.createClass({
return path.indexOf(window.baseUrl + '/dashboard') === 0 || path.indexOf(window.baseUrl + '/governance') === 0;
},
+ shouldShowAdministration() {
+ return Object.keys(this.props.conf).some(key => this.props.conf[key]);
+ },
+
renderDashboardLink() {
const url = getComponentUrl(this.props.component.key);
const name = <i className="icon-home"/>;
@@ -96,22 +100,10 @@ export default React.createClass({
},
renderAdministration() {
- const shouldShowAdministration =
- this.props.conf.showBackgroundTasks ||
- this.props.conf.showHistory ||
- this.props.conf.showLinks ||
- this.props.conf.showManualMeasures ||
- this.props.conf.showPermissions ||
- this.props.conf.showQualityGates ||
- this.props.conf.showQualityProfiles ||
- this.props.conf.showSettings ||
- this.props.conf.showUpdateKey;
- if (!shouldShowAdministration) {
+ if (!this.shouldShowAdministration()) {
return null;
}
- const isSettingsActive = SETTINGS_URLS.some(url => {
- return window.location.href.indexOf(url) !== -1;
- });
+ const isSettingsActive = SETTINGS_URLS.some(url => window.location.href.indexOf(url) !== -1);
const className = 'dropdown' + (isSettingsActive ? ' active' : '');
return (
<li className={className}>