diff --git a/server/sonar-web/src/main/js/api/ce.js b/server/sonar-web/src/main/js/api/ce.js index dc36ed444a3c..b272cb9c0fb5 100644 --- a/server/sonar-web/src/main/js/api/ce.js +++ b/server/sonar-web/src/main/js/api/ce.js @@ -21,22 +21,22 @@ import $ from 'jquery'; import { getJSON, post } from '../helpers/request.js'; export function getQueue (data) { - const url = baseUrl + '/api/ce/queue'; + const url = '/api/ce/queue'; return $.get(url, data); } export function getActivity (data) { - const url = baseUrl + '/api/ce/activity'; + const url = '/api/ce/activity'; return $.get(url, data); } export function getTask (id) { - const url = window.baseUrl + '/api/ce/task'; + const url = '/api/ce/task'; return getJSON(url, { id }).then(r => r.task); } export function cancelTask (id) { - const url = window.baseUrl + '/api/ce/cancel'; + const url = '/api/ce/cancel'; return post(url, { id }).then( getTask.bind(null, id), getTask.bind(null, id) @@ -44,17 +44,17 @@ export function cancelTask (id) { } export function cancelAllTasks () { - const url = window.baseUrl + '/api/ce/cancel_all'; + const url = '/api/ce/cancel_all'; return post(url); } export function getTasksForComponent (componentId) { - const url = baseUrl + '/api/ce/component'; + const url = '/api/ce/component'; const data = { componentId }; return new Promise((resolve) => $.get(url, data).done(resolve)); } export function getTypes () { - const url = window.baseUrl + '/api/ce/task_types'; + const url = '/api/ce/task_types'; return getJSON(url).then(r => r.taskTypes); } diff --git a/server/sonar-web/src/main/js/api/components.js b/server/sonar-web/src/main/js/api/components.js index 32ed9f744cd6..6b61a89fe42f 100644 --- a/server/sonar-web/src/main/js/api/components.js +++ b/server/sonar-web/src/main/js/api/components.js @@ -21,32 +21,32 @@ import { getJSON, postJSON, post } from '../helpers/request.js'; export function getComponents (data) { - const url = baseUrl + '/api/components/search'; + const url = '/api/components/search'; return getJSON(url, data); } export function getProvisioned (data) { - const url = baseUrl + '/api/projects/provisioned'; + const url = '/api/projects/provisioned'; return getJSON(url, data); } export function getGhosts (data) { - const url = baseUrl + '/api/projects/ghosts'; + const url = '/api/projects/ghosts'; return getJSON(url, data); } export function deleteComponents (data) { - const url = baseUrl + '/api/projects/bulk_delete'; + const url = '/api/projects/bulk_delete'; return post(url, data); } export function createProject (data) { - const url = baseUrl + '/api/projects/create'; + const url = '/api/projects/create'; return postJSON(url, data); } export function getChildren (componentKey, metrics = []) { - const url = baseUrl + '/api/measures/component_tree'; + const url = '/api/measures/component_tree'; const data = { baseComponentKey: componentKey, metricKeys: metrics.join(','), @@ -56,7 +56,7 @@ export function getChildren (componentKey, metrics = []) { } export function getFiles (componentKey, metrics = [], additional = {}) { - const url = baseUrl + '/api/measures/component_tree'; + const url = '/api/measures/component_tree'; const data = Object.assign({}, additional, { baseComponentKey: componentKey, metricKeys: metrics.join(','), @@ -66,25 +66,25 @@ export function getFiles (componentKey, metrics = [], additional = {}) { } export function getComponent (componentKey, metrics = []) { - const url = baseUrl + '/api/measures/component'; + const url = '/api/measures/component'; const data = { componentKey, metricKeys: metrics.join(',') }; return getJSON(url, data).then(r => r.component); } export function getTree (baseComponentKey, options = {}) { - const url = baseUrl + '/api/components/tree'; + const url = '/api/components/tree'; const data = Object.assign({}, options, { baseComponentKey }); return getJSON(url, data); } export function getParents ({ id, key }) { - const url = baseUrl + '/api/components/show'; + const url = '/api/components/show'; const data = id ? { id } : { key }; return getJSON(url, data).then(r => r.ancestors); } export function getBreadcrumbs ({ id, key }) { - const url = baseUrl + '/api/components/show'; + const url = '/api/components/show'; const data = id ? { id } : { key }; return getJSON(url, data).then(r => { const reversedAncestors = [...r.ancestors].reverse(); @@ -93,7 +93,7 @@ export function getBreadcrumbs ({ id, key }) { } export function getProjectsWithInternalId (query) { - const url = window.baseUrl + '/api/resources/search'; + const url = '/api/resources/search'; const data = { f: 's2', q: 'TRK', diff --git a/server/sonar-web/src/main/js/api/events.js b/server/sonar-web/src/main/js/api/events.js index a04405dbcf11..8922faa2021b 100644 --- a/server/sonar-web/src/main/js/api/events.js +++ b/server/sonar-web/src/main/js/api/events.js @@ -27,7 +27,7 @@ import { getJSON } from '../helpers/request.js'; * @returns {Promise} */ export function getEvents (componentKey, categories) { - const url = baseUrl + '/api/events'; + const url = '/api/events'; const data = { resource: componentKey }; if (categories) { data.categories = categories; diff --git a/server/sonar-web/src/main/js/api/issue-filters.js b/server/sonar-web/src/main/js/api/issue-filters.js index 1e8c872dc7d8..f2bd4226eab5 100644 --- a/server/sonar-web/src/main/js/api/issue-filters.js +++ b/server/sonar-web/src/main/js/api/issue-filters.js @@ -20,7 +20,7 @@ import { post } from '../helpers/request.js'; export function toggleIssueFilter (id) { - const url = window.baseUrl + '/issues/toggle_fav'; + const url = '/issues/toggle_fav'; const data = { id }; return post(url, data); } diff --git a/server/sonar-web/src/main/js/api/issues.js b/server/sonar-web/src/main/js/api/issues.js index 3569d1854bd7..89486fcd1b42 100644 --- a/server/sonar-web/src/main/js/api/issues.js +++ b/server/sonar-web/src/main/js/api/issues.js @@ -23,7 +23,7 @@ import { getJSON } from '../helpers/request.js'; export function getFacets (query, facets) { - const url = baseUrl + '/api/issues/search'; + const url = '/api/issues/search'; const data = _.extend({}, query, { facets: facets.join(), ps: 1, additionalFields: '_all' }); return getJSON(url, data).then(r => { return { facets: r.facets, response: r }; @@ -62,7 +62,7 @@ export function getAssignees (query) { export function getIssuesCount (query) { - const url = baseUrl + '/api/issues/search'; + const url = '/api/issues/search'; const data = _.extend({}, query, { ps: 1, facetMode: 'debt' }); return getJSON(url, data).then(r => { return { issues: r.total, debt: r.debtTotal }; @@ -70,6 +70,6 @@ export function getIssuesCount (query) { } export function getIssueFilters () { - const url = window.baseUrl + '/api/issue_filters/search'; + const url = '/api/issue_filters/search'; return getJSON(url).then(r => r.issueFilters); } diff --git a/server/sonar-web/src/main/js/api/languages.js b/server/sonar-web/src/main/js/api/languages.js index f44b8f8ca609..4b3a00b764d9 100644 --- a/server/sonar-web/src/main/js/api/languages.js +++ b/server/sonar-web/src/main/js/api/languages.js @@ -20,6 +20,6 @@ import { getJSON } from '../helpers/request.js'; export function getLanguages () { - const url = baseUrl + '/api/languages/list'; + const url = '/api/languages/list'; return getJSON(url).then(r => r.languages); } diff --git a/server/sonar-web/src/main/js/api/measure-filters.js b/server/sonar-web/src/main/js/api/measure-filters.js index 67699863d9ad..ed64ba09db76 100644 --- a/server/sonar-web/src/main/js/api/measure-filters.js +++ b/server/sonar-web/src/main/js/api/measure-filters.js @@ -20,7 +20,7 @@ import { post } from '../helpers/request.js'; export function toggleMeasureFilter (id) { - const url = window.baseUrl + '/measures/toggle_fav'; + const url = '/measures/toggle_fav'; const data = { id }; return post(url, data); } diff --git a/server/sonar-web/src/main/js/api/measures.js b/server/sonar-web/src/main/js/api/measures.js index 96dd50b77532..a22b042104d0 100644 --- a/server/sonar-web/src/main/js/api/measures.js +++ b/server/sonar-web/src/main/js/api/measures.js @@ -21,7 +21,7 @@ import { getJSON } from '../helpers/request.js'; export function getMeasures (componentKey, metrics) { - const url = baseUrl + '/api/measures/component'; + const url = '/api/measures/component'; const data = { componentKey, metricKeys: metrics.join(',') }; return getJSON(url, data).then(r => r.component.measures); } diff --git a/server/sonar-web/src/main/js/api/metrics.js b/server/sonar-web/src/main/js/api/metrics.js index 6bc54e7437ba..45f2500288c6 100644 --- a/server/sonar-web/src/main/js/api/metrics.js +++ b/server/sonar-web/src/main/js/api/metrics.js @@ -20,7 +20,7 @@ import { getJSON } from '../helpers/request.js'; export function getMetrics () { - const url = baseUrl + '/api/metrics/search'; + const url = '/api/metrics/search'; const data = { ps: 9999 }; return getJSON(url, data).then(r => r.metrics); } diff --git a/server/sonar-web/src/main/js/api/nav.js b/server/sonar-web/src/main/js/api/nav.js index c43973f1e526..424c0a685366 100644 --- a/server/sonar-web/src/main/js/api/nav.js +++ b/server/sonar-web/src/main/js/api/nav.js @@ -20,17 +20,17 @@ import { getJSON } from '../helpers/request.js'; export function getGlobalNavigation () { - const url = baseUrl + '/api/navigation/global'; + const url = '/api/navigation/global'; return getJSON(url); } export function getComponentNavigation (componentKey) { - const url = baseUrl + '/api/navigation/component'; + const url = '/api/navigation/component'; const data = { componentKey }; return getJSON(url, data); } export function getSettingsNavigation () { - const url = baseUrl + '/api/navigation/settings'; + const url = '/api/navigation/settings'; return getJSON(url); } diff --git a/server/sonar-web/src/main/js/api/permissions.js b/server/sonar-web/src/main/js/api/permissions.js index 8b699d77e06b..64b89276a345 100644 --- a/server/sonar-web/src/main/js/api/permissions.js +++ b/server/sonar-web/src/main/js/api/permissions.js @@ -24,17 +24,13 @@ function request (options) { return $.ajax(options); } -function buildUrl (path) { - return window.baseUrl + path; -} - function typeError (method, message) { throw new TypeError(`permissions#${method}: ${message}`); } export function getUsers (data) { - const url = buildUrl('/api/permissions/users'); + const url = '/api/permissions/users'; return request({ type: 'GET', url: url, data: data }); } @@ -47,7 +43,7 @@ export function grantToUser (permission, user, project) { return typeError('grantToUser', 'please provide user login'); } - const url = buildUrl('/api/permissions/add_user'); + const url = '/api/permissions/add_user'; const data = { permission: permission, login: user }; if (project) { data.projectId = project; @@ -64,7 +60,7 @@ export function revokeFromUser (permission, user, project) { return typeError('revokeFromUser', 'please provide user login'); } - const url = buildUrl('/api/permissions/remove_user'); + const url = '/api/permissions/remove_user'; const data = { permission: permission, login: user }; if (project) { data.projectId = project; @@ -74,7 +70,7 @@ export function revokeFromUser (permission, user, project) { export function getGroups (data) { - const url = buildUrl('/api/permissions/groups'); + const url = '/api/permissions/groups'; return request({ type: 'GET', url: url, data: data }); } @@ -87,7 +83,7 @@ export function grantToGroup (permission, group, project) { return typeError('grantToGroup', 'please provide group name'); } - const url = buildUrl('/api/permissions/add_group'); + const url = '/api/permissions/add_group'; const data = { permission: permission, groupName: group }; if (project) { data.projectId = project; @@ -104,7 +100,7 @@ export function revokeFromGroup (permission, group, project) { return typeError('revokeFromGroup', 'please provide group name'); } - const url = buildUrl('/api/permissions/remove_group'); + const url = '/api/permissions/remove_group'; const data = { permission: permission, groupName: group }; if (project) { data.projectId = project; @@ -114,7 +110,7 @@ export function revokeFromGroup (permission, group, project) { export function getPermissionTemplates (query) { - const url = buildUrl('/api/permissions/search_templates'); + const url = '/api/permissions/search_templates'; const data = { }; if (query) { data.q = query; @@ -124,18 +120,18 @@ export function getPermissionTemplates (query) { export function createPermissionTemplate (options) { - const url = buildUrl('/api/permissions/create_template'); + const url = '/api/permissions/create_template'; return request(_.extend({ type: 'POST', url: url }, options)); } export function updatePermissionTemplate (options) { - const url = buildUrl('/api/permissions/update_template'); + const url = '/api/permissions/update_template'; return request(_.extend({ type: 'POST', url: url }, options)); } export function deletePermissionTemplate (options) { - const url = buildUrl('/api/permissions/delete_template'); + const url = '/api/permissions/delete_template'; return request(_.extend({ type: 'POST', url: url }, options)); } @@ -145,13 +141,13 @@ export function setDefaultPermissionTemplate (template, qualifier) { return typeError('setDefaultPermissionTemplate', 'please provide permission template ID'); } - const url = buildUrl('/api/permissions/set_default_template'); + const url = '/api/permissions/set_default_template'; const data = { templateId: template, qualifier }; return request({ type: 'POST', url, data }); } export function applyTemplateToProject(options) { - const url = buildUrl('/api/permissions/apply_template'); + const url = '/api/permissions/apply_template'; return request(_.extend({ type: 'POST', url: url }, options)); } diff --git a/server/sonar-web/src/main/js/api/quality-profiles.js b/server/sonar-web/src/main/js/api/quality-profiles.js index 69ceca5bb50e..3daf1e6f8f4a 100644 --- a/server/sonar-web/src/main/js/api/quality-profiles.js +++ b/server/sonar-web/src/main/js/api/quality-profiles.js @@ -20,7 +20,7 @@ import { checkStatus, parseJSON } from '../helpers/request'; export function createQualityProfile (data) { - const url = window.baseUrl + '/api/qualityprofiles/create'; + const url = '/api/qualityprofiles/create'; const options = { method: 'post', credentials: 'same-origin', diff --git a/server/sonar-web/src/main/js/api/system.js b/server/sonar-web/src/main/js/api/system.js index 25b52880f9be..13efcd502ccd 100644 --- a/server/sonar-web/src/main/js/api/system.js +++ b/server/sonar-web/src/main/js/api/system.js @@ -20,23 +20,23 @@ import { getJSON, post } from '../helpers/request'; export function setLogLevel (level) { - const url = window.baseUrl + '/api/system/change_log_level'; + const url = '/api/system/change_log_level'; const data = { level }; return post(url, data); } export function getSystemInfo () { - const url = window.baseUrl + '/api/system/info'; + const url = '/api/system/info'; return getJSON(url); } export function getStatus () { - const url = window.baseUrl + '/api/system/status'; + const url = '/api/system/status'; return getJSON(url); } export function restart () { - const url = window.baseUrl + '/api/system/restart'; + const url = '/api/system/restart'; return post(url); } diff --git a/server/sonar-web/src/main/js/api/time-machine.js b/server/sonar-web/src/main/js/api/time-machine.js index caabe67e2bf9..adf44fdbcac1 100644 --- a/server/sonar-web/src/main/js/api/time-machine.js +++ b/server/sonar-web/src/main/js/api/time-machine.js @@ -20,7 +20,7 @@ import { getJSON } from '../helpers/request.js'; export function getTimeMachineData (componentKey, metrics) { - const url = baseUrl + '/api/timemachine/index'; + const url = '/api/timemachine/index'; const data = { resource: componentKey, metrics }; return getJSON(url, data); } diff --git a/server/sonar-web/src/main/js/api/user-tokens.js b/server/sonar-web/src/main/js/api/user-tokens.js index dbfbf362edf0..e0d46231eaeb 100644 --- a/server/sonar-web/src/main/js/api/user-tokens.js +++ b/server/sonar-web/src/main/js/api/user-tokens.js @@ -26,7 +26,7 @@ import { getJSON, postJSON, post } from '../helpers/request.js'; * @returns {Promise} */ export function getTokens (login) { - const url = baseUrl + '/api/user_tokens/search'; + const url = '/api/user_tokens/search'; const data = { login }; return getJSON(url, data).then(r => r.userTokens); } @@ -39,7 +39,7 @@ export function getTokens (login) { * @returns {Promise} */ export function generateToken(userLogin, tokenName) { - const url = baseUrl + '/api/user_tokens/generate'; + const url = '/api/user_tokens/generate'; const data = { login: userLogin, name: tokenName }; return postJSON(url, data); } @@ -52,7 +52,7 @@ export function generateToken(userLogin, tokenName) { * @returns {Promise} */ export function revokeToken(userLogin, tokenName) { - const url = baseUrl + '/api/user_tokens/revoke'; + const url = '/api/user_tokens/revoke'; const data = { login: userLogin, name: tokenName }; return post(url, data); } diff --git a/server/sonar-web/src/main/js/api/users.js b/server/sonar-web/src/main/js/api/users.js index bd07b1b4d73c..ec4b778c623a 100644 --- a/server/sonar-web/src/main/js/api/users.js +++ b/server/sonar-web/src/main/js/api/users.js @@ -20,12 +20,12 @@ import { getJSON, post } from '../helpers/request.js'; export function getCurrentUser () { - const url = baseUrl + '/api/users/current'; + const url = '/api/users/current'; return getJSON(url); } export function changePassword (login, password, previousPassword) { - const url = window.baseUrl + '/api/users/change_password'; + const url = '/api/users/change_password'; const data = { login, password }; if (previousPassword != null) { 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 e4643b9349cb..4494c4d3d65f 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 3eb59fcc0761..af3baa5d0ddb 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 }) => ( - + {f.name} @@ -52,7 +52,7 @@ const FavoriteIssueFilters = ({ issueFilters }) => (
- {translate('see_all')} + {translate('see_all')}
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 c9998d0eaca4..4bf9b26e79ab 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 }) => ( - + {f.name} @@ -52,7 +52,7 @@ const FavoriteMeasureFilters = ({ measureFilters }) => (
- {translate('see_all')} + {translate('see_all')}
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 673089bab6a1..a59d59a55854 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 a1fe74bfc0dc..a7c1df4a6db3 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 }) => (
  • + className={window.location.pathname === `/account/issues` && 'active'} + href={`/account/issues`}> {translate('issues.page')}
  • 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 8eb4e437afbd..9c24284a7d24 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

    {translate('notification.dispatcher.information')}

    -
    +
    { 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 bb1270ac4b8b..32b5bb71ac03 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 61c454f39644..980da17df613 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 99a484b7637d..ff0c7e5a5f0c 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 00143e7d0958..73f211631352 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 ca21c1327586..8f5baa9f16d8 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 + '
    ' + item.login + ''; }, 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 31a13f246da9..5cf9f16c893e 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 8673311560b3..3fc1f32663fb 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 1c0de423ba52..d252a6e75a3e 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 5e1359a4d684..af92bd840373 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 c3e3a1ac0e8c..363c83c0e406 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 368e59b4f438..ac03ba3341cf 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 0ae574ab032d..a9cf5cd01871 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 43b4de50c28c..13be00166fd2 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 72f775448fb5..2deb3b6710c1 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 63024e99950e..c43bd88fa73d 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 8053a5e36345..ba3e50c684f8 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 1d1187059a20..7911332865d6 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 4a3a3b84b2bc..7d533fe555e4 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 97bc58d4636a..a7bfdac0cc67 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 2b3194f2bf7a..d6318adaef2b 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 c19526599d4d..395778d8b946 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 1e25f177d801..31613599f307 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 0625efd5dc93..53ea76de36ac 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 deffa8ae473f..4ad5565b59bc 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 (
    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 12d060f541c9..80ab66122d7f 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
    {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 5fb20a259b89..e140e5bafe41 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 3b73dd2060fe..6348a1ad9c4a 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 071dd763aaf3..6e00dcce72f8 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 4603c21efc76..1a4658b68ff8 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 556fec0a65dd..61d838a8beca 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 42947b9ede77..1c19f08bf309 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 358dee103368..9212527eae68 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 795ffeae47a1..8e8f42e0076c 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 b53b990609bf..9973df8a975b 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 1bf62ecf15c0..9fd9b2e5d115 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 ac2449ad86d8..939face75f0b 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 522de6751b9c..31c046b62bd2 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 c411c446a006..2b4a300bb4c8 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 20e79a6a51b0..c84ff73422ae 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 c9e026d0267d..ee8b267313d2 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 edded1382372..1d77201f20b7 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 8fbfccaac71f..681098f20cb3 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 d28c0934d751..68046423c393 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 095111902113..d17be22b774a 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 d0b21a3dae08..7b9e6889f4c5 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 5fa02436f01e..6fbdea721f24 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 c7fa5b21bcf6..04018894b056 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 52adaa5e40da..01f9440868f2 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 4cb03e66c23c..4093cf3ff60c 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 c595871cb43e..3386cfe6a75d 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 e12d12f29a83..0fbabea94bdb 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({

    {translate('system_info.page')}

    - Logs - Download + Logs + Download