aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/permissions
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-02-01 19:05:48 +0100
committerStas Vilchik <stas-vilchik@users.noreply.github.com>2017-02-07 11:07:02 +0100
commitab71ca77ca97a03b503f65449132c007ae32f269 (patch)
tree4dab2ed1a99a152c6b55975a617abf4f9d3e3b73 /server/sonar-web/src/main/js/apps/permissions
parentea7785d32257e0500a020e1650d02e8b69069a86 (diff)
downloadsonarqube-ab71ca77ca97a03b503f65449132c007ae32f269.tar.gz
sonarqube-ab71ca77ca97a03b503f65449132c007ae32f269.zip
SONAR-8659 Create organization's projects management page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/permissions')
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/project/views/ApplyTemplateView.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/permissions/project/views/ApplyTemplateView.js b/server/sonar-web/src/main/js/apps/permissions/project/views/ApplyTemplateView.js
index a22e93f8740..487fb2c3822 100644
--- a/server/sonar-web/src/main/js/apps/permissions/project/views/ApplyTemplateView.js
+++ b/server/sonar-web/src/main/js/apps/permissions/project/views/ApplyTemplateView.js
@@ -33,7 +33,10 @@ export default ModalForm.extend({
},
loadPermissionTemplates () {
- return getPermissionTemplates(this.options.project.organization).then(r => {
+ const request = this.options.organization ?
+ getPermissionTemplates(this.options.organization.key) :
+ getPermissionTemplates();
+ return request.then(r => {
this.permissionTemplates = r.permissionTemplates;
this.render();
});
@@ -52,10 +55,14 @@ export default ModalForm.extend({
const permissionTemplate = this.$('#project-permissions-template').val();
this.disableForm();
- applyTemplateToProject({
+ const data = {
projectKey: this.options.project.key,
templateId: permissionTemplate
- }).then(() => {
+ };
+ if (this.options.organization) {
+ data.organization = this.options.organization.key;
+ }
+ applyTemplateToProject(data).then(() => {
this.trigger('done');
this.done = true;
this.render();