diff options
author | Guillaume Peoc'h <guillaume.peoch@sonarsource.com> | 2022-11-03 15:53:09 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-11-04 20:03:11 +0000 |
commit | eef18a46de8086e1c8cd8afacd19a15f2cac0384 (patch) | |
tree | 4024d5ce4ced1e30924fa8816352d8f00bbf78cc /server/sonar-web/src/main/js/apps/component-measures | |
parent | 60eebac8634f052be9b12f92e48e20634715acc3 (diff) | |
download | sonarqube-eef18a46de8086e1c8cd8afacd19a15f2cac0384.tar.gz sonarqube-eef18a46de8086e1c8cd8afacd19a15f2cac0384.zip |
SONAR-15675 Duplicated files and bad sorting when listing 500+ files
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component-measures')
2 files changed, 18 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx index bb89c2936dd..936a4aa5213 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx @@ -131,6 +131,10 @@ export default class MeasureContent extends React.PureComponent<Props, State> { ([tree, measures]) => { if (this.mounted) { const metric = tree.metrics.find((m) => m.key === requestedMetric.key); + if (metric !== undefined) { + metric.direction = requestedMetric.direction; + } + const components = tree.components.map((component) => enhanceComponent(component, metric, metrics) ); diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureContent-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureContent-test.tsx.snap index e81c83983dc..58696b8c502 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureContent-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureContent-test.tsx.snap @@ -84,6 +84,7 @@ exports[`should render correctly for a file 1`] = ` measureValue="12" metric={ Object { + "direction": 1, "domain": "Reliability", "id": "1", "key": "bugs", @@ -178,6 +179,7 @@ exports[`should render correctly for a project 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -225,6 +227,7 @@ exports[`should render correctly for a project 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -272,6 +275,7 @@ exports[`should render correctly for a project 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -389,6 +393,7 @@ exports[`should render correctly when asc prop is defined 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -436,6 +441,7 @@ exports[`should render correctly when asc prop is defined 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -483,6 +489,7 @@ exports[`should render correctly when asc prop is defined 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -600,6 +607,7 @@ exports[`should render correctly when view prop is tree 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -647,6 +655,7 @@ exports[`should render correctly when view prop is tree 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -694,6 +703,7 @@ exports[`should render correctly when view prop is tree 1`] = ` "bestValue": "0", "custom": false, "description": "Bugs", + "direction": 1, "domain": "Reliability", "hidden": false, "higherValuesAreBetter": false, @@ -808,6 +818,7 @@ exports[`should test fetchMoreComponents to work correctly 1`] = ` handleViewChange={[Function]} metric={ Object { + "direction": 1, "domain": "Reliability", "id": "1", "key": "bugs", @@ -850,6 +861,7 @@ exports[`should test fetchMoreComponents to work correctly 1`] = ` measureValue="12" metric={ Object { + "direction": 1, "domain": "Reliability", "id": "1", "key": "bugs", @@ -867,6 +879,7 @@ exports[`should test fetchMoreComponents to work correctly 1`] = ` loadingMore={true} metric={ Object { + "direction": 1, "domain": "Reliability", "id": "1", "key": "bugs", @@ -877,6 +890,7 @@ exports[`should test fetchMoreComponents to work correctly 1`] = ` metrics={ Object { "bugs": Object { + "direction": 1, "domain": "Reliability", "id": "1", "key": "bugs", |