From: Grégoire Aubert Date: Thu, 29 Jun 2017 09:45:36 +0000 (+0200) Subject: SONAR-9482 Rename api getQualityProfiles to seachQualityProfiles X-Git-Tag: 6.5-M2~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4355a61e7b28be2f78a75f724733fca86bcfe07;p=sonarqube.git SONAR-9482 Rename api getQualityProfiles to seachQualityProfiles --- 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 ec31557c1c5..950c2c68c3a 100644 --- a/server/sonar-web/src/main/js/api/quality-profiles.js +++ b/server/sonar-web/src/main/js/api/quality-profiles.js @@ -20,11 +20,16 @@ // @flow import { request, checkStatus, parseJSON, getJSON, post, postJSON } from '../helpers/request'; -export function getQualityProfiles(data: { organization?: string, projectKey?: string }) { +export function searchQualityProfiles(data: { organization?: string, projectKey?: string }) { const url = '/api/qualityprofiles/search'; return getJSON(url, data).then(r => r.profiles); } +export function getQualityProfiles(data: { compareToSonarWay?: boolean, profile: string }) { + const url = '/api/qualityprofiles/show'; + return getJSON(url, data); +} + export function createQualityProfile(data: Object) { return request('/api/qualityprofiles/create') .setMethod('post') diff --git a/server/sonar-web/src/main/js/apps/project-admin/store/actions.js b/server/sonar-web/src/main/js/apps/project-admin/store/actions.js index 8fa84ac1d97..d5a5cf222ec 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/store/actions.js +++ b/server/sonar-web/src/main/js/apps/project-admin/store/actions.js @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { - getQualityProfiles, + searchQualityProfiles, associateProject, dissociateProject } from '../../../api/quality-profiles'; @@ -49,10 +49,10 @@ export const receiveProjectProfiles = (projectKey, profiles) => ({ export const fetchProjectProfiles = (projectKey, organization) => dispatch => { Promise.all([ - organization ? getQualityProfiles({ organization }) : getQualityProfiles(), + organization ? searchQualityProfiles({ organization }) : searchQualityProfiles(), organization - ? getQualityProfiles({ organization, projectKey }) - : getQualityProfiles({ projectKey }) + ? searchQualityProfiles({ organization, projectKey }) + : searchQualityProfiles({ projectKey }) ]).then(responses => { const [allProfiles, projectProfiles] = responses; dispatch(receiveProfiles(allProfiles)); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/App.js b/server/sonar-web/src/main/js/apps/quality-profiles/components/App.js index e60087cd0fc..81cb730053a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/App.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/App.js @@ -19,7 +19,7 @@ */ // @flow import React from 'react'; -import { getQualityProfiles, getExporters } from '../../../api/quality-profiles'; +import { searchQualityProfiles, getExporters } from '../../../api/quality-profiles'; import { sortProfiles } from '../utils'; import { translate } from '../../../helpers/l10n'; import OrganizationHelmet from '../../../components/common/OrganizationHelmet'; @@ -68,7 +68,7 @@ export default class App extends React.PureComponent { fetchProfiles() { const { organization } = this.props; const data = organization ? { organization: organization.key } : {}; - return getQualityProfiles(data); + return searchQualityProfiles(data); } loadData() {