diff --git a/src/web/pages/alerts/alembavfiremethodpart.jsx b/src/web/pages/alerts/alembavfiremethodpart.jsx
index 261e1b95f3..8d13fb7ad5 100644
--- a/src/web/pages/alerts/alembavfiremethodpart.jsx
+++ b/src/web/pages/alerts/alembavfiremethodpart.jsx
@@ -17,13 +17,8 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {USERNAME_PASSWORD_CREDENTIAL_TYPE} from 'gmp/models/credential';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
import withPrefix from 'web/utils/withPrefix';
@@ -39,6 +34,8 @@ import NewIcon from 'web/components/icon/newicon';
import {VFIRE_CALL_DESCRIPTION} from 'web/pages/alerts/dialog';
+import useTranslation from 'web/hooks/useTranslation';
+
const VFIRE_CREDENTIAL_TYPES = [USERNAME_PASSWORD_CREDENTIAL_TYPE];
const AlembaVfireMethodPart = ({
@@ -64,8 +61,9 @@ const AlembaVfireMethodPart = ({
credentials = credentials.filter(
cred => cred.credential_type === USERNAME_PASSWORD_CREDENTIAL_TYPE,
);
+ const [_] = useTranslation();
return (
-
+ <>
-
-
-
-
-
-
-
+
+
+
-
+
-
+ >
);
};
diff --git a/src/web/pages/alerts/condition.jsx b/src/web/pages/alerts/condition.jsx
index 9fa830195b..dbf431302b 100644
--- a/src/web/pages/alerts/condition.jsx
+++ b/src/web/pages/alerts/condition.jsx
@@ -15,8 +15,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
import {parseInt} from 'gmp/parser';
@@ -33,7 +31,10 @@ import {
import PropTypes from 'web/utils/proptypes';
+import useTranslation from 'web/hooks/useTranslation';
+
const Condition = ({condition = {}, event}) => {
+ const [_] = useTranslation();
if (!isDefined(condition.type) || !isDefined(condition.data)) {
return null;
}
diff --git a/src/web/pages/alerts/contentcomposerdialog.jsx b/src/web/pages/alerts/contentcomposerdialog.jsx
index 13e0521193..63306e204f 100644
--- a/src/web/pages/alerts/contentcomposerdialog.jsx
+++ b/src/web/pages/alerts/contentcomposerdialog.jsx
@@ -18,10 +18,6 @@
import React from 'react';
-import styled from 'styled-components';
-
-import _ from 'gmp/locale';
-
import {NO_VALUE, YES_VALUE} from 'gmp/parser';
import {isDefined} from 'gmp/utils/identity';
@@ -38,12 +34,7 @@ import CheckBox from 'web/components/form/checkbox';
import FormGroup from 'web/components/form/formgroup';
import Select from 'web/components/form/select';
-import Layout from 'web/components/layout/layout';
-import Divider from 'web/components/layout/divider';
-
-const StyledDiv = styled.div`
- text-align: end;
-`;
+import useTranslation from 'web/hooks/useTranslation';
const ContentComposerDialog = ({
filterId = UNSET_VALUE,
@@ -57,6 +48,7 @@ const ContentComposerDialog = ({
onSave,
onChange,
}) => {
+ const [_] = useTranslation();
const filter =
filterId === UNSET_VALUE ? undefined : filters.find(f => f.id === filterId);
@@ -76,54 +68,42 @@ const ContentComposerDialog = ({
onClose={onClose}
onSave={onSave}
>
- {({values, onValueChange}) => (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )}
+
+
+
+
+
+
);
};
diff --git a/src/web/pages/alerts/dialog.jsx b/src/web/pages/alerts/dialog.jsx
index db4e3514c5..5701b320ef 100644
--- a/src/web/pages/alerts/dialog.jsx
+++ b/src/web/pages/alerts/dialog.jsx
@@ -62,7 +62,7 @@ import YesNoRadio from 'web/components/form/yesnoradio';
import ReportIcon from 'web/components/icon/reporticon';
import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
+import Row from 'web/components/layout/row';
import {UNSET_VALUE} from 'web/utils/render';
import withCapabilities from 'web/utils/withCapabilities';
@@ -507,13 +507,12 @@ class AlertDialog extends React.Component {
>
{({values, onValueChange}) => {
return (
-
+ <>
@@ -523,92 +522,88 @@ class AlertDialog extends React.Component {
name="comment"
value={values.comment}
grow="1"
- size="30"
onChange={onValueChange}
/>
-
-
-
- this.handleEventChange(value, onValueChange)
- }
+
+
+ this.handleEventChange(value, onValueChange)
+ }
+ onChange={onValueChange}
+ />
+
+
+ this.handleEventChange(value, onValueChange)
+ }
+ onChange={onValueChange}
+ />
+
+
+ this.handleEventChange(value, onValueChange)
+ }
+ />
+
+
+
+
+
+ {taskEvent && (
+
+ )}
-
- this.handleEventChange(value, onValueChange)
- }
+ {taskEvent && (
+
-
- this.handleEventChange(value, onValueChange)
- }
+ )}
+
+ {(secinfoEvent || taskEvent) && (
+
-
-
-
-
-
-
-
- {taskEvent && (
-
- )}
-
- {taskEvent && (
-
- )}
-
- {(secinfoEvent || taskEvent) && (
-
- )}
-
- {taskEvent && (
-
- )}
-
+ )}
{secinfoEvent && (
@@ -632,46 +627,42 @@ class AlertDialog extends React.Component {
)}
{taskEvent && (
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
)}
@@ -862,7 +853,7 @@ class AlertDialog extends React.Component {
onChange={onValueChange}
/>
-
+ >
);
}}
diff --git a/src/web/pages/alerts/emailmethodpart.jsx b/src/web/pages/alerts/emailmethodpart.jsx
index 9c03906bcd..1d8b6cda94 100644
--- a/src/web/pages/alerts/emailmethodpart.jsx
+++ b/src/web/pages/alerts/emailmethodpart.jsx
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import {
isTaskEvent,
isSecinfoEvent,
@@ -40,18 +38,16 @@ import Radio from 'web/components/form/radio';
import NewIcon from 'web/components/icon/newicon';
-import Divider from 'web/components/layout/divider';
-import IconDivider from 'web/components/layout/icondivider';
-import Layout from 'web/components/layout/layout';
+import Row from 'web/components/layout/row';
-import compose from 'web/utils/compose';
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems, UNSET_VALUE} from 'web/utils/render';
-import withCapabilities from 'web/utils/withCapabilities';
import withPrefix from 'web/utils/withPrefix';
+import useTranslation from 'web/hooks/useTranslation';
+import useCapabilities from 'web/utils/useCapabilities';
+
const EmailMethodPart = ({
- capabilities,
credentials = [],
fromAddress,
event,
@@ -69,6 +65,8 @@ const EmailMethodPart = ({
onCredentialChange,
onNewCredentialClick,
}) => {
+ const [_] = useTranslation();
+ const capabilities = useCapabilities();
const taskEvent = isTaskEvent(event);
const secinfoEvent = isSecinfoEvent(event);
const reportFormatItems = renderSelectItems(
@@ -79,7 +77,7 @@ const EmailMethodPart = ({
);
credentials = credentials.filter(email_credential_filter);
return (
-
+ <>
)}
-
-
-
-
-
+
+
+
{(taskEvent || secinfoEvent) && (
-
-
-
-
- {capabilities.mayOp('get_report_formats') && (
-
-
-
- {taskEvent && (
-
- )}
-
-
- )}
-
- {capabilities.mayOp('get_report_formats') && (
-
-
-
-
- {taskEvent && (
-
- )}
-
-
-
+ )}
+
+
+ >
+ )}
+
+ {capabilities.mayOp('get_report_formats') && (
+ <>
+
+
-
- )}
-
+ {taskEvent && (
+
+ )}
+
+
+ >
+ )}
)}
-
+ >
);
};
EmailMethodPart.propTypes = {
- capabilities: PropTypes.capabilities.isRequired,
credentials: PropTypes.array,
event: PropTypes.string.isRequired,
fromAddress: PropTypes.string.isRequired,
@@ -246,6 +240,6 @@ EmailMethodPart.propTypes = {
onNewCredentialClick: PropTypes.func,
};
-export default compose(withCapabilities, withPrefix)(EmailMethodPart);
+export default withPrefix(EmailMethodPart);
// vim: set ts=2 sw=2 tw=80:
diff --git a/src/web/pages/alerts/event.jsx b/src/web/pages/alerts/event.jsx
index ec4f1d4d79..c02127771f 100644
--- a/src/web/pages/alerts/event.jsx
+++ b/src/web/pages/alerts/event.jsx
@@ -15,8 +15,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
import {secInfoTypeName} from 'gmp/models/secinfo';
@@ -31,7 +29,10 @@ import {
import PropTypes from 'web/utils/proptypes';
+import useTranslation from 'web/hooks/useTranslation';
+
const Event = ({event = {}}) => {
+ const [_] = useTranslation();
if (!isDefined(event.type) || !isDefined(event.data)) {
return null;
}
diff --git a/src/web/pages/alerts/filtercountchangedconditionpart.jsx b/src/web/pages/alerts/filtercountchangedconditionpart.jsx
index 54e04bfa2e..c1c0a6a313 100644
--- a/src/web/pages/alerts/filtercountchangedconditionpart.jsx
+++ b/src/web/pages/alerts/filtercountchangedconditionpart.jsx
@@ -17,9 +17,7 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
-import Divider from 'web/components/layout/divider';
+import Row from 'web/components/layout/row';
import Layout from 'web/components/layout/layout';
import PropTypes from 'web/utils/proptypes';
@@ -30,6 +28,8 @@ import Select from 'web/components/form/select';
import Spinner from 'web/components/form/spinner';
import Radio from 'web/components/form/radio';
+import useTranslation from 'web/hooks/useTranslation';
+
const VALUE = 'Filter count changed';
const FilterCountChangedConditionPart = ({
@@ -40,8 +40,9 @@ const FilterCountChangedConditionPart = ({
prefix,
onChange,
}) => {
+ const [_] = useTranslation();
return (
-
+
{_('result(s) more than previous scan')}
-
+
);
};
diff --git a/src/web/pages/alerts/filtercountleastconditionpart.jsx b/src/web/pages/alerts/filtercountleastconditionpart.jsx
index f13dde18b2..95d850a118 100644
--- a/src/web/pages/alerts/filtercountleastconditionpart.jsx
+++ b/src/web/pages/alerts/filtercountleastconditionpart.jsx
@@ -17,9 +17,7 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
-import Divider from 'web/components/layout/divider';
+import Row from 'web/components/layout/row';
import Layout from 'web/components/layout/layout';
import PropTypes from 'web/utils/proptypes';
@@ -30,6 +28,8 @@ import Select from 'web/components/form/select';
import Spinner from 'web/components/form/spinner';
import Radio from 'web/components/form/radio';
+import useTranslation from 'web/hooks/useTranslation';
+
const VALUE = 'Filter count at least';
const FilterCountLeastConditionPart = ({
@@ -40,8 +40,9 @@ const FilterCountLeastConditionPart = ({
prefix,
onChange,
}) => {
+ const [_] = useTranslation();
return (
-
+
{_('result(s) NVT(s)')}
-
+
);
};
diff --git a/src/web/pages/alerts/httpmethodpart.jsx b/src/web/pages/alerts/httpmethodpart.jsx
index ad24dc4a7d..1e2e4cd0cb 100644
--- a/src/web/pages/alerts/httpmethodpart.jsx
+++ b/src/web/pages/alerts/httpmethodpart.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import withPrefix from 'web/utils/withPrefix';
@@ -26,7 +24,10 @@ import withPrefix from 'web/utils/withPrefix';
import FormGroup from 'web/components/form/formgroup';
import TextField from 'web/components/form/textfield';
+import useTranslation from 'web/hooks/useTranslation';
+
const HttpMethodPart = ({prefix, URL, onChange}) => {
+ const [_] = useTranslation();
return (
{
+ const [_] = useTranslation();
if (!isDefined(method.type)) {
return null;
}
@@ -450,8 +451,8 @@ const Method = ({method = {}, details = false, reportFormats = []}) => {
{data.notice.value === EMAIL_NOTICE_INCLUDE
? _('Include Content')
: data.notice.value === EMAIL_NOTICE_ATTACH
- ? _('Attach Content')
- : _('Simple Notice')}
+ ? _('Attach Content')
+ : _('Simple Notice')}
)}
diff --git a/src/web/pages/alerts/scpmethodpart.jsx b/src/web/pages/alerts/scpmethodpart.jsx
index 8df23f6b16..c28a69754c 100644
--- a/src/web/pages/alerts/scpmethodpart.jsx
+++ b/src/web/pages/alerts/scpmethodpart.jsx
@@ -17,16 +17,11 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {
SSH_CREDENTIAL_TYPES,
ssh_credential_filter,
} from 'gmp/models/credential';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
@@ -40,6 +35,8 @@ import TextArea from 'web/components/form/textarea';
import NewIcon from 'web/components/icon/newicon';
+import useTranslation from 'web/hooks/useTranslation';
+
const ScpMethodPart = ({
prefix,
credentials = [],
@@ -54,26 +51,24 @@ const ScpMethodPart = ({
onCredentialChange,
onNewCredentialClick,
}) => {
+ const [_] = useTranslation();
credentials = credentials.filter(ssh_credential_filter);
return (
-
-
-
-
-
-
-
-
+ <>
+
+
+
@@ -123,7 +118,7 @@ const ScpMethodPart = ({
onChange={onChange}
/>
-
+ >
);
};
diff --git a/src/web/pages/alerts/secinfoeventpart.jsx b/src/web/pages/alerts/secinfoeventpart.jsx
index c45dbb09e3..6e83c47cde 100644
--- a/src/web/pages/alerts/secinfoeventpart.jsx
+++ b/src/web/pages/alerts/secinfoeventpart.jsx
@@ -17,11 +17,9 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {EVENT_TYPE_NEW_SECINFO, isSecinfoEvent} from 'gmp/models/alert';
-import Divider from 'web/components/layout/divider';
+import Row from 'web/components/layout/row';
import Select from 'web/components/form/select';
import Radio from 'web/components/form/radio';
@@ -29,6 +27,8 @@ import Radio from 'web/components/form/radio';
import PropTypes from 'web/utils/proptypes';
import withPrefix from 'web/utils/withPrefix';
+import useTranslation from 'web/hooks/useTranslation';
+
const SecinfoEventPart = ({
event,
feedEvent,
@@ -36,60 +36,65 @@ const SecinfoEventPart = ({
secinfoType,
onChange,
onEventChange,
-}) => (
-
-
-
-
-
-);
+}) => {
+ const [_] = useTranslation();
+ return (
+
+
+
+
+
+ );
+};
SecinfoEventPart.propTypes = {
event: PropTypes.string.isRequired,
diff --git a/src/web/pages/alerts/sendmethodpart.jsx b/src/web/pages/alerts/sendmethodpart.jsx
index 6ef6cf8efb..5a46cdac86 100644
--- a/src/web/pages/alerts/sendmethodpart.jsx
+++ b/src/web/pages/alerts/sendmethodpart.jsx
@@ -17,11 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
import withPrefix from 'web/utils/withPrefix';
@@ -30,6 +25,8 @@ import Select from 'web/components/form/select';
import FormGroup from 'web/components/form/formgroup';
import TextField from 'web/components/form/textfield';
+import useTranslation from 'web/hooks/useTranslation';
+
const SendMethodPart = ({
prefix,
reportFormats,
@@ -38,25 +35,24 @@ const SendMethodPart = ({
sendReportFormat,
onChange,
}) => {
+ const [_] = useTranslation();
return (
-
-
-
-
- {_('on port')}
-
-
+ <>
+
+
+ {_('on port')}
+
@@ -67,7 +63,7 @@ const SendMethodPart = ({
onChange={onChange}
/>
-
+ >
);
};
diff --git a/src/web/pages/alerts/severitychangedconditionpart.jsx b/src/web/pages/alerts/severitychangedconditionpart.jsx
index 56cdb27a6e..9b4f5a405c 100644
--- a/src/web/pages/alerts/severitychangedconditionpart.jsx
+++ b/src/web/pages/alerts/severitychangedconditionpart.jsx
@@ -17,9 +17,7 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
-import Divider from 'web/components/layout/divider';
+import Row from 'web/components/layout/row';
import PropTypes from 'web/utils/proptypes';
import withPrefix from 'web/utils/withPrefix';
@@ -27,6 +25,8 @@ import withPrefix from 'web/utils/withPrefix';
import Select from 'web/components/form/select';
import Radio from 'web/components/form/radio';
+import useTranslation from 'web/hooks/useTranslation';
+
const VALUE = 'Severity changed';
const SeverityChangedConditionPart = ({
@@ -35,8 +35,9 @@ const SeverityChangedConditionPart = ({
prefix,
onChange,
}) => {
+ const [_] = useTranslation();
return (
-
+
-
+
);
};
diff --git a/src/web/pages/alerts/severityleastconditionpart.jsx b/src/web/pages/alerts/severityleastconditionpart.jsx
index 47110cfa72..da858d11cb 100644
--- a/src/web/pages/alerts/severityleastconditionpart.jsx
+++ b/src/web/pages/alerts/severityleastconditionpart.jsx
@@ -17,9 +17,7 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
-import Divider from 'web/components/layout/divider';
+import Row from 'web/components/layout/row';
import PropTypes from 'web/utils/proptypes';
import withPrefix from 'web/utils/withPrefix';
@@ -27,6 +25,8 @@ import withPrefix from 'web/utils/withPrefix';
import Spinner from 'web/components/form/spinner';
import Radio from 'web/components/form/radio';
+import useTranslation from 'web/hooks/useTranslation';
+
const VALUE = 'Severity at least';
const SeverityLeastConditionPart = ({
@@ -35,8 +35,9 @@ const SeverityLeastConditionPart = ({
prefix,
onChange,
}) => {
+ const [_] = useTranslation();
return (
-
+
-
+
);
};
diff --git a/src/web/pages/alerts/smbmethodpart.jsx b/src/web/pages/alerts/smbmethodpart.jsx
index 8815f5aeff..6f107408a7 100644
--- a/src/web/pages/alerts/smbmethodpart.jsx
+++ b/src/web/pages/alerts/smbmethodpart.jsx
@@ -17,17 +17,11 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-import {_l} from 'gmp/locale/lang';
-
import {
SMB_CREDENTIAL_TYPES,
smb_credential_filter,
} from 'gmp/models/credential';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
@@ -39,12 +33,7 @@ import TextField from 'web/components/form/textfield';
import NewIcon from 'web/components/icon/newicon';
-const smbMaxProtocolItems = [
- {label: _l('Default'), value: ''},
- {label: 'NT1', value: 'NT1'},
- {label: 'SMB2', value: 'SMB2'},
- {label: 'SMB3', value: 'SMB3'},
-];
+import useTranslation from 'web/hooks/useTranslation';
const SmbMethodPart = ({
prefix,
@@ -60,8 +49,16 @@ const SmbMethodPart = ({
onCredentialChange,
}) => {
credentials = credentials.filter(smb_credential_filter);
+ const [_] = useTranslation();
+ const smbMaxProtocolItems = [
+ {label: _('Default'), value: ''},
+ {label: 'NT1', value: 'NT1'},
+ {label: 'SMB2', value: 'SMB2'},
+ {label: 'SMB3', value: 'SMB3'},
+ ];
+
return (
-
+ <>
{_(
@@ -72,23 +69,20 @@ const SmbMethodPart = ({
-
-
-
-
-
-
-
+
+
+
@@ -126,7 +120,7 @@ const SmbMethodPart = ({
onChange={onChange}
/>
-
+ >
);
};
diff --git a/src/web/pages/alerts/snmpmethodpart.jsx b/src/web/pages/alerts/snmpmethodpart.jsx
index 2864908a04..7fae5c48c9 100644
--- a/src/web/pages/alerts/snmpmethodpart.jsx
+++ b/src/web/pages/alerts/snmpmethodpart.jsx
@@ -17,16 +17,14 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import withPrefix from 'web/utils/withPrefix';
import FormGroup from 'web/components/form/formgroup';
import TextField from 'web/components/form/textfield';
+import useTranslation from 'web/hooks/useTranslation';
+
const SnmpMethodPart = ({
prefix,
snmpAgent,
@@ -34,11 +32,11 @@ const SnmpMethodPart = ({
snmpMessage,
onChange,
}) => {
+ const [_] = useTranslation();
return (
-
+ <>
-
+ >
);
};
diff --git a/src/web/pages/alerts/sourcefiremethodpart.jsx b/src/web/pages/alerts/sourcefiremethodpart.jsx
index bfaa3f6ce6..3135a80569 100644
--- a/src/web/pages/alerts/sourcefiremethodpart.jsx
+++ b/src/web/pages/alerts/sourcefiremethodpart.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {
PASSWORD_ONLY_CREDENTIAL_TYPE,
password_only_credential_filter,
@@ -39,6 +37,8 @@ import PropTypes from 'web/utils/proptypes';
import {renderSelectItems, UNSET_VALUE} from 'web/utils/render';
import withPrefix from 'web/utils/withPrefix';
+import useTranslation from 'web/hooks/useTranslation';
+
const SourcefireMethodPart = ({
credentials,
pkcs12Credential,
@@ -49,6 +49,7 @@ const SourcefireMethodPart = ({
onCredentialChange,
onNewCredentialClick,
}) => {
+ const [_] = useTranslation();
const credentialOptions = credentials.filter(password_only_credential_filter);
return (
diff --git a/src/web/pages/alerts/starttaskmethodpart.jsx b/src/web/pages/alerts/starttaskmethodpart.jsx
index 777852616b..5908bbfe25 100644
--- a/src/web/pages/alerts/starttaskmethodpart.jsx
+++ b/src/web/pages/alerts/starttaskmethodpart.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
import withPrefix from 'web/utils/withPrefix';
@@ -26,16 +24,21 @@ import withPrefix from 'web/utils/withPrefix';
import Select from 'web/components/form/select';
import FormGroup from 'web/components/form/formgroup';
-const StartTaskMethodPart = ({prefix, tasks, startTaskTask, onChange}) => (
-
-
-
-);
+import useTranslation from 'web/hooks/useTranslation';
+
+const StartTaskMethodPart = ({prefix, tasks, startTaskTask, onChange}) => {
+ const [_] = useTranslation();
+ return (
+
+
+
+ );
+};
StartTaskMethodPart.propTypes = {
prefix: PropTypes.string,
diff --git a/src/web/pages/alerts/taskeventpart.jsx b/src/web/pages/alerts/taskeventpart.jsx
index c6e18cb156..bee003c287 100644
--- a/src/web/pages/alerts/taskeventpart.jsx
+++ b/src/web/pages/alerts/taskeventpart.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {
EVENT_TYPE_TASK_RUN_STATUS_CHANGED,
isTaskEvent,
@@ -27,54 +25,60 @@ import {
import Radio from 'web/components/form/radio';
import Select from 'web/components/form/select';
-import Divider from 'web/components/layout/divider';
+import Row from 'web/components/layout/row';
import PropTypes from 'web/utils/proptypes';
import withPrefix from 'web/utils/withPrefix';
-const TaskEventPart = ({prefix, event, status, onChange, onEventChange}) => (
-
-
-
-
-);
+import useTranslation from 'web/hooks/useTranslation';
+
+const TaskEventPart = ({prefix, event, status, onChange, onEventChange}) => {
+ const [_] = useTranslation();
+ return (
+
+
+
+
+ );
+};
TaskEventPart.propTypes = {
event: PropTypes.string.isRequired,
diff --git a/src/web/pages/alerts/ticketeventpart.jsx b/src/web/pages/alerts/ticketeventpart.jsx
index 4967741398..26dc1afd65 100644
--- a/src/web/pages/alerts/ticketeventpart.jsx
+++ b/src/web/pages/alerts/ticketeventpart.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import {_} from 'gmp/locale/lang';
-
import {
EVENT_TYPE_TICKET_RECEIVED,
EVENT_TYPE_OWNED_TICKET_CHANGED,
@@ -27,34 +25,39 @@ import {
import Radio from 'web/components/form/radio';
+import Row from 'web/components/layout/row';
+
import PropTypes from 'web/utils/proptypes';
-import Divider from 'web/components/layout/divider';
+import useTranslation from 'web/hooks/useTranslation';
-const TicketEventPart = ({event, onEventChange}) => (
-
-
-
-
-
-);
+const TicketEventPart = ({event, onEventChange}) => {
+ const [_] = useTranslation();
+ return (
+
+
+
+
+
+ );
+};
TicketEventPart.propTypes = {
event: PropTypes.string.isRequired,
diff --git a/src/web/pages/alerts/tippingpointmethodpart.jsx b/src/web/pages/alerts/tippingpointmethodpart.jsx
index a385f8daef..20faab50fb 100644
--- a/src/web/pages/alerts/tippingpointmethodpart.jsx
+++ b/src/web/pages/alerts/tippingpointmethodpart.jsx
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {USERNAME_PASSWORD_CREDENTIAL_TYPE} from 'gmp/models/credential';
import {renderSelectItems} from 'web/utils/render';
@@ -34,8 +32,7 @@ import YesNoRadio from 'web/components/form/yesnoradio';
import NewIcon from 'web/components/icon/newicon';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
+import useTranslation from 'web/hooks/useTranslation';
const TIPPINGPOINT_CREDENTIAL_TYPES = [USERNAME_PASSWORD_CREDENTIAL_TYPE];
@@ -49,37 +46,34 @@ const TippingPointMethodPart = ({
onCredentialChange,
onNewCredentialClick,
}) => {
+ const [_] = useTranslation();
credentials = credentials.filter(
cred => cred.credential_type === USERNAME_PASSWORD_CREDENTIAL_TYPE,
);
return (
-
+ <>
-
-
-
-
-
-
-
+
+
+
-
+ >
);
};
diff --git a/src/web/pages/alerts/verinicemethodpart.jsx b/src/web/pages/alerts/verinicemethodpart.jsx
index a68b6ee32f..98b2892961 100644
--- a/src/web/pages/alerts/verinicemethodpart.jsx
+++ b/src/web/pages/alerts/verinicemethodpart.jsx
@@ -17,13 +17,8 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {USERNAME_PASSWORD_CREDENTIAL_TYPE} from 'gmp/models/credential';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
import withPrefix from 'web/utils/withPrefix';
@@ -34,6 +29,8 @@ import TextField from 'web/components/form/textfield';
import NewIcon from 'web/components/icon/newicon';
+import useTranslation from 'web/hooks/useTranslation';
+
const VERINICE_CREDENTIAL_TYPES = [USERNAME_PASSWORD_CREDENTIAL_TYPE];
const VeriniceMethodPart = ({
@@ -47,39 +44,36 @@ const VeriniceMethodPart = ({
onCredentialChange,
onNewCredentialClick,
}) => {
+ const [_] = useTranslation();
reportFormats = reportFormats.filter(format => format.extension === 'vna');
credentials = credentials.filter(
cred => cred.credential_type === USERNAME_PASSWORD_CREDENTIAL_TYPE,
);
return (
-
+ <>
-
-
-
-
-
-
-
+
+
+
@@ -90,7 +84,7 @@ const VeriniceMethodPart = ({
onChange={onChange}
/>
-
+ >
);
};