aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/shared
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/components/shared
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/components/shared')
-rw-r--r--server/sonar-web/src/main/js/components/shared/QualifierIcon.tsx36
-rw-r--r--server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/shared/SeverityIcon.tsx35
-rw-r--r--server/sonar-web/src/main/js/components/shared/StatusHelper.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/shared/StatusIcon.tsx30
-rw-r--r--server/sonar-web/src/main/js/components/shared/TestStatusIcon.tsx30
-rw-r--r--server/sonar-web/src/main/js/components/shared/__tests__/QualifierIcon-test.tsx35
-rw-r--r--server/sonar-web/src/main/js/components/shared/__tests__/__snapshots__/QualifierIcon-test.tsx.snap19
8 files changed, 2 insertions, 187 deletions
diff --git a/server/sonar-web/src/main/js/components/shared/QualifierIcon.tsx b/server/sonar-web/src/main/js/components/shared/QualifierIcon.tsx
deleted file mode 100644
index 3b6c0c1704f..00000000000
--- a/server/sonar-web/src/main/js/components/shared/QualifierIcon.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-import * as React from 'react';
-import * as classNames from 'classnames';
-
-interface Props {
- className?: string;
- qualifier: string | null;
-}
-
-export default function QualifierIcon(props: Props) {
- if (!props.qualifier) {
- return null;
- }
-
- const className = classNames('icon-qualifier-' + props.qualifier.toLowerCase(), props.className);
-
- return <i className={className} />;
-}
diff --git a/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx b/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx
index 40788425b7b..bd81a6e7d53 100644
--- a/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx
+++ b/server/sonar-web/src/main/js/components/shared/SeverityHelper.tsx
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import SeverityIcon from './SeverityIcon';
+import SeverityIcon from '../icons-components/SeverityIcon';
import { translate } from '../../helpers/l10n';
interface Props {
diff --git a/server/sonar-web/src/main/js/components/shared/SeverityIcon.tsx b/server/sonar-web/src/main/js/components/shared/SeverityIcon.tsx
deleted file mode 100644
index 38ee50884a4..00000000000
--- a/server/sonar-web/src/main/js/components/shared/SeverityIcon.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-import * as React from 'react';
-import * as classNames from 'classnames';
-
-interface Props {
- className?: string;
- severity: string | null | undefined;
-}
-
-export default function SeverityIcon(props: Props) {
- if (!props.severity) {
- return null;
- }
- return (
- <i className={classNames('icon-severity-' + props.severity.toLowerCase(), props.className)} />
- );
-}
diff --git a/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx b/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx
index b6921effdac..f5cd7f21dc9 100644
--- a/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx
+++ b/server/sonar-web/src/main/js/components/shared/StatusHelper.tsx
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import StatusIcon from './StatusIcon';
+import StatusIcon from '../icons-components/StatusIcon';
import { translate } from '../../helpers/l10n';
interface Props {
diff --git a/server/sonar-web/src/main/js/components/shared/StatusIcon.tsx b/server/sonar-web/src/main/js/components/shared/StatusIcon.tsx
deleted file mode 100644
index d043b034406..00000000000
--- a/server/sonar-web/src/main/js/components/shared/StatusIcon.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-import * as React from 'react';
-import * as classNames from 'classnames';
-
-interface Props {
- className?: string;
- status: string;
-}
-
-export default function StatusIcon({ className, status }: Props) {
- return <i className={classNames('icon-status-' + status.toLowerCase(), className)} />;
-}
diff --git a/server/sonar-web/src/main/js/components/shared/TestStatusIcon.tsx b/server/sonar-web/src/main/js/components/shared/TestStatusIcon.tsx
deleted file mode 100644
index c54fca5654b..00000000000
--- a/server/sonar-web/src/main/js/components/shared/TestStatusIcon.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-import * as React from 'react';
-import * as classNames from 'classnames';
-
-interface Props {
- className?: string;
- status: string;
-}
-
-export default function TestStatusIcon({ className, status }: Props) {
- return <i className={classNames('icon-test-status-' + status.toLowerCase(), className)} />;
-}
diff --git a/server/sonar-web/src/main/js/components/shared/__tests__/QualifierIcon-test.tsx b/server/sonar-web/src/main/js/components/shared/__tests__/QualifierIcon-test.tsx
deleted file mode 100644
index 06169277552..00000000000
--- a/server/sonar-web/src/main/js/components/shared/__tests__/QualifierIcon-test.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-import * as React from 'react';
-import { shallow } from 'enzyme';
-import QualifierIcon from '../QualifierIcon';
-
-it('should render icon', () => {
- expect(shallow(<QualifierIcon qualifier="TRK" />)).toMatchSnapshot();
- expect(shallow(<QualifierIcon qualifier="trk" />)).toMatchSnapshot();
-});
-
-it('should not render icon', () => {
- expect(shallow(<QualifierIcon qualifier={null} />).type()).toBeNull();
-});
-
-it('should render with custom class', () => {
- expect(shallow(<QualifierIcon className="spacer-right" qualifier="TRK" />)).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/shared/__tests__/__snapshots__/QualifierIcon-test.tsx.snap b/server/sonar-web/src/main/js/components/shared/__tests__/__snapshots__/QualifierIcon-test.tsx.snap
deleted file mode 100644
index 3e1625b3e32..00000000000
--- a/server/sonar-web/src/main/js/components/shared/__tests__/__snapshots__/QualifierIcon-test.tsx.snap
+++ /dev/null
@@ -1,19 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render icon 1`] = `
-<i
- className="icon-qualifier-trk"
-/>
-`;
-
-exports[`should render icon 2`] = `
-<i
- className="icon-qualifier-trk"
-/>
-`;
-
-exports[`should render with custom class 1`] = `
-<i
- className="icon-qualifier-trk spacer-right"
-/>
-`;