Skip to content

Commit

Permalink
fix(ui): Fixing modal validations for multiple language support (#4673)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamThakre authored Apr 15, 2022
1 parent 7db6b0a commit 72046bf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
8 changes: 1 addition & 7 deletions datahub-web-react/src/app/domain/CreateDomainModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down Expand Up @@ -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
>
Expand Down
6 changes: 0 additions & 6 deletions datahub-web-react/src/app/identity/group/CreateGroupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down Expand Up @@ -86,10 +84,6 @@ export default function CreateGroupModal({ visible, onClose, onCreate }: Props)
},
{ whitespace: true },
{ min: 1, max: 50 },
{
pattern: USER_NAME_REGEX,
message: '',
},
]}
hasFeedback
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {});
Expand Down Expand Up @@ -85,10 +83,6 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
},
{ whitespace: true },
{ min: 1, max: 50 },
{
pattern: SECRET_NAME_ALPHANUMERIC,
message: '',
},
]}
hasFeedback
>
Expand Down

0 comments on commit 72046bf

Please sign in to comment.