diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-02-02 09:59:36 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-02-19 11:01:56 +0100 |
commit | 2ee64e504b6921fd2d2f2d183e425904bc492c9d (patch) | |
tree | 37b02f07c7a819f4cd9f41d2a1b83ac37445c376 /server/sonar-web/src/main/js/apps | |
parent | 0c2b2d0afe3f28f7075fcadb78a81c59a21b34d3 (diff) | |
download | sonarqube-2ee64e504b6921fd2d2f2d183e425904bc492c9d.tar.gz sonarqube-2ee64e504b6921fd2d2f2d183e425904bc492c9d.zip |
SONAR-7122 drop web context from js code
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
86 files changed, 148 insertions, 149 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/app.js b/server/sonar-web/src/main/js/apps/account/app.js index e4643b9349c..4494c4d3d65 100644 --- a/server/sonar-web/src/main/js/apps/account/app.js +++ b/server/sonar-web/src/main/js/apps/account/app.js @@ -36,7 +36,7 @@ window.sonarqube.appStarted.then(options => { const el = document.querySelector(options.el); const history = useRouterHistory(createHistory)({ - basename: window.baseUrl + '/account' + basename: '/account' }); const store = configureStore(); diff --git a/server/sonar-web/src/main/js/apps/account/components/FavoriteIssueFilters.js b/server/sonar-web/src/main/js/apps/account/components/FavoriteIssueFilters.js index 3eb59fcc076..af3baa5d0dd 100644 --- a/server/sonar-web/src/main/js/apps/account/components/FavoriteIssueFilters.js +++ b/server/sonar-web/src/main/js/apps/account/components/FavoriteIssueFilters.js @@ -42,7 +42,7 @@ const FavoriteIssueFilters = ({ issueFilters }) => ( <FavoriteIssueFilter filter={f} favorite={true}/> </td> <td> - <a href={`${window.baseUrl}/issues/search#id=${f.id}`}> + <a href={`/issues/search#id=${f.id}`}> {f.name} </a> </td> @@ -52,7 +52,7 @@ const FavoriteIssueFilters = ({ issueFilters }) => ( </table> <div className="spacer-top small"> - <a href={`${window.baseUrl}/issues/manage`}>{translate('see_all')}</a> + <a href="/issues/manage">{translate('see_all')}</a> </div> </section> diff --git a/server/sonar-web/src/main/js/apps/account/components/FavoriteMeasureFilters.js b/server/sonar-web/src/main/js/apps/account/components/FavoriteMeasureFilters.js index c9998d0eaca..4bf9b26e79a 100644 --- a/server/sonar-web/src/main/js/apps/account/components/FavoriteMeasureFilters.js +++ b/server/sonar-web/src/main/js/apps/account/components/FavoriteMeasureFilters.js @@ -42,7 +42,7 @@ const FavoriteMeasureFilters = ({ measureFilters }) => ( <FavoriteMeasureFilter filter={f} favorite={true}/> </td> <td> - <a href={`${window.baseUrl}/measures/filter/${f.id}`}> + <a href={`/measures/filter/${f.id}`}> {f.name} </a> </td> @@ -52,7 +52,7 @@ const FavoriteMeasureFilters = ({ measureFilters }) => ( </table> <div className="spacer-top small"> - <a href={`${window.baseUrl}/measures/manage`}>{translate('see_all')}</a> + <a href="/measures/manage">{translate('see_all')}</a> </div> </section> diff --git a/server/sonar-web/src/main/js/apps/account/components/IssueWidgets.js b/server/sonar-web/src/main/js/apps/account/components/IssueWidgets.js index 673089bab6a..a59d59a5585 100644 --- a/server/sonar-web/src/main/js/apps/account/components/IssueWidgets.js +++ b/server/sonar-web/src/main/js/apps/account/components/IssueWidgets.js @@ -32,27 +32,27 @@ const BASE_QUERY = { resolved: false, assignees: '__me__' }; function getTotalUrl () { - return window.baseUrl + '/account/issues#resolved=false'; + return '/account/issues#resolved=false'; } function getToFixUrl () { - return window.baseUrl + '/account/issues#resolved=false|statuses=CONFIRMED'; + return '/account/issues#resolved=false|statuses=CONFIRMED'; } function getToReviewUrl () { - return window.baseUrl + '/account/issues#resolved=false|statuses=' + encodeURIComponent('OPEN,REOPENED'); + return '/account/issues#resolved=false|statuses=' + encodeURIComponent('OPEN,REOPENED'); } function getSeverityUrl (severity) { - return window.baseUrl + '/account/issues#resolved=false|severities=' + severity; + return '/account/issues#resolved=false|severities=' + severity; } function getProjectUrl (project) { - return window.baseUrl + '/account/issues#resolved=false|projectUuids=' + project; + return '/account/issues#resolved=false|projectUuids=' + project; } function getPeriodUrl (createdAfter, createdBefore) { - return window.baseUrl + `/account/issues#resolved=false|createdAfter=${createdAfter}|createdBefore=${createdBefore}`; + return `/account/issues#resolved=false|createdAfter=${createdAfter}|createdBefore=${createdBefore}`; } diff --git a/server/sonar-web/src/main/js/apps/account/components/Nav.js b/server/sonar-web/src/main/js/apps/account/components/Nav.js index a1fe74bfc0d..a7c1df4a6db 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Nav.js +++ b/server/sonar-web/src/main/js/apps/account/components/Nav.js @@ -36,8 +36,8 @@ const Nav = ({ user }) => ( </li> <li> <a - className={window.location.pathname === `${window.baseUrl}/account/issues` && 'active'} - href={`${window.baseUrl}/account/issues`}> + className={window.location.pathname === `/account/issues` && 'active'} + href={`/account/issues`}> {translate('issues.page')} </a> </li> diff --git a/server/sonar-web/src/main/js/apps/account/components/Notifications.js b/server/sonar-web/src/main/js/apps/account/components/Notifications.js index 8eb4e437afb..9c24284a7d2 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Notifications.js +++ b/server/sonar-web/src/main/js/apps/account/components/Notifications.js @@ -31,7 +31,7 @@ export default function Notifications ({ globalNotifications, projectNotificatio <p className="big-spacer-bottom"> {translate('notification.dispatcher.information')} </p> - <form id="notif_form" method="post" action={`${window.baseUrl}/account/update_notifications`}> + <form id="notif_form" method="post" action={`/account/update_notifications`}> <div className="columns columns-overflow-visible"> <div className="column-half"> <GlobalNotifications diff --git a/server/sonar-web/src/main/js/apps/api-documentation/action-view.js b/server/sonar-web/src/main/js/apps/api-documentation/action-view.js index 9374cca1eb2..99896b6d850 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/action-view.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/action-view.js @@ -57,7 +57,7 @@ export default Marionette.ItemView.extend({ fetchResponse: function () { var that = this, - url = baseUrl + '/api/webservices/response_example', + url = '/api/webservices/response_example', options = { controller: this.model.get('path'), action: this.model.get('key') }; return $.get(url, options).done(function (r) { that.model.set({ responseExample: r.example }); diff --git a/server/sonar-web/src/main/js/apps/api-documentation/list.js b/server/sonar-web/src/main/js/apps/api-documentation/list.js index 0a4edfcbb97..fd9950c438d 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/list.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/list.js @@ -21,7 +21,7 @@ import _ from 'underscore'; import Backbone from 'backbone'; export default Backbone.Collection.extend({ - url: baseUrl + '/api/webservices/list', + url: '/api/webservices/list', comparator: 'path', parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskLogsLink.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskLogsLink.js index 2f5893e8bed..1954e26d52f 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskLogsLink.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskLogsLink.js @@ -21,7 +21,7 @@ import React from 'react'; import { translate } from '../../../helpers/l10n'; export default function TaskLogsLink ({ task }) { - const url = `${window.baseUrl}/api/ce/logs?taskId=${task.id}`; + const url = `/api/ce/logs?taskId=${task.id}`; return ( <a diff --git a/server/sonar-web/src/main/js/apps/coding-rules/app.js b/server/sonar-web/src/main/js/apps/coding-rules/app.js index 88477fd3727..c23aa61b3d6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/app.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/app.js @@ -96,7 +96,7 @@ App.getSubCharacteristicName = function (key) { } }; -var appXHR = $.get(baseUrl + '/api/rules/app').done(function (r) { +var appXHR = $.get('/api/rules/app').done(function (r) { App.canWrite = r.canWrite; App.qualityProfiles = _.sortBy(r.qualityprofiles, ['name', 'lang']); App.languages = _.extend(r.languages, { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js index 754cdc208ec..cf805e393d3 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js @@ -59,7 +59,7 @@ export default ModalFormView.extend({ onFormSubmit: function () { ModalFormView.prototype.onFormSubmit.apply(this, arguments); - var url = baseUrl + '/api/qualityprofiles/' + this.options.action + '_rules', + var url = '/api/qualityprofiles/' + this.options.action + '_rules', options = _.extend({}, this.options.app.state.get('query'), { wsAction: this.options.action }), profiles = this.$('#coding-rules-bulk-change-profile').val() || [this.options.param]; this.ui.messagesContainer.empty(); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/controller.js b/server/sonar-web/src/main/js/apps/coding-rules/controller.js index 205e2ec483f..7b627f9e818 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/controller.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/controller.js @@ -61,7 +61,7 @@ export default Controller.extend({ this.hideDetails(firstPage); var that = this, - url = baseUrl + '/api/rules/search', + url = '/api/rules/search', options = _.extend(this._searchParameters(), this.app.state.get('query')); return $.get(url, options).done(function (r) { var rules = that.app.list.parseRules(r); @@ -93,7 +93,7 @@ export default Controller.extend({ }, requestFacet: function (id) { - var url = baseUrl + '/api/rules/search', + var url = '/api/rules/search', facet = this.app.facets.get(id), options = _.extend({ facets: id, ps: 1 }, this.app.state.get('query')); return $.get(url, options).done(function (r) { @@ -113,7 +113,7 @@ export default Controller.extend({ getRuleDetails: function (rule) { var that = this, - url = baseUrl + '/api/rules/show', + url = '/api/rules/show', options = { key: rule.id, actives: true diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js index 663038ce870..ef9417f855d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/custom-values-facet.js @@ -32,7 +32,7 @@ export default BaseFacet.extend({ }, getUrl: function () { - return baseUrl; + return ''; }, onRender: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js index 35fcb190b7f..56703f8a0a6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/language-facet.js @@ -23,7 +23,7 @@ import CustomValuesFacet from './custom-values-facet'; export default CustomValuesFacet.extend({ getUrl: function () { - return baseUrl + '/api/languages/list'; + return '/api/languages/list'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js index d052c168d92..73d4b6ebcb2 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/repository-facet.js @@ -23,7 +23,7 @@ import CustomValuesFacet from './custom-values-facet'; export default CustomValuesFacet.extend({ getUrl: function () { - return baseUrl + '/api/rules/repositories'; + return '/api/rules/repositories'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js index 0ead16ee6bd..91d3cb52624 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/facets/tag-facet.js @@ -22,7 +22,7 @@ import CustomValuesFacet from './custom-values-facet'; export default CustomValuesFacet.extend({ getUrl: function () { - return baseUrl + '/api/rules/tags'; + return '/api/rules/tags'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js index 6e3f33566c1..c13e5538ee4 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule-details-view.js @@ -98,7 +98,7 @@ export default Marionette.LayoutView.extend({ fetchCustomRules: function () { var that = this, - url = baseUrl + '/api/rules/search', + url = '/api/rules/search', options = { template_key: this.model.get('key'), f: 'name,severity,params' @@ -153,7 +153,7 @@ export default Marionette.LayoutView.extend({ title: translate('delete'), html: translateWithParameters('coding_rules.delete.' + ruleType + '.confirm', this.model.get('name')), yesHandler: function () { - var url = baseUrl + '/api/rules/delete', + var url = '/api/rules/delete', options = { key: that.model.id }; $.post(url, options).done(function () { that.options.app.controller.fetchList(); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js index a19de959ef6..dc0ad6fb708 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-creation-view.js @@ -154,7 +154,7 @@ export default ModalFormView.extend({ sendRequest: function (action, options) { this.$('.alert').addClass('hidden'); var that = this, - url = baseUrl + '/api/rules/' + action; + url = '/api/rules/' + action; return $.ajax({ url: url, type: 'POST', diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js index 6f813a64cc0..992d662ef31 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/custom-rule-view.js @@ -42,7 +42,7 @@ export default Marionette.ItemView.extend({ title: translate('delete'), html: translate('are_you_sure'), yesHandler: function () { - var url = baseUrl + '/api/rules/delete', + var url = '/api/rules/delete', options = { key: that.model.id }; $.post(url, options).done(function () { that.model.collection.remove(that.model); @@ -56,7 +56,7 @@ export default Marionette.ItemView.extend({ return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { canWrite: this.options.app.canWrite, templateRule: this.options.templateRule, - permalink: baseUrl + '/coding_rules/#rule_key=' + encodeURIComponent(this.model.id) + permalink: '/coding_rules/#rule_key=' + encodeURIComponent(this.model.id) }); } }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js index 160405496bd..9e807573888 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/manual-rule-creation-view.js @@ -101,7 +101,7 @@ export default ModalFormView.extend({ sendRequest: function (action, options) { var that = this, - url = baseUrl + '/api/rules/' + action; + url = '/api/rules/' + action; return $.ajax({ url: url, type: 'POST', diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js index c9d788914f7..84b4784c44d 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/profile-activation-view.js @@ -99,7 +99,7 @@ export default ModalForm.extend({ return $.ajax({ type: 'POST', - url: baseUrl + '/api/qualityprofiles/activate_rule', + url: '/api/qualityprofiles/activate_rule', data: { profile_key: profileKey, rule_key: ruleKey, diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js index d21c05e9b34..b6d7b78f0b3 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-description-view.js @@ -64,7 +64,7 @@ export default Marionette.ItemView.extend({ this.ui.extendDescriptionForm.addClass('hidden'); return $.ajax({ type: 'POST', - url: baseUrl + '/api/rules/update', + url: '/api/rules/update', dataType: 'json', data: { key: this.model.get('key'), diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js index 5738ce708d6..bcb5bd09191 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-issues-view.js @@ -36,7 +36,7 @@ export default Marionette.ItemView.extend({ requestIssues: function () { var that = this, - url = baseUrl + '/api/issues/search', + url = '/api/issues/search', options = { rules: this.model.id, resolved: false, @@ -61,7 +61,7 @@ export default Marionette.ItemView.extend({ return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { total: this.total, projects: this.projects, - baseSearchUrl: baseUrl + '/issues/search#resolved=false|rules=' + encodeURIComponent(this.model.id) + baseSearchUrl: '/issues/search#resolved=false|rules=' + encodeURIComponent(this.model.id) }); } }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js index 3990be2658e..129eb7744fb 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-meta-view.js @@ -57,7 +57,7 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({ }, requestTags: function () { - var url = baseUrl + '/api/rules/tags'; + var url = '/api/rules/tags'; return $.get(url); }, @@ -90,7 +90,7 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({ tags = this.ui.tagInput.val(); return $.ajax({ type: 'POST', - url: baseUrl + '/api/rules/update', + url: '/api/rules/update', data: { key: this.model.get('key'), tags: tags @@ -108,7 +108,7 @@ export default Marionette.ItemView.extend(RuleFilterMixin).extend({ canWrite: this.options.app.canWrite, subCharacteristic: this.options.app.getSubCharacteristicName(this.model.get('debtSubChar')), allTags: _.union(this.model.get('sysTags'), this.model.get('tags')), - permalink: baseUrl + '/coding_rules#rule_key=' + encodeURIComponent(this.model.id) + permalink: '/coding_rules#rule_key=' + encodeURIComponent(this.model.id) }); } }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js index 30c888854b8..22ed2b47ad5 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/rule/rule-profile-view.js @@ -75,7 +75,7 @@ export default Marionette.ItemView.extend({ yesHandler: function () { return $.ajax({ type: 'POST', - url: baseUrl + '/api/qualityprofiles/activate_rule', + url: '/api/qualityprofiles/activate_rule', data: { profile_key: that.model.get('qProfile'), rule_key: ruleKey, @@ -97,7 +97,7 @@ export default Marionette.ItemView.extend({ yesHandler: function () { return $.ajax({ type: 'POST', - url: baseUrl + '/api/qualityprofiles/deactivate_rule', + url: '/api/qualityprofiles/deactivate_rule', data: { profile_key: that.model.get('qProfile'), rule_key: ruleKey diff --git a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js index 42e6a441e1f..8a87b4e951c 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/workspace-list-item-view.js @@ -87,7 +87,7 @@ export default WorkspaceListItemView.extend(RuleFilterMixin).extend({ yesHandler: function () { return $.ajax({ type: 'POST', - url: baseUrl + '/api/qualityprofiles/deactivate_rule', + url: '/api/qualityprofiles/deactivate_rule', data: { profile_key: activation.qProfile, rule_key: ruleKey diff --git a/server/sonar-web/src/main/js/apps/custom-measures/custom-measure.js b/server/sonar-web/src/main/js/apps/custom-measures/custom-measure.js index d07513ca9d5..6576b554c8d 100644 --- a/server/sonar-web/src/main/js/apps/custom-measures/custom-measure.js +++ b/server/sonar-web/src/main/js/apps/custom-measures/custom-measure.js @@ -24,7 +24,7 @@ export default Backbone.Model.extend({ idAttribute: 'id', urlRoot: function () { - return baseUrl + '/api/custom_measures'; + return '/api/custom_measures'; }, sync: function (method, model, options) { diff --git a/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js b/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js index 103a289bf25..3afb64f5c63 100644 --- a/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js +++ b/server/sonar-web/src/main/js/apps/custom-measures/custom-measures.js @@ -29,7 +29,7 @@ export default Backbone.Collection.extend({ }, url: function () { - return baseUrl + '/api/custom_measures/search'; + return '/api/custom_measures/search'; }, parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/global-permissions/groups-view.js b/server/sonar-web/src/main/js/apps/global-permissions/groups-view.js index 45a774c3a9d..c29c1eeba85 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/groups-view.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/groups-view.js @@ -22,7 +22,7 @@ import Template from './templates/global-permissions-groups.hbs'; import '../../components/SelectList'; function getSearchUrl (permission, project) { - var url = baseUrl + '/api/permissions/groups?ps=100&permission=' + permission; + var url = '/api/permissions/groups?ps=100&permission=' + permission; if (project) { url = url + '&projectId=' + project; } @@ -52,8 +52,8 @@ export default Modal.extend({ }, queryParam: 'q', searchUrl: getSearchUrl(this.options.permission, this.options.project), - selectUrl: baseUrl + '/api/permissions/add_group', - deselectUrl: baseUrl + '/api/permissions/remove_group', + selectUrl: '/api/permissions/add_group', + deselectUrl: '/api/permissions/remove_group', extra: getExtra(this.options.permission, this.options.project), selectParameter: 'groupName', selectParameterValue: 'name', diff --git a/server/sonar-web/src/main/js/apps/global-permissions/main.js b/server/sonar-web/src/main/js/apps/global-permissions/main.js index eb420321990..963713722ed 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/main.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/main.js @@ -32,7 +32,7 @@ export default React.createClass({ }, requestPermissions() { - const url = `${window.baseUrl}/api/permissions/search_global_permissions`; + const url = `/api/permissions/search_global_permissions`; $.get(url).done(r => { this.setState({ ready: true, permissions: r.permissions }); }); diff --git a/server/sonar-web/src/main/js/apps/global-permissions/permission.js b/server/sonar-web/src/main/js/apps/global-permissions/permission.js index bb1270ac4b8..32b5bb71ac0 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/permission.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/permission.js @@ -40,7 +40,7 @@ export default React.createClass({ }, requestUsers() { - const url = `${window.baseUrl}/api/permissions/users`; + const url = `/api/permissions/users`; let data = { permission: this.props.permission.key, ps: MAX_ITEMS }; if (this.props.project) { data.projectId = this.props.project; @@ -49,7 +49,7 @@ export default React.createClass({ }, requestGroups() { - const url = `${window.baseUrl}/api/permissions/groups`; + const url = `/api/permissions/groups`; let data = { permission: this.props.permission.key, ps: MAX_ITEMS }; if (this.props.project) { data.projectId = this.props.project; diff --git a/server/sonar-web/src/main/js/apps/global-permissions/users-view.js b/server/sonar-web/src/main/js/apps/global-permissions/users-view.js index 61c454f3964..980da17df61 100644 --- a/server/sonar-web/src/main/js/apps/global-permissions/users-view.js +++ b/server/sonar-web/src/main/js/apps/global-permissions/users-view.js @@ -22,7 +22,7 @@ import Template from './templates/global-permissions-users.hbs'; import '../../components/SelectList'; function getSearchUrl (permission, project) { - var url = baseUrl + '/api/permissions/users?ps=100&permission=' + permission; + var url = '/api/permissions/users?ps=100&permission=' + permission; if (project) { url = url + '&projectId=' + project; } @@ -52,8 +52,8 @@ export default Modal.extend({ }, queryParam: 'q', searchUrl: getSearchUrl(this.options.permission, this.options.project), - selectUrl: baseUrl + '/api/permissions/add_user', - deselectUrl: baseUrl + '/api/permissions/remove_user', + selectUrl: '/api/permissions/add_user', + deselectUrl: '/api/permissions/remove_user', extra: getExtra(this.options.permission, this.options.project), selectParameter: 'login', selectParameterValue: 'login', diff --git a/server/sonar-web/src/main/js/apps/groups/group.js b/server/sonar-web/src/main/js/apps/groups/group.js index 99a484b7637..ff0c7e5a5f0 100644 --- a/server/sonar-web/src/main/js/apps/groups/group.js +++ b/server/sonar-web/src/main/js/apps/groups/group.js @@ -22,7 +22,7 @@ import Backbone from 'backbone'; export default Backbone.Model.extend({ urlRoot: function () { - return baseUrl + '/api/user_groups'; + return '/api/user_groups'; }, sync: function (method, model, options) { diff --git a/server/sonar-web/src/main/js/apps/groups/groups.js b/server/sonar-web/src/main/js/apps/groups/groups.js index 00143e7d095..73f21163135 100644 --- a/server/sonar-web/src/main/js/apps/groups/groups.js +++ b/server/sonar-web/src/main/js/apps/groups/groups.js @@ -24,7 +24,7 @@ export default Backbone.Collection.extend({ model: Group, url: function () { - return baseUrl + '/api/user_groups/search'; + return '/api/user_groups/search'; }, parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/groups/users-view.js b/server/sonar-web/src/main/js/apps/groups/users-view.js index ca21c132758..8f5baa9f16d 100644 --- a/server/sonar-web/src/main/js/apps/groups/users-view.js +++ b/server/sonar-web/src/main/js/apps/groups/users-view.js @@ -35,9 +35,9 @@ export default Modal.extend({ return item.name + '<br><span class="note">' + item.login + '</span>'; }, queryParam: 'q', - searchUrl: baseUrl + '/api/user_groups/users?ps=100&id=' + this.model.id, - selectUrl: baseUrl + '/api/user_groups/add_user', - deselectUrl: baseUrl + '/api/user_groups/remove_user', + searchUrl: '/api/user_groups/users?ps=100&id=' + this.model.id, + selectUrl: '/api/user_groups/add_user', + deselectUrl: '/api/user_groups/remove_user', extra: { id: this.model.id }, diff --git a/server/sonar-web/src/main/js/apps/issues/controller.js b/server/sonar-web/src/main/js/apps/issues/controller.js index 31a13f246da..5cf9f16c893 100644 --- a/server/sonar-web/src/main/js/apps/issues/controller.js +++ b/server/sonar-web/src/main/js/apps/issues/controller.js @@ -70,7 +70,7 @@ export default Controller.extend({ if (this.options.app.state.get('isContext')) { _.extend(data, this.options.app.state.get('contextQuery')); } - return $.get(baseUrl + '/api/issues/search', data).done(function (r) { + return $.get('/api/issues/search', data).done(function (r) { var issues = that.options.app.list.parseIssues(r); if (firstPage) { that.options.app.list.reset(issues); @@ -108,7 +108,7 @@ export default Controller.extend({ var that = this; return $.when( that.options.app.filters.fetch({ reset: true }), - $.get(baseUrl + '/api/issue_filters/app', function (r) { + $.get('/api/issue_filters/app', function (r) { that.options.app.state.set({ canBulkChange: r.canBulkChange, canManageFilters: r.canManageFilters @@ -132,7 +132,7 @@ export default Controller.extend({ if (this.options.app.state.get('isContext')) { _.extend(data, this.options.app.state.get('contextQuery')); } - return $.get(baseUrl + '/api/issues/search', data, function (r) { + return $.get('/api/issues/search', data, function (r) { FACET_DATA_FIELDS.forEach(function (field) { that.options.app.facets[field] = that._mergeCollections(that.options.app.facets[field], r[field]); }); @@ -151,7 +151,7 @@ export default Controller.extend({ if (this.options.app.state.get('isContext')) { _.extend(data, this.options.app.state.get('contextQuery')); } - return $.get(baseUrl + '/api/issues/search', data, function (r) { + return $.get('/api/issues/search', data, function (r) { FACET_DATA_FIELDS.forEach(function (field) { that.options.app.facets[field] = that._mergeCollections(that.options.app.facets[field], r[field]); }); diff --git a/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js index 8673311560b..3fc1f32663f 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js @@ -26,7 +26,7 @@ export default CustomValuesFacet.extend({ template: Template, getUrl: function () { - return baseUrl + '/api/users/search'; + return '/api/users/search'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js index 1c0de423ba5..d252a6e75a3 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js @@ -22,7 +22,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; export default CustomValuesFacet.extend({ getUrl: function () { - return baseUrl + '/api/issues/authors'; + return '/api/issues/authors'; }, prepareSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js index 5e1359a4d68..af92bd84037 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js @@ -23,7 +23,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; export default CustomValuesFacet.extend({ getUrl: function () { - return baseUrl + '/api/languages/list'; + return '/api/languages/list'; }, prepareSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js index c3e3a1ac0e8..363c83c0e40 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js @@ -26,9 +26,9 @@ export default CustomValuesFacet.extend({ getUrl: function () { var q = this.options.app.state.get('contextComponentQualifier'); if (q === 'VW' || q === 'SVW') { - return baseUrl + '/api/components/search_view_components'; + return '/api/components/search_view_components'; } else { - return baseUrl + '/api/resources/search?f=s2&q=TRK&display_uuid=true'; + return '/api/resources/search?f=s2&q=TRK&display_uuid=true'; } }, diff --git a/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js index 368e59b4f43..ac03ba3341c 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/reporter-facet.js @@ -22,7 +22,7 @@ import CustomValuesFacet from './custom-values-facet'; export default CustomValuesFacet.extend({ getUrl: function () { - return baseUrl + '/api/users/search'; + return '/api/users/search'; }, prepareAjaxSearch: function () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js index 0ae574ab032..a9cf5cd0187 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js @@ -23,7 +23,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; export default CustomValuesFacet.extend({ prepareSearch: function () { - var url = baseUrl + '/api/rules/search?f=name,langName', + var url = '/api/rules/search?f=name,langName', languages = this.options.app.state.get('query').languages; if (languages != null) { url += '&languages=' + languages; diff --git a/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js index 43b4de50c28..13be00166fd 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js @@ -23,7 +23,7 @@ import { translate } from '../../../helpers/l10n'; export default CustomValuesFacet.extend({ prepareSearch: function () { - var url = baseUrl + '/api/issues/tags?ps=10', + var url = '/api/issues/tags?ps=10', tags = this.options.app.state.get('query').tags; if (tags != null) { url += '&tags=' + tags; diff --git a/server/sonar-web/src/main/js/apps/issues/filters-view.js b/server/sonar-web/src/main/js/apps/issues/filters-view.js index 72f775448fb..2deb3b6710c 100644 --- a/server/sonar-web/src/main/js/apps/issues/filters-view.js +++ b/server/sonar-web/src/main/js/apps/issues/filters-view.js @@ -75,26 +75,26 @@ export default Marionette.ItemView.extend({ saveAs: function () { var query = this.options.app.controller.getQuery('&'), - url = baseUrl + '/issues/save_as_form?' + query; + url = '/issues/save_as_form?' + query; window.openModalWindow(url, {}); }, save: function () { var that = this; var query = this.options.app.controller.getQuery('&'), - url = baseUrl + '/issues/save/' + (this.options.app.state.get('filter').id) + '?' + query; + url = '/issues/save/' + (this.options.app.state.get('filter').id) + '?' + query; return $.post(url).done(function () { return that.options.app.state.set({ changed: false }); }); }, copy: function () { - var url = baseUrl + '/issues/copy_form/' + (this.options.app.state.get('filter').id); + var url = '/issues/copy_form/' + (this.options.app.state.get('filter').id); window.openModalWindow(url, {}); }, edit: function () { - var url = baseUrl + '/issues/edit_form/' + (this.options.app.state.get('filter').id); + var url = '/issues/edit_form/' + (this.options.app.state.get('filter').id); window.openModalWindow(url, {}); }, diff --git a/server/sonar-web/src/main/js/apps/issues/models/filter.js b/server/sonar-web/src/main/js/apps/issues/models/filter.js index 63024e99950..c43bd88fa73 100644 --- a/server/sonar-web/src/main/js/apps/issues/models/filter.js +++ b/server/sonar-web/src/main/js/apps/issues/models/filter.js @@ -21,7 +21,7 @@ import Backbone from 'backbone'; export default Backbone.Model.extend({ url: function () { - return baseUrl + '/api/issue_filters/show/' + this.id; + return '/api/issue_filters/show/' + this.id; }, parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/issues/models/filters.js b/server/sonar-web/src/main/js/apps/issues/models/filters.js index 8053a5e3634..ba3e50c684f 100644 --- a/server/sonar-web/src/main/js/apps/issues/models/filters.js +++ b/server/sonar-web/src/main/js/apps/issues/models/filters.js @@ -24,7 +24,7 @@ export default Backbone.Collection.extend({ model: Filter, url: function () { - return window.baseUrl + '/api/issue_filters/search'; + return '/api/issue_filters/search'; }, parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/issues/models/issues.js b/server/sonar-web/src/main/js/apps/issues/models/issues.js index 1d1187059a2..7911332865d 100644 --- a/server/sonar-web/src/main/js/apps/issues/models/issues.js +++ b/server/sonar-web/src/main/js/apps/issues/models/issues.js @@ -25,7 +25,7 @@ export default Backbone.Collection.extend({ model: Issue, url: function () { - return baseUrl + '/api/issues/search'; + return '/api/issues/search'; }, _injectRelational: function (issue, source, baseField, lookupField) { diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js index 4a3a3b84b2b..7d533fe555e 100644 --- a/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js +++ b/server/sonar-web/src/main/js/apps/issues/workspace-header-view.js @@ -105,7 +105,7 @@ export default WorkspaceHeaderView.extend({ bulkChange: function () { var query = this.options.app.controller.getQuery('&', true), - url = baseUrl + '/issues/bulk_change_form?' + query; + url = '/issues/bulk_change_form?' + query; window.openModalWindow(url, {}); }, @@ -113,7 +113,7 @@ export default WorkspaceHeaderView.extend({ var selected = this.options.app.list.where({ selected: true }), selectedKeys = _.first(_.pluck(selected, 'id'), 200), query = 'issues=' + selectedKeys.join(), - url = baseUrl + '/issues/bulk_change_form?' + query; + url = '/issues/bulk_change_form?' + query; window.openModalWindow(url, {}); }, diff --git a/server/sonar-web/src/main/js/apps/maintenance/main-view.js b/server/sonar-web/src/main/js/apps/maintenance/main-view.js index 97bc58d4636..a7bfdac0cc6 100644 --- a/server/sonar-web/src/main/js/apps/maintenance/main-view.js +++ b/server/sonar-web/src/main/js/apps/maintenance/main-view.js @@ -34,7 +34,7 @@ export default Marionette.ItemView.extend({ var that = this; this.requestOptions = { type: 'GET', - url: baseUrl + '/api/system/' + (this.options.setup ? 'db_migration_status' : 'status') + url: '/api/system/' + (this.options.setup ? 'db_migration_status' : 'status') }; this.pollingInternal = setInterval(function () { that.refresh(); @@ -62,7 +62,7 @@ export default Marionette.ItemView.extend({ startMigration: function () { var that = this; Backbone.ajax({ - url: baseUrl + '/api/system/migrate_db', + url: '/api/system/migrate_db', type: 'POST' }).done(function (r) { that.model.set(r); @@ -76,7 +76,7 @@ export default Marionette.ItemView.extend({ goHome: function () { setInterval(function () { - window.location = baseUrl + '/'; + window.location = '/'; }, 2500); }, diff --git a/server/sonar-web/src/main/js/apps/metrics/app.js b/server/sonar-web/src/main/js/apps/metrics/app.js index 2b3194f2bf7..d6318adaef2 100644 --- a/server/sonar-web/src/main/js/apps/metrics/app.js +++ b/server/sonar-web/src/main/js/apps/metrics/app.js @@ -63,12 +63,12 @@ var App = new Marionette.Application(), App.requestDomains = function () { - return $.get(baseUrl + '/api/metrics/domains').done(function (r) { + return $.get('/api/metrics/domains').done(function (r) { App.domains = r.domains; }); }; App.requestTypes = function () { - return $.get(baseUrl + '/api/metrics/types').done(function (r) { + return $.get('/api/metrics/types').done(function (r) { App.types = r.types; }); }; diff --git a/server/sonar-web/src/main/js/apps/metrics/metric.js b/server/sonar-web/src/main/js/apps/metrics/metric.js index c19526599d4..395778d8b94 100644 --- a/server/sonar-web/src/main/js/apps/metrics/metric.js +++ b/server/sonar-web/src/main/js/apps/metrics/metric.js @@ -24,7 +24,7 @@ export default Backbone.Model.extend({ idAttribute: 'id', urlRoot: function () { - return baseUrl + '/api/metrics'; + return '/api/metrics'; }, sync: function (method, model, options) { diff --git a/server/sonar-web/src/main/js/apps/metrics/metrics.js b/server/sonar-web/src/main/js/apps/metrics/metrics.js index 1e25f177d80..31613599f30 100644 --- a/server/sonar-web/src/main/js/apps/metrics/metrics.js +++ b/server/sonar-web/src/main/js/apps/metrics/metrics.js @@ -25,7 +25,7 @@ export default Backbone.Collection.extend({ model: Metric, url: function () { - return baseUrl + '/api/metrics/search'; + return '/api/metrics/search'; }, parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/overview/app.js b/server/sonar-web/src/main/js/apps/overview/app.js index 0625efd5dc9..53ea76de36a 100644 --- a/server/sonar-web/src/main/js/apps/overview/app.js +++ b/server/sonar-web/src/main/js/apps/overview/app.js @@ -32,7 +32,7 @@ class App { start (options) { let opts = _.extend({}, options, window.sonarqube.overview); _.extend(opts.component, options.component); - opts.urlRoot = window.baseUrl + '/overview'; + opts.urlRoot = '/overview'; $('html').toggleClass('dashboard-page', opts.component.hasSnapshot); let el = document.querySelector(opts.el); diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js b/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js index deffa8ae473..4ad5565b59b 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js @@ -22,7 +22,7 @@ import { translate } from '../../../helpers/l10n'; export default React.createClass({ render() { - let qualityGatesUrl = window.baseUrl + '/quality_gates'; + let qualityGatesUrl = '/quality_gates'; return ( <div className="overview-gate"> diff --git a/server/sonar-web/src/main/js/apps/overview/main/components.js b/server/sonar-web/src/main/js/apps/overview/main/components.js index 12d060f541c..80ab66122d7 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/components.js +++ b/server/sonar-web/src/main/js/apps/overview/main/components.js @@ -34,8 +34,7 @@ export const Domain = React.createClass({ export const DomainTitle = React.createClass({ render () { if (this.props.linkTo) { - let url = window.baseUrl + '/overview' + this.props.linkTo + - '?id=' + encodeURIComponent(this.props.component.key); + let url = '/overview' + this.props.linkTo + '?id=' + encodeURIComponent(this.props.component.key); return <div> <div className="overview-title"> {this.props.children} diff --git a/server/sonar-web/src/main/js/apps/permission-templates/groups-view.js b/server/sonar-web/src/main/js/apps/permission-templates/groups-view.js index 5fb20a259b8..e140e5bafe4 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/groups-view.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/groups-view.js @@ -23,7 +23,7 @@ import '../../components/SelectList'; import Template from './templates/permission-templates-groups.hbs'; function getSearchUrl (permission, permissionTemplate) { - return baseUrl + '/api/permissions/template_groups?ps=100&permission=' + permission.key + + return '/api/permissions/template_groups?ps=100&permission=' + permission.key + '&templateId=' + permissionTemplate.id; } @@ -42,8 +42,8 @@ export default Modal.extend({ }, queryParam: 'q', searchUrl: getSearchUrl(this.options.permission, this.options.permissionTemplate), - selectUrl: baseUrl + '/api/permissions/add_group_to_template', - deselectUrl: baseUrl + '/api/permissions/remove_group_from_template', + selectUrl: '/api/permissions/add_group_to_template', + deselectUrl: '/api/permissions/remove_group_from_template', extra: { permission: this.options.permission.key, templateId: this.options.permissionTemplate.id diff --git a/server/sonar-web/src/main/js/apps/permission-templates/users-view.js b/server/sonar-web/src/main/js/apps/permission-templates/users-view.js index 3b73dd2060f..6348a1ad9c4 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/users-view.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/users-view.js @@ -27,7 +27,7 @@ export default Modal.extend({ onRender: function () { Modal.prototype.onRender.apply(this, arguments); - var searchUrl = baseUrl + '/api/permissions/template_users?ps=100&permission=' + this.options.permission.key + + var searchUrl = '/api/permissions/template_users?ps=100&permission=' + this.options.permission.key + '&templateId=' + this.options.permissionTemplate.id; new window.SelectList({ el: this.$('#permission-templates-users'), @@ -39,8 +39,8 @@ export default Modal.extend({ }, queryParam: 'q', searchUrl: searchUrl, - selectUrl: baseUrl + '/api/permissions/add_user_to_template', - deselectUrl: baseUrl + '/api/permissions/remove_user_from_template', + selectUrl: '/api/permissions/add_user_to_template', + deselectUrl: '/api/permissions/remove_user_from_template', extra: { permission: this.options.permission.key, templateId: this.options.permissionTemplate.id diff --git a/server/sonar-web/src/main/js/apps/project-permissions/app.js b/server/sonar-web/src/main/js/apps/project-permissions/app.js index 071dd763aaf..6e00dcce72f 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/app.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/app.js @@ -23,7 +23,7 @@ import ReactDOM from 'react-dom'; import Main from './main'; function requestPermissionTemplates () { - return $.get(baseUrl + '/api/permissions/search_templates'); + return $.get('/api/permissions/search_templates'); } window.sonarqube.appStarted.then(options => { diff --git a/server/sonar-web/src/main/js/apps/project-permissions/groups-view.js b/server/sonar-web/src/main/js/apps/project-permissions/groups-view.js index 4603c21efc7..1a4658b68ff 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/groups-view.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/groups-view.js @@ -23,7 +23,7 @@ import '../../components/SelectList'; import Template from './templates/project-permissions-groups.hbs'; function getSearchUrl (permission, project) { - return baseUrl + '/api/permissions/groups?ps=100&permission=' + permission + '&projectId=' + project; + return '/api/permissions/groups?ps=100&permission=' + permission + '&projectId=' + project; } export default Modal.extend({ @@ -41,8 +41,8 @@ export default Modal.extend({ }, queryParam: 'q', searchUrl: getSearchUrl(this.options.permission, this.options.project), - selectUrl: baseUrl + '/api/permissions/add_group', - deselectUrl: baseUrl + '/api/permissions/remove_group', + selectUrl: '/api/permissions/add_group', + deselectUrl: '/api/permissions/remove_group', extra: { permission: this.options.permission, projectId: this.options.project diff --git a/server/sonar-web/src/main/js/apps/project-permissions/main.js b/server/sonar-web/src/main/js/apps/project-permissions/main.js index 556fec0a65d..61d838a8bec 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/main.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/main.js @@ -60,7 +60,7 @@ export default React.createClass({ }, requestPermissions(page = 1, query = '', filter = this.state.filter) { - let url = `${window.baseUrl}/api/permissions/search_project_permissions`; + let url = `/api/permissions/search_project_permissions`; let data = { p: page, q: query }; if (filter !== '__ALL__') { data.qualifier = filter; diff --git a/server/sonar-web/src/main/js/apps/project-permissions/users-view.js b/server/sonar-web/src/main/js/apps/project-permissions/users-view.js index 42947b9ede7..1c19f08bf30 100644 --- a/server/sonar-web/src/main/js/apps/project-permissions/users-view.js +++ b/server/sonar-web/src/main/js/apps/project-permissions/users-view.js @@ -27,7 +27,7 @@ export default Modal.extend({ onRender: function () { Modal.prototype.onRender.apply(this, arguments); - var searchUrl = baseUrl + '/api/permissions/users?ps=100&permission=' + this.options.permission + + var searchUrl = '/api/permissions/users?ps=100&permission=' + this.options.permission + '&projectId=' + this.options.project; new window.SelectList({ el: this.$('#project-permissions-users'), @@ -39,8 +39,8 @@ export default Modal.extend({ }, queryParam: 'q', searchUrl: searchUrl, - selectUrl: baseUrl + '/api/permissions/add_user', - deselectUrl: baseUrl + '/api/permissions/remove_user', + selectUrl: '/api/permissions/add_user', + deselectUrl: '/api/permissions/remove_user', extra: { permission: this.options.permission, projectId: this.options.project diff --git a/server/sonar-web/src/main/js/apps/quality-gates/app.js b/server/sonar-web/src/main/js/apps/quality-gates/app.js index 358dee10336..9212527eae6 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/app.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/app.js @@ -64,7 +64,7 @@ var init = function () { }); }; -var appXHR = $.get(baseUrl + '/api/qualitygates/app') +var appXHR = $.get('/api/qualitygates/app') .done(function (r) { App.canEdit = r.edit; App.periods = r.periods; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/condition.js b/server/sonar-web/src/main/js/apps/quality-gates/condition.js index 795ffeae47a..8e8f42e0076 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/condition.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/condition.js @@ -26,7 +26,7 @@ export default Backbone.Model.extend({ }, url: function () { - return baseUrl + '/api/qualitygates'; + return '/api/qualitygates'; }, createUrl: function () { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/copy-view.js b/server/sonar-web/src/main/js/apps/quality-gates/copy-view.js index b53b990609b..9973df8a975 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/copy-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/copy-view.js @@ -24,7 +24,7 @@ export default FormView.extend({ prepareRequest: function () { var that = this; - var url = baseUrl + '/api/qualitygates/copy', + var url = '/api/qualitygates/copy', name = this.$('#quality-gate-form-name').val(), options = { url: url, diff --git a/server/sonar-web/src/main/js/apps/quality-gates/create-view.js b/server/sonar-web/src/main/js/apps/quality-gates/create-view.js index 1bf62ecf15c..9fd9b2e5d11 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/create-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/create-view.js @@ -24,7 +24,7 @@ export default FormView.extend({ prepareRequest: function () { var that = this; - var url = baseUrl + '/api/qualitygates/create', + var url = '/api/qualitygates/create', name = this.$('#quality-gate-form-name').val(), options = { url: url, diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gate-projects-view.js b/server/sonar-web/src/main/js/apps/quality-gates/gate-projects-view.js index ac2449ad86d..939face75f0 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/gate-projects-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/gate-projects-view.js @@ -36,9 +36,9 @@ export default Marionette.ItemView.extend({ format: function (item) { return item.name; }, - searchUrl: baseUrl + '/api/qualitygates/search?gateId=' + this.model.id, - selectUrl: baseUrl + '/api/qualitygates/select', - deselectUrl: baseUrl + '/api/qualitygates/deselect', + searchUrl: '/api/qualitygates/search?gateId=' + this.model.id, + selectUrl: '/api/qualitygates/select', + deselectUrl: '/api/qualitygates/deselect', extra: { gateId: this.model.id }, diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gate.js b/server/sonar-web/src/main/js/apps/quality-gates/gate.js index 522de6751b9..31c046b62bd 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/gate.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/gate.js @@ -26,7 +26,7 @@ export default Backbone.Model.extend({ }, url: function () { - return baseUrl + '/api/qualitygates'; + return '/api/qualitygates'; }, showUrl: function () { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gates.js b/server/sonar-web/src/main/js/apps/quality-gates/gates.js index c411c446a00..2b4a300bb4c 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/gates.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/gates.js @@ -25,7 +25,7 @@ export default Backbone.Collection.extend({ model: Gate, url: function () { - return baseUrl + '/api/qualitygates/list'; + return '/api/qualitygates/list'; }, parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/quality-gates/rename-view.js b/server/sonar-web/src/main/js/apps/quality-gates/rename-view.js index 20e79a6a51b..c84ff73422a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/rename-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/rename-view.js @@ -24,7 +24,7 @@ export default FormView.extend({ prepareRequest: function () { var that = this; - var url = baseUrl + '/api/qualitygates/rename', + var url = '/api/qualitygates/rename', name = this.$('#quality-gate-form-name').val(), options = { url: url, diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/actions-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/actions-view.js index c9e026d0267..ee8b267313d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/actions-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/actions-view.js @@ -83,7 +83,7 @@ export default Marionette.ItemView.extend({ requestLanguages: function () { var that = this, - url = baseUrl + '/api/languages/list'; + url = '/api/languages/list'; return $.get(url).done(function (r) { that.languages = r.languages; }); @@ -91,7 +91,7 @@ export default Marionette.ItemView.extend({ requestImporters: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/importers'; + url = '/api/qualityprofiles/importers'; return $.get(url).done(function (r) { that.importers = r.importers; }); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/app.js b/server/sonar-web/src/main/js/apps/quality-profiles/app.js index edded138237..1d77201f20b 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/app.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/app.js @@ -28,10 +28,10 @@ import ActionsView from './actions-view'; import ProfilesView from './profiles-view'; var App = new Marionette.Application(), - requestUser = $.get(baseUrl + '/api/users/current').done(function (r) { + requestUser = $.get('/api/users/current').done(function (r) { App.canWrite = r.permissions.global.indexOf('profileadmin') !== -1; }), - requestExporters = $.get(baseUrl + '/api/qualityprofiles/exporters').done(function (r) { + requestExporters = $.get('/api/qualityprofiles/exporters').done(function (r) { App.exporters = r.exporters; }), init = function () { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/change-profile-parent-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/change-profile-parent-view.js index 8fbfccaac71..681098f20cb 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/change-profile-parent-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/change-profile-parent-view.js @@ -42,7 +42,7 @@ export default ModalFormView.extend({ sendRequest: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/change_parent', + url = '/api/qualityprofiles/change_parent', parent = this.$('#change-profile-parent').val(), options = { profileKey: this.model.get('key'), diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/controller.js b/server/sonar-web/src/main/js/apps/quality-profiles/controller.js index d28c0934d75..68046423c39 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/controller.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/controller.js @@ -99,7 +99,7 @@ export default Marionette.Controller.extend({ onProfileSetAsDefault: function (profile) { var that = this, - url = baseUrl + '/api/qualityprofiles/set_default', + url = '/api/qualityprofiles/set_default', key = profile.get('key'), options = { profileKey: key }; return $.post(url, options).done(function () { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/copy-profile-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/copy-profile-view.js index 09511190211..d17be22b774 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/copy-profile-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/copy-profile-view.js @@ -33,7 +33,7 @@ export default ModalFormView.extend({ sendRequest: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/copy', + url = '/api/qualityprofiles/copy', name = this.$('#copy-profile-name').val(), options = { fromKey: this.model.get('key'), diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/delete-profile-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/delete-profile-view.js index d0b21a3dae0..7b9e6889f4c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/delete-profile-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/delete-profile-view.js @@ -36,7 +36,7 @@ export default ModalFormView.extend({ sendRequest: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/delete', + url = '/api/qualityprofiles/delete', options = { profileKey: this.model.get('key') }; return $.ajax({ type: 'POST', diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js index 5fa02436f01..6fbdea721f2 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/profile-details-view.js @@ -84,9 +84,9 @@ export default Marionette.LayoutView.extend({ format: function (item) { return item.name; }, - searchUrl: baseUrl + '/api/qualityprofiles/projects?key=' + encodeURIComponent(key), - selectUrl: baseUrl + '/api/qualityprofiles/add_project', - deselectUrl: baseUrl + '/api/qualityprofiles/remove_project', + searchUrl: '/api/qualityprofiles/projects?key=' + encodeURIComponent(key), + selectUrl: '/api/qualityprofiles/add_project', + deselectUrl: '/api/qualityprofiles/remove_project', extra: { profileKey: key }, diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profile.js b/server/sonar-web/src/main/js/apps/quality-profiles/profile.js index c7fa5b21bcf..04018894b05 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/profile.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/profile.js @@ -42,7 +42,7 @@ export default Backbone.Model.extend({ fetchProfileRules: function () { var that = this, - url = baseUrl + '/api/rules/search', + url = '/api/rules/search', key = this.id, options = { ps: 1, @@ -65,7 +65,7 @@ export default Backbone.Model.extend({ fetchInheritance: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/inheritance', + url = '/api/qualityprofiles/inheritance', options = { profileKey: this.id }; return $.get(url, options).done(function (r) { _.extend(that.fetchChanged, r.profile, { @@ -77,7 +77,7 @@ export default Backbone.Model.extend({ fetchChangelog: function (options) { var that = this, - url = baseUrl + '/api/qualityprofiles/changelog', + url = '/api/qualityprofiles/changelog', opts = _.extend({}, options, { profileKey: this.id }); return $.get(url, opts).done(function (r) { that.set({ @@ -91,7 +91,7 @@ export default Backbone.Model.extend({ fetchMoreChangelog: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/changelog', + url = '/api/qualityprofiles/changelog', page = this.get('eventsPage') || 0, parameters = this.get('eventsParameters') || {}, opts = _.extend({}, parameters, { profileKey: this.id, p: page + 1 }); @@ -113,7 +113,7 @@ export default Backbone.Model.extend({ compareWith: function (withKey) { var that = this, - url = baseUrl + '/api/qualityprofiles/compare', + url = '/api/qualityprofiles/compare', options = { leftKey: this.id, rightKey: withKey }; return $.get(url, options).done(function (r) { var comparison = _.extend(r, { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/profiles.js b/server/sonar-web/src/main/js/apps/quality-profiles/profiles.js index 52adaa5e40d..01f9440868f 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/profiles.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/profiles.js @@ -22,7 +22,7 @@ import Profile from './profile'; export default Backbone.Collection.extend({ model: Profile, - url: baseUrl + '/api/qualityprofiles/search', + url: '/api/qualityprofiles/search', comparator: 'key', parse: function (r) { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js index 4cb03e66c23..4093cf3ff60 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/rename-profile-view.js @@ -31,7 +31,7 @@ export default ModalFormView.extend({ sendRequest: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/rename', + url = '/api/qualityprofiles/rename', name = this.$('#rename-profile-name').val(), options = { key: this.model.get('key'), diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js index c595871cb43..3386cfe6a75 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js @@ -47,7 +47,7 @@ export default ModalFormView.extend({ sendRequest: function () { var that = this, - url = baseUrl + '/api/qualityprofiles/restore_built_in', + url = '/api/qualityprofiles/restore_built_in', lang = this.$('#restore-built-in-profiles-language').val(), options = { language: lang }; this.selectedLanguage = _.findWhere(this.options.languages, { key: lang }).name; diff --git a/server/sonar-web/src/main/js/apps/system/main.js b/server/sonar-web/src/main/js/apps/system/main.js index e12d12f29a8..0fbabea94bd 100644 --- a/server/sonar-web/src/main/js/apps/system/main.js +++ b/server/sonar-web/src/main/js/apps/system/main.js @@ -70,8 +70,8 @@ export default React.createClass({ <header className="page-header"> <h1 className="page-title">{translate('system_info.page')}</h1> <div className="page-actions"> - <a className="spacer-right" href={window.baseUrl + '/api/system/logs'} id="logs-link">Logs</a> - <a href={window.baseUrl + '/api/system/info'} id="download-link">Download</a> + <a className="spacer-right" href={'/api/system/logs'} id="logs-link">Logs</a> + <a href={'/api/system/info'} id="download-link">Download</a> <button id="restart-server-button" className="big-spacer-left" diff --git a/server/sonar-web/src/main/js/apps/update-center/plugin.js b/server/sonar-web/src/main/js/apps/update-center/plugin.js index e712c8acecb..6e6807e2a06 100644 --- a/server/sonar-web/src/main/js/apps/update-center/plugin.js +++ b/server/sonar-web/src/main/js/apps/update-center/plugin.js @@ -61,7 +61,7 @@ export default Backbone.Model.extend({ install: function () { return this._action({ - url: baseUrl + '/api/plugins/install', + url: '/api/plugins/install', success: function (model) { model.set({ _status: 'installing' }); } @@ -70,7 +70,7 @@ export default Backbone.Model.extend({ update: function () { return this._action({ - url: baseUrl + '/api/plugins/update', + url: '/api/plugins/update', success: function (model) { model.set({ _status: 'installing' }); } @@ -79,7 +79,7 @@ export default Backbone.Model.extend({ uninstall: function () { return this._action({ - url: baseUrl + '/api/plugins/uninstall', + url: '/api/plugins/uninstall', success: function (model) { model.set({ _status: 'uninstalling' }); } diff --git a/server/sonar-web/src/main/js/apps/update-center/plugins.js b/server/sonar-web/src/main/js/apps/update-center/plugins.js index 2655bf22c5c..537a1d38c33 100644 --- a/server/sonar-web/src/main/js/apps/update-center/plugins.js +++ b/server/sonar-web/src/main/js/apps/update-center/plugins.js @@ -70,7 +70,7 @@ var Plugins = Backbone.Collection.extend({ var that = this; var opts = { type: 'GET', - url: baseUrl + '/api/plugins/installed', + url: '/api/plugins/installed', success: function (r) { that._installed = that.parse(r); } @@ -85,7 +85,7 @@ var Plugins = Backbone.Collection.extend({ var that = this; var opts = { type: 'GET', - url: baseUrl + '/api/plugins/updates', + url: '/api/plugins/updates', success: function (r) { that._updates = that.parse(r); } @@ -100,7 +100,7 @@ var Plugins = Backbone.Collection.extend({ var that = this; var opts = { type: 'GET', - url: baseUrl + '/api/plugins/available', + url: '/api/plugins/available', success: function (r) { that._available = that.parse(r); } @@ -112,7 +112,7 @@ var Plugins = Backbone.Collection.extend({ var that = this; var opts = { type: 'GET', - url: baseUrl + '/api/plugins/pending', + url: '/api/plugins/pending', success: function (r) { var installing = r.installing.map(function (plugin) { return { key: plugin.key, _status: 'installing' }; @@ -135,7 +135,7 @@ var Plugins = Backbone.Collection.extend({ var that = this; var opts = { type: 'GET', - url: baseUrl + '/api/system/upgrades', + url: '/api/system/upgrades', success: function (r) { that._systemUpdates = r.upgrades.map(function (update) { return _.extend(update, { _system: true }); @@ -195,7 +195,7 @@ var Plugins = Backbone.Collection.extend({ var that = this; var opts = { type: 'POST', - url: baseUrl + '/api/plugins/cancel_all', + url: '/api/plugins/cancel_all', success: function () { that._installedCount = 0; that._uninstalledCount = 0; diff --git a/server/sonar-web/src/main/js/apps/users/groups-view.js b/server/sonar-web/src/main/js/apps/users/groups-view.js index d619afacb50..30fdb22fc44 100644 --- a/server/sonar-web/src/main/js/apps/users/groups-view.js +++ b/server/sonar-web/src/main/js/apps/users/groups-view.js @@ -35,9 +35,9 @@ export default Modal.extend({ return item.name + '<br><span class="note">' + item.description + '</span>'; }, queryParam: 'q', - searchUrl: baseUrl + '/api/users/groups?ps=100&login=' + this.model.id, - selectUrl: baseUrl + '/api/user_groups/add_user', - deselectUrl: baseUrl + '/api/user_groups/remove_user', + searchUrl: '/api/users/groups?ps=100&login=' + this.model.id, + selectUrl: '/api/user_groups/add_user', + deselectUrl: '/api/user_groups/remove_user', extra: { login: this.model.id }, diff --git a/server/sonar-web/src/main/js/apps/users/user.js b/server/sonar-web/src/main/js/apps/users/user.js index ef4406966d1..86fc8870f5a 100644 --- a/server/sonar-web/src/main/js/apps/users/user.js +++ b/server/sonar-web/src/main/js/apps/users/user.js @@ -24,7 +24,7 @@ export default Backbone.Model.extend({ idAttribute: 'login', urlRoot: function () { - return baseUrl + '/api/users'; + return '/api/users'; }, defaults: function () { diff --git a/server/sonar-web/src/main/js/apps/users/users.js b/server/sonar-web/src/main/js/apps/users/users.js index 81cee0372bd..e9140fc39bb 100644 --- a/server/sonar-web/src/main/js/apps/users/users.js +++ b/server/sonar-web/src/main/js/apps/users/users.js @@ -24,7 +24,7 @@ export default Backbone.Collection.extend({ model: User, url: function () { - return baseUrl + '/api/users/search'; + return '/api/users/search'; }, parse: function (r) { |