diff --git a/src/web/pages/audits/dialog.js b/src/web/pages/audits/dialog.js
index 4c09cad37b..6dd82bd07e 100644
--- a/src/web/pages/audits/dialog.js
+++ b/src/web/pages/audits/dialog.js
@@ -18,7 +18,7 @@
import React from 'react';
-import _ from 'gmp/locale';
+import styled from 'styled-components';
import {isDefined} from 'gmp/utils/identity';
import {selectSaveId} from 'gmp/utils/id';
@@ -39,7 +39,6 @@ import {
} from 'gmp/models/scanner';
import PropTypes from 'web/utils/proptypes';
-import withCapabilities from 'web/utils/withCapabilities';
import {renderSelectItems, UNSET_VALUE} from 'web/utils/render';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -54,12 +53,16 @@ import TextField from 'web/components/form/textfield';
import NewIcon from 'web/components/icon/newicon';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import AddResultsToAssetsGroup from 'web/pages/tasks/addresultstoassetsgroup';
import AutoDeleteReportsGroup from 'web/pages/tasks/autodeletereportsgroup';
+import useTranslation from 'web/hooks/useTranslation';
+import useCapabilities from 'web/utils/useCapabilities';
+
+const Title = styled.div`
+ flex-grow: 1;
+`;
+
const getScanner = (scanners, scanner_id) => {
if (!isDefined(scanners)) {
return undefined;
@@ -70,9 +73,14 @@ const getScanner = (scanners, scanner_id) => {
});
};
-const ScannerSelect = props => {
- const {changeAudit, isLoading, scannerId, scanners, onChange} = props;
-
+const ScannerSelect = ({
+ changeAudit,
+ isLoading,
+ scannerId,
+ scanners,
+ onChange,
+}) => {
+ const [_] = useTranslation();
return (
@@ -86,7 +86,6 @@ const FilterDialog = ({
name="term"
grow="1"
value={state.term}
- size="30"
onChange={onValueChange}
/>
@@ -99,7 +98,7 @@ const FilterDialog = ({
value={state.type}
/>
-
+ >
);
}}
diff --git a/src/web/pages/groups/dialog.js b/src/web/pages/groups/dialog.js
index 4db84a5cab..78094fc277 100644
--- a/src/web/pages/groups/dialog.js
+++ b/src/web/pages/groups/dialog.js
@@ -18,13 +18,9 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
import {map} from 'gmp/utils/array';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -34,16 +30,14 @@ import FormGroup from 'web/components/form/formgroup';
import MultiSelect from 'web/components/form/multiselect';
import TextField from 'web/components/form/textfield';
-const Dialog = ({
- allUsers,
- grant_full,
- group,
- title = _('New Group'),
- onClose,
- onSave,
-}) => {
+import useTranslation from 'web/hooks/useTranslation';
+
+const Dialog = ({allUsers, grant_full, group, title, onClose, onSave}) => {
+ const [_] = useTranslation();
const is_edit = isDefined(group);
+ title = title || _('New Group');
+
const userOptions = map(allUsers, user => ({
value: user.name,
label: user.name,
@@ -63,13 +57,11 @@ const Dialog = ({
>
{({values: state, onValueChange}) => {
return (
-
+ <>
@@ -78,7 +70,6 @@ const Dialog = ({
@@ -107,7 +98,7 @@ const Dialog = ({
/>
)}
-
+ >
);
}}
diff --git a/src/web/pages/hosts/dialog.js b/src/web/pages/hosts/dialog.js
index 5926676d5e..e130856cd0 100644
--- a/src/web/pages/hosts/dialog.js
+++ b/src/web/pages/hosts/dialog.js
@@ -17,12 +17,8 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
-import Layout from 'web/components/layout/layout';
-
import SaveDialog from 'web/components/dialog/savedialog';
import PropTypes from 'web/utils/proptypes';
@@ -30,9 +26,13 @@ import PropTypes from 'web/utils/proptypes';
import FormGroup from 'web/components/form/formgroup';
import TextField from 'web/components/form/textfield';
+import useTranslation from 'web/hooks/useTranslation';
+
const DEFAULTS = {name: '127.0.0.1', comment: ''};
-const HostsDialog = ({host, title = _('New Host'), onClose, onSave}) => {
+const HostsDialog = ({host, title, onClose, onSave}) => {
+ const [_] = useTranslation();
+ title = title || _('New Host');
return (
{
>
{({values: state, onValueChange}) => {
return (
-
+ <>
@@ -58,12 +56,10 @@ const HostsDialog = ({host, title = _('New Host'), onClose, onSave}) => {
-
+ >
);
}}
diff --git a/src/web/pages/ldap/dialog.js b/src/web/pages/ldap/dialog.js
index 4c883c891d..e13b001350 100644
--- a/src/web/pages/ldap/dialog.js
+++ b/src/web/pages/ldap/dialog.js
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -29,7 +27,7 @@ import FileField from 'web/components/form/filefield';
import FormGroup from 'web/components/form/formgroup';
import TextField from 'web/components/form/textfield';
-import Layout from 'web/components/layout/layout';
+import useTranslation from 'web/hooks/useTranslation';
const LdapDialog = ({
authdn = '',
@@ -39,6 +37,7 @@ const LdapDialog = ({
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
const uncontrolledValues = {
authdn,
enable,
@@ -54,17 +53,16 @@ const LdapDialog = ({
onSave={onSave}
>
{({values, onValueChange}) => (
-
-
-
-
+ <>
+
-
-
-
-
-
-
+
-
+
+ >
)}
);
diff --git a/src/web/pages/notes/dialog.js b/src/web/pages/notes/dialog.js
index 4c3045cb2b..684eeb6fbe 100644
--- a/src/web/pages/notes/dialog.js
+++ b/src/web/pages/notes/dialog.js
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
import {isEmpty} from 'gmp/utils/string';
@@ -43,8 +41,7 @@ import DateTime from 'web/components/date/datetime';
import SaveDialog from 'web/components/dialog/savedialog';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
+import Row from 'web/components/layout/row';
import PropTypes from 'web/utils/proptypes';
import {
@@ -64,6 +61,8 @@ import Radio from 'web/components/form/radio';
import Select from 'web/components/form/select';
import Spinner from 'web/components/form/spinner';
+import useTranslation from 'web/hooks/useTranslation';
+
const NoteDialog = ({
active = ACTIVE_YES_ALWAYS_VALUE,
days = DEFAULT_DAYS,
@@ -85,11 +84,14 @@ const NoteDialog = ({
tasks,
task_uuid,
text = '',
- title = _('New Note'),
+ title,
onClose,
onSave,
}) => {
- const is_edit = isDefined(note);
+ const [_] = useTranslation();
+ const isEdit = isDefined(note);
+
+ title = title || _('New Note');
const data = {
severity,
@@ -121,7 +123,7 @@ const NoteDialog = ({
>
{({values: state, onValueChange}) => {
return (
-
+ <>
{state.fixed && isDefined(oid) && (
{renderNvtName(oid, nvt_name)}
@@ -132,8 +134,8 @@ const NoteDialog = ({
{renderNvtName(state.oid, nvt_name)}
)}
- {is_edit && !state.fixed && (
-
+ {isEdit && !state.fixed && (
+
-
+
-
+
)}
- {!is_edit && !state.fixed && (
+ {!isEdit && !state.fixed && (
)}
-
-
+
+
- {is_edit && note.isActive() && isDefined(note.endTime) && (
-
+ {isEdit && note.isActive() && isDefined(note.endTime) && (
+
-
+
)}
-
-
+
+
{_('days')}
-
+
-
+
-
+
@@ -248,7 +249,7 @@ const NoteDialog = ({
value={ANY}
onChange={onValueChange}
/>
-
+
-
+
@@ -273,7 +274,7 @@ const NoteDialog = ({
onChange={onValueChange}
/>
{isDefined(severity) && (
-
+ <>
{severity > LOG_VALUE ? (
)}
-
+ >
)}
{!isDefined(severity) && (
-
+
0.0')}
@@ -313,7 +314,7 @@ const NoteDialog = ({
convert={parseFloat}
onChange={onValueChange}
/>
-
+
)}
@@ -325,7 +326,7 @@ const NoteDialog = ({
value=""
onChange={onValueChange}
/>
-
+
-
+
@@ -350,7 +351,7 @@ const NoteDialog = ({
value={RESULT_ANY}
onChange={onValueChange}
/>
-
+
)}
-
+
-
+ >
);
}}
diff --git a/src/web/pages/overrides/dialog.js b/src/web/pages/overrides/dialog.js
index 7395dbab23..672a52b174 100644
--- a/src/web/pages/overrides/dialog.js
+++ b/src/web/pages/overrides/dialog.js
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
import {parseFloat, parseYesNo, YES_VALUE, NO_VALUE} from 'gmp/parser';
@@ -41,9 +39,6 @@ import {
import DateTime from 'web/components/date/datetime';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import {
renderNvtName,
@@ -73,6 +68,10 @@ import TextArea from 'web/components/form/textarea';
import TextField from 'web/components/form/textfield';
import Select from 'web/components/form/select';
+import Row from 'web/components/layout/row';
+
+import useTranslation from 'web/hooks/useTranslation';
+
const OverrideDialog = ({
active = ACTIVE_YES_ALWAYS_VALUE,
custom_severity = NO_VALUE,
@@ -97,12 +96,15 @@ const OverrideDialog = ({
tasks,
task_uuid,
text = '',
- title = _('New Override'),
+ title,
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
const is_edit = isDefined(override);
+ title = title || _('New Override');
+
const data = {
active,
custom_severity,
@@ -167,7 +169,7 @@ const OverrideDialog = ({
>
{({values: state, onValueChange}) => {
return (
-
+ <>
{fixed && isDefined(oid) && (
{renderNvtName(oid, nvt_name)}
@@ -179,7 +181,7 @@ const OverrideDialog = ({
)}
{is_edit && !fixed && (
-
+
-
+
-
+
)}
{!is_edit && !fixed && (
)}
-
+
- {is_edit && override.isActive() && isDefined(override.endTime) && (
-
-
+ {is_edit &&
+ override.isActive() &&
+ isDefined(override.endTime) && (
+
-
-
- )}
-
+
+ )}
+
{_('days')}
-
+
-
+
-
-
-
-
+
+
-
+
-
-
-
-
+
+
@@ -319,31 +319,27 @@ const OverrideDialog = ({
value=""
onChange={onValueChange}
/>
- {isDefined(severity) && (
-
- {severity > 0 ? (
- ' + severityFormat(severity - 0.1)}
- checked={true}
- convert={parseFloat}
- value={severity}
- onChange={onValueChange}
- />
- ) : (
-
- )}
-
+ {isDefined(severity) && severity > 0 ? (
+ ' + severityFormat(severity - 0.1)}
+ checked={true}
+ convert={parseFloat}
+ value={severity}
+ onChange={onValueChange}
+ />
+ ) : (
+
)}
{!isDefined(severity) && (
-
+
0.0')}
@@ -360,43 +356,41 @@ const OverrideDialog = ({
convert={parseFloat}
onChange={onValueChange}
/>
-
+
)}
-
-
-
-
-
-
-
+
+
+
+
+
@@ -407,7 +401,7 @@ const OverrideDialog = ({
value={TASK_ANY}
onChange={onValueChange}
/>
-
+
-
+
@@ -433,7 +428,7 @@ const OverrideDialog = ({
value={RESULT_ANY}
onChange={onValueChange}
/>
-
+
)}
-
+
-
+ >
);
}}
diff --git a/src/web/pages/permissions/dialog.js b/src/web/pages/permissions/dialog.js
index 2966d38411..9e73036e6d 100644
--- a/src/web/pages/permissions/dialog.js
+++ b/src/web/pages/permissions/dialog.js
@@ -18,13 +18,13 @@
import React from 'react';
-import _ from 'gmp/locale';
+import Model from 'gmp/model';
import {isDefined} from 'gmp/utils/identity';
+import {split} from 'gmp/utils/string';
import PropTypes from 'web/utils/proptypes';
import {permissionDescription, renderSelectItems} from 'web/utils/render';
-import withCapabilities from 'web/utils/withCapabilities';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -33,11 +33,10 @@ import Radio from 'web/components/form/radio';
import Select from 'web/components/form/select';
import TextField from 'web/components/form/textfield';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-import Model from 'gmp/model';
+import Row from 'web/components/layout/row';
-import {split} from 'gmp/utils/string';
+import useCapabilities from 'web/utils/useCapabilities';
+import useTranslation from 'web/hooks/useTranslation';
const NEED_RESOURCE_ID = [
'Super',
@@ -118,7 +117,6 @@ const NEED_RESOURCE_ID = [
];
const PermissionDialog = ({
- capabilities,
comment = '',
fixedResource = false,
groupId,
@@ -132,12 +130,16 @@ const PermissionDialog = ({
roleId,
roles = [],
subjectType,
- title = _('New Permission'),
+ title,
userId,
users = [],
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
+ const capabilities = useCapabilities();
+
+ title = title || _('New Permission');
const permItems = [
{
value: 'Super',
@@ -210,13 +212,13 @@ const PermissionDialog = ({
}
return (
-
+ <>
@@ -226,71 +228,72 @@ const PermissionDialog = ({
name="comment"
value={state.comment}
grow="1"
- size="30"
onChange={onValueChange}
/>
-
-
- {capabilities.mayAccess('users') && (
-
-
-
-
- )}
- {capabilities.mayAccess('roles') && (
-
-
-
-
- )}
- {capabilities.mayAccess('groups') && (
-
-
-
-
- )}
-
+
+ {capabilities.mayAccess('users') && (
+
+
+
+
+ )}
+ {capabilities.mayAccess('roles') && (
+
+
+
+
+ )}
+ {capabilities.mayAccess('groups') && (
+
+
+
+
+ )}
{state.name === 'Super' && (
@@ -329,7 +332,7 @@ const PermissionDialog = ({
{permissionDescription(state.name, resource, subject)}
-
+ >
);
}}
@@ -337,7 +340,6 @@ const PermissionDialog = ({
};
PermissionDialog.propTypes = {
- capabilities: PropTypes.capabilities.isRequired,
comment: PropTypes.string,
fixedResource: PropTypes.bool,
groupId: PropTypes.id,
@@ -358,6 +360,6 @@ PermissionDialog.propTypes = {
onSave: PropTypes.func.isRequired,
};
-export default withCapabilities(PermissionDialog);
+export default PermissionDialog;
// vim: set ts=2 sw=2 tw=80:
diff --git a/src/web/pages/permissions/multipledialog.js b/src/web/pages/permissions/multipledialog.js
index cd68b2bccb..bd32fac8a9 100644
--- a/src/web/pages/permissions/multipledialog.js
+++ b/src/web/pages/permissions/multipledialog.js
@@ -20,12 +20,9 @@ import React from 'react';
import styled from 'styled-components';
-import _ from 'gmp/locale';
-
import {typeName, getEntityType} from 'gmp/utils/entitytype';
import PropTypes from 'web/utils/proptypes';
-import withCapabilities from 'web/utils/withCapabilities';
import {renderSelectItems} from 'web/utils/render';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -35,7 +32,10 @@ import Radio from 'web/components/form/radio';
import Select from 'web/components/form/select';
import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
+import Row from 'web/components/layout/row';
+
+import useCapabilities from 'web/utils/useCapabilities';
+import useTranslation from 'web/hooks/useTranslation';
export const CURRENT_RESOURCE_ONLY = '0';
export const INCLUDE_RELATED_RESOURCES = '1';
@@ -46,185 +46,184 @@ const EntityName = styled.div`
word-break: break-all;
`;
-const MultiplePermissionDialog = withCapabilities(
- ({
- capabilities,
- entityName = '',
- entityType = '',
+const MultiplePermissionDialog = ({
+ entityName = '',
+ entityType = '',
+ groupId,
+ groups = [],
+ id,
+ includeRelated = INCLUDE_RELATED_RESOURCES,
+ permission = 'read',
+ related = [],
+ roleId,
+ roles = [],
+ subjectType = 'user',
+ title,
+ userId,
+ users = [],
+ onChange,
+ onClose,
+ onSave,
+}) => {
+ const [_] = useTranslation();
+ const capabilities = useCapabilities();
+ const hasRelated = related.length > 0;
+
+ title = title || _('Create Permission');
+
+ const defaultValues = {
+ permission,
+ subjectType,
+ };
+
+ const values = {
+ includeRelated,
groupId,
- groups = [],
id,
- includeRelated = INCLUDE_RELATED_RESOURCES,
- permission = 'read',
- related = [],
+ entityType,
+ related,
roleId,
- roles = [],
- subjectType = 'user',
- title = _('Create Permission'),
userId,
- users = [],
- onChange,
- onClose,
- onSave,
- }) => {
- const hasRelated = related.length > 0;
-
- const defaultValues = {
- permission,
- subjectType,
- };
-
- const values = {
- includeRelated,
- groupId,
- id,
- entityType,
- related,
- roleId,
- userId,
- };
-
- const includeRelatedItems = [];
- if (hasRelated || includeRelated === INCLUDE_RELATED_RESOURCES) {
- includeRelatedItems.push({
- label: _('including related resources'),
- value: INCLUDE_RELATED_RESOURCES,
- });
- }
+ };
+ const includeRelatedItems = [];
+ if (hasRelated || includeRelated === INCLUDE_RELATED_RESOURCES) {
includeRelatedItems.push({
- label: _('for current resource only'),
- value: CURRENT_RESOURCE_ONLY,
+ label: _('including related resources'),
+ value: INCLUDE_RELATED_RESOURCES,
});
+ }
- if (hasRelated || includeRelated === RELATED_RESOURCES_ONLY) {
- includeRelatedItems.push({
- label: _('for related resources only'),
- value: RELATED_RESOURCES_ONLY,
- });
- }
+ includeRelatedItems.push({
+ label: _('for current resource only'),
+ value: CURRENT_RESOURCE_ONLY,
+ });
- return (
-
- {({values: state, onValueChange}) => {
- return (
-
-
-
+ if (hasRelated || includeRelated === RELATED_RESOURCES_ONLY) {
+ includeRelatedItems.push({
+ label: _('for related resources only'),
+ value: RELATED_RESOURCES_ONLY,
+ });
+ }
+
+ return (
+
+ {({values: state, onValueChange}) => {
+ return (
+ <>
+
+
+ {_('Permission')}
+
+
+ {capabilities.mayAccess('users') && (
+
+
+
+ )}
+
+ {capabilities.mayAccess('roles') && (
+
+
- {_('Permission')}
-
-
-
-
- {capabilities.mayAccess('users') && (
-
-
-
-
- )}
-
- {capabilities.mayAccess('roles') && (
-
-
-
-
- )}
-
- {capabilities.mayAccess('groups') && (
-
-
-
-
- )}
-
-
-
-
- {typeName(getEntityType(state))}
- {entityName}
-
-
-
- {hasRelated && (
-
- {state.related.map(rentity => (
- -
-
- {typeName(getEntityType(rentity))}
- {rentity.name}
-
-
- ))}
-
- )}
-
-
- );
- }}
-
- );
- },
-);
+
+ )}
+
+ {capabilities.mayAccess('groups') && (
+
+
+
+
+ )}
+
+
+ {typeName(getEntityType(state))}
+ {entityName}
+
+
+
+ {hasRelated && (
+
+ {state.related.map(rentity => (
+ -
+
+ {typeName(getEntityType(rentity))}
+ {rentity.name}
+
+
+ ))}
+
+ )}
+
+ >
+ );
+ }}
+
+ );
+};
MultiplePermissionDialog.propTypes = {
entityName: PropTypes.string,
diff --git a/src/web/pages/policies/dialog.js b/src/web/pages/policies/dialog.js
index 7f2c65e57c..c410b3fef4 100644
--- a/src/web/pages/policies/dialog.js
+++ b/src/web/pages/policies/dialog.js
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -27,15 +25,14 @@ import SaveDialog from 'web/components/dialog/savedialog';
import FormGroup from 'web/components/form/formgroup';
import TextField from 'web/components/form/textfield';
-import Layout from 'web/components/layout/layout';
+import useTranslation from 'web/hooks/useTranslation';
+
+const CreatePolicyDialog = ({comment = '', name, title, onClose, onSave}) => {
+ const [_] = useTranslation();
+
+ title = title || _('New Policy');
+ name = name || _('Unnamed');
-const CreatePolicyDialog = ({
- comment = '',
- name = _('Unnamed'),
- title = _('New Policy'),
- onClose,
- onSave,
-}) => {
const data = {
comment,
name,
@@ -49,13 +46,11 @@ const CreatePolicyDialog = ({
>
{({values: state, onValueChange}) => {
return (
-
+ <>
@@ -64,12 +59,10 @@ const CreatePolicyDialog = ({
-
+ >
);
}}
diff --git a/src/web/pages/portlists/dialog.js b/src/web/pages/portlists/dialog.js
index dc919cdd21..1ff318f68c 100644
--- a/src/web/pages/portlists/dialog.js
+++ b/src/web/pages/portlists/dialog.js
@@ -17,15 +17,10 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {NO_VALUE, YES_VALUE, parseYesNo} from 'gmp/parser';
import {isDefined} from 'gmp/utils/identity';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
import PropTypes from 'web/utils/proptypes';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -39,6 +34,10 @@ import NewIcon from 'web/components/icon/newicon';
import Section from 'web/components/section/section';
+import Row from 'web/components/layout/row';
+
+import useTranslation from 'web/hooks/useTranslation';
+
import PortRangesTable from './portrangestable';
const FROM_FILE = YES_VALUE;
@@ -48,19 +47,22 @@ const PortListsDialog = ({
comment = '',
from_file = NO_VALUE,
id,
- name = _('Unnamed'),
+ name,
port_list,
port_range = 'T:1-5,7,9,U:1-3,5,7,9',
port_ranges = [],
- title = _('New Port List'),
+ title,
onClose,
onNewPortRangeClick,
onTmpDeletePortRange,
onSave,
}) => {
- const is_edit = isDefined(port_list);
+ const [_] = useTranslation();
+ const isEdit = isDefined(port_list);
+ name = name || _('Unnamed');
+ title = title || _('New Port List');
- const newrangeicon = (
+ const newRangeIcon = (
{({values: state, onValueChange}) => {
return (
-
-
-
-
-
-
-
-
-
- {!is_edit && (
-
-
-
-
-
-
-
-
-
-
-
+ <>
+
+
+
+
+ {!isEdit && (
+
+
+
+
+
+
+
+
+
)}
- {is_edit && (
-
+ {isEdit && (
+
{isDefined(port_list) && (
)}
-
+ >
);
}}
diff --git a/src/web/pages/portlists/importdialog.js b/src/web/pages/portlists/importdialog.js
index 2ceaae21fb..c6cc66916a 100644
--- a/src/web/pages/portlists/importdialog.js
+++ b/src/web/pages/portlists/importdialog.js
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -26,9 +24,10 @@ 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';
+import useTranslation from 'web/hooks/useTranslation';
const ImportDialog = ({onClose, onSave}) => {
+ const [_] = useTranslation();
return (
{
>
{({onValueChange}) => {
return (
-
-
-
-
-
+
+
+
);
}}
@@ -55,5 +52,3 @@ ImportDialog.propTypes = {
};
export default ImportDialog;
-
-// vim: set ts=2 sw=2 tw=80:
diff --git a/src/web/pages/portlists/portrangedialog.js b/src/web/pages/portlists/portrangedialog.js
index 8bce67c250..2ccf9c09d6 100644
--- a/src/web/pages/portlists/portrangedialog.js
+++ b/src/web/pages/portlists/portrangedialog.js
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {parseInt} from 'gmp/parser';
import PropTypes from 'web/utils/proptypes';
@@ -29,17 +27,15 @@ import FormGroup from 'web/components/form/formgroup';
import Radio from 'web/components/form/radio';
import TextField from 'web/components/form/textfield';
-import Layout from 'web/components/layout/layout';
+import useTranslation from 'web/hooks/useTranslation';
const convertPort = value => (value === '' ? value : parseInt(value));
-const PortRangeDialog = ({
- id,
- port_type = 'tcp',
- title = _('New Port Range'),
- onClose,
- onSave,
-}) => {
+const PortRangeDialog = ({id, port_type = 'tcp', title, onClose, onSave}) => {
+ const [_] = useTranslation();
+
+ title = title || _('New Port Range');
+
const data = {
id,
port_range_start: '',
@@ -56,13 +52,11 @@ const PortRangeDialog = ({
>
{({values: state, onValueChange}) => {
return (
-
+ <>
@@ -72,14 +66,12 @@ const PortRangeDialog = ({
-
+
-
+ >
);
}}
diff --git a/src/web/pages/portlists/portrangestable.js b/src/web/pages/portlists/portrangestable.js
index c6bf496039..1a9a033c4d 100644
--- a/src/web/pages/portlists/portrangestable.js
+++ b/src/web/pages/portlists/portrangestable.js
@@ -17,8 +17,6 @@
*/
import React from 'react';
-import _ from 'gmp/locale';
-
import {isDefined} from 'gmp/utils/identity';
import PropTypes from 'web/utils/proptypes';
@@ -32,7 +30,10 @@ import TableHead from 'web/components/table/head';
import TableHeader from 'web/components/table/header';
import TableRow from 'web/components/table/row';
+import useTranslation from 'web/hooks/useTranslation';
+
const PortRangesTable = ({actions = true, portRanges, onDeleteClick}) => {
+ const [_] = useTranslation();
if (!isDefined(portRanges) || portRanges.length === 0) {
return _('No Port Ranges available');
}
diff --git a/src/web/pages/radius/dialog.js b/src/web/pages/radius/dialog.js
index 0d1ec8fbf6..6505087869 100644
--- a/src/web/pages/radius/dialog.js
+++ b/src/web/pages/radius/dialog.js
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -29,9 +27,10 @@ import FormGroup from 'web/components/form/formgroup';
import PasswordField from 'web/components/form/passwordfield';
import TextField from 'web/components/form/textfield';
-import Layout from 'web/components/layout/layout';
+import useTranslation from 'web/hooks/useTranslation';
const RadiusDialog = ({enable = false, radiushost = '', onClose, onSave}) => {
+ const [_] = useTranslation();
const uncontrolledValues = {
enable,
radiushost,
@@ -46,36 +45,35 @@ const RadiusDialog = ({enable = false, radiushost = '', onClose, onSave}) => {
onSave={onSave}
>
{({values, onValueChange}) => (
-
-
-
-
+ <>
+
-
+ >
)}
);
diff --git a/src/web/pages/reportconfigs/dialog.js b/src/web/pages/reportconfigs/dialog.js
index 252633d3d0..659e47aa4b 100644
--- a/src/web/pages/reportconfigs/dialog.js
+++ b/src/web/pages/reportconfigs/dialog.js
@@ -37,8 +37,6 @@ import MultiSelect from 'web/components/form/multiselect';
import Select from 'web/components/form/select';
import YesNoRadio from 'web/components/form/yesnoradio';
-import Layout from 'web/components/layout/layout';
-
import Table from 'web/components/table/table';
import TableBody from 'web/components/table/body';
import TableData from 'web/components/table/data';
@@ -56,7 +54,7 @@ const Param = ({
formats,
}) => {
const {name, type, min, max} = value;
- const field_value = data[name];
+ const fieldValue = data[name];
const formatOptions = map(formats, format => ({
label: format.name,
@@ -69,7 +67,7 @@ const Param = ({
);
@@ -80,7 +78,7 @@ const Param = ({
name={name}
min={min}
max={max}
- value={field_value}
+ value={fieldValue}
onChange={onPrefChange}
/>
);
@@ -89,7 +87,7 @@ const Param = ({
);
@@ -103,7 +101,7 @@ const Param = ({
);
@@ -112,23 +110,22 @@ const Param = ({
);
} else {
field = (
);
}
- const use_default_check = (
+ const useDefaultCheck = (
{name}
{field}
- {use_default_check}
+ {useDefaultCheck}
);
};
@@ -302,10 +299,9 @@ class Dialog extends React.Component {
>
{({values: state, onValueChange}) => {
return (
-
+ <>
- {isDefined(format_items) && format_items.length > 0 && (
+ {isDefined(format_items) && format_items.length > 0 ? (
- )}
- {(!isDefined(format_items) || format_items.length === 0) && (
+ ) : (
{_('No configurable report formats found.')}
)}
{isDefined(originalParamInfo) && originalParamInfo.length > 0 && (
- {_('Parameters')}
- )}
- {isDefined(originalParamInfo) && originalParamInfo.length > 0 && (
-
-
-
- {_('Name')}
- {_('Value')}
- {_('Default')}
-
-
-
- {originalParamInfo.map(param => {
- return (
+ <>
+ {_('Parameters')}
+
+
+
+ {_('Name')}
+ {_('Value')}
+ {_('Default')}
+
+
+
+ {originalParamInfo.map(param => (
- );
- })}
-
-
+ ))}
+
+
+ >
)}
-
+ >
);
}}
diff --git a/src/web/pages/reportformats/dialog.js b/src/web/pages/reportformats/dialog.js
index c6541f0d5b..bb321e5791 100644
--- a/src/web/pages/reportformats/dialog.js
+++ b/src/web/pages/reportformats/dialog.js
@@ -16,9 +16,7 @@
* along with this program. If not, see .
*/
-import React from 'react';
-
-import _ from 'gmp/locale';
+import React, {useCallback} from 'react';
import {isDefined, isArray, hasValue} from 'gmp/utils/identity';
import {map} from 'gmp/utils/array';
@@ -36,8 +34,6 @@ import MultiSelect from 'web/components/form/multiselect';
import Select from 'web/components/form/select';
import YesNoRadio from 'web/components/form/yesnoradio';
-import Layout from 'web/components/layout/layout';
-
import Table from 'web/components/table/table';
import TableBody from 'web/components/table/body';
import TableData from 'web/components/table/data';
@@ -45,6 +41,8 @@ import TableHeader from 'web/components/table/header';
import TableHead from 'web/components/table/head';
import TableRow from 'web/components/table/row';
+import useTranslation from 'web/hooks/useTranslation';
+
const ReportFormatListParam = ({formats, idList, name, onValueChange}) => {
const formatOptions = map(formats, format => ({
label: format.name,
@@ -119,8 +117,7 @@ const Param = ({data, value, onPrefChange}) => {
} else {
field = (
- {use_openvas_scan_config && (
-
-
-
+ {useOpenvasScanConfig && (
+ <>
+
+
{
onScanConfigChange(value);
}}
/>
-
+
-
+
-
+
-
+ >
)}
{capabilities.mayAccess('tags') &&
capabilities.mayCreate('tag') &&
showTagSelection && (
-
-
-
-
-
-
-
-
+
+
+
+
+
+
)}
-
+ >
);
}}
diff --git a/src/web/pages/tickets/createdialog.js b/src/web/pages/tickets/createdialog.js
index 179ea97f17..a326378c2c 100644
--- a/src/web/pages/tickets/createdialog.js
+++ b/src/web/pages/tickets/createdialog.js
@@ -17,45 +17,43 @@
*/
import React, {useState} from 'react';
-import _ from 'gmp/locale';
-
import SaveDialog from 'web/components/dialog/savedialog';
import FormGroup from 'web/components/form/formgroup';
import Select from 'web/components/form/select';
import TextArea from 'web/components/form/textarea';
-import Layout from 'web/components/layout/layout';
import useFormValidation from 'web/components/form/useFormValidation';
import useFormValues from 'web/components/form/useFormValues';
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
+import useTranslation from 'web/hooks/useTranslation';
+
import {createTicketRules as validationRules} from './validationrules';
const fieldsToValidate = ['note'];
const CreateTicketDialog = ({
resultId,
- title = _('Create new Ticket for Result'),
+ title,
userId,
users,
onClose,
onSave,
onUserIdChange,
}) => {
+ const [_] = useTranslation();
const [error, setError] = useState();
const [formValues, handleValueChange] = useFormValues({note: ''});
- const {hasError, errors, validate} = useFormValidation(
- validationRules,
- formValues,
- {
- onValidationSuccess: onSave,
- onValidationError: setError,
- fieldsToValidate,
- },
- );
+ const {errors, validate} = useFormValidation(validationRules, formValues, {
+ onValidationSuccess: onSave,
+ onValidationError: setError,
+ fieldsToValidate,
+ });
+
+ title = title || _('Create new Ticket for Result');
return (
{({values}) => (
-
+ <>
-
+ >
)}
);
diff --git a/src/web/pages/tickets/editdialog.js b/src/web/pages/tickets/editdialog.js
index 43b2f68c9e..082e29e3b8 100644
--- a/src/web/pages/tickets/editdialog.js
+++ b/src/web/pages/tickets/editdialog.js
@@ -17,14 +17,11 @@
*/
import React, {useState} from 'react';
-import _ from 'gmp/locale';
-
import {TICKET_STATUS, TICKET_STATUS_TRANSLATIONS} from 'gmp/models/ticket';
import SaveDialog from 'web/components/dialog/savedialog';
import FormGroup from 'web/components/form/formgroup';
-import Layout from 'web/components/layout/layout';
import Select from 'web/components/form/select';
import TextArea from 'web/components/form/textarea';
import useFormValidation from 'web/components/form/useFormValidation';
@@ -33,15 +30,12 @@ import useFormValues from 'web/components/form/useFormValues';
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
+import useTranslation from 'web/hooks/useTranslation';
+
import {editTicketRules as validationRules} from './validationrules';
const STATUS = [TICKET_STATUS.open, TICKET_STATUS.fixed, TICKET_STATUS.closed];
-const STATUS_ITEMS = STATUS.map(status => ({
- value: status,
- label: TICKET_STATUS_TRANSLATIONS[status],
-}));
-
const fieldsToValidate = ['openNote', 'closedNote', 'fixedNote'];
const EditTicketDialog = ({
@@ -49,13 +43,14 @@ const EditTicketDialog = ({
fixedNote = '',
openNote = '',
ticketId,
- title = _('Edit Ticket'),
+ title,
status,
userId,
users,
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
const [error, setError] = useState();
const [formValues, handleValueChange] = useFormValues({
ticketId,
@@ -65,15 +60,17 @@ const EditTicketDialog = ({
status,
userId,
});
- const {errors, hasError, validate} = useFormValidation(
- validationRules,
- formValues,
- {
- onValidationSuccess: onSave,
- onValidationError: setError,
- fieldsToValidate,
- },
- );
+ const {errors, validate} = useFormValidation(validationRules, formValues, {
+ onValidationSuccess: onSave,
+ onValidationError: setError,
+ fieldsToValidate,
+ });
+ const STATUS_ITEMS = STATUS.map(ticketStatus => ({
+ value: ticketStatus,
+ label: `${TICKET_STATUS_TRANSLATIONS[ticketStatus]}`,
+ }));
+
+ title = title || _('Edit Ticket');
return (
{({values}) => (
-
+ <>
-
+ >
)}
);
diff --git a/src/web/pages/users/confirmdeletedialog.js b/src/web/pages/users/confirmdeletedialog.js
index a8b2800196..8839326b4a 100644
--- a/src/web/pages/users/confirmdeletedialog.js
+++ b/src/web/pages/users/confirmdeletedialog.js
@@ -18,8 +18,6 @@
import React from 'react';
-import _ from 'gmp/locale';
-
import PropTypes from 'web/utils/proptypes';
import {renderSelectItems} from 'web/utils/render';
@@ -28,7 +26,7 @@ import SaveDialog from 'web/components/dialog/savedialog';
import FormGroup from 'web/components/form/formgroup';
import Select from 'web/components/form/select';
-import Layout from 'web/components/layout/layout';
+import useTranslation from 'web/hooks/useTranslation';
const ConfirmDeleteDialog = ({
deleteUsers = [],
@@ -38,6 +36,7 @@ const ConfirmDeleteDialog = ({
onClose,
onSave,
}) => {
+ const [_] = useTranslation();
let headline;
if (deleteUsers.length === 1) {
headline = _('User {{name}} will be deleted.', {name: deleteUsers[0].name});
@@ -76,7 +75,7 @@ const ConfirmDeleteDialog = ({
>
{({values: state, onValueChange}) => {
return (
-
+ <>
{headline}
{_(
@@ -92,7 +91,7 @@ const ConfirmDeleteDialog = ({
onChange={onValueChange}
/>
-
+ >
);
}}
@@ -111,4 +110,3 @@ ConfirmDeleteDialog.propTypes = {
export default ConfirmDeleteDialog;
// vim: set ts=2 sw=2 tw=80:
-
diff --git a/src/web/pages/users/dialog.js b/src/web/pages/users/dialog.js
index ddfc8f79f6..cbe402c69c 100644
--- a/src/web/pages/users/dialog.js
+++ b/src/web/pages/users/dialog.js
@@ -16,13 +16,7 @@
* along with this program. If not, see .
*/
-import React from 'react';
-import {connect} from 'react-redux';
-import {getUsername} from 'web/store/usersettings/selectors';
-
-import compose from 'web/utils/compose';
-
-import _ from 'gmp/locale';
+import React, {useState} from 'react';
import {isDefined} from 'gmp/utils/identity';
import {map} from 'gmp/utils/array';
@@ -37,7 +31,6 @@ import {
} from 'gmp/models/user';
import PropTypes from 'web/utils/proptypes';
-import withCapabilities from 'web/utils/withCapabilities';
import ConfirmationDialog from 'web/components/dialog/confirmationdialog';
import SaveDialog from 'web/components/dialog/savedialog';
@@ -48,362 +41,329 @@ import Radio from 'web/components/form/radio';
import MultiSelect from 'web/components/form/multiselect';
import TextField from 'web/components/form/textfield';
-import Divider from 'web/components/layout/divider';
-import Layout from 'web/components/layout/layout';
-
-class Dialog extends React.Component {
- constructor(...args) {
- super(...args);
-
- const {roleIds = []} = this.props;
-
- this.state = {
- confirmationDialogVisible: false,
- confirmationDialogVisibleSuperAdmin: false,
- noRoleConfirmed: false,
- roleIds,
- superAdminData: {},
- };
-
- this.closeConfirmationDialog = this.closeConfirmationDialog.bind(this);
- this.closeConfirmationDialogSuperAdmin =
- this.closeConfirmationDialogSuperAdmin.bind(this);
- this.openConfirmationDialogSuperAdmin =
- this.openConfirmationDialogSuperAdmin.bind(this);
- this.handleResumeClick = this.handleResumeClick.bind(this);
- this.handleResumeClickSuperAdmin =
- this.handleResumeClickSuperAdmin.bind(this);
- this.handleRoleIdsChange = this.handleRoleIdsChange.bind(this);
- this.handleSaveClick = this.handleSaveClick.bind(this);
- }
-
- openConfirmationDialog() {
- this.setState({confirmationDialogVisible: true});
- }
-
- closeConfirmationDialog() {
- this.setState({confirmationDialogVisible: false});
- }
-
- openConfirmationDialogSuperAdmin() {
- this.setState({confirmationDialogVisibleSuperAdmin: true});
- }
-
- closeConfirmationDialogSuperAdmin() {
- this.setState({confirmationDialogVisibleSuperAdmin: false});
- }
-
- handleResumeClick() {
- this.setState({noRoleConfirmed: true});
- this.closeConfirmationDialog();
- }
-
- handleResumeClickSuperAdmin(onSave) {
- this.closeConfirmationDialogSuperAdmin();
- return onSave(this.state.superAdminData);
- }
-
- handleRoleIdsChange(value) {
- this.setState({
- noRoleConfirmed: false,
- roleIds: value,
- });
- }
-
- handleSaveClick(onSave, userData) {
- const {roleIds, noRoleConfirmed} = this.state;
+import Row from 'web/components/layout/row';
+
+import useTranslation from 'web/hooks/useTranslation';
+import useUserName from 'web/utils/useUserName';
+import useCapabilities from 'web/utils/useCapabilities';
+
+const Dialog = ({
+ roleIds: initialRoleIds = [],
+ accessHosts = '',
+ comment = '',
+ groups,
+ groupIds = [],
+ hostsAllow = ACCESS_ALLOW_ALL,
+ name,
+ oldName,
+ password = '',
+ roles,
+ settings,
+ title,
+ user,
+ onClose,
+ onSave,
+}) => {
+ const [_] = useTranslation();
+ const [username] = useUserName();
+ const capabilities = useCapabilities();
+ const [confirmationDialogVisible, setConfirmationDialogVisible] =
+ useState(false);
+ const [
+ confirmationDialogVisibleSuperAdmin,
+ setConfirmationDialogVisibleSuperAdmin,
+ ] = useState(false);
+ const [noRoleConfirmed, setNoRoleConfirmed] = useState(false);
+ const [superAdminData, setSuperAdminData] = useState({});
+ const [roleIds, setRoleIds] = useState(initialRoleIds);
+
+ name = name || _('Unnamed');
+ title = title || _('New User');
+
+ const openConfirmationDialog = () => {
+ setConfirmationDialogVisible(true);
+ };
+
+ const closeConfirmationDialog = () => {
+ setConfirmationDialogVisible(false);
+ };
+
+ const openConfirmationDialogSuperAdmin = () => {
+ setConfirmationDialogVisibleSuperAdmin(true);
+ };
+
+ const closeConfirmationDialogSuperAdmin = () => {
+ setConfirmationDialogVisibleSuperAdmin(false);
+ };
+
+ const handleResumeClick = () => {
+ setNoRoleConfirmed(true);
+ closeConfirmationDialog();
+ };
+
+ const handleResumeClickSuperAdmin = () => {
+ closeConfirmationDialogSuperAdmin();
+ return onSave(superAdminData);
+ };
+
+ const handleRoleIdsChange = value => {
+ setNoRoleConfirmed(false);
+ setRoleIds(value);
+ };
+
+ const handleSaveClick = userData => {
if (roleIds.length > 0 || noRoleConfirmed) {
/*
* You reach this point, if you have at least one role in the user data
* or you have already confirmed that you want to save the user data
* without any role.
*/
- if (
- isDefined(this.props.user) &&
- this.props.username === this.props.user.name
- ) {
+ if (isDefined(user) && username === user.name) {
/*
* You reach this point only as a Super Admin, when you try to save your
* own personal user data. The confirmation dialog opens. The data can
* then be saved from the confirmation dialog, so we have to "return"
* after opening the confirmation dialog.
*/
- this.setState({superAdminData: userData});
- this.openConfirmationDialogSuperAdmin();
+ setSuperAdminData(userData);
+ openConfirmationDialogSuperAdmin();
return;
}
return onSave(userData);
}
- this.openConfirmationDialog();
- }
-
- render() {
- const {
- accessHosts = '',
- capabilities,
- comment = '',
- groups,
- groupIds = [],
- hostsAllow = ACCESS_ALLOW_ALL,
- name = _('Unnamed'),
- oldName,
- password = '',
- roles,
- settings,
- title = _('New User'),
- user,
- onClose,
- onSave,
- } = this.props;
-
- const {
- confirmationDialogVisible,
- confirmationDialogVisibleSuperAdmin,
- roleIds,
- } = this.state;
-
- const isEdit = isDefined(user);
-
- const data = {
- ...user,
- access_hosts: accessHosts,
- auth_method:
- isEdit && isDefined(user.authMethod)
- ? user.authMethod
- : AUTH_METHOD_PASSWORD,
- comment,
- group_ids: groupIds,
- groups,
- hosts_allow: hostsAllow,
- name,
- old_name: oldName,
- password,
- roles,
- };
-
- const controlledValues = {
- role_ids: roleIds,
- };
-
- const rolesOptions = map(roles, role => ({
- label: role.name,
- value: role.id,
- }));
-
- const groupsOptions = map(groups, group => ({
- label: group.name,
- value: group.id,
- }));
-
- const hasLdapEnabled = settings.get('method:ldap_connect').enabled;
- const hasRadiusEnabled = settings.get('method:radius_connect').enabled;
-
- return (
-
- this.handleSaveClick(onSave, userData)}
- defaultValues={data}
- >
- {({values: state, onValueChange}) => (
-
-
-
- ({
+ label: role.name,
+ value: role.id,
+ }));
+
+ const groupsOptions = map(groups, group => ({
+ label: group.name,
+ value: group.id,
+ }));
+
+ const hasLdapEnabled = settings.get('method:ldap_connect').enabled;
+ const hasRadiusEnabled = settings.get('method:radius_connect').enabled;
+
+ return (
+
+
+ {({values: state, onValueChange}) => (
+
+
+
+
+
+
+
+
+
+ {!isEdit && (
+
+
+
-
-
-
-
+
+ {hasLdapEnabled && (
+
-
-
- {!isEdit && (
-
-
-
-
-
-
- {hasLdapEnabled && (
-
- )}
- {hasRadiusEnabled && (
-
- )}
-
-
)}
-
- {isEdit && (
-
-
-
-
-
-
-
- {hasLdapEnabled && (
-
- )}
- {hasRadiusEnabled && (
-
- )}
-
-
+ {hasRadiusEnabled && (
+
)}
- {capabilities.mayAccess('roles') && (
-
-
-
+
+ )}
+
+ {isEdit && (
+
+
+
+
+
+
+ {hasLdapEnabled && (
+
)}
-
- {capabilities.mayAccess('groups') && (
-
-
-
+ {hasRadiusEnabled && (
+
)}
-
-
-
-
-
-
-
-
-
-
-
- {confirmationDialogVisibleSuperAdmin && (
- this.handleResumeClickSuperAdmin(onSave)}
+
+ )}
+ {capabilities.mayAccess('roles') && (
+
+
- )}
- {confirmationDialogVisible && (
-
+ )}
+
+ {capabilities.mayAccess('groups') && (
+
+
- )}
-
- )}
-
-
- );
- }
-}
+
+ )}
+
+
+
+
+
+
+
+
+ {confirmationDialogVisibleSuperAdmin && (
+
+ )}
+ {confirmationDialogVisible && (
+
+ )}
+
+ )}
+
+
+ );
+};
Dialog.propTypes = {
accessHosts: PropTypes.string,
@@ -413,7 +373,6 @@ Dialog.propTypes = {
AUTH_METHOD_PASSWORD,
AUTH_METHOD_RADIUS,
]),
- capabilities: PropTypes.capabilities.isRequired,
comment: PropTypes.string,
groupIds: PropTypes.array,
groups: PropTypes.array,
@@ -427,16 +386,10 @@ Dialog.propTypes = {
settings: PropTypes.settings.isRequired,
title: PropTypes.string,
user: PropTypes.model,
- username: PropTypes.string,
onClose: PropTypes.func.isRequired,
onSave: PropTypes.func.isRequired,
};
-const mapStateToProps = rootState => {
- const username = getUsername(rootState);
- return {username};
-};
-
-export default compose(withCapabilities, connect(mapStateToProps))(Dialog);
+export default Dialog;
// vim: set ts=2 sw=2 tw=80: