aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/about
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-08-22 13:47:56 +0200
committerSonarTech <sonartech@sonarsource.com>2018-08-24 20:21:20 +0200
commitfae8b544d6c105606bb8a6c584bbe24ee2d94834 (patch)
treeb7ac8b6a6759c7cc404bde744bf83cfa32aa8a5e /server/sonar-web/src/main/js/apps/about
parentfe5472dfe520e0681034fbd9996ccd030627b09b (diff)
downloadsonarqube-fae8b544d6c105606bb8a6c584bbe24ee2d94834.tar.gz
sonarqube-fae8b544d6c105606bb8a6c584bbe24ee2d94834.zip
introduce IssueType and RuleType enums
Diffstat (limited to 'server/sonar-web/src/main/js/apps/about')
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutApp.js8
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js15
2 files changed, 17 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.js b/server/sonar-web/src/main/js/apps/about/components/AboutApp.js
index c1d319015f1..941db10c50b 100644
--- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.js
+++ b/server/sonar-web/src/main/js/apps/about/components/AboutApp.js
@@ -38,6 +38,7 @@ import { getAppState, getCurrentUser, getGlobalSettingValue } from '../../../sto
import { translate } from '../../../helpers/l10n';
import { fetchAboutPageSettings } from '../actions';
import { isSonarCloud } from '../../../helpers/system';
+import { IssueType } from '../../../app/types';
import '../styles.css';
/*::
@@ -138,9 +139,10 @@ class AboutApp extends React.PureComponent {
let vulnerabilities;
let codeSmells;
if (!loading && issueTypes) {
- bugs = issueTypes['BUG'] && issueTypes['BUG'].count;
- vulnerabilities = issueTypes['VULNERABILITY'] && issueTypes['VULNERABILITY'].count;
- codeSmells = issueTypes['CODE_SMELL'] && issueTypes['CODE_SMELL'].count;
+ bugs = issueTypes[IssueType.Bug] && issueTypes[IssueType.Bug].count;
+ vulnerabilities =
+ issueTypes[IssueType.Vulnerability] && issueTypes[IssueType.Vulnerability].count;
+ codeSmells = issueTypes[IssueType.CodeSmell] && issueTypes[IssueType.CodeSmell].count;
}
return (
diff --git a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js
index 499df6ce3a2..b6584777311 100644
--- a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js
+++ b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js
@@ -26,6 +26,7 @@ import { getIssuesUrl } from '../../../helpers/urls';
import BugIcon from '../../../components/icons-components/BugIcon';
import VulnerabilityIcon from '../../../components/icons-components/VulnerabilityIcon';
import CodeSmellIcon from '../../../components/icons-components/CodeSmellIcon';
+import { IssueType } from '../../../app/types';
/*::
type Props = {
@@ -49,7 +50,11 @@ export default function EntryIssueTypes(
<td className="about-page-issue-type-number">
<Link
className="about-page-issue-type-link"
- to={getIssuesUrl({ resolved: 'false', types: 'BUG', s: 'CREATION_DATE' })}>
+ to={getIssuesUrl({
+ resolved: 'false',
+ types: IssueType.Bug,
+ s: 'CREATION_DATE'
+ })}>
{formatMeasure(bugs, 'SHORT_INT')}
</Link>
</td>
@@ -66,7 +71,7 @@ export default function EntryIssueTypes(
className="about-page-issue-type-link"
to={getIssuesUrl({
resolved: 'false',
- types: 'VULNERABILITY',
+ types: IssueType.Vulnerability,
s: 'CREATION_DATE'
})}>
{formatMeasure(vulnerabilities, 'SHORT_INT')}
@@ -83,7 +88,11 @@ export default function EntryIssueTypes(
<td className="about-page-issue-type-number">
<Link
className="about-page-issue-type-link"
- to={getIssuesUrl({ resolved: 'false', types: 'CODE_SMELL', s: 'CREATION_DATE' })}>
+ to={getIssuesUrl({
+ resolved: 'false',
+ types: IssueType.CodeSmell,
+ s: 'CREATION_DATE'
+ })}>
{formatMeasure(codeSmells, 'SHORT_INT')}
</Link>
</td>