@@ -221,7 +221,7 @@ const AddStep = React.memo(({ onClose }) => {
|
|||||||
ref={handleUsernameFieldRef}
|
ref={handleUsernameFieldRef}
|
||||||
name="username"
|
name="username"
|
||||||
value={data.username}
|
value={data.username}
|
||||||
maxLength={16}
|
maxLength={32}
|
||||||
readOnly={isSubmitting}
|
readOnly={isSubmitting}
|
||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ const EditUserUsernameStep = React.memo(({ id, onBack, onClose }) => {
|
|||||||
name="username"
|
name="username"
|
||||||
value={data.username}
|
value={data.username}
|
||||||
placeholder={username}
|
placeholder={username}
|
||||||
maxLength={16}
|
maxLength={32}
|
||||||
className={styles.field}
|
className={styles.field}
|
||||||
onChange={handleFieldChange}
|
onChange={handleFieldChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ export const isUrl = (string) =>
|
|||||||
export const isPassword = (string) => zxcvbn(string).score >= 2; // TODO: move to config
|
export const isPassword = (string) => zxcvbn(string).score >= 2; // TODO: move to config
|
||||||
|
|
||||||
export const isUsername = (string) =>
|
export const isUsername = (string) =>
|
||||||
string.length >= 3 && string.length <= 16 && USERNAME_REGEX.test(string);
|
string.length >= 3 && string.length <= 32 && USERNAME_REGEX.test(string);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
* username:
|
* username:
|
||||||
* type: string
|
* type: string
|
||||||
* minLength: 3
|
* minLength: 3
|
||||||
* maxLength: 16
|
* maxLength: 32
|
||||||
* pattern: "^[a-zA-Z0-9]+((_{1}|\\.|){1}[a-zA-Z0-9])*$"
|
* pattern: "^[a-zA-Z0-9]+((_{1}|\\.|){1}[a-zA-Z0-9])*$"
|
||||||
* nullable: true
|
* nullable: true
|
||||||
* description: Unique username for user identification
|
* description: Unique username for user identification
|
||||||
@@ -150,7 +150,7 @@ module.exports = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
isNotEmptyString: true,
|
isNotEmptyString: true,
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
maxLength: 16,
|
maxLength: 32,
|
||||||
regex: /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/,
|
regex: /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
* username:
|
* username:
|
||||||
* type: string
|
* type: string
|
||||||
* minLength: 3
|
* minLength: 3
|
||||||
* maxLength: 16
|
* maxLength: 32
|
||||||
* pattern: '^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$'
|
* pattern: '^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$'
|
||||||
* nullable: true
|
* nullable: true
|
||||||
* description: Unique username for user identification
|
* description: Unique username for user identification
|
||||||
@@ -93,7 +93,7 @@ module.exports = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
isNotEmptyString: true,
|
isNotEmptyString: true,
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
maxLength: 16,
|
maxLength: 32,
|
||||||
regex: /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/,
|
regex: /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
* username:
|
* username:
|
||||||
* type: string
|
* type: string
|
||||||
* minLength: 3
|
* minLength: 3
|
||||||
* maxLength: 32
|
* maxLength: 64
|
||||||
* pattern: "^[a-z0-9._-]*$"
|
* pattern: "^[a-z0-9._-]*$"
|
||||||
* nullable: true
|
* nullable: true
|
||||||
* description: Unique username for user identification
|
* description: Unique username for user identification
|
||||||
@@ -304,7 +304,7 @@ module.exports = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
isNotEmptyString: true,
|
isNotEmptyString: true,
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
maxLength: 32,
|
maxLength: 64,
|
||||||
regex: /^[a-z0-9._-]*$/,
|
regex: /^[a-z0-9._-]*$/,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const isPassword = (value) => zxcvbn(value).score >= 2; // TODO: move to config
|
|||||||
const isEmailOrUsername = (value) =>
|
const isEmailOrUsername = (value) =>
|
||||||
value.includes('@')
|
value.includes('@')
|
||||||
? validator.isEmail(value)
|
? validator.isEmail(value)
|
||||||
: value.length >= 3 && value.length <= 16 && USERNAME_REGEX.test(value);
|
: value.length >= 3 && value.length <= 32 && USERNAME_REGEX.test(value);
|
||||||
|
|
||||||
const isDueDate = (value) => moment(value, moment.ISO_8601, true).isValid();
|
const isDueDate = (value) => moment(value, moment.ISO_8601, true).isValid();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user