mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-03 04:10:43 +00:00
fix(ui): Fixing modal validations for multiple language support (#4673)
This commit is contained in:
parent
7db6b0a03f
commit
72046bf43d
@ -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
|
||||
>
|
||||
|
||||
@ -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
|
||||
>
|
||||
|
||||
@ -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
|
||||
>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user