mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
Make mail optional for user
This commit is contained in:
@@ -27,13 +27,13 @@ import { Links } from "./hal";
|
|||||||
export type DisplayedUser = {
|
export type DisplayedUser = {
|
||||||
id: string;
|
id: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
mail: string;
|
mail?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type User = {
|
export type User = {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
name: string;
|
name: string;
|
||||||
mail: string;
|
mail?: string;
|
||||||
password: string;
|
password: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
type?: string;
|
type?: string;
|
||||||
|
|||||||
@@ -113,8 +113,7 @@ class UserForm extends React.Component<Props, State> {
|
|||||||
this.editUserComponentsAreUnchanged() ||
|
this.editUserComponentsAreUnchanged() ||
|
||||||
this.state.mailValidationError ||
|
this.state.mailValidationError ||
|
||||||
this.state.displayNameValidationError ||
|
this.state.displayNameValidationError ||
|
||||||
this.isFalsy(user.displayName) ||
|
this.isFalsy(user.displayName)
|
||||||
this.isFalsy(user.mail)
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -152,6 +151,7 @@ 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")} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{subtitle}
|
{subtitle}
|
||||||
@@ -218,7 +218,7 @@ class UserForm extends React.Component<Props, State> {
|
|||||||
|
|
||||||
handleEmailChange = (mail: string) => {
|
handleEmailChange = (mail: string) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
mailValidationError: !validator.isMailValid(mail),
|
mailValidationError: !!mail && !validator.isMailValid(mail),
|
||||||
user: {
|
user: {
|
||||||
...this.state.user,
|
...this.state.user,
|
||||||
mail
|
mail
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ public class UserDto extends HalRepresentation {
|
|||||||
private String displayName;
|
private String displayName;
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private Instant lastModified;
|
private Instant lastModified;
|
||||||
@NotEmpty @Email
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@Email
|
||||||
private String mail;
|
private String mail;
|
||||||
@Pattern(regexp = ValidationUtil.REGEX_NAME)
|
@Pattern(regexp = ValidationUtil.REGEX_NAME)
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
Reference in New Issue
Block a user