mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 08:50:18 +00:00
fix url malformed issue in entity popover and data insight detail page (#15402)
This commit is contained in:
parent
ce8a58c126
commit
bf9269fb7b
@ -47,7 +47,6 @@ import { getTagByFqn } from '../../../rest/tagAPI';
|
||||
import { getTestCaseByFqn } from '../../../rest/testAPI';
|
||||
import { getTopicByFqn } from '../../../rest/topicsAPI';
|
||||
import { getEntityName } from '../../../utils/EntityUtils';
|
||||
import { getDecodedFqn } from '../../../utils/StringsUtils';
|
||||
import { EntityUnion } from '../../Explore/ExplorePage.interface';
|
||||
import ExploreSearchCard from '../../ExploreV1/ExploreSearchCard/ExploreSearchCard';
|
||||
import { SearchedDataProps } from '../../SearchedData/SearchedData.interface';
|
||||
@ -65,7 +64,6 @@ export const PopoverContent: React.FC<{
|
||||
entityType: string;
|
||||
extraInfo?: React.ReactNode;
|
||||
}> = ({ entityFQN, entityType, extraInfo }) => {
|
||||
const decodedFqn = getDecodedFqn(entityFQN);
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const { cachedEntityData, updateCachedEntityData } =
|
||||
@ -82,7 +80,7 @@ export const PopoverContent: React.FC<{
|
||||
displayName: getEntityName(data),
|
||||
id: data.id ?? '',
|
||||
description: data.description ?? '',
|
||||
fullyQualifiedName: decodedFqn,
|
||||
fullyQualifiedName: entityFQN,
|
||||
tags: (data as Table)?.tags,
|
||||
entityType: entityType,
|
||||
serviceType: (data as Table)?.serviceType,
|
||||
@ -101,7 +99,7 @@ export const PopoverContent: React.FC<{
|
||||
|
||||
break;
|
||||
case EntityType.TEST_CASE:
|
||||
promise = getTestCaseByFqn(decodedFqn, {
|
||||
promise = getTestCaseByFqn(entityFQN, {
|
||||
fields: ['owner'],
|
||||
});
|
||||
|
||||
|
@ -45,7 +45,6 @@ import { getTestCaseByFqn, updateTestCaseById } from '../../../rest/testAPI';
|
||||
import { getFeedCounts } from '../../../utils/CommonUtils';
|
||||
import { checkPermission } from '../../../utils/PermissionsUtils';
|
||||
import { getIncidentManagerDetailPagePath } from '../../../utils/RouterUtils';
|
||||
import { getDecodedFqn } from '../../../utils/StringsUtils';
|
||||
import { showErrorToast } from '../../../utils/ToastUtils';
|
||||
import { IncidentManagerTabs } from '../IncidentManager.interface';
|
||||
import { TestCaseData } from './IncidentManagerDetailPage.interface';
|
||||
@ -61,11 +60,6 @@ const IncidentManagerDetailPage = () => {
|
||||
|
||||
const { fqn: testCaseFQN } = useFqn();
|
||||
|
||||
const decodedTestCaseFQN = useMemo(
|
||||
() => getDecodedFqn(testCaseFQN),
|
||||
[testCaseFQN]
|
||||
);
|
||||
|
||||
const [testCaseData, setTestCaseData] = useState<TestCaseData>({
|
||||
data: undefined,
|
||||
isLoading: true,
|
||||
@ -132,7 +126,7 @@ const IncidentManagerDetailPage = () => {
|
||||
const fetchTestCaseData = async () => {
|
||||
setTestCaseData((prev) => ({ ...prev, isLoading: true }));
|
||||
try {
|
||||
const response = await getTestCaseByFqn(decodedTestCaseFQN, {
|
||||
const response = await getTestCaseByFqn(testCaseFQN, {
|
||||
fields: [
|
||||
'testSuite',
|
||||
'testCaseResult',
|
||||
@ -177,7 +171,7 @@ const IncidentManagerDetailPage = () => {
|
||||
if (activeKey !== activeTab) {
|
||||
history.push(
|
||||
getIncidentManagerDetailPagePath(
|
||||
decodedTestCaseFQN,
|
||||
testCaseFQN,
|
||||
activeKey as IncidentManagerTabs
|
||||
)
|
||||
);
|
||||
@ -230,17 +224,17 @@ const IncidentManagerDetailPage = () => {
|
||||
}, []);
|
||||
|
||||
const getEntityFeedCount = useCallback(() => {
|
||||
getFeedCounts(EntityType.TEST_CASE, decodedTestCaseFQN, handleFeedCount);
|
||||
}, [decodedTestCaseFQN]);
|
||||
getFeedCounts(EntityType.TEST_CASE, testCaseFQN, handleFeedCount);
|
||||
}, [testCaseFQN]);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasViewPermission && decodedTestCaseFQN) {
|
||||
if (hasViewPermission && testCaseFQN) {
|
||||
fetchTestCaseData();
|
||||
getEntityFeedCount();
|
||||
} else {
|
||||
setTestCaseData((prev) => ({ ...prev, isLoading: false }));
|
||||
}
|
||||
}, [decodedTestCaseFQN, hasViewPermission]);
|
||||
}, [testCaseFQN, hasViewPermission]);
|
||||
|
||||
if (testCaseData.isLoading) {
|
||||
return <Loader />;
|
||||
|
Loading…
x
Reference in New Issue
Block a user