diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-05-15 17:10:00 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-05-15 20:20:50 +0200 |
commit | 5386cb6010e7469db0c8f0fa5972973b9a2fa266 (patch) | |
tree | 3fc0e12c1c69f9f9621f583d8955fd2c7acd10f4 /server/sonar-web/src/main/js/components/ui | |
parent | 05a73f23b2e922de87d37dc101728c94dfee7648 (diff) | |
download | sonarqube-5386cb6010e7469db0c8f0fa5972973b9a2fa266.tar.gz sonarqube-5386cb6010e7469db0c8f0fa5972973b9a2fa266.zip |
rewrite some components in ts (#243)
Diffstat (limited to 'server/sonar-web/src/main/js/components/ui')
-rw-r--r-- | server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js | 41 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/components/ui/CoverageRating.tsx | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx (renamed from server/sonar-web/src/main/js/components/ui/__tests__/Level-test.js) | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/components/ui/buttons.tsx | 1 |
4 files changed, 4 insertions, 44 deletions
diff --git a/server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js b/server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js deleted file mode 100644 index 45b233ba806..00000000000 --- a/server/sonar-web/src/main/js/components/ui/BugTrackerIcon.js +++ /dev/null @@ -1,41 +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. - */ -// @flow -import React from 'react'; - -export default function BugTrackerIcon() { - /* 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> - ); -} diff --git a/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx b/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx index 7439b850ff3..10ffc9e849b 100644 --- a/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx +++ b/server/sonar-web/src/main/js/components/ui/CoverageRating.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { DonutChart } from '../charts/donut-chart'; +import DonutChart from '../charts/DonutChart'; import * as theme from '../../app/theme'; const SIZE_TO_WIDTH_MAPPING = { small: 16, normal: 24, big: 40, huge: 60 }; @@ -45,5 +45,5 @@ export default function CoverageRating({ muted = false, size = 'normal', value } const width = SIZE_TO_WIDTH_MAPPING[size]; const thickness = SIZE_TO_THICKNESS_MAPPING[size]; - return <DonutChart data={data} width={width} height={width} thickness={thickness} />; + return <DonutChart data={data} height={width} thickness={thickness} width={width} />; } diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.js b/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx index 3a315a07599..7706ee2414b 100644 --- a/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.js +++ b/server/sonar-web/src/main/js/components/ui/__tests__/Level-test.tsx @@ -17,8 +17,8 @@ * 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 React from 'react'; import Level from '../Level'; it('should render', () => { diff --git a/server/sonar-web/src/main/js/components/ui/buttons.tsx b/server/sonar-web/src/main/js/components/ui/buttons.tsx index 82992ba0a64..1ede3bb8ce1 100644 --- a/server/sonar-web/src/main/js/components/ui/buttons.tsx +++ b/server/sonar-web/src/main/js/components/ui/buttons.tsx @@ -32,6 +32,7 @@ interface ButtonProps { disabled?: boolean; id?: string; innerRef?: (node: HTMLElement | null) => void; + name?: string; onClick?: (event: React.MouseEvent<HTMLElement>) => void; preventDefault?: boolean; stopPropagation?: boolean; |