diff --git a/src/web/wizard/advancedtaskwizard.jsx b/src/web/wizard/advancedtaskwizard.jsx
index e68fe8cec6..97fdd53cb0 100644
--- a/src/web/wizard/advancedtaskwizard.jsx
+++ b/src/web/wizard/advancedtaskwizard.jsx
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import {
esxi_credential_filter,
smb_credential_filter,
@@ -28,12 +26,9 @@ import {
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
-import withCapabilities from 'web/utils/withCapabilities';
import SaveDialog from 'web/components/dialog/savedialog';
-import Divider from 'web/components/layout/divider';
-
import Select from 'web/components/form/select';
import Spinner from 'web/components/form/spinner';
import FormGroup from 'web/components/form/formgroup';
@@ -42,7 +37,12 @@ import Radio from 'web/components/form/radio';
import Datepicker from 'web/components/form/datepicker';
import TimeZoneSelect from 'web/components/form/timezoneselect';
+import Divider from 'web/components/layout/divider';
import Layout from 'web/components/layout/layout';
+import Column from 'web/components/layout/column';
+
+import useTranslation from 'web/hooks/useTranslation';
+import useCapabilities from 'web/utils/useCapabilities';
import {WizardContent, WizardIcon} from './taskwizard';
@@ -60,7 +60,6 @@ const DEFAULTS = {
const AdvancedTaskWizard = ({
alert_email,
auto_start,
- capabilities,
config_id,
credentials = [],
start_date,
@@ -77,6 +76,8 @@ const AdvancedTaskWizard = ({
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
+ const capabilities = useCapabilities();
const configItems = renderSelectItems(scan_configs);
const sshCredentialItems = renderSelectItems(
credentials.filter(ssh_credential_filter),
@@ -181,19 +182,18 @@ const AdvancedTaskWizard = ({
-
-
+
+
-
+
-
+
-
-
-
-
+
+
{capabilities.mayCreate('schedule') &&
capabilities.mayAccess('schedules') && (
-
-
+ <>
+
-
-
-
-
{_('at')}
{_('m')}
-
-
-
-
-
+
+
+ >
)}
-
-
-
- {_(' on port ')}
-
-
+
+
+ {_(' on port ')}
+
-
+
-
+
+
)}
@@ -351,7 +338,6 @@ AdvancedTaskWizard.propTypes = {
SCHEDULE_START_VALUE,
DONT_START_VALUE,
]),
- capabilities: PropTypes.capabilities.isRequired,
config_id: PropTypes.idOrZero,
credentials: PropTypes.arrayOf(PropTypes.model),
esxi_credential: PropTypes.idOrZero,
@@ -370,6 +356,6 @@ AdvancedTaskWizard.propTypes = {
onSave: PropTypes.func.isRequired,
};
-export default withCapabilities(AdvancedTaskWizard);
+export default AdvancedTaskWizard;
// vim: set ts=2 sw=2 tw=80:
diff --git a/src/web/wizard/modifytaskwizard.jsx b/src/web/wizard/modifytaskwizard.jsx
index 6f0783d44c..1a99a23b40 100644
--- a/src/web/wizard/modifytaskwizard.jsx
+++ b/src/web/wizard/modifytaskwizard.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {parseYesNo, NO_VALUE, YES_VALUE} from 'gmp/parser';
import PropTypes from 'web/utils/proptypes';
@@ -33,17 +31,19 @@ import TextField from 'web/components/form/textfield';
import TimeZoneSelect from 'web/components/form/timezoneselect';
import Datepicker from 'web/components/form/datepicker';
-import Divider from 'web/components/layout/divider';
import Layout from 'web/components/layout/layout';
+import Column from 'web/components/layout/column';
+import Row from 'web/components/layout/row';
import {renderSelectItems} from 'web/utils/render';
-import withCapabilities from 'web/utils/withCapabilities';
+
+import useTranslation from 'web/hooks/useTranslation';
+import useCapabilities from 'web/utils/useCapabilities';
import {WizardContent, WizardIcon} from './taskwizard';
const ModifyTaskWizard = ({
alert_email = '',
- capabilities,
reschedule,
start_date,
start_hour,
@@ -54,6 +54,8 @@ const ModifyTaskWizard = ({
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
+ const capabilities = useCapabilities();
const data = {
alert_email,
start_date,
@@ -116,8 +118,8 @@ const ModifyTaskWizard = ({
-
-
+
+
)}
{capabilities.mayCreate('alert') &&
capabilities.mayAccess('alerts') && (
-
+
)}
-
+
)}
@@ -215,7 +204,6 @@ const ModifyTaskWizard = ({
ModifyTaskWizard.propTypes = {
alert_email: PropTypes.string,
- capabilities: PropTypes.capabilities.isRequired,
reschedule: PropTypes.oneOf([NO_VALUE, YES_VALUE]),
start_date: PropTypes.date,
start_hour: PropTypes.number,
@@ -228,6 +216,6 @@ ModifyTaskWizard.propTypes = {
onSave: PropTypes.func.isRequired,
};
-export default withCapabilities(ModifyTaskWizard);
+export default ModifyTaskWizard;
// vim: set ts=2 sw=2 tw=80:
diff --git a/src/web/wizard/taskwizard.jsx b/src/web/wizard/taskwizard.jsx
index 776128e32b..253dcdec35 100644
--- a/src/web/wizard/taskwizard.jsx
+++ b/src/web/wizard/taskwizard.jsx
@@ -30,8 +30,8 @@ import TextField from 'web/components/form/textfield';
import {default as WizIcon} from 'web/components/icon/wizardicon';
import NewIcon from 'web/components/icon/newicon';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
+import Column from 'web/components/layout/column';
+import Row from 'web/components/layout/row';
export const WizardContent = styled.div`
margin: 0 20px;
@@ -62,37 +62,35 @@ const TaskWizard = ({
defaultValues={{hosts}}
>
{({values: state, onValueChange}) => (
-
+
-
+
{_('Quick start: Immediately scan an IP address')}
-
+
{_('IP address or hostname:')}
-
+
{_(
'The default address is either your computer' +
' or your network gateway.',
)}
-
- {_('As a short-cut the following steps will be done for you:')}
-
- - {_('Create a new Target')}
- - {_('Create a new Task')}
- - {_('Start this scan task right away')}
-
-
+ {_('As a short-cut the following steps will be done for you:')}
+
+ - {_('Create a new Target')}
+ - {_('Create a new Task')}
+ - {_('Start this scan task right away')}
+
{_(
'As soon as the scan progress is beyond 1%, you can already ' +
@@ -106,14 +104,14 @@ const TaskWizard = ({
' as configured in "My Settings".',
)}
-
+
{_('By clicking the New Task icon')}
{_('you can create a new Task yourself.')}
-
-
+
+
-
+
)}
);