UI Fixed issue Spaces in test suite name should not be allowed #7872 (#7876)

* Fixed issue Spaces in test suite name should not be allowed #7872

* Fixed redirection issue in click of view test suite

* addressing comments

* addressing comment
This commit is contained in:
Shailesh Parmar 2022-10-03 16:33:12 +05:30 committed by GitHub
parent 4f2fc4b9a5
commit e8c517748f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -129,7 +129,11 @@ const AddDataQualityTestV1: React.FC<AddDataQualityTestProps> = ({ table }) => {
const handleViewTestSuiteClick = () => {
history.push(
getTestSuitePath(selectedTestSuite?.data?.fullyQualifiedName || '')
getTestSuitePath(
selectedTestSuite?.data?.fullyQualifiedName ||
testSuiteData?.fullyQualifiedName ||
''
)
);
};

View File

@ -36,6 +36,7 @@ import {
} from '../../../constants/constants';
import { TestSuite } from '../../../generated/tests/testSuite';
import { useAuth } from '../../../hooks/authHooks';
import jsonData from '../../../jsons/en';
import SVGIcons, { Icons } from '../../../utils/SvgUtils';
import { showErrorToast } from '../../../utils/ToastUtils';
import RichTextEditor from '../../common/rich-text-editor/RichTextEditor';
@ -167,6 +168,10 @@ const SelectTestSuite: React.FC<SelectTestSuiteProps> = ({
required: isEmpty(form.getFieldValue('testSuiteId')),
message: 'Name is required!',
},
{
pattern: /^[A-Za-z0-9_]*$/g,
message: jsonData.label['special-character-error'],
},
{
validator: (_, value) => {
if (testSuites.some((suite) => suite.name === value)) {

View File

@ -200,6 +200,7 @@ const jsonData = {
'Once you delete this entity, it will be removed permanently.',
'email-confirmation':
'Please confirm your email, confirmation has been sent to your email',
'special-character-error': 'Special character is not allowed!',
},
message: {
'no-services': 'No services',