aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/overview
diff options
context:
space:
mode:
authorPascal Mugnier <pascal.mugnier@sonarsource.com>2018-04-16 08:29:08 +0200
committerSonarTech <sonartech@sonarsource.com>2018-04-16 20:20:47 +0200
commitee0cd4ea0df3e71d1fceced8255ce5a01c98cc4e (patch)
treeaee6a02f0404c4f0d5b29f35d54df06b21e87182 /server/sonar-web/src/main/js/apps/overview
parent3ee8ec8dec07179ea5eb72cf7e3a5cc584f5734c (diff)
downloadsonarqube-ee0cd4ea0df3e71d1fceced8255ce5a01c98cc4e.tar.gz
sonarqube-ee0cd4ea0df3e71d1fceced8255ce5a01c98cc4e.zip
SONAR-10580 Local storage references should not use window.localStorage (#145)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx15
1 files changed, 12 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
index 091826a44a6..4a0fce06905 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx
@@ -33,9 +33,14 @@ import { getAllTimeMachineData, History } from '../../../api/time-machine';
import { parseDate } from '../../../helpers/dates';
import { enhanceMeasuresWithMetrics, MeasureEnhanced } from '../../../helpers/measures';
import { getLeakPeriod, Period } from '../../../helpers/periods';
-import { getCustomGraph, getGraph } from '../../../helpers/storage';
+import { get } from '../../../helpers/storage';
import { METRICS, HISTORY_METRICS_LIST } from '../utils';
-import { DEFAULT_GRAPH, getDisplayedHistoryMetrics } from '../../projectActivity/utils';
+import {
+ DEFAULT_GRAPH,
+ getDisplayedHistoryMetrics,
+ PROJECT_ACTIVITY_GRAPH,
+ PROJECT_ACTIVITY_GRAPH_CUSTOM
+} from '../../projectActivity/utils';
import { isSameBranchLike, getBranchLikeQuery } from '../../../helpers/branches';
import { fetchMetrics } from '../../../store/rootActions';
import { getMetrics } from '../../../store/rootReducer';
@@ -118,7 +123,11 @@ export class OverviewApp extends React.PureComponent<Props, State> {
loadHistory = () => {
const { branchLike, component } = this.props;
- let graphMetrics = getDisplayedHistoryMetrics(getGraph(), getCustomGraph());
+ const customGraphs = get(PROJECT_ACTIVITY_GRAPH_CUSTOM);
+ let graphMetrics = getDisplayedHistoryMetrics(
+ get(PROJECT_ACTIVITY_GRAPH) || 'issues',
+ customGraphs ? customGraphs.split(',') : []
+ );
if (!graphMetrics || graphMetrics.length <= 0) {
graphMetrics = getDisplayedHistoryMetrics(DEFAULT_GRAPH, []);
}