From 84953760d779486937c2ac42d1a179c5bc5f89a9 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Tue, 27 Jul 2021 14:12:28 +0200 Subject: [PATCH 1/5] Add new InfoIcon --- gsa/src/web/components/icon/infoicon.js | 26 ++++++++++++++++++++++ gsa/src/web/components/icon/svg/info.svg | 28 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gsa/src/web/components/icon/infoicon.js create mode 100644 gsa/src/web/components/icon/svg/info.svg diff --git a/gsa/src/web/components/icon/infoicon.js b/gsa/src/web/components/icon/infoicon.js new file mode 100644 index 0000000000..da926bf9c4 --- /dev/null +++ b/gsa/src/web/components/icon/infoicon.js @@ -0,0 +1,26 @@ +/* Copyright (C) 2021 Greenbone Networks GmbH + * + * SPDX-License-Identifier: AGPL-3.0-or-later + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +import withSvgIcon from './withSvgIcon'; + +import {ReactComponent as Icon} from './svg/info.svg'; + +const InfoIcon = withSvgIcon()(Icon); + +export default InfoIcon; + +// vim: set ts=2 sw=2 tw=80: diff --git a/gsa/src/web/components/icon/svg/info.svg b/gsa/src/web/components/icon/svg/info.svg new file mode 100644 index 0000000000..1a0f384a69 --- /dev/null +++ b/gsa/src/web/components/icon/svg/info.svg @@ -0,0 +1,28 @@ + + + + + + + + + + From 0eee1814fe99853da42ba298601e2822596eede9 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Tue, 27 Jul 2021 14:12:50 +0200 Subject: [PATCH 2/5] Add tests for InfoIcon --- .../web/components/icon/__tests__/infoicon.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 gsa/src/web/components/icon/__tests__/infoicon.js diff --git a/gsa/src/web/components/icon/__tests__/infoicon.js b/gsa/src/web/components/icon/__tests__/infoicon.js new file mode 100644 index 0000000000..d8af6cab35 --- /dev/null +++ b/gsa/src/web/components/icon/__tests__/infoicon.js @@ -0,0 +1,26 @@ +/* Copyright (C) 2021 Greenbone Networks GmbH + * + * SPDX-License-Identifier: AGPL-3.0-or-later + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +import {testIcon} from 'web/components/icon/testing'; + +import InfoIcon from '../infoicon'; + +describe('InfoIcon component tests', () => { + testIcon(InfoIcon); +}); + +// vim: set ts=2 sw=2 tw=80: From e86877abcf54dedf5a6b40fd82ee81de459d8fb1 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Tue, 27 Jul 2021 14:14:20 +0200 Subject: [PATCH 3/5] Use InfoIcon for additional Elevate Credential information in TargetDialog --- gsa/src/web/pages/targets/dialog.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gsa/src/web/pages/targets/dialog.js b/gsa/src/web/pages/targets/dialog.js index 098ff880f5..034c1f5ad5 100644 --- a/gsa/src/web/pages/targets/dialog.js +++ b/gsa/src/web/pages/targets/dialog.js @@ -34,6 +34,7 @@ import Select from 'web/components/form/select'; import TextField from 'web/components/form/textfield'; import YesNoRadio from 'web/components/form/yesnoradio'; +import InfoIcon from 'web/components/icon/infoicon'; import NewIcon from 'web/components/icon/newicon'; import Divider from 'web/components/layout/divider'; @@ -390,7 +391,17 @@ const TargetDialog = ({ {state.ssh_credential_id !== UNSET_VALUE && ( - {_('Elevate privileges')} + + + + {_('Elevate privileges')} + +