mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-14 10:19:51 +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'];
|
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) {
|
export default function CreateDomainModal({ visible, onClose, onCreate }: Props) {
|
||||||
const [stagedName, setStagedName] = useState('');
|
const [stagedName, setStagedName] = useState('');
|
||||||
@ -99,11 +97,7 @@ export default function CreateDomainModal({ visible, onClose, onCreate }: Props)
|
|||||||
message: 'Enter a Domain name.',
|
message: 'Enter a Domain name.',
|
||||||
},
|
},
|
||||||
{ whitespace: true },
|
{ whitespace: true },
|
||||||
{ min: 2, max: 50 },
|
{ min: 1, max: 50 },
|
||||||
{
|
|
||||||
pattern: USER_NAME_REGEX,
|
|
||||||
message: '',
|
|
||||||
},
|
|
||||||
]}
|
]}
|
||||||
hasFeedback
|
hasFeedback
|
||||||
>
|
>
|
||||||
|
|||||||
@ -9,8 +9,6 @@ type Props = {
|
|||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
onCreate: (name: string, description: string) => 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) {
|
export default function CreateGroupModal({ visible, onClose, onCreate }: Props) {
|
||||||
const [stagedName, setStagedName] = useState('');
|
const [stagedName, setStagedName] = useState('');
|
||||||
@ -86,10 +84,6 @@ export default function CreateGroupModal({ visible, onClose, onCreate }: Props)
|
|||||||
},
|
},
|
||||||
{ whitespace: true },
|
{ whitespace: true },
|
||||||
{ min: 1, max: 50 },
|
{ min: 1, max: 50 },
|
||||||
{
|
|
||||||
pattern: USER_NAME_REGEX,
|
|
||||||
message: '',
|
|
||||||
},
|
|
||||||
]}
|
]}
|
||||||
hasFeedback
|
hasFeedback
|
||||||
>
|
>
|
||||||
|
|||||||
@ -9,8 +9,6 @@ type Props = {
|
|||||||
onSubmit?: (source: SecretBuilderState, resetState: () => void) => void;
|
onSubmit?: (source: SecretBuilderState, resetState: () => void) => void;
|
||||||
onCancel?: () => 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) => {
|
export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }: Props) => {
|
||||||
const [secretBuilderState, setSecretBuilderState] = useState<SecretBuilderState>(initialState || {});
|
const [secretBuilderState, setSecretBuilderState] = useState<SecretBuilderState>(initialState || {});
|
||||||
@ -85,10 +83,6 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
|
|||||||
},
|
},
|
||||||
{ whitespace: true },
|
{ whitespace: true },
|
||||||
{ min: 1, max: 50 },
|
{ min: 1, max: 50 },
|
||||||
{
|
|
||||||
pattern: SECRET_NAME_ALPHANUMERIC,
|
|
||||||
message: '',
|
|
||||||
},
|
|
||||||
]}
|
]}
|
||||||
hasFeedback
|
hasFeedback
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user