fix(ui): Fixing modal validations for multiple language support (#4673)

This commit is contained in:
Shubham Thakre 2022-04-15 19:33:25 +02:00 committed by GitHub
parent 7db6b0a03f
commit 72046bf43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 19 deletions

View File

@ -22,8 +22,6 @@ type Props = {
};
const SUGGESTED_DOMAIN_NAMES = ['Engineering', 'Marketing', 'Sales', 'Product'];
/** Regex Validations */
export const USER_NAME_REGEX = new RegExp('^[a-zA-Z ]*$');
export default function CreateDomainModal({ visible, onClose, onCreate }: Props) {
const [stagedName, setStagedName] = useState('');
@ -99,11 +97,7 @@ export default function CreateDomainModal({ visible, onClose, onCreate }: Props)
message: 'Enter a Domain name.',
},
{ whitespace: true },
{ min: 2, max: 50 },
{
pattern: USER_NAME_REGEX,
message: '',
},
{ min: 1, max: 50 },
]}
hasFeedback
>

View File

@ -9,8 +9,6 @@ type Props = {
onClose: () => void;
onCreate: (name: string, description: string) => void;
};
/** Regex Validations */
export const USER_NAME_REGEX = new RegExp('^[a-zA-Z ]*$');
export default function CreateGroupModal({ visible, onClose, onCreate }: Props) {
const [stagedName, setStagedName] = useState('');
@ -86,10 +84,6 @@ export default function CreateGroupModal({ visible, onClose, onCreate }: Props)
},
{ whitespace: true },
{ min: 1, max: 50 },
{
pattern: USER_NAME_REGEX,
message: '',
},
]}
hasFeedback
>

View File

@ -9,8 +9,6 @@ type Props = {
onSubmit?: (source: SecretBuilderState, resetState: () => void) => void;
onCancel?: () => void;
};
/** Regex Validations */
export const SECRET_NAME_ALPHANUMERIC = new RegExp('^[a-zA-Z0-9_/]+(?:[w·-]*[a-zA-Z0-9/]+)*$');
export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }: Props) => {
const [secretBuilderState, setSecretBuilderState] = useState<SecretBuilderState>(initialState || {});
@ -85,10 +83,6 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
},
{ whitespace: true },
{ min: 1, max: 50 },
{
pattern: SECRET_NAME_ALPHANUMERIC,
message: '',
},
]}
hasFeedback
>