aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-21 10:59:32 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-24 08:20:48 +0200
commit15ed3abf008b93923fe37457c57913b40989d788 (patch)
tree2d3202a5eef0620f56aa484faab7c4e8ee5f7a58 /server/sonar-web/src
parent76c0d9b6da6c83ba8342dfa162a2e9a74a14dc6a (diff)
downloadsonarqube-15ed3abf008b93923fe37457c57913b40989d788.tar.gz
sonarqube-15ed3abf008b93923fe37457c57913b40989d788.zip
Rename project activity graph Overview to Issues
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/OverviewApp.js4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/events/PreviewGraph.js13
-rw-r--r--server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js7
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/__tests__/__snapshots__/utils-test.js.snap10
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.js16
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js7
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.js (renamed from server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js)12
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsHistory-test.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltips-test.js8
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentIssues-test.js (renamed from server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentOverview-test.js)10
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltips-test.js.snap8
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentIssues-test.js.snap (renamed from server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap)4
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap4
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityGraphs-test.js.snap4
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css2
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/utils.js11
-rw-r--r--server/sonar-web/src/main/js/helpers/storage.js2
21 files changed, 76 insertions, 61 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.js b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.js
index 8ca0ce8f45c..bbde489216a 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.js
@@ -35,7 +35,7 @@ import { getLeakPeriod } from '../../../helpers/periods';
import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin';
import { getCustomGraph, getGraph } from '../../../helpers/storage';
import { METRICS, HISTORY_METRICS_LIST } from '../utils';
-import { getDisplayedHistoryMetrics } from '../../projectActivity/utils';
+import { DEFAULT_GRAPH, getDisplayedHistoryMetrics } from '../../projectActivity/utils';
import type { Component, History, MeasuresList, Period } from '../types';
import '../styles.css';
@@ -103,7 +103,7 @@ export default class OverviewApp extends React.PureComponent {
loadHistory(component: Component) {
let graphMetrics = getDisplayedHistoryMetrics(getGraph(), getCustomGraph());
if (!graphMetrics || graphMetrics.length <= 0) {
- graphMetrics = getDisplayedHistoryMetrics('overview', []);
+ graphMetrics = getDisplayedHistoryMetrics(DEFAULT_GRAPH, []);
}
const metrics = uniq(HISTORY_METRICS_LIST.concat(graphMetrics));
diff --git a/server/sonar-web/src/main/js/apps/overview/events/PreviewGraph.js b/server/sonar-web/src/main/js/apps/overview/events/PreviewGraph.js
index 73eba033873..00592d7b346 100644
--- a/server/sonar-web/src/main/js/apps/overview/events/PreviewGraph.js
+++ b/server/sonar-web/src/main/js/apps/overview/events/PreviewGraph.js
@@ -23,7 +23,11 @@ import { minBy } from 'lodash';
import { AutoSizer } from 'react-virtualized';
import AdvancedTimeline from '../../../components/charts/AdvancedTimeline';
import PreviewGraphTooltips from './PreviewGraphTooltips';
-import { generateSeries, getDisplayedHistoryMetrics } from '../../projectActivity/utils';
+import {
+ DEFAULT_GRAPH,
+ generateSeries,
+ getDisplayedHistoryMetrics
+} from '../../projectActivity/utils';
import { getCustomGraph, getGraph } from '../../../helpers/storage';
import { formatMeasure, getShortType } from '../../../helpers/measures';
import type { Serie } from '../../../components/charts/AdvancedTimeline';
@@ -88,7 +92,7 @@ export default class PreviewGraph extends React.PureComponent {
getDisplayedMetrics = (graph: string, customMetrics: Array<string>): Array<string> => {
const metrics: Array<string> = getDisplayedHistoryMetrics(graph, customMetrics);
if (!metrics || metrics.length <= 0) {
- return getDisplayedHistoryMetrics('overview', customMetrics);
+ return getDisplayedHistoryMetrics(DEFAULT_GRAPH, customMetrics);
}
return metrics;
};
@@ -139,7 +143,7 @@ export default class PreviewGraph extends React.PureComponent {
tabIndex={0}
role="link">
<AutoSizer disableHeight={true}>
- {({ width }) => (
+ {({ width }) =>
<div>
<AdvancedTimeline
endDate={null}
@@ -168,8 +172,7 @@ export default class PreviewGraph extends React.PureComponent {
tooltipIdx={tooltipIdx}
tooltipPos={tooltipXPos}
/>}
- </div>
- )}
+ </div>}
</AutoSizer>
</div>
);
diff --git a/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js b/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js
index 1b37aaf3691..03f95631867 100644
--- a/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js
+++ b/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js
@@ -20,8 +20,9 @@
import React from 'react';
import { shallow } from 'enzyme';
import PreviewGraphTooltips from '../PreviewGraphTooltips';
+import { DEFAULT_GRAPH } from '../../../projectActivity/utils';
-const SERIES_OVERVIEW = [
+const SERIES_ISSUES = [
{
name: 'code_smells',
style: 1,
@@ -74,11 +75,11 @@ const METRICS = [
const DEFAULT_PROPS = {
formatValue: val => 'Formated.' + val,
- graph: 'overview',
+ graph: DEFAULT_GRAPH,
graphWidth: 150,
metrics: METRICS,
selectedDate: new Date('2011-10-01T22:01:00.000Z'),
- series: SERIES_OVERVIEW,
+ series: SERIES_ISSUES,
tooltipIdx: 0,
tooltipPos: 25
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/__snapshots__/utils-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/__snapshots__/utils-test.js.snap
index 14647a21294..52f54d40c25 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/__snapshots__/utils-test.js.snap
+++ b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/__snapshots__/utils-test.js.snap
@@ -69,7 +69,7 @@ Array [
Object {
"category": "QUALITY_PROFILE",
"key": "AVwQF7zXl-nNFgFWOJ3W",
- "name": "Changes in 'Default - SonarSource conventions' (Java)",
+ "name": "Changes in \\"Default - SonarSource conventions\\" (Java)",
},
],
"key": "AVwQF7kwl-nNFgFWOJ3V",
@@ -82,7 +82,7 @@ Array [
Object {
"category": "QUALITY_PROFILE",
"key": "AVxZtC-N7841nF4RNEMJ",
- "name": "Changes in 'Default - SonarSource conventions' (Java)",
+ "name": "Changes in \\"Default - SonarSource conventions\\" (Java)",
},
],
"key": "AVxZtCpH7841nF4RNEMI",
@@ -130,7 +130,7 @@ Array [
Object {
"category": "QUALITY_PROFILE",
"key": "AVxZtC-N7841nF4RNEMJ",
- "name": "Changes in 'Default - SonarSource conventions' (Java)",
+ "name": "Changes in \\"Default - SonarSource conventions\\" (Java)",
},
],
"key": "AVxZtCpH7841nF4RNEMI",
@@ -195,7 +195,7 @@ Array [
Object {
"category": "QUALITY_PROFILE",
"key": "AVwQF7zXl-nNFgFWOJ3W",
- "name": "Changes in 'Default - SonarSource conventions' (Java)",
+ "name": "Changes in \\"Default - SonarSource conventions\\" (Java)",
},
],
"key": "AVwQF7kwl-nNFgFWOJ3V",
@@ -208,7 +208,7 @@ Array [
Object {
"category": "QUALITY_PROFILE",
"key": "AVxZtC-N7841nF4RNEMJ",
- "name": "Changes in 'Default - SonarSource conventions' (Java)",
+ "name": "Changes in \\"Default - SonarSource conventions\\" (Java)",
},
],
"key": "AVxZtCpH7841nF4RNEMI",
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.js b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.js
index b3e4f2b28cf..087184f52b2 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.js
@@ -35,7 +35,7 @@ const ANALYSES = [
{
key: 'AVxZtC-N7841nF4RNEMJ',
category: 'QUALITY_PROFILE',
- name: 'Changes in \'Default - SonarSource conventions\' (Java)'
+ name: 'Changes in "Default - SonarSource conventions" (Java)'
}
]
},
@@ -48,7 +48,7 @@ const ANALYSES = [
{
key: 'AVwQF7zXl-nNFgFWOJ3W',
category: 'QUALITY_PROFILE',
- name: 'Changes in \'Default - SonarSource conventions\' (Java)'
+ name: 'Changes in "Default - SonarSource conventions" (Java)'
}
]
},
@@ -75,7 +75,7 @@ const HISTORY = [
const QUERY = {
category: '',
from: new Date('2017-04-27T08:21:32+0200'),
- graph: 'overview',
+ graph: utils.DEFAULT_GRAPH,
project: 'foo',
to: undefined,
selectedDate: undefined,
@@ -112,7 +112,7 @@ describe('getAnalysesByVersionByDay', () => {
utils.getAnalysesByVersionByDay(ANALYSES, {
category: '',
customMetrics: [],
- graph: 'overview',
+ graph: utils.DEFAULT_GRAPH,
project: 'foo'
})
).toMatchSnapshot();
@@ -122,7 +122,7 @@ describe('getAnalysesByVersionByDay', () => {
utils.getAnalysesByVersionByDay(ANALYSES, {
category: 'QUALITY_PROFILE',
customMetrics: [],
- graph: 'overview',
+ graph: utils.DEFAULT_GRAPH,
project: 'foo'
})
).toMatchSnapshot();
@@ -130,7 +130,7 @@ describe('getAnalysesByVersionByDay', () => {
utils.getAnalysesByVersionByDay(ANALYSES, {
category: '',
customMetrics: [],
- graph: 'overview',
+ graph: utils.DEFAULT_GRAPH,
project: 'foo',
to: new Date('2017-06-09T11:12:27+0200'),
from: new Date('2017-05-18T14:13:07+0200')
@@ -142,7 +142,7 @@ describe('getAnalysesByVersionByDay', () => {
describe('getDisplayedHistoryMetrics', () => {
const customMetrics = ['foo', 'bar'];
it('should return only displayed metrics on the graph', () => {
- expect(utils.getDisplayedHistoryMetrics('overview', [])).toEqual([
+ expect(utils.getDisplayedHistoryMetrics(utils.DEFAULT_GRAPH, [])).toEqual([
'bugs',
'code_smells',
'vulnerabilities'
@@ -160,7 +160,7 @@ describe('getDisplayedHistoryMetrics', () => {
describe('getHistoryMetrics', () => {
const customMetrics = ['foo', 'bar'];
it('should return all metrics', () => {
- expect(utils.getHistoryMetrics('overview', [])).toEqual([
+ expect(utils.getHistoryMetrics(utils.DEFAULT_GRAPH, [])).toEqual([
'bugs',
'code_smells',
'vulnerabilities',
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
index 43dd36a2323..985961a300c 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
@@ -25,7 +25,8 @@ import GraphsTooltipsContent from './GraphsTooltipsContent';
import GraphsTooltipsContentEvents from './GraphsTooltipsContentEvents';
import GraphsTooltipsContentCoverage from './GraphsTooltipsContentCoverage';
import GraphsTooltipsContentDuplication from './GraphsTooltipsContentDuplication';
-import GraphsTooltipsContentOverview from './GraphsTooltipsContentOverview';
+import GraphsTooltipsContentIssues from './GraphsTooltipsContentIssues';
+import { DEFAULT_GRAPH } from '../utils';
import { getLocalizedMetricName } from '../../../helpers/l10n';
import type { Event, MeasureHistory, Metric } from '../types';
import type { Serie } from '../../../components/charts/AdvancedTimeline';
@@ -70,9 +71,9 @@ export default class GraphsTooltips extends React.PureComponent {
if (!point || (!point.y && point.y !== 0)) {
return null;
}
- if (this.props.graph === 'overview') {
+ if (this.props.graph === DEFAULT_GRAPH) {
return (
- <GraphsTooltipsContentOverview
+ <GraphsTooltipsContentIssues
key={serie.name}
measuresHistory={measuresHistory}
serie={serie}
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.js
index f16476bd41e..31bbef0d2c9 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.js
@@ -38,7 +38,7 @@ const METRIC_RATING = {
code_smells: 'sqale_rating'
};
-export default function GraphsTooltipsContentOverview(props: Props) {
+export default function GraphsTooltipsContentIssues(props: Props) {
const rating = props.measuresHistory.find(
measure => measure.metric === METRIC_RATING[props.serie.name]
);
@@ -47,7 +47,7 @@ export default function GraphsTooltipsContentOverview(props: Props) {
}
const ratingValue = rating.history[props.tooltipIdx].value;
return (
- <tr key={props.serie.name} className="project-activity-graph-tooltip-overview-line">
+ <tr key={props.serie.name} className="project-activity-graph-tooltip-issues-line">
<td className="thin">
<ChartLegendIcon
className={classNames(
@@ -57,10 +57,14 @@ export default function GraphsTooltipsContentOverview(props: Props) {
/>
</td>
<td className="text-right spacer-right">
- <span className="project-activity-graph-tooltip-value">{props.value}</span>
+ <span className="project-activity-graph-tooltip-value">
+ {props.value}
+ </span>
{ratingValue && <Rating className="spacer-left" small={true} value={ratingValue} />}
</td>
- <td>{props.serie.translatedName}</td>
+ <td>
+ {props.serie.translatedName}
+ </td>
</tr>
);
}
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.js
index 035693ad599..01a3a09af36 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.js
@@ -32,6 +32,7 @@ import * as actions from '../actions';
import { getCustomGraph, getGraph } from '../../../helpers/storage';
import {
customMetricsChanged,
+ DEFAULT_GRAPH,
getHistoryMetrics,
isCustomGraph,
parseQuery,
@@ -274,7 +275,7 @@ class ProjectActivityAppContainer extends React.PureComponent {
// if there is no filter, but there are saved preferences in the localStorage
const graph = getGraph();
- return !filtered && graph != null && graph !== 'overview';
+ return !filtered && graph != null && graph !== DEFAULT_GRAPH;
}
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsHistory-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsHistory-test.js
index f13577ae571..20ea2bdcc10 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsHistory-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsHistory-test.js
@@ -20,6 +20,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import GraphsHistory from '../GraphsHistory';
+import { DEFAULT_GRAPH } from '../../utils';
const ANALYSES = [
{
@@ -81,7 +82,7 @@ const EMPTY_SERIES = [
const DEFAULT_PROPS = {
analyses: ANALYSES,
eventFilter: '',
- graph: 'overview',
+ graph: DEFAULT_GRAPH,
graphEndDate: null,
graphStartDate: null,
leakPeriodDate: '2017-05-16T13:50:02+0200',
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltips-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltips-test.js
index cebdb8265a7..f80776b6630 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltips-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltips-test.js
@@ -21,7 +21,7 @@ import React from 'react';
import { shallow } from 'enzyme';
import GraphsTooltips from '../GraphsTooltips';
-const SERIES_OVERVIEW = [
+const SERIES_ISSUES = [
{
name: 'code_smells',
translatedName: 'metric.code_smells.name',
@@ -76,17 +76,17 @@ const METRICS = [
const DEFAULT_PROPS = {
formatValue: val => 'Formated.' + val,
- graph: 'overview',
+ graph: 'issues',
graphWidth: 500,
measuresHistory: [],
metrics: METRICS,
selectedDate: new Date('2011-10-01T22:01:00.000Z'),
- series: SERIES_OVERVIEW,
+ series: SERIES_ISSUES,
tooltipIdx: 0,
tooltipPos: 666
};
-it('should render correctly for overview graphs', () => {
+it('should render correctly for issues graphs', () => {
expect(shallow(<GraphsTooltips {...DEFAULT_PROPS} />)).toMatchSnapshot();
});
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentOverview-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentIssues-test.js
index cae7b7bcec4..5d5dfaf6e0a 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentOverview-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentIssues-test.js
@@ -19,9 +19,9 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
-import GraphsTooltipsContentOverview from '../GraphsTooltipsContentOverview';
+import GraphsTooltipsContentIssues from '../GraphsTooltipsContentIssues';
-const MEASURES_OVERVIEW = [
+const MEASURES_ISSUES = [
{
metric: 'bugs',
history: [
@@ -50,7 +50,7 @@ const MEASURES_OVERVIEW = [
];
const DEFAULT_PROPS = {
- measuresHistory: MEASURES_OVERVIEW,
+ measuresHistory: MEASURES_ISSUES,
serie: {
name: 'bugs',
translatedName: 'Bugs',
@@ -61,11 +61,11 @@ const DEFAULT_PROPS = {
};
it('should render correctly', () => {
- expect(shallow(<GraphsTooltipsContentOverview {...DEFAULT_PROPS} />)).toMatchSnapshot();
+ expect(shallow(<GraphsTooltipsContentIssues {...DEFAULT_PROPS} />)).toMatchSnapshot();
});
it('should render correctly when rating data is missing', () => {
expect(
- shallow(<GraphsTooltipsContentOverview {...DEFAULT_PROPS} tooltipIdx={0} value="500" />)
+ shallow(<GraphsTooltipsContentIssues {...DEFAULT_PROPS} tooltipIdx={0} value="500" />)
).toMatchSnapshot();
});
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.js
index 762c2d5efe3..147fdeca7d6 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.js
@@ -20,6 +20,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import ProjectActivityAnalysesList from '../ProjectActivityAnalysesList';
+import { DEFAULT_GRAPH } from '../../utils';
const ANALYSES = [
{
@@ -77,7 +78,7 @@ const DEFAULT_PROPS = {
deleteAnalysis: () => {},
deleteEvent: () => {},
loading: false,
- query: { category: '', graph: 'overview', project: 'org.sonarsource.sonarqube:sonarqube' },
+ query: { category: '', graph: DEFAULT_GRAPH, project: 'org.sonarsource.sonarqube:sonarqube' },
updateQuery: () => {}
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.js
index 21c0a40d10c..6f3655c42ec 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.js
@@ -20,6 +20,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import ProjectActivityApp from '../ProjectActivityApp';
+import { DEFAULT_GRAPH } from '../../utils';
const ANALYSES = [
{
@@ -80,7 +81,7 @@ const DEFAULT_PROPS = {
]
}
],
- query: { category: '', graph: 'overview', project: 'org.sonarsource.sonarqube:sonarqube' },
+ query: { category: '', graph: DEFAULT_GRAPH, project: 'org.sonarsource.sonarqube:sonarqube' },
updateQuery: () => {}
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.js
index 07930d40463..7cff6fd832a 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.js
@@ -20,6 +20,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import ProjectActivityGraphs from '../ProjectActivityGraphs';
+import { DEFAULT_GRAPH } from '../../utils';
const ANALYSES = [
{
@@ -71,7 +72,7 @@ const DEFAULT_PROPS = {
}
],
metricsType: 'INT',
- query: { category: '', graph: 'overview', project: 'org.sonarsource.sonarqube:sonarqube' },
+ query: { category: '', graph: DEFAULT_GRAPH, project: 'org.sonarsource.sonarqube:sonarqube' },
updateQuery: () => {}
};
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltips-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltips-test.js.snap
index ca571b58091..d0963afa545 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltips-test.js.snap
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltips-test.js.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`should render correctly for overview graphs 1`] = `
+exports[`should render correctly for issues graphs 1`] = `
<BubblePopup
customClass="bubble-popup-right"
position={
@@ -26,7 +26,7 @@ exports[`should render correctly for overview graphs 1`] = `
className="width-100"
>
<tbody>
- <GraphsTooltipsContentOverview
+ <GraphsTooltipsContentIssues
measuresHistory={Array []}
serie={
Object {
@@ -48,7 +48,7 @@ exports[`should render correctly for overview graphs 1`] = `
tooltipIdx={0}
value="Formated.18"
/>
- <GraphsTooltipsContentOverview
+ <GraphsTooltipsContentIssues
measuresHistory={Array []}
serie={
Object {
@@ -70,7 +70,7 @@ exports[`should render correctly for overview graphs 1`] = `
tooltipIdx={0}
value="Formated.3"
/>
- <GraphsTooltipsContentOverview
+ <GraphsTooltipsContentIssues
measuresHistory={Array []}
serie={
Object {
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentIssues-test.js.snap
index e7f3e105fca..3372a582f53 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentIssues-test.js.snap
@@ -2,7 +2,7 @@
exports[`should render correctly 1`] = `
<tr
- className="project-activity-graph-tooltip-overview-line"
+ className="project-activity-graph-tooltip-issues-line"
>
<td
className="thin"
@@ -34,7 +34,7 @@ exports[`should render correctly 1`] = `
exports[`should render correctly when rating data is missing 1`] = `
<tr
- className="project-activity-graph-tooltip-overview-line"
+ className="project-activity-graph-tooltip-issues-line"
>
<td
className="thin"
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap
index f966955c248..4c5a46b26a2 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap
@@ -67,7 +67,7 @@ exports[`should render correctly 1`] = `
query={
Object {
"category": "",
- "graph": "overview",
+ "graph": "issues",
"project": "org.sonarsource.sonarqube:sonarqube",
}
}
@@ -146,7 +146,7 @@ exports[`should render correctly 1`] = `
query={
Object {
"category": "",
- "graph": "overview",
+ "graph": "issues",
"project": "org.sonarsource.sonarqube:sonarqube",
}
}
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityGraphs-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityGraphs-test.js.snap
index 7aaf0a0268d..ecbb6ae98fe 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityGraphs-test.js.snap
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityGraphs-test.js.snap
@@ -6,7 +6,7 @@ exports[`should render correctly the graph and legends 1`] = `
>
<ProjectActivityGraphsHeader
addCustomMetric={[Function]}
- graph="overview"
+ graph="issues"
updateGraph={[Function]}
/>
<GraphsHistory
@@ -47,7 +47,7 @@ exports[`should render correctly the graph and legends 1`] = `
]
}
eventFilter=""
- graph="overview"
+ graph="issues"
graphEndDate={null}
graphStartDate={null}
leakPeriodDate="2017-05-16T13:50:02+0200"
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css b/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css
index a42cbc13f2e..4b0e990f2b7 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css
@@ -84,7 +84,7 @@
padding-bottom: 4px;
}
-.project-activity-graph-tooltip-overview-line {
+.project-activity-graph-tooltip-issues-line {
height: 26px;
padding-bottom: 4px;
}
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/utils.js b/server/sonar-web/src/main/js/apps/projectActivity/utils.js
index 83f5960b6e7..894fea65128 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/utils.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/utils.js
@@ -35,14 +35,15 @@ import type { RawQuery } from '../../helpers/query';
import type { Serie } from '../../components/charts/AdvancedTimeline';
export const EVENT_TYPES = ['VERSION', 'QUALITY_GATE', 'QUALITY_PROFILE', 'OTHER'];
-export const GRAPH_TYPES = ['overview', 'coverage', 'duplications', 'custom'];
+export const DEFAULT_GRAPH = 'issues';
+export const GRAPH_TYPES = ['issues', 'coverage', 'duplications', 'custom'];
export const GRAPHS_METRICS_DISPLAYED = {
- overview: ['bugs', 'code_smells', 'vulnerabilities'],
+ issues: ['bugs', 'code_smells', 'vulnerabilities'],
coverage: ['uncovered_lines', 'lines_to_cover'],
duplications: ['duplicated_lines', 'ncloc']
};
export const GRAPHS_METRICS = {
- overview: GRAPHS_METRICS_DISPLAYED['overview'].concat([
+ issues: GRAPHS_METRICS_DISPLAYED['issues'].concat([
'reliability_rating',
'security_rating',
'sqale_rating'
@@ -183,10 +184,10 @@ export const getHistoryMetrics = (graph: string, customMetrics: Array<string>):
const parseGraph = (value?: string): string => {
const graph = parseAsString(value);
- return GRAPH_TYPES.includes(graph) ? graph : 'overview';
+ return GRAPH_TYPES.includes(graph) ? graph : DEFAULT_GRAPH;
};
-const serializeGraph = (value: string): ?string => (value === 'overview' ? undefined : value);
+const serializeGraph = (value: string): ?string => (value === DEFAULT_GRAPH ? undefined : value);
export const parseQuery = (urlQuery: RawQuery): Query => ({
category: parseAsString(urlQuery['category']),
diff --git a/server/sonar-web/src/main/js/helpers/storage.js b/server/sonar-web/src/main/js/helpers/storage.js
index d9bee866b8b..977f184443e 100644
--- a/server/sonar-web/src/main/js/helpers/storage.js
+++ b/server/sonar-web/src/main/js/helpers/storage.js
@@ -71,4 +71,4 @@ export const getCustomGraph = (): Array<string> =>
export const saveGraph = (graph: ?string) => save(PROJECT_ACTIVITY_GRAPH, graph);
export const getGraph = (): string =>
- window.localStorage.getItem(PROJECT_ACTIVITY_GRAPH) || 'overview';
+ window.localStorage.getItem(PROJECT_ACTIVITY_GRAPH) || 'issues';