]> source.dussan.org Git - sonarqube.git/commitdiff
Rename project activity graph Overview to Issues
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 21 Jul 2017 09:38:41 +0000 (11:38 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Mon, 24 Jul 2017 06:31:05 +0000 (08:31 +0200)
26 files changed:
server/sonar-web/src/main/js/apps/overview/components/OverviewApp.js
server/sonar-web/src/main/js/apps/overview/events/PreviewGraph.js
server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js
server/sonar-web/src/main/js/apps/projectActivity/__tests__/utils-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.js [new file with mode: 0644]
server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js [deleted file]
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAppContainer.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphHistory-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsHistory-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltips-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentIssues-test.js [new file with mode: 0644]
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentOverview-test.js [deleted file]
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityAnalysesList-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityApp-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/ProjectActivityGraphs-test.js
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsHistory-test.js.snap
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltips-test.js.snap
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentIssues-test.js.snap [new file with mode: 0644]
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap [deleted file]
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap
server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityGraphs-test.js.snap
server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css
server/sonar-web/src/main/js/apps/projectActivity/utils.js
server/sonar-web/src/main/js/helpers/storage.js
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 8ca0ce8f45c5d5e190ce95c0427e4246ead21c37..bbde489216a451e48422ca5e7f91178200f21560 100644 (file)
@@ -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));
index ed1bc391b187467dbfd941f259cc64ef4c250ae5..2f84509a196cc6c7186762b3e010493d07012e7b 100644 (file)
@@ -22,6 +22,7 @@ import React from 'react';
 import { minBy } from 'lodash';
 import { AutoSizer } from 'react-virtualized';
 import {
+  DEFAULT_GRAPH,
   getDisplayedHistoryMetrics,
   generateSeries,
   getSeriesMetricType,
@@ -100,7 +101,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;
   };
index 6292808b788c84b7a1cd57d960e0da20128212cb..a26d4d7daf20df9c1ff72fa6630bf0d6b795247a 100644 (file)
@@ -20,6 +20,7 @@
 import React from 'react';
 import { shallow } from 'enzyme';
 import PreviewGraphTooltips from '../PreviewGraphTooltips';
