diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-06-27 16:08:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-27 16:08:44 +0200 |
commit | 4ecb6fc3ec08ee37a1bb5c19d8ca44e2b832b5a7 (patch) | |
tree | 763ce4b5a9d7b37982ab54fc64a0597167c2bc3d /server/sonar-web/src/main/js/api/rules.js | |
parent | c467e84eed1a60bbe8c0fe800e2cada2bb26bb4c (diff) | |
download | sonarqube-4ecb6fc3ec08ee37a1bb5c19d8ca44e2b832b5a7.tar.gz sonarqube-4ecb6fc3ec08ee37a1bb5c19d8ca44e2b832b5a7.zip |
refactor quality profiles page (#1056)
Diffstat (limited to 'server/sonar-web/src/main/js/api/rules.js')
-rw-r--r-- | server/sonar-web/src/main/js/api/rules.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/api/rules.js b/server/sonar-web/src/main/js/api/rules.js new file mode 100644 index 00000000000..825e114d0f7 --- /dev/null +++ b/server/sonar-web/src/main/js/api/rules.js @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { getJSON } from '../helpers/request'; + +export function searchRules (data) { + const url = '/api/rules/search'; + return getJSON(url, data); +} + +export function takeFacet (response, property) { + const facet = response.facets.find(facet => facet.property === property); + return facet ? facet.values : []; +} |