From 75efda3dd83b392b39a09ccf61b848a141fec9e2 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 11 Jul 2016 17:06:07 +0200 Subject: [PATCH] SONAR-7880 Put actions on permissions on the Projects Management page --- .../sonar-web/src/main/js/api/permissions.js | 6 +- .../templates/ApplyTemplateTemplate.hbs | 45 +++++--- .../project/views/ApplyTemplateView.js | 7 +- .../src/main/js/apps/projects/header.js | 53 +++++++-- .../src/main/js/apps/projects/main.js | 16 ++- .../src/main/js/apps/projects/projects.js | 77 ++++++++++--- .../templates/BulkApplyTemplateTemplate.hbs | 68 +++++++++++ .../projects/views/BulkApplyTemplateView.js | 108 ++++++++++++++++++ server/sonar-web/src/main/js/helpers/urls.js | 9 ++ .../resources/org/sonar/l10n/core.properties | 3 + 10 files changed, 339 insertions(+), 53 deletions(-) create mode 100644 server/sonar-web/src/main/js/apps/projects/templates/BulkApplyTemplateTemplate.hbs create mode 100644 server/sonar-web/src/main/js/apps/projects/views/BulkApplyTemplateView.js diff --git a/server/sonar-web/src/main/js/api/permissions.js b/server/sonar-web/src/main/js/api/permissions.js index 80a77e56539..e7ea01ed4b7 100644 --- a/server/sonar-web/src/main/js/api/permissions.js +++ b/server/sonar-web/src/main/js/api/permissions.js @@ -114,9 +114,9 @@ export function applyTemplateToProject (data) { return post(url, data); } -export function bulkApplyTemplateToProject (options) { - const url = window.baseUrl + '/api/permissions/bulk_apply_template'; - return request(_.extend({ type: 'POST', url }, options)); +export function bulkApplyTemplate (data) { + const url = '/api/permissions/bulk_apply_template'; + return post(url, data); } export function addProjectCreatorToTemplate (templateName, permission) { diff --git a/server/sonar-web/src/main/js/apps/permissions/project/templates/ApplyTemplateTemplate.hbs b/server/sonar-web/src/main/js/apps/permissions/project/templates/ApplyTemplateTemplate.hbs index c7307670cbe..82c157e5d53 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/templates/ApplyTemplateTemplate.hbs +++ b/server/sonar-web/src/main/js/apps/permissions/project/templates/ApplyTemplateTemplate.hbs @@ -5,26 +5,37 @@