+import { DEFAULT_GRAPH } from '../../../projectActivity/utils';
 
 const SERIES_OVERVIEW = [
   {
@@ -74,7 +75,7 @@ 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'),
index 371294178f64770cdedd963439dbc952644419ae..54cae93e0eec24235d4bcd1e39b7294ba0d7c5cf 100644 (file)
@@ -80,7 +80,7 @@ const METRICS = [
 const QUERY = {
   category: '',
   from: new Date('2017-04-27T08:21:32+0200'),
-  graph: 'overview',
+  graph: utils.DEFAULT_GRAPH,
   project: 'foo',
   to: undefined,
   selectedDate: undefined,
@@ -117,7 +117,7 @@ describe('getAnalysesByVersionByDay', () => {
       utils.getAnalysesByVersionByDay(ANALYSES, {
         category: '',
         customMetrics: [],
-        graph: 'overview',
+        graph: utils.DEFAULT_GRAPH,
         project: 'foo'
       })
     ).toMatchSnapshot();
@@ -127,7 +127,7 @@ describe('getAnalysesByVersionByDay', () => {
       utils.getAnalysesByVersionByDay(ANALYSES, {
         category: 'QUALITY_PROFILE',
         customMetrics: [],
-        graph: 'overview',
+        graph: utils.DEFAULT_GRAPH,
         project: 'foo'
       })
     ).toMatchSnapshot();
@@ -135,7 +135,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')
@@ -147,7 +147,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'
@@ -165,7 +165,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',
index 977fd6298fcaa4a1efa1ea639ccf2f3d56f6266a..8a60dd4e0c904fb14665ecff62fc466a65bba764 100644 (file)
@@ -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 type { Event, MeasureHistory } from '../types';
 import type { Serie } from '../../../components/charts/AdvancedTimeline';
 
@@ -68,9 +69,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}
                       name={serie.name}
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentIssues.js
new file mode 100644 (file)
index 0000000..cad11cf
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import classNames from 'classnames';
+import ChartLegendIcon from '../../../components/icons-components/ChartLegendIcon';
+import Rating from '../../../components/ui/Rating';
+import type { MeasureHistory } from '../types';
+
+type Props = {
+  measuresHistory: Array<MeasureHistory>,
+  name: string,
+  style: string,
+  tooltipIdx: number,
+  translatedName: string,
+  value: string
+};
+
+const METRIC_RATING = {
+  bugs: 'reliability_rating',
+  vulnerabilities: 'security_rating',
+  code_smells: 'sqale_rating'
+};
+
+export default function GraphsTooltipsContentIssues(props: Props) {
+  const rating = props.measuresHistory.find(
+    measure => measure.metric === METRIC_RATING[props.name]
+  );
+  if (!rating || !rating.history[props.tooltipIdx]) {
+    return null;
+  }
+  const ratingValue = rating.history[props.tooltipIdx].value;
+  return (
+    <tr key={props.name} className="project-activity-graph-tooltip-issues-line">
+      <td className="thin">
+        <ChartLegendIcon
+          className={classNames(
+            'spacer-right line-chart-legend',
+            'line-chart-legend-' + props.style
+          )}
+        />
+      </td>
+      <td className="text-right spacer-right">
+        <span className="project-activity-graph-tooltip-value">
+          {props.value}
+        </span>
+        {ratingValue && <Rating className="spacer-left" small={true} value={ratingValue} />}
+      </td>
+      <td>
+        {props.translatedName}
+      </td>
+    </tr>
+  );
+}
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js
deleted file mode 100644 (file)
index 439e0f8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import classNames from 'classnames';
-import ChartLegendIcon from '../../../components/icons-components/ChartLegendIcon';
-import Rating from '../../../components/ui/Rating';
-import type { MeasureHistory } from '../types';
-
-type Props = {
-  measuresHistory: Array<MeasureHistory>,
-  name: string,
-  style: string,
-  tooltipIdx: number,
-  translatedName: string,
-  value: string
-};
-
-const METRIC_RATING = {
-  bugs: 'reliability_rating',
-  vulnerabilities: 'security_rating',
-  code_smells: 'sqale_rating'
-};
-
-export default function GraphsTooltipsContentOverview(props: Props) {
-  const rating = props.measuresHistory.find(
-    measure => measure.metric === METRIC_RATING[props.name]
-  );
-  if (!rating || !rating.history[props.tooltipIdx]) {
-    return null;
-  }
-  const ratingValue = rating.history[props.tooltipIdx].value;
-  return (
-    <tr key={props.name} className="project-activity-graph-tooltip-overview-line">
-      <td className="thin">
-        <ChartLegendIcon
-          className={classNames(
-            'spacer-right line-chart-legend',
-            'line-chart-legend-' + props.style
-          )}
-        />
-      </td>
-      <td className="text-right spacer-right">
-        <span className="project-activity-graph-tooltip-value">
-          {props.value}
-        </span>
-        {ratingValue && <Rating className="spacer-left" small={true} value={ratingValue} />}
-      </td>
-      <td>
-        {props.translatedName}
-      </td>
-    </tr>
-  );
-}
index f20a8d80cc386a42fd62ea37234e348b0a9e8700..837e2fd91ffe7f62ab6a38022281f7d23f7a9655 100644 (file)
@@ -32,6 +32,7 @@ import * as actions from '../actions';
 import { getCustomGraph, getGraph } from '../../../helpers/storage';
 import {
   customMetricsChanged,
+  DEFAULT_GRAPH,
   getHistoryMetrics,
   isCustomGraph,
   parseQuery,
@@ -271,7 +272,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;
     }
   };
 
index adeeb1afa0c64d02c905fac18b8e4f7b732e03a6..57cf8c7087e7b55059bb7d299044e943a0452c7d 100644 (file)
@@ -20,6 +20,7 @@
 import React from 'react';
 import { shallow } from 'enzyme';
 import GraphHistory from '../GraphHistory';
+import { DEFAULT_GRAPH } from '../../utils';
 
 const SERIES = [
   {
@@ -35,7 +36,7 @@ const SERIES = [
 
 const DEFAULT_PROPS = {
   events: [],
-  graph: 'overview',
+  graph: DEFAULT_GRAPH,
   graphEndDate: null,
   graphStartDate: null,
   leakPeriodDate: '2017-05-16T13:50:02+0200',
index ea9e7c419b095a5a8ade2f682661cede3c58710c..099b253622cfb0c9a497a45d39f9fa803e6ca24d 100644 (file)
@@ -20,6 +20,7 @@
 import React from 'react';
 import { shallow } from 'enzyme';
 import GraphsHistory from '../GraphsHistory';
+import { DEFAULT_GRAPH } from '../../utils';
 
 const ANALYSES = [
   {
@@ -71,7 +72,7 @@ const SERIES = [
 const DEFAULT_PROPS = {
   analyses: ANALYSES,
   eventFilter: '',
-  graph: 'overview',
+  graph: DEFAULT_GRAPH,
   graphs: [SERIES],
   graphEndDate: null,
   graphStartDate: null,
index a08472315e2bd54899f5ba542432faf562259784..ebb184701e7aac819fad0d4f0b6569cb1354e0f7 100644 (file)
@@ -20,8 +20,9 @@
 import React from 'react';
 import { shallow } from 'enzyme';
 import GraphsTooltips from '../GraphsTooltips';
+import { DEFAULT_GRAPH } from '../../utils';
 
-const SERIES_OVERVIEW = [
+const SERIES_ISSUES = [
   {
     name: 'bugs',
     translatedName: 'Bugs',
@@ -68,16 +69,16 @@ const SERIES_OVERVIEW = [
 
 const DEFAULT_PROPS = {
   formatValue: val => 'Formated.' + val,
-  graph: 'overview',
+  graph: DEFAULT_GRAPH,
   graphWidth: 500,
   measuresHistory: [],
   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__/GraphsTooltipsContentIssues-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentIssues-test.js
new file mode 100644 (file)
index 0000000..95e398e
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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 React from 'react';
+import { shallow } from 'enzyme';
+import GraphsTooltipsContentIssues from '../GraphsTooltipsContentIssues';
+
+const MEASURES_ISSUES = [
+  {
+    metric: 'bugs',
+    history: [
+      {
+        date: '2011-10-01T22:01:00.000Z',
+        value: '500'
+      },
+      {
+        date: '2011-10-25T10:27:41.000Z',
+        value: '1.2k'
+      }
+    ]
+  },
+  {
+    metric: 'reliability_rating',
+    history: [
+      {
+        date: '2011-10-01T22:01:00.000Z'
+      },
+      {
+        date: '2011-10-25T10:27:41.000Z',
+        value: '5.0'
+      }
+    ]
+  }
+];
+
+const DEFAULT_PROPS = {
+  measuresHistory: MEASURES_ISSUES,
+  name: 'bugs',
+  style: '2',
+  tooltipIdx: 1,
+  translatedName: 'Bugs',
+  value: '1.2k'
+};
+
+it('should render correctly', () => {
+  expect(shallow(<GraphsTooltipsContentIssues {...DEFAULT_PROPS} />)).toMatchSnapshot();
+});
+
+it('should render correctly when rating data is missing', () => {
+  expect(
+    shallow(<GraphsTooltipsContentIssues {...DEFAULT_PROPS} tooltipIdx={0} value="500" />)
+  ).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__/GraphsTooltipsContentOverview-test.js
deleted file mode 100644 (file)
index c0e6720..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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 React from 'react';
-import { shallow } from 'enzyme';
-import GraphsTooltipsContentOverview from '../GraphsTooltipsContentOverview';
-
-const MEASURES_OVERVIEW = [
-  {
-    metric: 'bugs',
-    history: [
-      {
-        date: '2011-10-01T22:01:00.000Z',
-        value: '500'
-      },
-      {
-        date: '2011-10-25T10:27:41.000Z',
-        value: '1.2k'
-      }
-    ]
-  },
-  {
-    metric: 'reliability_rating',
-    history: [
-      {
-        date: '2011-10-01T22:01:00.000Z'
-      },
-      {
-        date: '2011-10-25T10:27:41.000Z',
-        value: '5.0'
-      }
-    ]
-  }
-];
-
-const DEFAULT_PROPS = {
-  measuresHistory: MEASURES_OVERVIEW,
-  name: 'bugs',
-  style: '2',
-  tooltipIdx: 1,
-  translatedName: 'Bugs',
-  value: '1.2k'
-};
-
-it('should render correctly', () => {
-  expect(shallow(<GraphsTooltipsContentOverview {...DEFAULT_PROPS} />)).toMatchSnapshot();
-});
-
-it('should render correctly when rating data is missing', () => {
-  expect(
-    shallow(<GraphsTooltipsContentOverview {...DEFAULT_PROPS} tooltipIdx={0} value="500" />)
-  ).toMatchSnapshot();
-});
index 762c2d5efe3186225f42916ab1052e2168a57cc2..7a6660d6a962b840efe39e60df9271935314a6ab 100644 (file)
@@ -77,7 +77,7 @@ const DEFAULT_PROPS = {
   deleteAnalysis: () => {},
   deleteEvent: () => {},
   loading: false,
-  query: { category: '', graph: 'overview', project: 'org.sonarsource.sonarqube:sonarqube' },
+  query: { category: '', graph: 'issues', project: 'org.sonarsource.sonarqube:sonarqube' },
   updateQuery: () => {}
 };
 
index 21c0a40d10c34b8bf95c0563d577638d52f51d33..d5c40161288d127316872002a0f90372a0f8bdee 100644 (file)
@@ -80,7 +80,7 @@ const DEFAULT_PROPS = {
       ]
     }
   ],
-  query: { category: '', graph: 'overview', project: 'org.sonarsource.sonarqube:sonarqube' },
+  query: { category: '', graph: 'issues', project: 'org.sonarsource.sonarqube:sonarqube' },
   updateQuery: () => {}
 };
 
index 4a6f3ba02e27652caf2f62ca97f8132dff625663..64c9f8b420b7bfffff5285d1b0582ef73f3c8dc3 100644 (file)
@@ -20,6 +20,7 @@
 import React from 'react';
 import { shallow } from 'enzyme';
 import ProjectActivityGraphs from '../ProjectActivityGraphs';
+import { DEFAULT_GRAPH } from '../../utils';
 
 const ANALYSES = [
   {
@@ -73,7 +74,7 @@ const DEFAULT_PROPS = {
     }
   ],
   metrics: METRICS,
-  query: { category: '', graph: 'overview', project: 'org.sonarsource.sonarqube:sonarqube' },
+  query: { category: '', graph: DEFAULT_GRAPH, project: 'org.sonarsource.sonarqube:sonarqube' },
   updateQuery: () => {}
 };
 
index 0621e71f0290ced90e8a4b249f5b1d2018ef8f0d..fb809d1f599c3ea894958917a3eaf606f2bdef67 100644 (file)
@@ -31,7 +31,7 @@ exports[`should correctly render a graph 1`] = `
 >
   <GraphHistory
     events={Array []}
-    graph="overview"
+    graph="issues"
     graphEndDate={null}
     graphStartDate={null}
     isCustom={false}
@@ -75,7 +75,7 @@ exports[`should correctly render multiple graphs 1`] = `
 >
   <GraphHistory
     events={Array []}
-    graph="overview"
+    graph="issues"
     graphEndDate={null}
     graphStartDate={null}
     isCustom={false}
@@ -112,7 +112,7 @@ exports[`should correctly render multiple graphs 1`] = `
   />
   <GraphHistory
     events={Array []}
-    graph="overview"
+    graph="issues"
     graphEndDate={null}
     graphStartDate={null}
     isCustom={false}
index 1d344f19d0b92d8f5b0e7504bd2112f4db0878b5..4458586fc1a3507daaa864c6c1fe98d84aafc656 100644 (file)
@@ -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 []}
           name="bugs"
           style="0"
@@ -34,7 +34,7 @@ exports[`should render correctly for overview graphs 1`] = `
           translatedName="Bugs"
           value="Formated.3"
         />
-        <GraphsTooltipsContentOverview
+        <GraphsTooltipsContentIssues
           measuresHistory={Array []}
           name="code_smells"
           style="1"
@@ -42,7 +42,7 @@ exports[`should render correctly for overview graphs 1`] = `
           translatedName="Code Smells"
           value="Formated.18"
         />
-        <GraphsTooltipsContentOverview
+        <GraphsTooltipsContentIssues
           measuresHistory={Array []}
           name="vulnerabilities"
           style="2"
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentIssues-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentIssues-test.js.snap
new file mode 100644 (file)
index 0000000..3372a58
--- /dev/null
@@ -0,0 +1,59 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<tr
+  className="project-activity-graph-tooltip-issues-line"
+>
+  <td
+    className="thin"
+  >
+    <ChartLegendIcon
+      className="spacer-right line-chart-legend line-chart-legend-2"
+    />
+  </td>
+  <td
+    className="text-right spacer-right"
+  >
+    <span
+      className="project-activity-graph-tooltip-value"
+    >
+      1.2k
+    </span>
+    <Rating
+      className="spacer-left"
+      muted={false}
+      small={true}
+      value="5.0"
+    />
+  </td>
+  <td>
+    Bugs
+  </td>
+</tr>
+`;
+
+exports[`should render correctly when rating data is missing 1`] = `
+<tr
+  className="project-activity-graph-tooltip-issues-line"
+>
+  <td
+    className="thin"
+  >
+    <ChartLegendIcon
+      className="spacer-right line-chart-legend line-chart-legend-2"
+    />
+  </td>
+  <td
+    className="text-right spacer-right"
+  >
+    <span
+      className="project-activity-graph-tooltip-value"
+    >
+      500
+    </span>
+  </td>
+  <td>
+    Bugs
+  </td>
+</tr>
+`;
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__/GraphsTooltipsContentOverview-test.js.snap
deleted file mode 100644 (file)
index e7f3e10..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<tr
-  className="project-activity-graph-tooltip-overview-line"
->
-  <td
-    className="thin"
-  >
-    <ChartLegendIcon
-      className="spacer-right line-chart-legend line-chart-legend-2"
-    />
-  </td>
-  <td
-    className="text-right spacer-right"
-  >
-    <span
-      className="project-activity-graph-tooltip-value"
-    >
-      1.2k
-    </span>
-    <Rating
-      className="spacer-left"
-      muted={false}
-      small={true}
-      value="5.0"
-    />
-  </td>
-  <td>
-    Bugs
-  </td>
-</tr>
-`;
-
-exports[`should render correctly when rating data is missing 1`] = `
-<tr
-  className="project-activity-graph-tooltip-overview-line"
->
-  <td
-    className="thin"
-  >
-    <ChartLegendIcon
-      className="spacer-right line-chart-legend line-chart-legend-2"
-    />
-  </td>
-  <td
-    className="text-right spacer-right"
-  >
-    <span
-      className="project-activity-graph-tooltip-value"
-    >
-      500
-    </span>
-  </td>
-  <td>
-    Bugs
-  </td>
-</tr>
-`;
index d1d34065dc479b914571f49da87350466a475830..6bf098ccb15e46c78c18046f678fe380e30a6542 100644 (file)
@@ -67,7 +67,7 @@ exports[`should render correctly 1`] = `
         query={
           Object {
             "category": "",
-            "graph": "overview",
+            "graph": "issues",
             "project": "org.sonarsource.sonarqube:sonarqube",
           }
         }
@@ -145,7 +145,7 @@ exports[`should render correctly 1`] = `
         query={
           Object {
             "category": "",
-            "graph": "overview",
+            "graph": "issues",
             "project": "org.sonarsource.sonarqube:sonarqube",
           }
         }
index 5fccf4aef7cf52772a6ef65d625e012d18b54900..fbfde630913e7047e1e56612dce88f3c80d177ee 100644 (file)
@@ -6,7 +6,7 @@ exports[`should render correctly the graph and legends 1`] = `
 >
   <ProjectActivityGraphsHeader
     addCustomMetric={[Function]}
-    graph="overview"
+    graph="issues"
     metrics={
       Array [
         Object {
@@ -57,7 +57,7 @@ exports[`should render correctly the graph and legends 1`] = `
       ]
     }
     eventFilter=""
-    graph="overview"
+    graph="issues"
     graphEndDate={null}
     graphStartDate={null}
     graphs={
index 8ef83fa028c3b9ad6181ace0045ed4b796cbcebe..e7688258d11811ebb199ed7c48033e75a0ed10c9 100644 (file)
@@ -98,7 +98,7 @@
   margin-top: 1px;
 }
 
-.project-activity-graph-tooltip-overview-line {
+.project-activity-graph-tooltip-issues-line {
   height: 26px;
   padding-bottom: 4px;
 }
index d4b52b6df7eb2f7038f67ea2b33d90465e7d1c64..49cec35fd5a778468fad53e2d47959981e870c85 100644 (file)
@@ -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'
@@ -184,10 +185,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']),
index d9bee866b8ba8f04ebee3f7dc3be048450e8a3cb..977f184443e4145914e9355910aee17d6d5da01b 100644 (file)
@@ -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';
index 26ee1514d81282bbad1945493546ab592b5c89fa..1b33eaf446435b41b70ea17c3afd4cd16b04e742 100644 (file)
@@ -1285,7 +1285,7 @@ project_activity.delete_analysis=Delete Analysis
 project_activity.delete_analysis.question=Are you sure you want to delete this analysis from the project history?
 project_activity.filter_events=Filter events
 
-project_activity.graphs.overview=Overview
+project_activity.graphs.issues=Issues
 project_activity.graphs.coverage=Coverage
 project_activity.graphs.duplications=Duplications
 project_activity.graphs.custom=Custom