aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects
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
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')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/app.js27
-rw-r--r--server/sonar-web/src/main/js/apps/projects/create-view.js6
-rw-r--r--server/sonar-web/src/main/js/apps/projects/delete-view.js6
3 files changed, 16 insertions, 23 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);
+ });
+});
diff --git a/server/sonar-web/src/main/js/apps/projects/create-view.js b/server/sonar-web/src/main/js/apps/projects/create-view.js
index 6307b708614..89425a212f8 100644
--- a/server/sonar-web/src/main/js/apps/projects/create-view.js
+++ b/server/sonar-web/src/main/js/apps/projects/create-view.js
@@ -1,9 +1,9 @@
-import ModalForm from 'components/common/modal-form';
+import ModalForm from '../../components/common/modal-form';
import {createProject} from '../../api/components';
-import './templates';
+import Template from './templates/projects-create-form.hbs';
export default ModalForm.extend({
- template: Templates['projects-create-form'],
+ template: Template,
onRender: function () {
this._super();
diff --git a/server/sonar-web/src/main/js/apps/projects/delete-view.js b/server/sonar-web/src/main/js/apps/projects/delete-view.js
index 56d5f1587b8..2a677ee1355 100644
--- a/server/sonar-web/src/main/js/apps/projects/delete-view.js
+++ b/server/sonar-web/src/main/js/apps/projects/delete-view.js
@@ -1,8 +1,8 @@
-import ModalForm from 'components/common/modal-form';
-import './templates';
+import ModalForm from '../../components/common/modal-form';
+import Template from './templates/projects-delete.hbs';
export default ModalForm.extend({
- template: Templates['projects-delete'],
+ template: Template,
onFormSubmit: function (e) {
this._super(e);