aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/app.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-10-02 15:51:15 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-10-14 10:28:59 +0200
commit15b2160babc5c35ede960b7d0e133acbec8c6c51 (patch)
tree6475ad0602bbe4d6dae895aae43d331726ab8c33 /server/sonar-web/src/main/js/apps/projects/app.js
parente51e9c9eb0145ea5e9d40453554c456585b79936 (diff)
downloadsonarqube-15b2160babc5c35ede960b7d0e133acbec8c6c51.tar.gz
sonarqube-15b2160babc5c35ede960b7d0e133acbec8c6c51.zip
improve the web build system, introduce gulp and browserify
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/app.js')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/app.js27
1 files changed, 10 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/app.js b/server/sonar-web/src/main/js/apps/projects/app.js
index 8e98bb1686b..917d7342adc 100644
--- a/server/sonar-web/src/main/js/apps/projects/app.js
+++ b/server/sonar-web/src/main/js/apps/projects/app.js
@@ -1,21 +1,14 @@
-import $ from 'jquery';
import React from 'react';
import Main from './main';
import {getCurrentUser} from '../../api/users';
-import {getGlobalNavigation} from '../../api/nav';
+import '../../helpers/handlebars-helpers';
-export default {
- start(options) {
- $.when(
- getCurrentUser(),
- getGlobalNavigation(),
- window.requestMessages()
- ).then((user, nav) => {
- let el = document.querySelector(options.el),
- hasProvisionPermission = user[0].permissions.global.indexOf('provisioning') !== -1,
- topLevelQualifiers = nav[0].qualifiers;
- React.render(<Main hasProvisionPermission={hasProvisionPermission}
- topLevelQualifiers={topLevelQualifiers}/>, el);
- });
- }
-};
+window.sonarqube.appStarted.then(options => {
+ getCurrentUser().done(user => {
+ let el = document.querySelector(options.el),
+ hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1,
+ topLevelQualifiers = options.rootQualifiers;
+ React.render(<Main hasProvisionPermission={hasProvisionPermission}
+ topLevelQualifiers={topLevelQualifiers}/>, el);
+ });
+});