aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/shared
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/components/shared
parentfe5472dfe520e0681034fbd9996ccd030627b09b (diff)
downloadsonarqube-fae8b544d6c105606bb8a6c584bbe24ee2d94834.tar.gz
sonarqube-fae8b544d6c105606bb8a6c584bbe24ee2d94834.zip
introduce IssueType and RuleType enums
Diffstat (limited to 'server/sonar-web/src/main/js/components/shared')
-rw-r--r--server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx8
-rw-r--r--server/sonar-web/src/main/js/components/shared/TypeHelper.tsx3
2 files changed, 6 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx b/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
index 8081a2c76d3..b711cdb4783 100644
--- a/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
+++ b/server/sonar-web/src/main/js/components/shared/DrilldownLink.tsx
@@ -20,7 +20,7 @@
import * as React from 'react';
import { Link } from 'react-router';
import { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls';
-import { BranchLike } from '../../app/types';
+import { BranchLike, IssueType } from '../../app/types';
import { getBranchLikeQuery } from '../../helpers/branches';
const ISSUE_MEASURES = [
@@ -104,15 +104,15 @@ export default class DrilldownLink extends React.PureComponent<Props> {
break;
case 'code_smells':
case 'new_code_smells':
- Object.assign(params, { resolved: 'false', types: 'CODE_SMELL' });
+ Object.assign(params, { resolved: 'false', types: IssueType.CodeSmell });
break;
case 'bugs':
case 'new_bugs':
- Object.assign(params, { resolved: 'false', types: 'BUG' });
+ Object.assign(params, { resolved: 'false', types: IssueType.Bug });
break;
case 'vulnerabilities':
case 'new_vulnerabilities':
- Object.assign(params, { resolved: 'false', types: 'VULNERABILITY' });
+ Object.assign(params, { resolved: 'false', types: IssueType.Vulnerability });
break;
default:
Object.assign(params, { resolved: 'false' });
diff --git a/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx b/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx
index 1229bf38a88..f397063230e 100644
--- a/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx
+++ b/server/sonar-web/src/main/js/components/shared/TypeHelper.tsx
@@ -20,10 +20,11 @@
import * as React from 'react';
import IssueTypeIcon from '../ui/IssueTypeIcon';
import { translate } from '../../helpers/l10n';
+import { RuleType, IssueType } from '../../app/types';
interface Props {
className?: string;
- type: string;
+ type: IssueType | RuleType;
}
export default function TypeHelper(props: Props) {