aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/app.js
blob: aba9a066b502654dbe2265ae6dc63759bf4e78bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import React from 'react';
import ReactDOM from 'react-dom';
import Main from './main';
import { getCurrentUser } from '../../api/users';
import '../../helpers/handlebars-helpers';

window.sonarqube.appStarted.then(options => {
  getCurrentUser().done(user => {
    let el = document.querySelector(options.el);
    let hasProvisionPermission = user.permissions.global.indexOf('provisioning') !== -1;
    let topLevelQualifiers = options.rootQualifiers;
    ReactDOM.render(<Main hasProvisionPermission={hasProvisionPermission}
                       topLevelQualifiers={topLevelQualifiers}/>, el);
  });
});