aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-03-07 10:25:36 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-03-07 12:20:23 +0100
commit8b65d7659da13196cf26e2dacf1137c17f3b7a9d (patch)
tree401ed5585cf66918b35db67a6d765c2b9a0c0fe6 /server/sonar-web/src/main
parent380ac8b1d1270984023d6c86b90e1bb4e4305c7e (diff)
downloadsonarqube-8b65d7659da13196cf26e2dacf1137c17f3b7a9d.tar.gz
sonarqube-8b65d7659da13196cf26e2dacf1137c17f3b7a9d.zip
SONAR-8876 Rename language facet to languages
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/LanguageFilter.js6
-rw-r--r--server/sonar-web/src/main/js/apps/projects/store/actions.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/store/utils.js13
3 files changed, 12 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/LanguageFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/LanguageFilter.js
index 0e3d5e51706..549d50eb6ac 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/LanguageFilter.js
+++ b/server/sonar-web/src/main/js/apps/projects/filters/LanguageFilter.js
@@ -30,6 +30,8 @@ export default class LanguageFilter extends React.Component {
organization: React.PropTypes.object
}
+ property = 'languages';
+
renderOption = option => {
return (
<LanguageFilterOption languageKey={option}/>
@@ -42,7 +44,7 @@ export default class LanguageFilter extends React.Component {
renderFooter = () => (
<LanguageFilterFooter
- property="language"
+ property={this.property}
query={this.props.query}
isFavorite={this.props.isFavorite}
organization={this.props.organization}/>
@@ -53,7 +55,7 @@ export default class LanguageFilter extends React.Component {
render () {
return (
<FilterContainer
- property="language"
+ property={this.property}
getOptions={facet => facet ? this.getSortedOptions(facet) : []}
renderName={() => 'Languages'}
renderOption={this.renderOption}
diff --git a/server/sonar-web/src/main/js/apps/projects/store/actions.js b/server/sonar-web/src/main/js/apps/projects/store/actions.js
index 237df655e0f..b609227c95f 100644
--- a/server/sonar-web/src/main/js/apps/projects/store/actions.js
+++ b/server/sonar-web/src/main/js/apps/projects/store/actions.js
@@ -54,7 +54,7 @@ const FACETS = [
'duplicated_lines_density',
'ncloc',
'alert_status',
- 'language'
+ 'languages'
];
const onFail = dispatch => error => {
diff --git a/server/sonar-web/src/main/js/apps/projects/store/utils.js b/server/sonar-web/src/main/js/apps/projects/store/utils.js
index 4d6ef3dc157..e2cd838941b 100644
--- a/server/sonar-web/src/main/js/apps/projects/store/utils.js
+++ b/server/sonar-web/src/main/js/apps/projects/store/utils.js
@@ -54,7 +54,7 @@ export const parseUrlQuery = urlQuery => ({
'coverage': getAsNumericRating(urlQuery['coverage']),
'duplications': getAsNumericRating(urlQuery['duplications']),
'size': getAsNumericRating(urlQuery['size']),
- 'language': getAsArray(urlQuery['language'], getAsString),
+ 'languages': getAsArray(urlQuery['languages'], getAsString),
'search': getAsString(urlQuery['search'])
});
@@ -152,11 +152,12 @@ export const convertToFilter = (query, isFavorite) => {
conditions.push(convertIssuesRating('sqale_rating', query['maintainability']));
}
- if (query['language'] != null) {
- if (!Array.isArray(query['language']) || query['language'].length < 2) {
- conditions.push('language = ' + query['language']);
+ const { languages } = query;
+ if (languages != null) {
+ if (!Array.isArray(languages) || languages.length < 2) {
+ conditions.push('languages = ' + languages);
} else {
- conditions.push(`language IN (${query['language'].join(', ')})`);
+ conditions.push(`languages IN (${languages.join(', ')})`);
}
}
@@ -176,7 +177,7 @@ export const mapMetricToProperty = metricKey => {
'duplicated_lines_density': 'duplications',
'ncloc': 'size',
'alert_status': 'gate',
- 'language': 'language'
+ 'languages': 'languages'
};
return map[metricKey];
};