fixed issue allow user to add tag 64 character long (#6144)

This commit is contained in:
Shailesh Parmar 2022-07-18 15:09:09 +05:30 committed by GitHub
parent 78e41a66a6
commit ef495e1118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,6 +143,7 @@ const TagsPage = () => {
);
showErrorToast(errMsg);
setError(errMsg);
setCurrentCategory({ name } as TagCategory);
setIsLoading(false);
}
}
@ -163,8 +164,8 @@ const TagsPage = () => {
)
) {
errData['name'] = 'Name already exists';
} else if (data.name.length < 2 || data.name.length > 25) {
errData['name'] = 'Name size must be between 2 and 25';
} else if (data.name.length < 2 || data.name.length > 64) {
errData['name'] = 'Name size must be between 2 and 64';
} else if (!isUrlFriendlyName(data.name.trim())) {
errData['name'] = 'Special characters are not allowed';
}
@ -326,8 +327,8 @@ const TagsPage = () => {
)
) {
errData['name'] = 'Name already exists';
} else if (data.name.length < 2 || data.name.length > 25) {
errData['name'] = 'Name size must be between 2 and 25';
} else if (data.name.length < 2 || data.name.length > 64) {
errData['name'] = 'Name size must be between 2 and 64';
}
setErrorDataTag(errData);
@ -474,16 +475,14 @@ const TagsPage = () => {
};
return (
<>
{error ? (
<ErrorPlaceHolder>
<p className="tw-text-center tw-m-auto">{error}</p>
</ErrorPlaceHolder>
) : (
<PageContainerV1 className="tw-py-4">
<PageLayout leftPanel={fetchLeftPanel()}>
{isLoading ? (
<Loader />
) : error ? (
<ErrorPlaceHolder>
<p className="tw-text-center tw-m-auto">{error}</p>
</ErrorPlaceHolder>
) : (
<div
className="full-height"
@ -559,9 +558,7 @@ const TagsPage = () => {
<table className="tw-w-full" data-testid="table">
<thead>
<tr className="tableHead-row">
<th
className="tableHead-cell"
data-testid="heading-name">
<th className="tableHead-cell" data-testid="heading-name">
Name
</th>
<th
@ -657,8 +654,7 @@ const TagsPage = () => {
data: {
id: tag.id as string,
name: tag.name,
categoryName:
currentCategory.name,
categoryName: currentCategory.name,
isCategory: false,
status: 'waiting',
},
@ -666,14 +662,10 @@ const TagsPage = () => {
})
}>
{deleteTags.data?.id === tag.id ? (
deleteTags.data?.status ===
'success' ? (
deleteTags.data?.status === 'success' ? (
<FontAwesomeIcon icon="check" />
) : (
<Loader
size="small"
type="default"
/>
<Loader size="small" type="default" />
)
) : (
<SVGIcons
@ -693,9 +685,7 @@ const TagsPage = () => {
)
) : (
<tr className="tableBody-row">
<td
className="tableBody-cell tw-text-center"
colSpan={4}>
<td className="tableBody-cell tw-text-center" colSpan={4}>
No tags available.
</td>
</tr>
@ -775,8 +765,6 @@ const TagsPage = () => {
)}
</PageLayout>
</PageContainerV1>
)}
</>
);
};