From c4355a61e7b28be2f78a75f724733fca86bcfe07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Thu, 29 Jun 2017 11:45:36 +0200 Subject: [PATCH] SONAR-9482 Rename api getQualityProfiles to seachQualityProfiles --- server/sonar-web/src/main/js/api/quality-profiles.js | 7 ++++++- .../src/main/js/apps/project-admin/store/actions.js | 8 ++++---- .../src/main/js/apps/quality-profiles/components/App.js | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) 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() { -- 2.39.5