mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Revert create forms
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
InputField,
|
InputField,
|
||||||
SubmitButton,
|
SubmitButton,
|
||||||
Textarea,
|
Textarea,
|
||||||
Icon,
|
|
||||||
Checkbox
|
Checkbox
|
||||||
} from "@scm-manager/ui-components";
|
} from "@scm-manager/ui-components";
|
||||||
import type { Group, SelectValue } from "@scm-manager/ui-types";
|
import type { Group, SelectValue } from "@scm-manager/ui-types";
|
||||||
@@ -114,16 +113,9 @@ class GroupForm extends React.Component<Props, State> {
|
|||||||
if (this.isExistingGroup()) {
|
if (this.isExistingGroup()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label = group && group.external ? (
|
|
||||||
<>{t("group.external")} <Icon title={t("group.external")} name="sign-out-alt fa-rotate-270" /></>
|
|
||||||
) : (
|
|
||||||
<>{t("group.internal")} <Icon title={t("group.internal")} name="sign-in-alt fa-rotate-90" /></>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
label={label}
|
label={t("group.external")}
|
||||||
checked={group.external}
|
checked={group.external}
|
||||||
helpText={t("groupForm.help.externalHelpText")}
|
helpText={t("groupForm.help.externalHelpText")}
|
||||||
onChange={this.handleExternalChange}
|
onChange={this.handleExternalChange}
|
||||||
@@ -131,7 +123,7 @@ class GroupForm extends React.Component<Props, State> {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
isExistingGroup = () => !! this.props.group;
|
isExistingGroup = () => !!this.props.group;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loading, t } = this.props;
|
const { loading, t } = this.props;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import type { User } from "@scm-manager/ui-types";
|
|||||||
import {
|
import {
|
||||||
Subtitle,
|
Subtitle,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
Icon,
|
|
||||||
InputField,
|
InputField,
|
||||||
PasswordConfirmation,
|
PasswordConfirmation,
|
||||||
SubmitButton,
|
SubmitButton,
|
||||||
@@ -17,8 +16,6 @@ type Props = {
|
|||||||
submitForm: User => void,
|
submitForm: User => void,
|
||||||
user?: User,
|
user?: User,
|
||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
|
|
||||||
// context props
|
|
||||||
t: string => string
|
t: string => string
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -83,7 +80,6 @@ class UserForm extends React.Component<Props, State> {
|
|||||||
return (
|
return (
|
||||||
this.props.user.displayName === user.displayName &&
|
this.props.user.displayName === user.displayName &&
|
||||||
this.props.user.mail === user.mail &&
|
this.props.user.mail === user.mail &&
|
||||||
this.props.user.admin === user.admin &&
|
|
||||||
this.props.user.active === user.active
|
this.props.user.active === user.active
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -139,19 +135,6 @@ class UserForm extends React.Component<Props, State> {
|
|||||||
// edit existing user
|
// edit existing user
|
||||||
subtitle = <Subtitle subtitle={t("userForm.subtitle")} />;
|
subtitle = <Subtitle subtitle={t("userForm.subtitle")} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label =
|
|
||||||
user && user.active ? (
|
|
||||||
<>
|
|
||||||
{t("user.active")} <Icon title={t("user.active")} name="user" />
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{t("user.inactive")}{" "}
|
|
||||||
<Icon title={t("user.inactive")} name="user-slash" />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{subtitle}
|
{subtitle}
|
||||||
@@ -183,7 +166,7 @@ class UserForm extends React.Component<Props, State> {
|
|||||||
<div className="column">
|
<div className="column">
|
||||||
{passwordChangeField}
|
{passwordChangeField}
|
||||||
<Checkbox
|
<Checkbox
|
||||||
label={label}
|
label={t("user.active")}
|
||||||
onChange={this.handleActiveChange}
|
onChange={this.handleActiveChange}
|
||||||
checked={user ? user.active : false}
|
checked={user ? user.active : false}
|
||||||
helpText={t("help.activeHelpText")}
|
helpText={t("help.activeHelpText")}
|
||||||
|
|||||||
Reference in New Issue
Block a user