Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cde4e63f9 | ||
|
|
95738ee7d3 | ||
|
|
bb7cdf5dd4 | ||
|
|
253af55790 | ||
|
|
62c3cca9a7 | ||
|
|
b476a19b79 | ||
|
|
3379c65a87 |
@@ -8,7 +8,7 @@ import { withPopup } from '../../lib/popup';
|
||||
import { Input, Popup } from '../../lib/custom-ui';
|
||||
|
||||
import { useForm } from '../../hooks';
|
||||
import { isUsername } from '../../utils/validator';
|
||||
import { isPassword, isUsername } from '../../utils/validator';
|
||||
|
||||
import styles from './UserAddPopup.module.scss';
|
||||
|
||||
@@ -69,7 +69,7 @@ const UserAddStep = React.memo(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cleanData.password) {
|
||||
if (!cleanData.password || !isPassword(cleanData.password)) {
|
||||
passwordField.current.focus();
|
||||
return;
|
||||
}
|
||||
@@ -142,15 +142,19 @@ const UserAddStep = React.memo(
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
<div className={styles.text}>{t('common.password')}</div>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={passwordField}
|
||||
name="password"
|
||||
value={data.password}
|
||||
readOnly={isSubmitting}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
<div className={styles.field}>
|
||||
<Input.Password
|
||||
fluid
|
||||
ref={passwordField}
|
||||
name="password"
|
||||
value={data.password}
|
||||
readOnly={isSubmitting}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
<div className={styles.note}>
|
||||
{t('common.mustBeAtLeast6CharactersLongAndContainAtLeastOneLetterAndNumber')}
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.text}>{t('common.name')}</div>
|
||||
<Input
|
||||
fluid
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.note {
|
||||
font-size: 11px;
|
||||
margin-top: 4px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #444444;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -6,6 +6,8 @@ import remarkBreaks from 'remark-breaks';
|
||||
|
||||
import './Markdown.module.scss'; // FIXME: import as styles?
|
||||
|
||||
const ABSOLUTE_URL_REGEX = /^(?:https?:)?\/\//i;
|
||||
|
||||
const Markdown = React.memo(({ linkStopPropagation, ...props }) => {
|
||||
const handleLinkClick = useCallback((event) => {
|
||||
event.stopPropagation();
|
||||
@@ -16,25 +18,30 @@ const Markdown = React.memo(({ linkStopPropagation, ...props }) => {
|
||||
jsx-a11y/click-events-have-key-events,
|
||||
jsx-a11y/no-static-element-interactions,
|
||||
react/jsx-props-no-spreading */
|
||||
({ node, ...linkProps }) => <a {...linkProps} onClick={handleLinkClick} />,
|
||||
({ node, ...linkProps }) => (
|
||||
<a
|
||||
{...linkProps}
|
||||
rel={
|
||||
ABSOLUTE_URL_REGEX.test(linkProps.href) && linkProps.target === '_blank'
|
||||
? 'noreferrer'
|
||||
: undefined
|
||||
}
|
||||
onClick={linkStopPropagation ? handleLinkClick : undefined}
|
||||
/>
|
||||
),
|
||||
/* eslint-enable jsx-a11y/anchor-has-content,
|
||||
jsx-a11y/click-events-have-key-events,
|
||||
jsx-a11y/no-static-element-interactions,
|
||||
react/jsx-props-no-spreading */
|
||||
[handleLinkClick],
|
||||
[linkStopPropagation, handleLinkClick],
|
||||
);
|
||||
|
||||
let components;
|
||||
if (linkStopPropagation) {
|
||||
components = {
|
||||
a: linkRenderer,
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<ReactMarkdown
|
||||
{...props} // eslint-disable-line react/jsx-props-no-spreading
|
||||
components={components}
|
||||
components={{
|
||||
a: linkRenderer,
|
||||
}}
|
||||
remarkPlugins={[remarkGfm, remarkBreaks]}
|
||||
className="markdown-body"
|
||||
/>
|
||||
|
||||
@@ -2,7 +2,7 @@ const PASSWORD_REGEX = /^(?=.*[A-Za-z])(?=.*\d).+$/;
|
||||
const USERNAME_REGEX = /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/;
|
||||
|
||||
export const isPassword = (string) => {
|
||||
return string.length >= 3 && PASSWORD_REGEX.test(string);
|
||||
return string.length >= 6 && PASSWORD_REGEX.test(string);
|
||||
};
|
||||
|
||||
export const isUsername = (string) => {
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "planka",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "planka",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.6",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "planka",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.6",
|
||||
"private": true,
|
||||
"homepage": "https://plankanban.github.io/planka",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user