aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-05-23 11:52:59 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-05-24 15:06:42 +0200
commitc110e6ee38343b43fd43d6dba0ef92dee61cf7ea (patch)
tree2a00e6f51c02ae646e339603abb677c1be8fdbc1 /server/sonar-web/src/main/js/apps
parent5d0455588bf6343bb7d6d29217142a3827b3ebf4 (diff)
downloadsonarqube-c110e6ee38343b43fd43d6dba0ef92dee61cf7ea.tar.gz
sonarqube-c110e6ee38343b43fd43d6dba0ef92dee61cf7ea.zip
SONAR-8913 Use "analysisDate" instead of "snapshotDate" in component overview
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/App.js3
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.js4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/__tests__/EmptyOverview-test.js2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/main/CodeSmells.js4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/main/enhance.js4
5 files changed, 9 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/components/App.js b/server/sonar-web/src/main/js/apps/overview/components/App.js
index d1c73df1555..8a4adde9571 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/App.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/App.js
@@ -26,6 +26,7 @@ import SourceViewer from '../../../components/SourceViewer/SourceViewer';
type Props = {
component: {
+ analysisDate?: string,
id: string,
key: string,
qualifier: string,
@@ -58,7 +59,7 @@ class App extends React.PureComponent {
);
}
- if (!component.snapshotDate) {
+ if (!component.analysisDate) {
return <EmptyOverview {...this.props} />;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.js b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.js
index 01d73ea8c74..70dd35ee95d 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.js
@@ -24,7 +24,7 @@ import OverviewApp from '../OverviewApp';
import EmptyOverview from '../EmptyOverview';
it('should render OverviewApp', () => {
- const component = { id: 'id', snapshotDate: '2016-01-01' };
+ const component = { id: 'id', analysisDate: '2016-01-01' };
const output = shallow(<UnconnectedApp component={component} />);
expect(output.type()).toBe(OverviewApp);
});
@@ -36,7 +36,7 @@ it('should render EmptyOverview', () => {
});
it('should pass leakPeriodIndex', () => {
- const component = { id: 'id', snapshotDate: '2016-01-01' };
+ const component = { id: 'id', analysisDate: '2016-01-01' };
const output = shallow(<UnconnectedApp component={component} />);
expect(output.prop('leakPeriodIndex')).toBe('1');
});
diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/EmptyOverview-test.js b/server/sonar-web/src/main/js/apps/overview/components/__tests__/EmptyOverview-test.js
index 7c9c06b16a5..f163dc8a969 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/EmptyOverview-test.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/EmptyOverview-test.js
@@ -25,7 +25,7 @@ it('should render component key', () => {
const component = {
id: 'id',
key: 'abcd',
- snapshotDate: '2016-01-01'
+ analysisDate: '2016-01-01'
};
const output = shallow(<EmptyOverview component={component} />);
expect(output.find('code').text()).toBe('abcd');
diff --git a/server/sonar-web/src/main/js/apps/overview/main/CodeSmells.js b/server/sonar-web/src/main/js/apps/overview/main/CodeSmells.js
index 1b7f13b95e7..ee496595efd 100644
--- a/server/sonar-web/src/main/js/apps/overview/main/CodeSmells.js
+++ b/server/sonar-web/src/main/js/apps/overview/main/CodeSmells.js
@@ -42,8 +42,8 @@ class CodeSmells extends React.PureComponent {
Object.assign(params, { sinceLeakPeriod: 'true' });
}
- const formattedSnapshotDate = moment(component.snapshotDate).format('LLL');
- const tooltip = translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate);
+ const formattedAnalysisDate = moment(component.analysisDate).format('LLL');
+ const tooltip = translateWithParameters('widget.as_calculated_on_x', formattedAnalysisDate);
return (
<Link to={getComponentIssuesUrl(component.key, params)}>
diff --git a/server/sonar-web/src/main/js/apps/overview/main/enhance.js b/server/sonar-web/src/main/js/apps/overview/main/enhance.js
index 1b21260cfeb..f6d450c661a 100644
--- a/server/sonar-web/src/main/js/apps/overview/main/enhance.js
+++ b/server/sonar-web/src/main/js/apps/overview/main/enhance.js
@@ -139,8 +139,8 @@ export default function enhance(ComposedComponent) {
if (isDiffMetric(metric)) {
Object.assign(params, { sinceLeakPeriod: 'true' });
}
- const formattedSnapshotDate = moment(component.snapshotDate).format('LLL');
- const tooltip = translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate);
+ const formattedAnalysisDate = moment(component.analysisDate).format('LLL');
+ const tooltip = translateWithParameters('widget.as_calculated_on_x', formattedAnalysisDate);
return (
<Link to={getComponentIssuesUrl(component.key, params)}>
<span title={tooltip} data-toggle="tooltip">