aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-11 17:21:51 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-03-11 17:21:51 +0100
commitb66377150a183d21db5205c5007f6d4ccfe42606 (patch)
tree88d411533ebcae9be800ff054a8d6e86b43a97b0
parent4bfd437e8827cee36ae501dd83bd774a59239abd (diff)
downloadsonarqube-b66377150a183d21db5205c5007f6d4ccfe42606.tar.gz
sonarqube-b66377150a183d21db5205c5007f6d4ccfe42606.zip
correctly order components when drilldown on "new_" measures
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownList.js18
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownTree.js18
2 files changed, 26 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownList.js b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownList.js
index d0f68256d3c..3610b3d0bb4 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownList.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownList.js
@@ -49,11 +49,19 @@ export default class MeasureDrilldownList extends React.Component {
const { metric, store, updateStore } = this.props;
const asc = metric.direction === 1;
- const options = {
- s: 'metric,name',
- metricSort: metric.key,
- asc
- };
+ const options = { asc };
+ if (metric.key.indexOf('new_') === 0) {
+ Object.assign(options, {
+ s: 'metricPeriod,name',
+ metricSort: metric.key,
+ metricPeriodSort: 1
+ });
+ } else {
+ Object.assign(options, {
+ s: 'metric,name',
+ metricSort: metric.key
+ });
+ }
updateStore({
list: {
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownTree.js b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownTree.js
index f6da317ad5b..11501e990c7 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownTree.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureDrilldownTree.js
@@ -49,11 +49,19 @@ export default class MeasureDrilldownTree extends React.Component {
const { metric, store, updateStore } = this.props;
const asc = metric.direction === 1;
- const options = {
- s: 'metric,name',
- metricSort: metric.key,
- asc
- };
+ const options = { asc };
+ if (metric.key.indexOf('new_') === 0) {
+ Object.assign(options, {
+ s: 'metricPeriod,name',
+ metricSort: metric.key,
+ metricPeriodSort: 1
+ });
+ } else {
+ Object.assign(options, {
+ s: 'metric,name',
+ metricSort: metric.key
+ });
+ }
const componentKey = baseComponent.refKey || baseComponent.key;