From a247dc044b37a7a26011020641aad5d8ec4ff4e9 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Fri, 12 Apr 2019 14:48:20 +0200 Subject: [PATCH] SONAR-11746 Replace 'x' icon for delete actions --- .../__tests__/NewProjectForm-test.tsx | 2 +- .../NewProjectForm-test.tsx.snap | 4 ++-- .../icons-components/DeleteIcon.tsx | 19 ++++++++-------- .../icons-components/__mocks__/DeleteIcon.tsx | 22 +++++++++++++++++++ .../src/main/js/components/ui/buttons.tsx | 4 ++-- 5 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 server/sonar-web/src/main/js/components/icons-components/__mocks__/DeleteIcon.tsx diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/NewProjectForm-test.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/NewProjectForm-test.tsx index 60a604bf7c7..0cb47e200d4 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/NewProjectForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/NewProjectForm-test.tsx @@ -27,7 +27,7 @@ jest.mock('../../../../api/components', () => ({ deleteProject: () => Promise.resolve() })); -jest.mock('../../../../components/icons-components/ClearIcon'); +jest.mock('../../../../components/icons-components/DeleteIcon'); it('creates new project', async () => { const onDone = jest.fn(); diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/NewProjectForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/NewProjectForm-test.tsx.snap index b043072b6a9..94a01466fdb 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/NewProjectForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/NewProjectForm-test.tsx.snap @@ -157,7 +157,7 @@ exports[`creates new project 3`] = ` } type="button" > - + @@ -215,7 +215,7 @@ exports[`deletes project 1`] = ` } type="button" > - + diff --git a/server/sonar-web/src/main/js/components/icons-components/DeleteIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/DeleteIcon.tsx index 6db6cd1acc4..34f1f1ac0d3 100644 --- a/server/sonar-web/src/main/js/components/icons-components/DeleteIcon.tsx +++ b/server/sonar-web/src/main/js/components/icons-components/DeleteIcon.tsx @@ -18,14 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import ClearIcon from './ClearIcon'; -import * as theme from '../../app/theme'; +import Icon, { IconProps } from './Icon'; -interface Props { - className?: string; - size?: number; -} - -export default function DeleteIcon(props: Props) { - return ; +export default function DeleteIcon({ className, fill = 'currentColor', size }: IconProps) { + return ( + + + + ); } diff --git a/server/sonar-web/src/main/js/components/icons-components/__mocks__/DeleteIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/__mocks__/DeleteIcon.tsx new file mode 100644 index 00000000000..07f11e31f4f --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons-components/__mocks__/DeleteIcon.tsx @@ -0,0 +1,22 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 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. + */ +export default function DeleteIcon() { + return null; +} 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 5ad0b9197ef..c8866c5ac4a 100644 --- a/server/sonar-web/src/main/js/components/ui/buttons.tsx +++ b/server/sonar-web/src/main/js/components/ui/buttons.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import * as classNames from 'classnames'; import * as theme from '../../app/theme'; import ChevronRightIcon from '../icons-components/ChevronRightcon'; -import ClearIcon from '../icons-components/ClearIcon'; +import DeleteIcon from '../icons-components/DeleteIcon'; import EditIcon from '../icons-components/EditIcon'; import Tooltip from '../controls/Tooltip'; import './buttons.css'; @@ -127,7 +127,7 @@ interface ActionButtonProps { export function DeleteButton(props: ActionButtonProps) { return ( - + ); } -- 2.39.5