aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/overview/meta
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-05-23 15:29:06 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-23 20:20:48 +0200
commitfbe1259e4abbbbe7416489819b79113ab953d864 (patch)
treec85a0bc88b97ef3d0949630fc4ea86903c14278c /server/sonar-web/src/main/js/apps/overview/meta
parent11c567859c646bc3202e6ca15f2c8f53e928d633 (diff)
downloadsonarqube-fbe1259e4abbbbe7416489819b79113ab953d864.tar.gz
sonarqube-fbe1259e4abbbbe7416489819b79113ab953d864.zip
SONAR-10673 Stop using font for icons (#252)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/meta')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx16
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/__tests__/__snapshots__/MetaLink-test.tsx.snap52
2 files changed, 16 insertions, 52 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx
index 7a3caf2ab7a..a336ee988bf 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx
@@ -18,10 +18,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { isProvided, getLinkName } from '../../project-admin/links/utils';
+import { getLinkName } from '../../project-admin/links/utils';
import { ProjectLink } from '../../../app/types';
-import DetachIcon from '../../../components/icons-components/DetachIcon';
-import BugTrackerIcon from '../../../components/icons-components/BugTrackerIcon';
+import ProjectLinkIcon from '../../../components/icons-components/ProjectLinkIcon';
interface Props {
link: ProjectLink;
@@ -31,16 +30,9 @@ export default function MetaLink({ link }: Props) {
return (
<li>
<a className="link-with-icon" href={link.url} rel="nofollow" target="_blank">
- <MetaLinkIcon link={link} /> {getLinkName(link)}
+ <ProjectLinkIcon className="little-spacer-right" type={link.type} />
+ {getLinkName(link)}
</a>
</li>
);
}
-
-function MetaLinkIcon({ link }: Props) {
- if (link.type === 'issue') {
- return <BugTrackerIcon />;
- }
-
- return isProvided(link) ? <i className={`icon-color-link icon-${link.type}`} /> : <DetachIcon />;
-}
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/__tests__/__snapshots__/MetaLink-test.tsx.snap b/server/sonar-web/src/main/js/apps/overview/meta/__tests__/__snapshots__/MetaLink-test.tsx.snap
index 1b37c9bfe64..553a37c7bf1 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/__tests__/__snapshots__/MetaLink-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/overview/meta/__tests__/__snapshots__/MetaLink-test.tsx.snap
@@ -8,17 +8,10 @@ exports[`should expand and collapse link 1`] = `
rel="nofollow"
target="_blank"
>
- <MetaLinkIcon
- link={
- Object {
- "id": "1",
- "name": "Foo",
- "type": "foo",
- "url": "scm:git:git@github.com",
- }
- }
+ <ProjectLinkIcon
+ className="little-spacer-right"
+ type="foo"
/>
-
Foo
</a>
</li>
@@ -32,17 +25,10 @@ exports[`should expand and collapse link 2`] = `
rel="nofollow"
target="_blank"
>
- <MetaLinkIcon
- link={
- Object {
- "id": "1",
- "name": "Foo",
- "type": "foo",
- "url": "scm:git:git@github.com",
- }
- }
+ <ProjectLinkIcon
+ className="little-spacer-right"
+ type="foo"
/>
-
Foo
</a>
</li>
@@ -56,17 +42,10 @@ exports[`should expand and collapse link 3`] = `
rel="nofollow"
target="_blank"
>
- <MetaLinkIcon
- link={
- Object {
- "id": "1",
- "name": "Foo",
- "type": "foo",
- "url": "scm:git:git@github.com",
- }
- }
+ <ProjectLinkIcon
+ className="little-spacer-right"
+ type="foo"
/>
-
Foo
</a>
</li>
@@ -80,17 +59,10 @@ exports[`should match snapshot 1`] = `
rel="nofollow"
target="_blank"
>
- <MetaLinkIcon
- link={
- Object {
- "id": "1",
- "name": "Foo",
- "type": "foo",
- "url": "http://example.com",
- }
- }
+ <ProjectLinkIcon
+ className="little-spacer-right"
+ type="foo"
/>
-
Foo
</a>
</li>