From 0a98c8edefc923ffd2e1c80c75479ebdc59711ae Mon Sep 17 00:00:00 2001 From: Sarah Diedrich Date: Wed, 31 Jul 2019 14:14:02 +0200 Subject: [PATCH] use scanconfig import dialog for policies --- gsa/src/web/pages/policies/component.js | 4 +- gsa/src/web/pages/policies/importdialog.js | 61 ------------------- gsa/src/web/pages/scanconfigs/component.js | 2 + gsa/src/web/pages/scanconfigs/importdialog.js | 8 ++- 4 files changed, 10 insertions(+), 65 deletions(-) delete mode 100644 gsa/src/web/pages/policies/importdialog.js diff --git a/gsa/src/web/pages/policies/component.js b/gsa/src/web/pages/policies/component.js index a178bd63ba..b59dc1191b 100644 --- a/gsa/src/web/pages/policies/component.js +++ b/gsa/src/web/pages/policies/component.js @@ -74,7 +74,7 @@ import EditPolicyFamilyDialog from 'web/pages/policies/editpolicyfamilydialog'; import EditPolicyDialog from 'web/pages/policies/editdialog'; import EditNvtDetailsDialog from 'web/pages/policies/editnvtdetailsdialog'; import AuditDialog from 'web/pages/audits/dialog'; -import ImportDialog from 'web/pages/policies/importdialog'; +import ImportDialog from 'web/pages/scanconfigs/importdialog'; import PolicyDialog from 'web/pages/policies/dialog'; import ScheduleComponent from 'web/pages/schedules/component'; @@ -743,6 +743,8 @@ class PolicyComponent extends React.Component { {importDialogVisible && ( diff --git a/gsa/src/web/pages/policies/importdialog.js b/gsa/src/web/pages/policies/importdialog.js deleted file mode 100644 index 37a32e503d..0000000000 --- a/gsa/src/web/pages/policies/importdialog.js +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 2019 Greenbone Networks GmbH - * - * SPDX-License-Identifier: GPL-2.0-or-later - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -import React from 'react'; - -import _ from 'gmp/locale'; - -import PropTypes from 'web/utils/proptypes'; - -import SaveDialog from 'web/components/dialog/savedialog'; - -import FileField from 'web/components/form/filefield'; -import FormGroup from 'web/components/form/formgroup'; - -import Layout from 'web/components/layout/layout'; - -const ImportDialog = ({onClose, onSave}) => { - return ( - - {({onValueChange}) => { - return ( - - - - - - ); - }} - - ); -}; - -ImportDialog.propTypes = { - onClose: PropTypes.func.isRequired, - onSave: PropTypes.func.isRequired, -}; - -export default ImportDialog; - -// vim: set ts=2 sw=2 tw=80: diff --git a/gsa/src/web/pages/scanconfigs/component.js b/gsa/src/web/pages/scanconfigs/component.js index 2fc8f780b3..6208d2309f 100644 --- a/gsa/src/web/pages/scanconfigs/component.js +++ b/gsa/src/web/pages/scanconfigs/component.js @@ -491,6 +491,8 @@ class ScanConfigComponent extends React.Component { {importDialogVisible && ( diff --git a/gsa/src/web/pages/scanconfigs/importdialog.js b/gsa/src/web/pages/scanconfigs/importdialog.js index 122246a986..7398d2deb4 100644 --- a/gsa/src/web/pages/scanconfigs/importdialog.js +++ b/gsa/src/web/pages/scanconfigs/importdialog.js @@ -29,11 +29,11 @@ import FormGroup from 'web/components/form/formgroup'; import Layout from 'web/components/layout/layout'; -const ImportDialog = ({onClose, onSave}) => { +const ImportDialog = ({title, text, onClose, onSave}) => { return ( { {({onValueChange}) => { return ( - + @@ -52,6 +52,8 @@ const ImportDialog = ({onClose, onSave}) => { }; ImportDialog.propTypes = { + text: PropTypes.string, + title: PropTypes.string, onClose: PropTypes.func.isRequired, onSave: PropTypes.func.isRequired, };