From 205dba501eb14aae28504b71b22a7a002bd78778 Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Fri, 25 Jun 2021 18:15:26 +0200 Subject: [PATCH] SONAR-14943 Vertical center the ellipsis icon --- .../components/ProjectCreationMenu.tsx | 4 +- .../ProjectCreationMenu-test.tsx.snap | 4 +- .../main/js/components/icons/EllipsisIcon.tsx | 39 ------------------- .../icons/__tests__/EllipsisIcon-test.tsx | 34 ---------------- .../__snapshots__/EllipsisIcon-test.tsx.snap | 16 -------- .../tutorials/TutorialSelectionRenderer.tsx | 4 +- .../TutorialSelectionRenderer-test.tsx.snap | 15 +++---- 7 files changed, 11 insertions(+), 105 deletions(-) delete mode 100644 server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/EllipsisIcon-test.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/EllipsisIcon-test.tsx.snap diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx index a2677ae4de8..3b1c420744f 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx @@ -22,10 +22,10 @@ import { Link } from 'react-router'; import { Button } from 'sonar-ui-common/components/controls/buttons'; import Dropdown from 'sonar-ui-common/components/controls/Dropdown'; import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon'; +import EllipsisIcon from 'sonar-ui-common/components/icons/EllipsisIcon'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getAlmSettings } from '../../../api/alm-settings'; import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; -import EllipsisIcon from '../../../components/icons/EllipsisIcon'; import { IMPORT_COMPATIBLE_ALMS, IMPORT_COMPATIBLE_ALM_COUNT } from '../../../helpers/constants'; import { hasGlobalPermission } from '../../../helpers/users'; import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings'; @@ -126,7 +126,7 @@ export class ProjectCreationMenu extends React.PureComponent { {boundAlms.length < IMPORT_COMPATIBLE_ALM_COUNT && (
  • - + {translate('more')}
  • diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCreationMenu-test.tsx.snap b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCreationMenu-test.tsx.snap index f5ed0aa061f..01db864b088 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCreationMenu-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCreationMenu-test.tsx.snap @@ -28,8 +28,8 @@ exports[`should render correctly: default 1`] = ` } > more diff --git a/server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx b/server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx deleted file mode 100644 index 51455e17736..00000000000 --- a/server/sonar-web/src/main/js/components/icons/EllipsisIcon.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 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 classNames from 'classnames'; -import * as React from 'react'; - -export interface EllipsisIconProps { - className?: string; - height?: number; - width?: number; -} - -export default function EllipsisIcon({ className, height, width }: EllipsisIconProps) { - return ( - - … - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/EllipsisIcon-test.tsx b/server/sonar-web/src/main/js/components/icons/__tests__/EllipsisIcon-test.tsx deleted file mode 100644 index fbc28175276..00000000000 --- a/server/sonar-web/src/main/js/components/icons/__tests__/EllipsisIcon-test.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 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 { shallow } from 'enzyme'; -import * as React from 'react'; -import EllipsisIcon, { EllipsisIconProps } from '../EllipsisIcon'; - -it('should render correctly', () => { - const wrapper = shallowRender(); - expect(wrapper).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/EllipsisIcon-test.tsx.snap b/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/EllipsisIcon-test.tsx.snap deleted file mode 100644 index adaf939e627..00000000000 --- a/server/sonar-web/src/main/js/components/icons/__tests__/__snapshots__/EllipsisIcon-test.tsx.snap +++ /dev/null @@ -1,16 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - … - -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx b/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx index f2749fc9247..28b272f0452 100644 --- a/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import EllipsisIcon from 'sonar-ui-common/components/icons/EllipsisIcon'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { AlmKeys, AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings'; -import EllipsisIcon from '../icons/EllipsisIcon'; import AzurePipelinesTutorial from './azure-pipelines/AzurePipelinesTutorial'; import BitbucketPipelinesTutorial from './bitbucket-pipelines/BitbucketPipelinesTutorial'; import GitHubActionTutorial from './github-action/GitHubActionTutorial'; @@ -178,7 +178,7 @@ export default function TutorialSelectionRenderer(props: TutorialSelectionRender {renderButton( TutorialModes.OtherCI, props.onSelectTutorial, - + )} diff --git a/server/sonar-web/src/main/js/components/tutorials/__tests__/__snapshots__/TutorialSelectionRenderer-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/__tests__/__snapshots__/TutorialSelectionRenderer-test.tsx.snap index 9e4c32dd8b2..f718c83a010 100644 --- a/server/sonar-web/src/main/js/components/tutorials/__tests__/__snapshots__/TutorialSelectionRenderer-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/__tests__/__snapshots__/TutorialSelectionRenderer-test.tsx.snap @@ -55,8 +55,7 @@ exports[`should render correctly for azure 1`] = ` type="button" >