]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8713 change bug tracker icon
authorStas Vilchik <vilchiks@gmail.com>
Mon, 30 Jan 2017 10:22:57 +0000 (11:22 +0100)
committerStas Vilchik <stas-vilchik@users.noreply.github.com>
Mon, 30 Jan 2017 15:11:06 +0000 (16:11 +0100)
server/sonar-web/src/main/js/apps/overview/meta/MetaLink.js
server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js
server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js [new file with mode: 0644]

index e7786e539dd7d87bac9ee6986062b08762ca81be..c726bfd6ca0b035167989f0266047e77c93251f9 100644 (file)
@@ -20,6 +20,7 @@
 // @flow
 import React from 'react';
 import { isProvided, isClickable } from '../../project-admin/links/utils';
+import BugTrackerIcon from '../../../components/ui/BugTrackerIcon';
 
 type Link = {
   id: string,
@@ -48,6 +49,10 @@ export default class MetaLink extends React.Component {
   };
 
   renderLinkIcon (link: Link) {
+    if (link.type === 'issue') {
+      return <BugTrackerIcon/>;
+    }
+
     return isProvided(link) ?
         <i className={`icon-color-link icon-${link.type}`}/> :
         <i className="icon-color-link icon-detach"/>;
index e55651dce89612e052b0711963629d4bd0465e72..74cc19788ffcdc4ccba3b12a2dc579b169c9b9a6 100644 (file)
@@ -21,6 +21,7 @@ import React from 'react';
 import shallowCompare from 'react-addons-shallow-compare';
 import { isProvided, isClickable } from './utils';
 import { translate } from '../../../helpers/l10n';
+import BugTrackerIcon from '../../../components/ui/BugTrackerIcon';
 
 export default class LinkRow extends React.Component {
   static propTypes = {
@@ -39,6 +40,14 @@ export default class LinkRow extends React.Component {
   }
 
   renderIcon (iconClassName) {
+    if (iconClassName === 'icon-issue') {
+      return (
+          <div className="display-inline-block text-top spacer-right">
+            <BugTrackerIcon/>
+          </div>
+      );
+    }
+
     return (
         <div className="display-inline-block text-top spacer-right">
           <i className={iconClassName}/>
diff --git a/server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js b/server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js
new file mode 100644 (file)
index 0000000..32af219
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact 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';
+
+export default class BugTrackerIcon extends React.Component {
+  render () {
+    /* eslint-disable max-len */
+    return (
+        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14">
+          <g transform="matrix(1,0,0,1,0,1)">
+            <path style={{ fill: 'none', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeMiterlimit: '10' }} d="M12 9h-2L8 5 6.5 9.5l-2-6L3 9H1"/>
+          </g>
+        </svg>
+    );
+  }
+}