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 = ({

- - + + - + - {_(' on port ')} - - + + - + - - - - - - - - + + + + + {_('at')} + - - - - {_('at')} - - {_('h')} - - {_('m')} - - - - {_('h')} + - + {_('m')} + + )} {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:')} -
    -
  1. {_('Create a new Target')}
  2. -
  3. {_('Create a new Task')}
  4. -
  5. {_('Start this scan task right away')}
  6. -
-
+ {_('As a short-cut the following steps will be done for you:')} +
    +
  1. {_('Create a new Target')}
  2. +
  3. {_('Create a new Task')}
  4. +
  5. {_('Start this scan task right away')}
  6. +

{_( '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.')} - - + + -
+ )} );