fixed issue for when classification has . in name the termCount was n… (#12729)

* fixed issue for when classification has . in name the termCount was not getting

* fix url encoding issues

* changes as per comments and sonar fix

* changes as per comments

* fixed issue for when classification has . in name and testcase and pytest issue

* checkstyle

---------

Co-authored-by: Ashish Gupta <ashish@getcollate.io>
This commit is contained in:
07Himank 2023-08-04 11:37:17 +05:30 committed by GitHub
parent c5e7a63fbb
commit cda004e35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 16 deletions

View File

@ -71,7 +71,7 @@ public class ClassificationRepository extends EntityRepository<Classification> {
}
private int getTermCount(Classification category) {
ListFilter filter = new ListFilter(Include.NON_DELETED).addQueryParam("parent", category.getName());
ListFilter filter = new ListFilter(Include.NON_DELETED).addQueryParam("parent", category.getFullyQualifiedName());
return daoCollection.tagDAO().listCount(filter);
}

View File

@ -25,6 +25,7 @@ import { reduceColorOpacity } from 'utils/CommonUtils';
import { getEncodedFqn } from 'utils/StringsUtils';
import { ReactComponent as IconTerm } from '../../../assets/svg/book.svg';
import { ReactComponent as PlusIcon } from '../../../assets/svg/plus-primary.svg';
import Fqn from '../../../utils/Fqn';
import { TagsV1Props } from './TagsV1.interface';
import './tagsV1.less';
@ -81,7 +82,7 @@ const TagsV1 = ({
tag.source === TagSource.Glossary
? history.push(`${ROUTES.GLOSSARY}/${getEncodedFqn(tag.tagFQN)}`)
: history.push(
`${ROUTES.TAGS}/${getEncodedFqn(tag.tagFQN.split('.')[0])}`
`${ROUTES.TAGS}/${getEncodedFqn(Fqn.split(tag.tagFQN)[0])}`
),
[tag.source, tag.tagFQN]
);

View File

@ -34,6 +34,7 @@ import { useHistory } from 'react-router-dom';
import { addTestCaseToLogicalTestSuite, createTestSuites } from 'rest/testAPI';
import { getCurrentUserId } from 'utils/CommonUtils';
import { getTestSuitePath } from 'utils/RouterUtils';
import { getEncodedFqn } from 'utils/StringsUtils';
import { showErrorToast } from 'utils/ToastUtils';
import AddTestSuiteForm from '../AddTestSuiteForm/AddTestSuiteForm';
@ -44,7 +45,11 @@ const TestSuiteStepper = () => {
const [testSuiteResponse, setTestSuiteResponse] = useState<TestSuite>();
const handleViewTestSuiteClick = () => {
history.push(getTestSuitePath(testSuiteResponse?.fullyQualifiedName ?? ''));
history.push(
getTestSuitePath(
getEncodedFqn(testSuiteResponse?.fullyQualifiedName ?? '')
)
);
};
const handleTestSuitNextClick = (data: TestSuite) => {

View File

@ -79,6 +79,7 @@ const PopoverContent: React.FC<{
break;
case EntityType.DASHBOARD:
case EntityType.CHART:
promise = getDashboardByFqn(entityFQN, fields);
break;
@ -103,7 +104,7 @@ const PopoverContent: React.FC<{
break;
case EntityType.GLOSSARY_TERM:
promise = getGlossaryTermByFQN(entityFQN, 'owner');
promise = getGlossaryTermByFQN(getDecodedFqn(entityFQN), 'owner');
break;
case EntityType.GLOSSARY:
@ -163,7 +164,7 @@ const PopoverContent: React.FC<{
displayName: getEntityName(entityData),
id: entityData.id ?? '',
description: entityData.description ?? '',
fullyQualifiedName: entityFQN,
fullyQualifiedName: getDecodedFqn(entityFQN),
tags: (entityData as Table).tags,
entityType: entityType,
serviceType: (entityData as Table).serviceType,

View File

@ -46,6 +46,7 @@ export enum EntityType {
DASHBOARD_DATA_MODEL = 'dashboardDataModel',
SUBSCRIPTION = 'subscription',
USER_NAME = 'username',
CHART = 'chart',
}
export enum AssetsType {

View File

@ -654,24 +654,26 @@ const ContainerPage = () => {
if (hasViewPermission) {
fetchContainerDetail(containerName);
}
}, [containerName, containerPermissions]);
}, [containerName, hasViewPermission]);
useEffect(() => {
fetchResourcePermission(containerName);
}, [containerName]);
useEffect(() => {
if (tab === EntityTabs.CHILDREN) {
if (tab === EntityTabs.CHILDREN && hasViewPermission) {
fetchContainerChildren(containerName);
}
}, [tab, containerName]);
}, [tab, containerName, hasViewPermission]);
useEffect(() => {
getEntityFeedCount();
}, [containerName]);
if (hasViewPermission) {
getEntityFeedCount();
}
}, [containerName, hasViewPermission]);
// Rendering
if (isLoading || !containerData) {
if (isLoading) {
return <Loader />;
}
@ -683,10 +685,14 @@ const ContainerPage = () => {
);
}
if (!hasViewPermission && !isLoading) {
if (!hasViewPermission) {
return <ErrorPlaceHolder type={ERROR_PLACEHOLDER_TYPE.PERMISSION} />;
}
if (!containerData) {
return <ErrorPlaceHolder />;
}
return (
<PageLayoutV1
className="bg-white"

View File

@ -1104,9 +1104,7 @@ const TagsPage = () => {
}
entityFQN={currentClassification.fullyQualifiedName}
entityId={currentClassification.id}
entityName={
currentClassification.fullyQualifiedName ?? ''
}
entityName={currentClassification.name}
entityType={EntityType.CLASSIFICATION}
extraDropdownContent={extraDropdownContent}
onEditDisplayName={handleUpdateDisplayName}

View File

@ -38,6 +38,7 @@ import {
patchTeamDetail,
} from 'rest/teamsAPI';
import { getUsers, updateUserDetail } from 'rest/userAPI';
import { getEncodedFqn } from 'utils/StringsUtils';
import AppState from '../../AppState';
import {
INITIAL_PAGING_VALUE,
@ -611,7 +612,7 @@ const TeamsPage = () => {
useEffect(() => {
if (currentTab === TeamsPageTab.USERS) {
getCurrentTeamUsers(selectedTeam.name, {}, false);
getCurrentTeamUsers(getEncodedFqn(selectedTeam.name), {}, false);
} else {
setUserPaging(pagingObject);
}