diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2024-12-03 11:51:55 +0100 |
---|---|---|
committer | Steve Marion <steve.marion@sonarsource.com> | 2024-12-18 11:13:22 +0100 |
commit | fb8c7e82be68bebdf4473a3020c91699e8021467 (patch) | |
tree | b8bbd8f4d8f48e3fed206382131c7a1a76ac512b /server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx | |
parent | 150964c272076babccd1d1fdd837d0324cdbd4ad (diff) | |
download | sonarqube-fb8c7e82be68bebdf4473a3020c91699e8021467.tar.gz sonarqube-fb8c7e82be68bebdf4473a3020c91699e8021467.zip |
SONAR-23605 Cleanup legacy sonar-web
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx deleted file mode 100644 index 3c0669680f6..00000000000 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DeleteQualityGateForm.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2024 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 { Button, ButtonVariety } from '@sonarsource/echoes-react'; -import { Modal } from '~design-system'; -import { useRouter } from '~sonar-aligned/components/hoc/withRouter'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { getQualityGatesUrl } from '../../../helpers/urls'; -import { useDeleteQualityGateMutation } from '../../../queries/quality-gates'; -import { QualityGate } from '../../../types/types'; - -interface Props { - onClose: () => void; - qualityGate: QualityGate; -} - -export default function DeleteQualityGateForm({ qualityGate, onClose }: Readonly<Props>) { - const { mutateAsync: deleteQualityGate } = useDeleteQualityGateMutation(qualityGate.name); - const router = useRouter(); - - const onDelete = async () => { - await deleteQualityGate(); - router.push(getQualityGatesUrl()); - }; - - return ( - <Modal - headerTitle={translate('quality_gates.delete')} - onClose={onClose} - body={translateWithParameters('quality_gates.delete.confirm.message', qualityGate.name)} - primaryButton={ - <Button hasAutoFocus type="submit" onClick={onDelete} variety={ButtonVariety.Danger}> - {translate('delete')} - </Button> - } - secondaryButtonLabel={translate('cancel')} - /> - ); -} |