diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-database.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-database.svg new file mode 100644 index 00000000000..8e62c6c41d3 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-database.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider.tsx index 06618f2e4c3..de61952c41d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider.tsx @@ -108,14 +108,14 @@ const ActivityFeedProvider = ({ children, user }: Props) => { setLoading(true); const feedFilterType = filterType ?? FeedFilter.ALL; const userId = - entityType === EntityType.USER_NAME + entityType === EntityType.USER ? user : feedFilterType === FeedFilter.ALL ? undefined : currentUser?.id; const { data, paging } = await getAllFeeds( - entityType !== EntityType.USER_NAME && fqn + entityType !== EntityType.USER && fqn ? getEntityFeedLink(entityType, encodeURIComponent(fqn)) : undefined, after, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx index 0ed6f0fb22d..70706a1299a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component.tsx @@ -89,7 +89,7 @@ export const ActivityFeedTab = ({ } = useActivityFeedProvider(); const isUserEntity = useMemo( - () => entityType === EntityType.USER_NAME, + () => entityType === EntityType.USER, [entityType] ); @@ -202,7 +202,7 @@ export const ActivityFeedTab = ({ feedFilter: activeTab === 'mentions' ? FeedFilter.MENTIONS - : EntityType.USER_NAME === entityType + : EntityType.USER === entityType ? FeedFilter.OWNER : undefined, }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx index 6cc96045bc7..59a5dd7cb3f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx @@ -60,7 +60,8 @@ import TestSuiteIngestion from './TestSuiteIngestion'; const AddDataQualityTestV1: React.FC = ({ table, }: AddDataQualityTestProps) => { - const { entityTypeFQN, dashboardType } = useParams>(); + const { entityTypeFQN, dashboardType } = + useParams<{ entityTypeFQN: string; dashboardType: string }>(); const isColumnFqn = dashboardType === ProfilerDashboardType.COLUMN; const isTableFqn = dashboardType === ProfilerDashboardType.TABLE; const history = useHistory(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx index d4a65242c4b..e6d940b87b7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx @@ -52,7 +52,7 @@ const TestSuiteIngestion: React.FC = ({ testSuite, onCancel, }) => { - const { ingestionFQN } = useParams>(); + const { ingestionFQN } = useParams<{ ingestionFQN: string }>(); const history = useHistory(); const { t } = useTranslation(); const [ingestionData, setIngestionData] = useState< diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx index 595cf7e9a38..c8c852bec61 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx @@ -51,7 +51,8 @@ const TestCaseForm: React.FC = ({ table, }) => { const history = useHistory(); - const { entityTypeFQN, dashboardType } = useParams>(); + const { entityTypeFQN, dashboardType } = + useParams<{ entityTypeFQN: string; dashboardType: string }>(); const decodedEntityFQN = getDecodedFqn(entityTypeFQN); const isColumnFqn = dashboardType === ProfilerDashboardType.COLUMN; const [form] = Form.useForm(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ClassificationDetails/ClassificationDetails.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ClassificationDetails/ClassificationDetails.tsx index 0e2f9e1047f..f3bc92d392f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ClassificationDetails/ClassificationDetails.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ClassificationDetails/ClassificationDetails.tsx @@ -107,7 +107,7 @@ function ClassificationDetails({ }: ClassificationDetailsProps) { const { permissions } = usePermissionProvider(); const { t } = useTranslation(); - const { tagCategoryName } = useParams>(); + const { fqn: tagCategoryName } = useParams<{ fqn: string }>(); const history = useHistory(); const currentVersion = useMemo( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ContainerVersion/ContainerVersion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ContainerVersion/ContainerVersion.component.tsx index a4d4b685118..faa18114898 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ContainerVersion/ContainerVersion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ContainerVersion/ContainerVersion.component.tsx @@ -14,7 +14,6 @@ import { Col, Row, Space, Tabs, TabsProps } from 'antd'; import classNames from 'classnames'; import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import DataAssetsVersionHeader from 'components/DataAssets/DataAssetsVersionHeader/DataAssetsVersionHeader'; import EntityVersionTimeLine from 'components/Entity/EntityVersionTimeLine/EntityVersionTimeLine'; @@ -24,11 +23,7 @@ import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2'; import VersionTable from 'components/VersionTable/VersionTable.component'; import { getVersionPathWithTab } from 'constants/constants'; import { EntityField } from 'constants/Feeds.constants'; -import { - ChangeDescription, - Column, - Container, -} from 'generated/entity/data/container'; +import { ChangeDescription, Column } from 'generated/entity/data/container'; import { TagSource } from 'generated/type/tagLabel'; import { cloneDeep, toString } from 'lodash'; import React, { useEffect, useMemo, useState } from 'react'; @@ -81,9 +76,7 @@ const ContainerVersion: React.FC = ({ ); const columns = useMemo(() => { - const colList = cloneDeep( - (currentVersionData as Container).dataModel?.columns - ); + const colList = cloneDeep(currentVersionData.dataModel?.columns); return getColumnsDataWithVersionChanges( changeDescription, @@ -199,9 +192,7 @@ const ContainerVersion: React.FC = ({ children: ( { const { entityTypeFQN } = useParams<{ entityTypeFQN: EntityType }>(); const history = useHistory(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx index 85dd4c49119..79e162d6230 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx @@ -56,7 +56,6 @@ import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils'; import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils'; import ActivityThreadPanel from '../ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; import { CustomPropertyTable } from '../common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from '../common/CustomPropertyTable/CustomPropertyTable.interface'; import { ModalWithMarkdownEditor } from '../Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor'; import { usePermissionProvider } from '../PermissionProvider/PermissionProvider'; import { ResourceEntity } from '../PermissionProvider/PermissionProvider.interface'; @@ -83,8 +82,8 @@ const DashboardDetails = ({ }: DashboardDetailsProps) => { const { t } = useTranslation(); const history = useHistory(); - const { dashboardFQN, tab: activeTab = EntityTabs.DETAILS } = - useParams<{ dashboardFQN: string; tab: EntityTabs }>(); + const { fqn: dashboardFQN, tab: activeTab = EntityTabs.DETAILS } = + useParams<{ fqn: string; tab: EntityTabs }>(); const { postFeed, deleteFeed, updateFeed } = useActivityFeedProvider(); const [isEdit, setIsEdit] = useState(false); @@ -290,7 +289,10 @@ const DashboardDetails = ({ await onDashboardUpdate(updatedData, 'displayName'); }; const onExtensionUpdate = async (updatedData: Dashboard) => { - await onDashboardUpdate(updatedData, 'extension'); + await onDashboardUpdate( + { ...dashboardDetails, extension: updatedData.extension }, + 'extension' + ); }; const handleRestoreDashboard = async () => { @@ -707,9 +709,6 @@ const DashboardDetails = ({ key: EntityTabs.CUSTOM_PROPERTIES, children: ( = ({ bordered columns={tableColumn} data-testid="schema-table" - dataSource={(currentVersionData as Dashboard)?.charts} + dataSource={currentVersionData?.charts} pagination={false} rowKey="id" size="small" @@ -226,9 +224,7 @@ const DashboardVersion: FC = ({ children: ( (); + const { fqn: dashboardDataModelFQN, tab: activeTab } = + useParams<{ fqn: string; tab: EntityTabs }>(); const [isEditDescription, setIsEditDescription] = useState(false); const [threadLink, setThreadLink] = useState(''); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineage.component.tsx index 38c2e629ba7..adedb325970 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineage.component.tsx @@ -90,7 +90,6 @@ import { getNewLineageConnectionDetails, getNewNodes, getPaginatedChildMap, - getParamByEntityType, getRemovedNodeData, getSelectedEdgeArr, getUniqueFlowElements, @@ -205,12 +204,11 @@ const EntityLineageComponent: FunctionComponent = ({ nodesPerLayer: 50, }); - const params = useParams>(); + const { fqn: entityFQN } = useParams<{ fqn: string }>(); const queryParams = new URLSearchParams(location.search); const isFullScreen = queryParams.get('fullscreen') === 'true'; - const entityFQN = - params[getParamByEntityType(entityType)] ?? params['entityFQN']; + const history = useHistory(); const onFullScreenClick = useCallback(() => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TopicSummary/TopicSummary.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TopicSummary/TopicSummary.component.tsx index 49b4111e29a..fd4222f64e3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TopicSummary/TopicSummary.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TopicSummary/TopicSummary.component.tsx @@ -30,7 +30,7 @@ import { showErrorToast } from 'utils/ToastUtils'; import { SummaryEntityType } from '../../../../enums/EntitySummary.enum'; import { TagLabel, Topic } from '../../../../generated/entity/data/topic'; import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils'; -import { bytesToSize } from '../../../../utils/StringsUtils'; +import { bytesToSize, getEncodedFqn } from '../../../../utils/StringsUtils'; import { getConfigObject } from '../../../../utils/TopicDetailsUtils'; import { TopicConfigObjectInterface } from '../../../TopicDetails/TopicDetails.interface'; import SummaryList from '../SummaryList/SummaryList.component'; @@ -84,10 +84,10 @@ function TopicSummary({ const fetchExtraTopicInfo = useCallback(async () => { try { - const res = await getTopicByFqn(entityDetails.fullyQualifiedName ?? '', [ - 'tags', - 'owner', - ]); + const res = await getTopicByFqn( + getEncodedFqn(entityDetails.fullyQualifiedName ?? ''), + ['tags', 'owner'] + ); const { partitions, messageSchema } = res; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx index 1c2bfd610ab..06506a8097d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx @@ -54,7 +54,6 @@ import { getEntityVoteStatus } from 'utils/EntityUtils'; import { getGlossaryPath, getGlossaryPathWithAction, - getGlossaryTermsPath, getGlossaryTermsVersionsPath, getGlossaryVersionsPath, } from 'utils/RouterUtils'; @@ -90,8 +89,8 @@ const GlossaryHeader = ({ const history = useHistory(); const USER_ID = getCurrentUserId(); - const { glossaryName: glossaryFqn, version } = useParams<{ - glossaryName: string; + const { fqn, version } = useParams<{ + fqn: string; version: string; }>(); const { showModal } = useEntityExportModalProvider(); @@ -110,8 +109,8 @@ const GlossaryHeader = ({ const fetchCurrentGlossaryInfo = async () => { try { const res = isGlossary - ? await getGlossariesById(glossaryFqn) - : await getGlossaryTermsById(glossaryFqn); + ? await getGlossariesById(fqn) + : await getGlossaryTermsById(fqn); setLatestGlossaryData(res); } catch (error) { @@ -130,7 +129,7 @@ const GlossaryHeader = ({ const handleAddGlossaryTermClick = useCallback(() => { onAddGlossaryTerm(!isGlossary ? (selectedData as GlossaryTerm) : undefined); - }, [glossaryFqn]); + }, [fqn]); const handleGlossaryImport = () => history.push( @@ -143,9 +142,7 @@ const GlossaryHeader = ({ const handleVersionClick = async () => { let path: string; if (isVersionView) { - path = isGlossary - ? getGlossaryPath(latestGlossaryData?.fullyQualifiedName) - : getGlossaryTermsPath(latestGlossaryData?.fullyQualifiedName ?? ''); + path = getGlossaryPath(latestGlossaryData?.fullyQualifiedName); } else { path = isGlossary ? getGlossaryVersionsPath( @@ -402,61 +399,59 @@ const GlossaryHeader = ({ /> -
-
- {createButtons} +
+ {createButtons} - - {updateVote && ( - - )} + + {updateVote && ( + + )} - {selectedData && selectedData.version && ( - - )} + 'text-primary': version, + })}> + {toString(selectedData.version)} + + + )} - {!isVersionView && ( - - - - - - )} - -
+ {!isVersionView && ( + + + + + + )} +
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.component.tsx index e1adccea01e..9f711647a03 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.component.tsx @@ -13,14 +13,17 @@ import { Col, Row, Tabs } from 'antd'; import { AssetSelectionModal } from 'components/Assets/AssetsSelectionModal/AssetSelectionModal'; +import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; import { EntityDetailsObjectInterface } from 'components/Explore/explore.interface'; import GlossaryHeader from 'components/Glossary/GlossaryHeader/GlossaryHeader.component'; import GlossaryTermTab from 'components/Glossary/GlossaryTermTab/GlossaryTermTab.component'; import { OperationPermission } from 'components/PermissionProvider/PermissionProvider.interface'; +import TabsLabel from 'components/TabsLabel/TabsLabel.component'; import { VotingDataProps } from 'components/Voting/voting.interface'; import { getGlossaryTermDetailsPath } from 'constants/constants'; import { EntityField } from 'constants/Feeds.constants'; import { myDataSearchIndex } from 'constants/Mydata.constants'; +import { EntityTabs, EntityType } from 'enums/entity.enum'; import { GlossaryTerm } from 'generated/entity/data/glossaryTerm'; import { ChangeDescription } from 'generated/entity/type'; import { t } from 'i18next'; @@ -66,10 +69,10 @@ const GlossaryTermsV1 = ({ isVersionView, }: Props) => { const { - glossaryName: glossaryFqn, + fqn: glossaryFqn, tab, version, - } = useParams<{ glossaryName: string; tab: string; version: string }>(); + } = useParams<{ fqn: string; tab: string; version: string }>(); const history = useHistory(); const assetTabRef = useRef(null); const [assetModalVisible, setAssetModelVisible] = useState(false); @@ -87,6 +90,13 @@ const GlossaryTermsV1 = ({ }); }; + const onExtensionUpdate = async (updatedTable: GlossaryTerm) => { + await handleGlossaryTermUpdate({ + ...glossaryTerm, + extension: updatedTable.extension, + }); + }; + const tabItems = useMemo(() => { const items = [ { @@ -154,6 +164,28 @@ const GlossaryTermsV1 = ({ }, ] : []), + { + label: ( + + ), + key: EntityTabs.CUSTOM_PROPERTIES, + children: ( + + ), + }, ]; return items; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.test.tsx index 9c2029433b3..00a0888d216 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/GlossaryTermsV1.test.tsx @@ -81,11 +81,12 @@ describe('Test Glossary-term component', () => { expect(await screen.findByText('GlossaryTermTab')).toBeInTheDocument(); expect(glossaryTerm).toBeInTheDocument(); - expect(tabs).toHaveLength(3); + expect(tabs).toHaveLength(4); expect(tabs.map((tab) => tab.textContent)).toStrictEqual([ 'label.overview', 'label.glossary-term-plural0', - 'label.asset-plural1', // 1 added as its count for assets + 'label.asset-plural0', // 1 added as its count for assets + 'label.custom-property-plural', ]); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryVersion/GlossaryVersion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryVersion/GlossaryVersion.component.tsx index c494ba867a2..c06a89b2fee 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryVersion/GlossaryVersion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryVersion/GlossaryVersion.component.tsx @@ -40,8 +40,11 @@ interface GlossaryVersionProps { const GlossaryVersion = ({ isGlossary = false }: GlossaryVersionProps) => { const history = useHistory(); - const { glossaryName, version } = - useParams<{ glossaryName: string; version: string }>(); + const { + fqn: glossaryName, + version, + tab = 'overview', + } = useParams<{ fqn: string; version: string; tab: string }>(); const [versionList, setVersionList] = useState( {} as EntityHistory ); @@ -74,7 +77,7 @@ const GlossaryVersion = ({ isGlossary = false }: GlossaryVersionProps) => { const onVersionChange = (selectedVersion: string) => { const path = isGlossary ? getGlossaryVersionsPath(glossaryName, selectedVersion) - : getGlossaryTermsVersionsPath(glossaryName, selectedVersion); + : getGlossaryTermsVersionsPath(glossaryName, selectedVersion, tab); history.push(path); }; @@ -90,7 +93,7 @@ const GlossaryVersion = ({ isGlossary = false }: GlossaryVersionProps) => { return ( -
+
{/* TODO: Need to implement version component for Glossary */} = ({ const { t } = useTranslation(); const history = useHistory(); const { postFeed, deleteFeed, updateFeed } = useActivityFeedProvider(); - const { mlModelFqn, tab: activeTab } = - useParams<{ tab: EntityTabs; mlModelFqn: string }>(); + const { fqn: mlModelFqn, tab: activeTab } = + useParams<{ tab: EntityTabs; fqn: string }>(); const [isEdit, setIsEdit] = useState(false); const [feedCount, setFeedCount] = useState(0); @@ -497,9 +496,6 @@ const MlModelDetail: FC = ({ key: EntityTabs.CUSTOM_PROPERTIES, children: ( = ({ /> - {(currentVersionData as Mlmodel).mlFeatures && - (currentVersionData as Mlmodel).mlFeatures?.length ? ( + {currentVersionData.mlFeatures?.length ? ( @@ -312,9 +310,7 @@ const MlModelVersion: FC = ({ children: ( = ({ children: ( = ({ children: ( ({ - useParams: jest.fn().mockImplementation(() => ({ datasetFQN: mockFQN })), + useParams: jest.fn().mockImplementation(() => ({ fqn: mockFQN })), })); jest.mock('rest/tableAPI'); jest.mock('../../ProfilerDashboard/component/ProfilerLatestValue', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx index fb795907cb6..737639f6772 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx @@ -39,7 +39,7 @@ const TableProfilerChart = ({ dateRangeObject, entityFqn = '', }: TableProfilerChartProps) => { - const { datasetFQN } = useParams<{ datasetFQN: string }>(); + const { fqn: datasetFQN } = useParams<{ fqn: string }>(); const { t } = useTranslation(); const [rowCountMetrics, setRowCountMetrics] = useState( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.test.tsx index 738e93dca19..6360599af48 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.test.tsx @@ -39,7 +39,7 @@ jest.mock('react-router-dom', () => ({ .fn() .mockImplementation(({ children }) => {children}), useParams: jest.fn().mockReturnValue({ - datasetFQN: 'sample_data.ecommerce_db.shopify.dim_address', + fqn: 'sample_data.ecommerce_db.shopify.dim_address', }), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx index 953734af217..c40a479e5eb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx @@ -119,7 +119,7 @@ const TableProfilerV1: FC = ({ return searchData as { activeTab: string; activeColumnFqn: string }; }, [location.search, isTourOpen]); - const { datasetFQN } = useParams<{ datasetFQN: string }>(); + const { fqn: datasetFQN } = useParams<{ fqn: string }>(); const [table, setTable] = useState(); const { profile, columns } = useMemo(() => { return { profile: table?.profile, columns: table?.columns || [] }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/QueryCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/QueryCard.tsx index 3ac02471370..e0e83cca89f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/QueryCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/QueryCard.tsx @@ -51,7 +51,7 @@ const QueryCard: FC = ({ afterDeleteAction, }: QueryCardProp) => { const { t } = useTranslation(); - const { datasetFQN } = useParams<{ datasetFQN: string }>(); + const { fqn: datasetFQN } = useParams<{ fqn: string }>(); const location = useLocation(); const history = useHistory(); const { onCopyToClipBoard } = useClipboard(query.query); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/TableQueries.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/TableQueries.tsx index f1157e6fea8..4b68fa54525 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/TableQueries.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableQueries/TableQueries.tsx @@ -66,7 +66,7 @@ const TableQueries: FC = ({ }: TableQueriesProp) => { const { t } = useTranslation(); const location = useLocation(); - const { datasetFQN } = useParams<{ datasetFQN: string }>(); + const { fqn: datasetFQN } = useParams<{ fqn: string }>(); const history = useHistory(); const searchParams = useMemo(() => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableVersion/TableVersion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableVersion/TableVersion.component.tsx index 9074291f1fd..eea8f880f50 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableVersion/TableVersion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableVersion/TableVersion.component.tsx @@ -14,7 +14,6 @@ import { Col, Row, Space, Tabs, TabsProps } from 'antd'; import classNames from 'classnames'; import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import DataAssetsVersionHeader from 'components/DataAssets/DataAssetsVersionHeader/DataAssetsVersionHeader'; import EntityVersionTimeLine from 'components/Entity/EntityVersionTimeLine/EntityVersionTimeLine'; @@ -35,7 +34,6 @@ import { ChangeDescription, Column, ColumnJoins, - Table, } from '../../generated/entity/data/table'; import { getPartialNameFromTableFQN } from '../../utils/CommonUtils'; import { @@ -82,7 +80,7 @@ const TableVersion: React.FC = ({ ); const columns = useMemo(() => { - const colList = cloneDeep((currentVersionData as Table).columns); + const colList = cloneDeep(currentVersionData.columns); return getColumnsDataWithVersionChanges(changeDescription, colList); }, [currentVersionData, changeDescription]); @@ -169,10 +167,8 @@ const TableVersion: React.FC = ({ columns={columns} deletedColumnConstraintDiffs={deletedColumnConstraintDiffs} deletedTableConstraintDiffs={deletedTableConstraintDiffs} - joins={(currentVersionData as Table).joins as ColumnJoins[]} - tableConstraints={ - (currentVersionData as Table).tableConstraints - } + joins={currentVersionData.joins as ColumnJoins[]} + tableConstraints={currentVersionData.tableConstraints} /> @@ -208,9 +204,7 @@ const TableVersion: React.FC = ({ children: ( = ({ }: TopicDetailsProps) => { const { t } = useTranslation(); const { postFeed, deleteFeed, updateFeed } = useActivityFeedProvider(); - const { topicFQN, tab: activeTab = EntityTabs.SCHEMA } = - useParams<{ topicFQN: string; tab: EntityTabs }>(); + const { fqn: topicFQN, tab: activeTab = EntityTabs.SCHEMA } = + useParams<{ fqn: string; tab: EntityTabs }>(); const history = useHistory(); const [isEdit, setIsEdit] = useState(false); const [threadLink, setThreadLink] = useState(''); @@ -113,7 +112,10 @@ const TopicDetails: React.FC = ({ await onTopicUpdate(updatedData, 'displayName'); }; const onExtensionUpdate = async (updatedData: Topic) => { - await onTopicUpdate(updatedData, 'extension'); + await onTopicUpdate( + { ...topicDetails, extension: updatedData.extension }, + 'extension' + ); }; const onThreadLinkSelect = (link: string, threadType?: ThreadType) => { @@ -430,7 +432,6 @@ const TopicDetails: React.FC = ({ key: EntityTabs.CUSTOM_PROPERTIES, children: ( = ({ children: ( ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Users/UsersProfile/UserProfileDetails/UserProfileDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Users/UsersProfile/UserProfileDetails/UserProfileDetails.component.tsx index c35d23b7685..f04824058f3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Users/UsersProfile/UserProfileDetails/UserProfileDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Users/UsersProfile/UserProfileDetails/UserProfileDetails.component.tsx @@ -41,7 +41,7 @@ const UserProfileDetails = ({ updateUserDetails, }: UserProfileDetailsProps) => { const { t } = useTranslation(); - const { username } = useParams<{ [key: string]: string }>(); + const { fqn: username } = useParams<{ fqn: string }>(); const { isAdminUser } = useAuth(); const { authConfig } = useAuthContext(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.interface.ts index 30f5d443f6f..fb9350774e4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.interface.ts @@ -12,6 +12,9 @@ */ import { Container } from 'generated/entity/data/container'; +import { Database } from 'generated/entity/data/database'; +import { DatabaseSchema } from 'generated/entity/data/databaseSchema'; +import { GlossaryTerm } from 'generated/entity/data/glossaryTerm'; import { SearchIndex } from 'generated/entity/data/searchIndex'; import { StoredProcedure } from 'generated/entity/data/storedProcedure'; import { EntityType } from '../../../enums/entity.enum'; @@ -21,20 +24,27 @@ import { Pipeline } from '../../../generated/entity/data/pipeline'; import { Table } from '../../../generated/entity/data/table'; import { Topic } from '../../../generated/entity/data/topic'; -export type EntityDetails = Table & - Topic & - Dashboard & - Pipeline & - Mlmodel & - Container & - SearchIndex & - StoredProcedure; +export type ExtentionEntities = { + [EntityType.TABLE]: Table; + [EntityType.TOPIC]: Topic; + [EntityType.DASHBOARD]: Dashboard; + [EntityType.PIPELINE]: Pipeline; + [EntityType.MLMODEL]: Mlmodel; + [EntityType.CONTAINER]: Container; + [EntityType.SEARCH_INDEX]: SearchIndex; + [EntityType.STORED_PROCEDURE]: StoredProcedure; + [EntityType.GLOSSARY_TERM]: GlossaryTerm; + [EntityType.DATABASE]: Database; + [EntityType.DATABASE_SCHEMA]: DatabaseSchema; +}; -export interface CustomPropertyProps { +export type ExtentionEntitiesKeys = keyof ExtentionEntities; + +export interface CustomPropertyProps { isVersionView?: boolean; - entityDetails: EntityDetails; - entityType: EntityType; - handleExtensionUpdate?: (updatedTable: EntityDetails) => Promise; + entityType: T; + entityDetails?: ExtentionEntities[T]; + handleExtensionUpdate?: (updatedTable: ExtentionEntities[T]) => Promise; hasEditAccess: boolean; className?: string; hasPermission: boolean; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.test.tsx index 6a4729b77d8..ba2520ff3a5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.test.tsx @@ -21,7 +21,6 @@ import React from 'react'; import { getTypeByFQN } from 'rest/metadataTypeAPI'; import { EntityType } from '../../../enums/entity.enum'; import { CustomPropertyTable } from './CustomPropertyTable'; -import { EntityDetails } from './CustomPropertyTable.interface'; const mockCustomProperties = [ { @@ -81,11 +80,20 @@ jest.mock('antd', () => ({ Skeleton: jest.fn().mockImplementation(() =>
Skeleton.loader
), })); -const mockTableDetails = {} as EntityDetails; +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useParams: jest.fn().mockImplementation(() => ({ + fqn: 'fqn', + })), +})); + +jest.mock('utils/CustomProperties/CustomProperty.utils', () => ({ + getEntityExtentionDetailsFromEntityType: jest.fn(), +})); + const handleExtensionUpdate = jest.fn(); const mockProp = { - entityDetails: mockTableDetails, handleExtensionUpdate, entityType: EntityType.TABLE, hasEditAccess: true, @@ -95,7 +103,13 @@ const mockProp = { describe('Test CustomProperty Table Component', () => { it("Should render permission placeholder if doesn't have permission", async () => { await act(async () => { - render(); + render( + + ); }); const permissionPlaceholder = await screen.findByText( 'ErrorPlaceHolder.component' @@ -106,7 +120,9 @@ describe('Test CustomProperty Table Component', () => { it('Should render table component', async () => { await act(async () => { - render(); + render( + + ); }); const table = await screen.findByTestId('custom-properties-table'); @@ -126,7 +142,9 @@ describe('Test CustomProperty Table Component', () => { Promise.resolve({ customProperties: [] }) ); await act(async () => { - render(); + render( + + ); }); const noDataPlaceHolder = await screen.findByText( 'ErrorPlaceHolder.component' @@ -137,7 +155,7 @@ describe('Test CustomProperty Table Component', () => { it('Loader should be shown while loading the custom properties', async () => { (getTypeByFQN as jest.Mock).mockResolvedValueOnce(Promise.resolve({})); - render(); + render(); // To check if loader was rendered when the loading state was true and then removed after loading is false await waitForElementToBeRemoved(() => screen.getByText('Skeleton.loader')); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx index bb10ea2c432..8ce8b615bb6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx @@ -24,9 +24,11 @@ import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum'; import { EntityType } from 'enums/entity.enum'; import { ChangeDescription } from 'generated/tests/testCase'; import { isEmpty, isUndefined } from 'lodash'; -import React, { FC, useEffect, useMemo, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { useParams } from 'react-router-dom'; import { getTypeByFQN } from 'rest/metadataTypeAPI'; +import { getEntityExtentionDetailsFromEntityType } from 'utils/CustomProperties/CustomProperty.utils'; import { getEntityName } from 'utils/EntityUtils'; import { getChangedEntityNewValue, @@ -39,27 +41,45 @@ import ErrorPlaceHolder from '../error-with-placeholder/ErrorPlaceHolder'; import Table from '../Table/Table'; import { CustomPropertyProps, - EntityDetails, + ExtentionEntities, + ExtentionEntitiesKeys, } from './CustomPropertyTable.interface'; import { ExtensionTable } from './ExtensionTable'; import { PropertyValue } from './PropertyValue'; -export const CustomPropertyTable: FC = ({ - entityDetails, +export const CustomPropertyTable = ({ handleExtensionUpdate, entityType, hasEditAccess, className, isVersionView, hasPermission, -}) => { + entityDetails, +}: CustomPropertyProps) => { const { t } = useTranslation(); const { getEntityPermissionByFqn } = usePermissionProvider(); + const [extentionDetails, setExtentionDetails] = + useState(); const [entityTypeDetail, setEntityTypeDetail] = useState({} as Type); const [entityTypeDetailLoading, setEntityTypeDetailLoading] = useState(false); + const { fqn } = useParams<{ fqn: string; tab: string; version: string }>(); + + const fetchExtentiondetails = async () => { + const response = await getEntityExtentionDetailsFromEntityType( + entityType, + fqn + ); + + setExtentionDetails(response as ExtentionEntities[T]); + }; + + useEffect(() => { + fetchExtentiondetails(); + }, [fqn]); const [typePermission, setPermission] = useState(); + const versionDetails = entityDetails ?? extentionDetails; const fetchTypeDetail = async () => { setEntityTypeDetailLoading(true); @@ -94,23 +114,26 @@ export const CustomPropertyTable: FC = ({ } }; - const onExtensionUpdate = async ( - updatedExtension: CustomPropertyProps['entityDetails']['extension'] - ) => { - if (!isUndefined(handleExtensionUpdate)) { - await handleExtensionUpdate({ - ...entityDetails, - extension: updatedExtension, - }); - } - }; + const onExtensionUpdate = useCallback( + async (updatedExtension: ExtentionEntities[T]) => { + if (!isUndefined(handleExtensionUpdate) && versionDetails) { + const updatedData = { + ...versionDetails, + extension: updatedExtension, + }; + await handleExtensionUpdate(updatedData); + setExtentionDetails(updatedData); + } + }, + [versionDetails] + ); const extensionObject: { - extensionObject: EntityDetails['extension']; + extensionObject: ExtentionEntities[T]; addedKeysList?: string[]; } = useMemo(() => { if (isVersionView) { - const changeDescription = entityDetails.changeDescription; + const changeDescription = versionDetails?.changeDescription; const extensionDiff = getDiffByFieldName( EntityField.EXTENSION, changeDescription as ChangeDescription @@ -122,19 +145,19 @@ export const CustomPropertyTable: FC = ({ const addedFields = JSON.parse(newValues ? newValues : [])[0]; if (addedFields) { return { - extensionObject: entityDetails.extension, + extensionObject: versionDetails?.extension, addedKeysList: Object.keys(addedFields), }; } } - if (extensionDiff.updated) { - return getUpdatedExtensionDiffFields(entityDetails, extensionDiff); + if (versionDetails && extensionDiff.updated) { + return getUpdatedExtensionDiffFields(versionDetails, extensionDiff); } } - return { extensionObject: entityDetails.extension }; - }, [isVersionView, entityDetails]); + return { extensionObject: versionDetails?.extension }; + }, [isVersionView, versionDetails]); const tableColumn: ColumnsType = useMemo(() => { return [ @@ -163,7 +186,7 @@ export const CustomPropertyTable: FC = ({ }, ]; }, [ - entityDetails.extension, + versionDetails?.extension, hasEditAccess, extensionObject, isVersionView, @@ -194,7 +217,7 @@ export const CustomPropertyTable: FC = ({ if ( isEmpty(entityTypeDetail.customProperties) && - isUndefined(entityDetails.extension) + isUndefined(versionDetails?.extension) ) { return (
@@ -210,8 +233,8 @@ export const CustomPropertyTable: FC = ({ } return isEmpty(entityTypeDetail.customProperties) && - !isUndefined(entityDetails.extension) ? ( - + !isUndefined(versionDetails?.extension) ? ( + ) : (
{ const { t } = useTranslation(); const dataSource: ExtensionDataSource[] = useMemo(() => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx index 3c4893cfb53..d9a1233f808 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx @@ -11,6 +11,7 @@ * limitations under the License. */ +import Icon from '@ant-design/icons'; import { Typography } from 'antd'; import { ReactComponent as EditIconComponent } from 'assets/svg/edit-new.svg'; import { t } from 'i18next'; @@ -32,15 +33,6 @@ interface Props { hasEditPermissions: boolean; } -const EditIcon = ({ onShowInput }: { onShowInput: () => void }) => ( - - - -); - export const PropertyValue: FC = ({ isVersionView, versionDataKeys, @@ -161,9 +153,15 @@ export const PropertyValue: FC = ({ getPropertyInput() ) : ( -
+
{getValueElement()} - {hasEditPermissions && } + {hasEditPermissions && ( + + )}
)} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/router/AuthenticatedAppRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/components/router/AuthenticatedAppRouter.tsx index 9e226a75b58..b6c5173095e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/router/AuthenticatedAppRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/router/AuthenticatedAppRouter.tsx @@ -283,16 +283,6 @@ const AuthenticatedAppRouter: FunctionComponent = () => { [permissions] ); - const glossaryTermPermission = useMemo( - () => - userPermissions.hasViewPermissions( - ResourceEntity.GLOSSARY_TERM, - permissions - ), - - [permissions] - ); - const domainPermission = useMemo( () => userPermissions.hasViewPermissions(ResourceEntity.DOMAIN, permissions), @@ -653,24 +643,12 @@ const AuthenticatedAppRouter: FunctionComponent = () => { /> - - > = { export const getTableDetailsPath = (tableFQN: string, columnName?: string) => { let path = ROUTES.TABLE_DETAILS; - path = path.replace(PLACEHOLDER_ROUTE_TABLE_FQN, getEncodedFqn(tableFQN)); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(tableFQN)); return `${path}${columnName ? `.${columnName}` : ''}`; }; @@ -372,10 +350,7 @@ export const getStoredProcedureDetailsPath = ( columnName?: string ) => { let path = ROUTES.STORED_PROCEDURE_DETAILS; - path = path.replace( - PLACEHOLDER_ROUTE_STORED_PROCEDURE_FQN, - getEncodedFqn(storedProcedureFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(storedProcedureFQN)); return `${path}${columnName ? `.${columnName}` : ''}`; }; @@ -383,7 +358,7 @@ export const getStoredProcedureDetailsPath = ( export const getTagsDetailsPath = (entityFQN: string, columnName?: string) => { let path = ROUTES.TAG_DETAILS; const classification = getPartialNameFromFQN(entityFQN, ['service']); - path = path.replace(PLACEHOLDER_TAG_NAME, classification); + path = path.replace(PLACEHOLDER_ROUTE_FQN, classification); return `${path}${columnName ? `.${columnName}` : ''}`; }; @@ -396,7 +371,7 @@ export const getVersionPath = ( let path = ROUTES.ENTITY_VERSION; path = path .replace(PLACEHOLDER_ROUTE_ENTITY_TYPE, entityType) - .replace(PLACEHOLDER_ROUTE_ENTITY_FQN, fqn) + .replace(PLACEHOLDER_ROUTE_FQN, fqn) .replace(PLACEHOLDER_ROUTE_VERSION, version); return path; @@ -411,7 +386,7 @@ export const getVersionPathWithTab = ( let path = ROUTES.ENTITY_VERSION_WITH_TAB; path = path .replace(PLACEHOLDER_ROUTE_ENTITY_TYPE, entityType) - .replace(PLACEHOLDER_ROUTE_ENTITY_FQN, fqn) + .replace(PLACEHOLDER_ROUTE_FQN, fqn) .replace(PLACEHOLDER_ROUTE_VERSION, version) .replace(PLACEHOLDER_ROUTE_TAB, tab); @@ -430,7 +405,7 @@ export const getTableTabPath = ( path = path.replace(PLACEHOLDER_ROUTE_SUB_TAB, subTab); } path = path - .replace(PLACEHOLDER_ROUTE_TABLE_FQN, tableFQN) + .replace(PLACEHOLDER_ROUTE_FQN, tableFQN) .replace(PLACEHOLDER_ROUTE_TAB, tab); return path; @@ -444,7 +419,7 @@ export const getServiceDetailsPath = ( let path = tab ? ROUTES.SERVICE_WITH_TAB : ROUTES.SERVICE; path = path .replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCat) - .replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN); + .replace(PLACEHOLDER_ROUTE_FQN, serviceFQN); if (tab) { path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); @@ -516,10 +491,7 @@ export const getDatabaseDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_DATABASE_FQN, - getEncodedFqn(databaseFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(databaseFQN)); return path; }; @@ -540,10 +512,7 @@ export const getDatabaseSchemaDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_DATABASE_SCHEMA_FQN, - getEncodedFqn(schemaFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(schemaFQN)); return path; }; @@ -564,7 +533,7 @@ export const getTopicDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace(PLACEHOLDER_ROUTE_TOPIC_FQN, getEncodedFqn(topicFQN)); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(topicFQN)); return path; }; @@ -585,10 +554,7 @@ export const getDashboardDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_DASHBOARD_FQN, - getEncodedFqn(dashboardFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(dashboardFQN)); return path; }; @@ -611,10 +577,7 @@ export const getDataModelDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_DATA_MODEL_FQN, - getEncodedFqn(dataModelFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(dataModelFQN)); return path; }; @@ -635,10 +598,7 @@ export const getPipelineDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_PIPELINE_FQN, - getEncodedFqn(pipelineFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(pipelineFQN)); return path; }; @@ -659,7 +619,7 @@ export const getMlModelDetailsPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace(PLACEHOLDER_ROUTE_MLMODEL_FQN, getEncodedFqn(mlModelFQN)); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(mlModelFQN)); return path; }; @@ -680,10 +640,7 @@ export const getContainerDetailPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_ENTITY_FQN, - getEncodedFqn(containerFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(containerFQN)); return path; }; @@ -706,10 +663,7 @@ export const getStoredProcedureDetailPath = ( path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace( - PLACEHOLDER_ROUTE_STORED_PROCEDURE_FQN, - getEncodedFqn(storedProcedureFQN) - ); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(storedProcedureFQN)); return path; }; @@ -719,7 +673,7 @@ export const getGlossaryTermDetailsPath = ( tab?: string ) => { let path = tab ? ROUTES.GLOSSARY_DETAILS_WITH_TAB : ROUTES.GLOSSARY_DETAILS; - path = path.replace(PLACEHOLDER_GLOSSARY_NAME, glossaryFQN); + path = path.replace(PLACEHOLDER_ROUTE_FQN, glossaryFQN); if (tab) { path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); @@ -763,14 +717,14 @@ export const getUserPath = (username: string, tab?: string, subTab = 'all') => { if (tab) { path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } - path = path.replace(PLACEHOLDER_USER_NAME, username); + path = path.replace(PLACEHOLDER_ROUTE_FQN, username); return path; }; export const getBotsPath = (botsName: string) => { let path = ROUTES.BOTS_PROFILE; - path = path.replace(PLACEHOLDER_BOTS_NAME, botsName); + path = path.replace(PLACEHOLDER_ROUTE_FQN, botsName); return path; }; @@ -778,7 +732,7 @@ export const getBotsPath = (botsName: string) => { export const getMlModelPath = (mlModelFqn: string, tab = '') => { let path = ROUTES.MLMODEL_DETAILS_WITH_TAB; path = path - .replace(PLACEHOLDER_ROUTE_MLMODEL_FQN, mlModelFqn) + .replace(PLACEHOLDER_ROUTE_FQN, mlModelFqn) .replace(PLACEHOLDER_ROUTE_TAB, tab); return path; @@ -829,17 +783,20 @@ export const configOptions = { export const NOTIFICATION_READ_TIMER = 2500; export const TIER_CATEGORY = 'Tier'; -export const ENTITY_PATH: Record = { +export const ENTITY_PATH = { tables: 'table', topics: 'topic', dashboards: 'dashboard', pipelines: 'pipeline', - mlmodels: 'mlmodel', + mlModels: 'mlmodel', containers: 'container', tags: 'tag', glossaries: 'glossary', searchindex: 'searchIndex', - storedprocedure: 'storedProcedure', + storedProcedure: 'storedProcedure', + glossaryTerm: 'glossaryTerm', + database: 'database', + databaseSchema: 'databaseSchema', }; export const VALIDATION_MESSAGES = { diff --git a/openmetadata-ui/src/main/resources/ui/src/enums/entity.enum.ts b/openmetadata-ui/src/main/resources/ui/src/enums/entity.enum.ts index 942578fa19f..2c202c38b2f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/enums/entity.enum.ts +++ b/openmetadata-ui/src/main/resources/ui/src/enums/entity.enum.ts @@ -46,7 +46,6 @@ export enum EntityType { TAG = 'tag', DASHBOARD_DATA_MODEL = 'dashboardDataModel', SUBSCRIPTION = 'subscription', - USER_NAME = 'username', CHART = 'chart', DOMAIN = 'domain', DATA_PRODUCT = 'dataProduct', diff --git a/openmetadata-ui/src/main/resources/ui/src/mocks/StoredProcedureVersion.mock.ts b/openmetadata-ui/src/main/resources/ui/src/mocks/StoredProcedureVersion.mock.ts index ba53f726ed0..e33357b1472 100644 --- a/openmetadata-ui/src/main/resources/ui/src/mocks/StoredProcedureVersion.mock.ts +++ b/openmetadata-ui/src/main/resources/ui/src/mocks/StoredProcedureVersion.mock.ts @@ -84,6 +84,7 @@ const mockData = { previousVersion: 0.1, }, deleted: false, + storedProcedureCode: '', }; export const storedProcedureVersionMockProps: StoredProcedureVersionProp = { diff --git a/openmetadata-ui/src/main/resources/ui/src/mocks/dashboardVersion.mock.ts b/openmetadata-ui/src/main/resources/ui/src/mocks/dashboardVersion.mock.ts index 2f3a73661ae..5227d4cef6b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/mocks/dashboardVersion.mock.ts +++ b/openmetadata-ui/src/main/resources/ui/src/mocks/dashboardVersion.mock.ts @@ -183,6 +183,7 @@ export const mockTagChangeVersion = { export const mockNoChartData = { id: '4ee70a0c-6ec9-4c93-a91c-4a57d65bebc8', description: 'test description', + name: 'test', version: 0.4, updatedAt: 1649354506617, updatedBy: 'anonymous', @@ -230,4 +231,4 @@ export const mockNoChartData = { previousVersion: 0.3, }, deleted: false, -} as unknown as VersionData; +} as Dashboard; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AddDataQualityTestPage/AddDataQualityTestPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AddDataQualityTestPage/AddDataQualityTestPage.tsx index 01a07076cb8..b9c411ce024 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AddDataQualityTestPage/AddDataQualityTestPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AddDataQualityTestPage/AddDataQualityTestPage.tsx @@ -21,7 +21,7 @@ import { getTableDetailsByFQN } from 'rest/tableAPI'; import { showErrorToast } from '../../utils/ToastUtils'; const AddDataQualityTestPage = () => { - const { entityTypeFQN } = useParams>(); + const { entityTypeFQN } = useParams<{ entityTypeFQN: string }>(); const [table, setTable] = useState({} as Table); const [isLoading, setIsLoading] = useState(true); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AddIngestionPage/AddIngestionPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AddIngestionPage/AddIngestionPage.component.tsx index a817bcdf033..c6fec1196fe 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AddIngestionPage/AddIngestionPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AddIngestionPage/AddIngestionPage.component.tsx @@ -54,8 +54,15 @@ import { showErrorToast } from '../../utils/ToastUtils'; const AddIngestionPage = () => { const { fetchAirflowStatus } = useAirflowStatus(); - const { ingestionType, serviceFQN, serviceCategory } = - useParams<{ [key: string]: string }>(); + const { + ingestionType, + fqn: serviceFQN, + serviceCategory, + } = useParams<{ + fqn: string; + serviceCategory: string; + ingestionType: string; + }>(); const { t } = useTranslation(); const history = useHistory(); const [serviceData, setServiceData] = useState(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.component.tsx index 49daf6f7748..cdf727e2482 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.component.tsx @@ -47,7 +47,7 @@ import { showErrorToast, showSuccessToast } from 'utils/ToastUtils'; const AddQueryPage = () => { const { t } = useTranslation(); - const { datasetFQN } = useParams<{ datasetFQN: string }>(); + const { fqn: datasetFQN } = useParams<{ fqn: string }>(); const { permissions } = usePermissionProvider(); const [form] = Form.useForm(); const [titleBreadcrumb, setTitleBreadcrumb] = useState< diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.test.tsx index 3b051e7a8e6..93d17ee7cfa 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AddQueryPage/AddQueryPage.test.tsx @@ -27,9 +27,7 @@ jest.mock('rest/miscAPI', () => ({ searchData: jest.fn().mockImplementation(() => Promise.resolve()), })); jest.mock('react-router-dom', () => ({ - useParams: jest - .fn() - .mockReturnValue({ datasetFQN: MOCK_TABLE.fullyQualifiedName }), + useParams: jest.fn().mockReturnValue({ fqn: MOCK_TABLE.fullyQualifiedName }), })); jest.mock( 'components/common/title-breadcrumb/title-breadcrumb.component', diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx index 997f4e980a6..d6afbf44211 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx @@ -41,7 +41,7 @@ import { showErrorToast } from '../../utils/ToastUtils'; const AddServicePage = () => { const { t } = useTranslation(); - const { serviceCategory } = useParams<{ [key: string]: string }>(); + const { serviceCategory } = useParams<{ serviceCategory: string }>(); const [newServiceData, setNewServiceData] = useState(); const [ingestionProgress, setIngestionProgress] = useState(0); const [isIngestionCreated, setIsIngestionCreated] = useState(false); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/BotDetailsPage/BotDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/BotDetailsPage/BotDetailsPage.tsx index 91b331f2ae6..fa887bb14de 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/BotDetailsPage/BotDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/BotDetailsPage/BotDetailsPage.tsx @@ -41,7 +41,7 @@ import { showErrorToast } from '../../utils/ToastUtils'; const BotDetailsPage = () => { const { t } = useTranslation(); - const { botsName } = useParams<{ [key: string]: string }>(); + const { fqn: botsName } = useParams<{ fqn: string }>(); const { isAdminUser } = useAuth(); const { getEntityPermissionByFqn } = usePermissionProvider(); const [botUserData, setBotUserData] = useState({} as User); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ClassificationVersionPage/ClassificationVersionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ClassificationVersionPage/ClassificationVersionPage.tsx index 4653a155a03..31e514c335b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ClassificationVersionPage/ClassificationVersionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ClassificationVersionPage/ClassificationVersionPage.tsx @@ -48,7 +48,8 @@ import { function ClassificationVersionPage() { const { t } = useTranslation(); const history = useHistory(); - const { tagCategoryName = '', version } = useParams>(); + const { fqn: tagCategoryName, version } = + useParams<{ fqn: string; version: string }>(); const { getEntityPermissionByFqn } = usePermissionProvider(); const [currentVersionData, setCurrentVersionData] = useState( {} as Classification diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ContainerPage/ContainerPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ContainerPage/ContainerPage.tsx index de010198a58..3d20d4f1fbf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ContainerPage/ContainerPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ContainerPage/ContainerPage.tsx @@ -17,7 +17,6 @@ import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedPro import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component'; import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import ContainerChildren from 'components/ContainerDetail/ContainerChildren/ContainerChildren'; @@ -79,8 +78,8 @@ const ContainerPage = () => { const { t } = useTranslation(); const { getEntityPermissionByFqn } = usePermissionProvider(); const { postFeed, deleteFeed, updateFeed } = useActivityFeedProvider(); - const { entityFQN: containerName, tab } = - useParams<{ entityFQN: string; tab: EntityTabs }>(); + const { fqn: containerName, tab = EntityTabs.SCHEMA } = + useParams<{ fqn: string; tab: EntityTabs }>(); // Local states const [isLoading, setIsLoading] = useState(false); @@ -642,9 +641,6 @@ const ContainerPage = () => { key: EntityTabs.CUSTOM_PROPERTIES, children: ( { const { t } = useTranslation(); - const { tab } = useParams<{ [key: string]: string }>(); + const { tab } = useParams<{ tab: keyof typeof ENTITY_PATH }>(); const history = useHistory(); const [activeTab, setActiveTab] = useState( @@ -55,7 +55,7 @@ const CustomEntityDetailV1 = () => { const [isButtonLoading, setIsButtonLoading] = useState(false); - const tabAttributePath = ENTITY_PATH[tab.toLowerCase()]; + const tabAttributePath = ENTITY_PATH[tab]; const { getEntityPermission } = usePermissionProvider(); @@ -134,7 +134,7 @@ const CustomEntityDetailV1 = () => { case ENTITY_PATH.pipelines: return PAGE_HEADERS.PIPELINES_CUSTOM_ATTRIBUTES; - case ENTITY_PATH.mlmodels: + case ENTITY_PATH.mlModels: return PAGE_HEADERS.ML_MODELS_CUSTOM_ATTRIBUTES; case ENTITY_PATH.containers: @@ -142,8 +142,19 @@ const CustomEntityDetailV1 = () => { case ENTITY_PATH.searchindex: return PAGE_HEADERS.SEARCH_INDEX_CUSTOM_ATTRIBUTES; - case ENTITY_PATH.storedprocedure: + + case ENTITY_PATH.storedProcedure: return PAGE_HEADERS.STORED_PROCEDURE_CUSTOM_ATTRIBUTES; + + case ENTITY_PATH.glossaryTerm: + return PAGE_HEADERS.GLOSSARY_TERM_CUSTOM_ATTRIBUTES; + + case ENTITY_PATH.database: + return PAGE_HEADERS.DATABASE_CUSTOM_ATTRIBUTES; + + case ENTITY_PATH.databaseSchema: + return PAGE_HEADERS.DATABASE_SCHEMA_CUSTOM_ATTRIBUTES; + default: return PAGE_HEADERS.TABLES_CUSTOM_ATTRIBUTES; } diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DashboardDetailsPage/DashboardDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DashboardDetailsPage/DashboardDetailsPage.component.tsx index 5d76459b926..a8930fa81e9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DashboardDetailsPage/DashboardDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DashboardDetailsPage/DashboardDetailsPage.component.tsx @@ -61,7 +61,7 @@ const DashboardDetailsPage = () => { const USERId = getCurrentUserId(); const history = useHistory(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { dashboardFQN } = useParams<{ dashboardFQN: string }>(); + const { fqn: dashboardFQN } = useParams<{ fqn: string }>(); const [dashboardDetails, setDashboardDetails] = useState( {} as Dashboard ); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DataModelPage/DataModelPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DataModelPage/DataModelPage.component.tsx index 871aa85c837..06fcb228195 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DataModelPage/DataModelPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DataModelPage/DataModelPage.component.tsx @@ -58,8 +58,7 @@ const DataModelsPage = () => { const { t } = useTranslation(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { dashboardDataModelFQN } = - useParams<{ dashboardDataModelFQN: string }>(); + const { fqn: dashboardDataModelFQN } = useParams<{ fqn: string }>(); const [isLoading, setIsLoading] = useState(false); const [hasError, setHasError] = useState(false); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.test.tsx index 5defe8b2300..7cf201d6aee 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.test.tsx @@ -142,7 +142,7 @@ jest.mock('react-router-dom', () => ({ )), useHistory: jest.fn(), useParams: jest.fn().mockReturnValue({ - databaseFQN: 'bigquery.shopify', + fqn: 'bigquery.shopify', }), useLocation: jest .fn() diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.tsx index b21ed2ca1be..46e28fded1d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseDetailsPage/DatabaseDetailsPage.tsx @@ -18,6 +18,7 @@ import ActivityFeedProvider, { } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider'; import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component'; import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; +import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import { PagingHandlerParams } from 'components/common/next-previous/NextPrevious.interface'; @@ -67,12 +68,12 @@ import { getFeedCount, postThread } from 'rest/feedsAPI'; import { searchQuery } from 'rest/searchAPI'; import { getEntityMissingError } from 'utils/CommonUtils'; import { getDatabaseSchemaTable } from 'utils/DatabaseDetails.utils'; -import { getDatabaseVersionPath } from 'utils/RouterUtils'; import { default as appState } from '../../AppState'; import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants'; import { getDatabaseDetailsPath, getExplorePath, + getVersionPathWithTab, INITIAL_PAGING_VALUE, PAGE_SIZE, pagingObject, @@ -102,8 +103,8 @@ const DatabaseDetails: FunctionComponent = () => { return searchData.schema as string | undefined; }, [location.search]); - const { databaseFQN, tab: activeTab = EntityTabs.SCHEMA } = - useParams<{ databaseFQN: string; tab: EntityTabs }>(); + const { fqn: databaseFQN, tab: activeTab = EntityTabs.SCHEMA } = + useParams<{ fqn: string; tab: EntityTabs }>(); const [isLoading, setIsLoading] = useState(true); const [showDeletedSchemas, setShowDeletedSchemas] = useState(false); const [database, setDatabase] = useState({} as Database); @@ -565,7 +566,12 @@ const DatabaseDetails: FunctionComponent = () => { const versionHandler = useCallback(() => { currentVersion && history.push( - getDatabaseVersionPath(databaseFQN, toString(currentVersion)) + getVersionPathWithTab( + EntityType.DATABASE, + databaseFQN, + toString(currentVersion), + EntityTabs.SCHEMA + ) ); }, [currentVersion, databaseFQN]); @@ -721,6 +727,27 @@ const DatabaseDetails: FunctionComponent = () => { ), }, + + { + label: ( + + ), + key: EntityTabs.CUSTOM_PROPERTIES, + children: ( + + ), + }, ], [ tags, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.component.tsx index 767b21faf03..e38f746e97b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.component.tsx @@ -18,6 +18,7 @@ import ActivityFeedProvider, { } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider'; import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component'; import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; +import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import { PagingHandlerParams } from 'components/common/next-previous/NextPrevious.interface'; import PageLayoutV1 from 'components/containers/PageLayoutV1'; @@ -39,7 +40,7 @@ import { compare, Operation } from 'fast-json-patch'; import { ThreadType } from 'generated/entity/feed/thread'; import { Include } from 'generated/type/include'; import { LabelType, State, TagLabel, TagSource } from 'generated/type/tagLabel'; -import { isEmpty, isUndefined, toString } from 'lodash'; +import { isEmpty, isUndefined } from 'lodash'; import { observer } from 'mobx-react'; import { EntityTags, PagingResponse } from 'Models'; import StoredProcedureTab from 'pages/StoredProcedure/StoredProcedureTab'; @@ -66,11 +67,11 @@ import { } from 'rest/storedProceduresAPI'; import { getTableList, TableListParams } from 'rest/tableAPI'; import { getEntityMissingError } from 'utils/CommonUtils'; -import { getDatabaseSchemaVersionPath } from 'utils/RouterUtils'; import { getDecodedFqn } from 'utils/StringsUtils'; import { default as appState } from '../../AppState'; import { getDatabaseSchemaDetailsPath, + getVersionPathWithTab, INITIAL_PAGING_VALUE, pagingObject, } from '../../constants/constants'; @@ -90,8 +91,8 @@ const DatabaseSchemaPage: FunctionComponent = () => { const { t } = useTranslation(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { databaseSchemaFQN, tab: activeTab = EntityTabs.TABLE } = - useParams<{ databaseSchemaFQN: string; tab: EntityTabs }>(); + const { fqn: databaseSchemaFQN, tab: activeTab = EntityTabs.TABLE } = + useParams<{ fqn: string; tab: EntityTabs }>(); const history = useHistory(); const isMounting = useRef(true); @@ -494,9 +495,11 @@ const DatabaseSchemaPage: FunctionComponent = () => { const versionHandler = useCallback(() => { currentVersion && history.push( - getDatabaseSchemaVersionPath( + getVersionPathWithTab( + EntityType.DATABASE_SCHEMA, databaseSchemaFQN, - toString(currentVersion) + String(currentVersion), + EntityTabs.TABLE ) ); }, [currentVersion, databaseSchemaFQN]); @@ -573,6 +576,16 @@ const DatabaseSchemaPage: FunctionComponent = () => { [databaseSchemaPermission, databaseSchema] ); + const handelExtentionUpdate = useCallback( + async (schema: DatabaseSchema) => { + await saveUpdatedDatabaseSchemaData({ + ...databaseSchema, + extension: schema.extension, + }); + }, + [saveUpdatedDatabaseSchemaData, databaseSchema] + ); + const tabs: TabsProps['items'] = [ { label: ( @@ -674,6 +687,28 @@ const DatabaseSchemaPage: FunctionComponent = () => { ), }, + { + label: ( + + ), + key: EntityTabs.CUSTOM_PROPERTIES, + children: ( + + ), + }, ]; const updateVote = async (data: QueryVote, id: string) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.test.tsx index d2ae98283bc..6cc8b50dfdb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/DatabaseSchemaPage.test.tsx @@ -183,7 +183,7 @@ jest.mock('../../AppState', () => ({ })); const mockParams = { - databaseSchemaFQN: 'sample_data.ecommerce_db.shopify', + fqn: 'sample_data.ecommerce_db.shopify', tab: 'table', }; @@ -204,7 +204,7 @@ describe('Tests for DatabaseSchemaPage', () => { expect(mockEntityPermissionByFqn).toHaveBeenCalledWith( 'databaseSchema', - mockParams.databaseSchemaFQN + mockParams.fqn ); }); @@ -241,7 +241,7 @@ describe('Tests for DatabaseSchemaPage', () => { }); expect(getDatabaseSchemaDetailsByFQN).toHaveBeenCalledWith( - mockParams.databaseSchemaFQN, + mockParams.fqn, API_FIELDS, 'include=all' ); @@ -259,7 +259,7 @@ describe('Tests for DatabaseSchemaPage', () => { }); expect(getStoredProceduresList).toHaveBeenCalledWith({ - databaseSchema: mockParams.databaseSchemaFQN, + databaseSchema: mockParams.fqn, fields: 'owner,tags,followers', include: 'non-deleted', limit: 0, @@ -278,7 +278,7 @@ describe('Tests for DatabaseSchemaPage', () => { }); expect(getDatabaseSchemaDetailsByFQN).toHaveBeenCalledWith( - mockParams.databaseSchemaFQN, + mockParams.fqn, API_FIELDS, 'include=all' ); @@ -300,7 +300,7 @@ describe('Tests for DatabaseSchemaPage', () => { }); expect(getDatabaseSchemaDetailsByFQN).toHaveBeenCalledWith( - mockParams.databaseSchemaFQN, + mockParams.fqn, API_FIELDS, 'include=all' ); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx index f00597ad90c..526c7faf656 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx @@ -13,6 +13,7 @@ import { Col, Row, Space, Tabs, TabsProps } from 'antd'; import classNames from 'classnames'; +import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import { PagingHandlerParams } from 'components/common/next-previous/NextPrevious.interface'; import PageLayoutV1 from 'components/containers/PageLayoutV1'; @@ -29,6 +30,7 @@ import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2'; import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface'; import { getDatabaseSchemaDetailsPath, + getVersionPathWithTab, INITIAL_PAGING_VALUE, } from 'constants/constants'; import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum'; @@ -57,16 +59,20 @@ import { getCommonExtraInfoForVersionDetails, } from 'utils/EntityVersionUtils'; import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils'; -import { getDatabaseSchemaVersionPath } from 'utils/RouterUtils'; import { getDecodedFqn } from 'utils/StringsUtils'; function DatabaseSchemaVersionPage() { const { t } = useTranslation(); const history = useHistory(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { databaseSchemaFQN, version } = useParams<{ - databaseSchemaFQN: string; + const { + fqn: databaseSchemaFQN, + version, + tab, + } = useParams<{ + fqn: string; version: string; + tab: EntityTabs; }>(); const [currentPage, setCurrentPage] = useState(INITIAL_PAGING_VALUE); const [tableData, setTableData] = useState>({ @@ -194,16 +200,32 @@ function DatabaseSchemaVersionPage() { () => ({ versionHandler: (newVersion = version) => { history.push( - getDatabaseSchemaVersionPath(databaseSchemaFQN, toString(newVersion)) + getVersionPathWithTab( + EntityType.DATABASE_SCHEMA, + databaseSchemaFQN, + newVersion, + tab + ) ); }, backHandler: () => { history.push(getDatabaseSchemaDetailsPath(databaseSchemaFQN)); }, }), - [databaseSchemaFQN] + [databaseSchemaFQN, tab] ); + const handleTabChange = (activeKey: string) => { + history.push( + getVersionPathWithTab( + EntityType.DATABASE_SCHEMA, + databaseSchemaFQN, + String(version), + activeKey + ) + ); + }; + const tabs: TabsProps['items'] = useMemo( () => [ { @@ -246,6 +268,25 @@ function DatabaseSchemaVersionPage() { ), }, + + { + key: EntityTabs.CUSTOM_PROPERTIES, + label: ( + + ), + children: ( + + ), + }, ], [ currentPage, @@ -294,7 +335,9 @@ function DatabaseSchemaVersionPage() { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseVersionPage/DatabaseVersionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseVersionPage/DatabaseVersionPage.tsx index a7d6c8a1710..c68b31d1721 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseVersionPage/DatabaseVersionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseVersionPage/DatabaseVersionPage.tsx @@ -13,6 +13,7 @@ import { Col, Row, Space, Tabs } from 'antd'; import classNames from 'classnames'; +import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import { PagingHandlerParams } from 'components/common/next-previous/NextPrevious.interface'; @@ -30,6 +31,7 @@ import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2'; import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface'; import { getDatabaseDetailsPath, + getVersionPathWithTab, INITIAL_PAGING_VALUE, pagingObject, } from 'constants/constants'; @@ -59,15 +61,19 @@ import { getCommonExtraInfoForVersionDetails, } from 'utils/EntityVersionUtils'; import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils'; -import { getDatabaseVersionPath } from 'utils/RouterUtils'; function DatabaseVersionPage() { const { t } = useTranslation(); const history = useHistory(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { databaseFQN, version } = useParams<{ - databaseFQN: string; + const { + fqn: databaseFQN, + version, + tab, + } = useParams<{ + fqn: string; version: string; + tab: EntityTabs; }>(); const [paging, setPaging] = useState(pagingObject); const [currentPage, setCurrentPage] = useState(INITIAL_PAGING_VALUE); @@ -195,15 +201,33 @@ function DatabaseVersionPage() { const { versionHandler, backHandler } = useMemo( () => ({ versionHandler: (newVersion = version) => { - history.push(getDatabaseVersionPath(databaseFQN, toString(newVersion))); + history.push( + getVersionPathWithTab( + EntityType.DATABASE, + databaseFQN, + newVersion, + tab + ) + ); }, backHandler: () => { history.push(getDatabaseDetailsPath(databaseFQN)); }, }), - [databaseFQN] + [databaseFQN, tab] ); + const handleTabChange = (activeKey: string) => { + history.push( + getVersionPathWithTab( + EntityType.DATABASE, + databaseFQN, + String(version), + activeKey + ) + ); + }; + const { displayName, tags, description } = useMemo( () => getCommonDiffsFromVersionData(currentVersionData, changeDescription), [currentVersionData, changeDescription] @@ -271,6 +295,25 @@ function DatabaseVersionPage() { ), }, + + { + key: EntityTabs.CUSTOM_PROPERTIES, + label: ( + + ), + children: ( + + ), + }, ], [tags, description, databaseFQN, databaseTable] ); @@ -310,7 +353,9 @@ function DatabaseVersionPage() { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/EditConnectionFormPage/EditConnectionFormPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/EditConnectionFormPage/EditConnectionFormPage.component.tsx index e0d1f8132a3..e525811c947 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/EditConnectionFormPage/EditConnectionFormPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/EditConnectionFormPage/EditConnectionFormPage.component.tsx @@ -42,8 +42,8 @@ import { showErrorToast } from '../../utils/ToastUtils'; function EditConnectionFormPage() { const { t } = useTranslation(); - const { serviceFQN, serviceCategory } = useParams<{ - serviceFQN: string; + const { fqn: serviceFQN, serviceCategory } = useParams<{ + fqn: string; serviceCategory: ServiceCategory; }>(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx index 389a9a28080..41b33b0bf87 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/EditIngestionPage/EditIngestionPage.component.tsx @@ -59,8 +59,17 @@ import { showErrorToast } from '../../utils/ToastUtils'; const EditIngestionPage = () => { const { t } = useTranslation(); const { fetchAirflowStatus } = useAirflowStatus(); - const { ingestionFQN, ingestionType, serviceFQN, serviceCategory } = - useParams<{ [key: string]: string }>(); + const { + ingestionFQN, + ingestionType, + fqn: serviceFQN, + serviceCategory, + } = useParams<{ + ingestionFQN: string; + ingestionType: string; + fqn: string; + serviceCategory: string; + }>(); const history = useHistory(); const [serviceData, setServiceData] = useState(); const [ingestionData, setIngestionData] = useState( diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/EntityVersionPage/EntityVersionPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/EntityVersionPage/EntityVersionPage.component.tsx index dd61791aa0a..7a62be165b3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/EntityVersionPage/EntityVersionPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/EntityVersionPage/EntityVersionPage.component.tsx @@ -11,17 +11,30 @@ * limitations under the License. */ +import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; +import PageLayoutV1 from 'components/containers/PageLayoutV1'; import ContainerVersion from 'components/ContainerVersion/ContainerVersion.component'; import DashboardVersion from 'components/DashboardVersion/DashboardVersion.component'; import DataModelVersion from 'components/DataModelVersion/DataModelVersion.component'; import Loader from 'components/Loader/Loader'; import MlModelVersion from 'components/MlModelVersion/MlModelVersion.component'; +import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider'; +import { + OperationPermission, + ResourceEntity, +} from 'components/PermissionProvider/PermissionProvider.interface'; import PipelineVersion from 'components/PipelineVersion/PipelineVersion.component'; +import SearchIndexVersion from 'components/SearchIndexVersion/SearchIndexVersion'; +import StoredProcedureVersion from 'components/StoredProcedureVersion/StoredProcedureVersion.component'; import TableVersion from 'components/TableVersion/TableVersion.component'; import TopicVersion from 'components/TopicVersion/TopicVersion.component'; +import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum'; import { Container } from 'generated/entity/data/container'; import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel'; import { Mlmodel } from 'generated/entity/data/mlmodel'; +import { SearchIndex } from 'generated/entity/data/searchIndex'; +import { StoredProcedure } from 'generated/entity/data/storedProcedure'; +import { isEmpty } from 'lodash'; import React, { FunctionComponent, useCallback, @@ -51,11 +64,21 @@ import { getPipelineVersion, getPipelineVersions, } from 'rest/pipelineAPI'; +import { + getSearchIndexDetailsByFQN, + getSearchIndexVersion, + getSearchIndexVersions, +} from 'rest/SearchIndexAPI'; import { getContainerByName, getContainerVersion, getContainerVersions, } from 'rest/storageAPI'; +import { + getStoredProceduresDetailsByFQN, + getStoredProceduresVersion, + getStoredProceduresVersionsList, +} from 'rest/storedProceduresAPI'; import { getTableDetailsByFQN, getTableVersion, @@ -67,6 +90,8 @@ import { getTopicVersions, } from 'rest/topicsAPI'; import { getEntityBreadcrumbs, getEntityName } from 'utils/EntityUtils'; +import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils'; +import { getSearchIndexTabPath } from 'utils/SearchIndexUtils'; import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants'; import { getContainerDetailPath, @@ -88,32 +113,6 @@ import { Topic } from '../../generated/entity/data/topic'; import { EntityHistory } from '../../generated/type/entityHistory'; import { TagLabel } from '../../generated/type/tagLabel'; import { getPartialNameFromFQN } from '../../utils/CommonUtils'; - -import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; -import PageLayoutV1 from 'components/containers/PageLayoutV1'; -import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider'; -import { - OperationPermission, - ResourceEntity, -} from 'components/PermissionProvider/PermissionProvider.interface'; -import SearchIndexVersion from 'components/SearchIndexVersion/SearchIndexVersion'; -import StoredProcedureVersion from 'components/StoredProcedureVersion/StoredProcedureVersion.component'; -import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum'; -import { SearchIndex } from 'generated/entity/data/searchIndex'; -import { StoredProcedure } from 'generated/entity/data/storedProcedure'; -import { isEmpty } from 'lodash'; -import { - getSearchIndexDetailsByFQN, - getSearchIndexVersion, - getSearchIndexVersions, -} from 'rest/SearchIndexAPI'; -import { - getStoredProceduresDetailsByFQN, - getStoredProceduresVersion, - getStoredProceduresVersionsList, -} from 'rest/storedProceduresAPI'; -import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils'; -import { getSearchIndexTabPath } from 'utils/SearchIndexUtils'; import { getTierTags } from '../../utils/TableUtils'; import './EntityVersionPage.less'; @@ -130,15 +129,23 @@ export type VersionData = const EntityVersionPage: FunctionComponent = () => { const { t } = useTranslation(); - const { tab } = useParams<{ tab: EntityTabs }>(); const history = useHistory(); const [entityId, setEntityId] = useState(''); const [currentVersionData, setCurrentVersionData] = useState( {} as VersionData ); - const { entityType, version, entityFQN } = - useParams<{ entityType: EntityType; version: string; entityFQN: string }>(); + const { + entityType, + version, + fqn: entityFQN, + tab, + } = useParams<{ + entityType: EntityType; + version: string; + fqn: string; + tab: EntityTabs; + }>(); const { getEntityPermissionByFqn } = usePermissionProvider(); const [entityPermissions, setEntityPermissions] = @@ -281,6 +288,21 @@ const EntityVersionPage: FunctionComponent = () => { break; } + case EntityType.DATABASE: { + await fetchResourcePermission(ResourceEntity.DATABASE); + + break; + } + case EntityType.DATABASE_SCHEMA: { + await fetchResourcePermission(ResourceEntity.DATABASE_SCHEMA); + + break; + } + case EntityType.GLOSSARY_TERM: { + await fetchResourcePermission(ResourceEntity.GLOSSARY_TERM); + + break; + } default: { break; } @@ -554,7 +576,7 @@ const EntityVersionPage: FunctionComponent = () => { return ( { return ( { return ( { return ( { return ( { backHandler={backHandler} breadCrumbList={slashedEntityName} containerFQN={entityFQN} - currentVersionData={currentVersionData} + currentVersionData={currentVersionData as Container} deleted={currentVersionData.deleted} domain={domain} entityPermissions={entityPermissions} @@ -670,7 +692,7 @@ const EntityVersionPage: FunctionComponent = () => { { return ( ({ @@ -123,7 +123,7 @@ describe('Test EntityVersionPage component', () => { mockParams = { entityType: 'dashboard', version: '0.2', - entityFQN: 'sample_superset.forecast_sales_performance', + fqn: 'sample_superset.forecast_sales_performance', }; await act(async () => { @@ -143,7 +143,7 @@ describe('Test EntityVersionPage component', () => { mockParams = { entityType: 'pipeline', version: '0.1', - entityFQN: 'sample_airflow.snowflake_etl', + fqn: 'sample_airflow.snowflake_etl', }; await act(async () => { @@ -163,7 +163,7 @@ describe('Test EntityVersionPage component', () => { mockParams = { entityType: 'topic', version: '0.1', - entityFQN: 'sample_kafka.sales', + fqn: 'sample_kafka.sales', }; await act(async () => { @@ -181,7 +181,7 @@ describe('Test EntityVersionPage component', () => { mockParams = { entityType: 'mlmodel', version: '0.1', - entityFQN: 'mlflow_svc.eta_predictions', + fqn: 'mlflow_svc.eta_predictions', }; await act(async () => { @@ -199,7 +199,7 @@ describe('Test EntityVersionPage component', () => { mockParams = { entityType: 'container', version: '0.1', - entityFQN: 's3_storage_sample.transactions', + fqn: 's3_storage_sample.transactions', }; await act(async () => { @@ -219,7 +219,7 @@ describe('Test EntityVersionPage component', () => { mockParams = { entityType: 'dashboardDataModel', version: '0.1', - entityFQN: 'data_model.sales', + fqn: 'data_model.sales', }; await act(async () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/GlobalSettingPage/GlobalSettingPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/GlobalSettingPage/GlobalSettingPage.tsx index 34204a9c4b4..0b960ea9215 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/GlobalSettingPage/GlobalSettingPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/GlobalSettingPage/GlobalSettingPage.tsx @@ -42,7 +42,8 @@ import './global-setting-page.style.less'; const GlobalSettingPage = () => { const history = useHistory(); const { t } = useTranslation(); - const { tab, settingCategory } = useParams<{ [key: string]: string }>(); + const { tab, settingCategory } = + useParams<{ tab: string; settingCategory: string }>(); const { permissions } = usePermissionProvider(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryLeftPanel/GlossaryLeftPanel.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryLeftPanel/GlossaryLeftPanel.component.tsx index 97b8ec97874..65540202f72 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryLeftPanel/GlossaryLeftPanel.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryLeftPanel/GlossaryLeftPanel.component.tsx @@ -33,7 +33,7 @@ import { GlossaryLeftPanelProps } from './GlossaryLeftPanel.interface'; const GlossaryLeftPanel = ({ glossaries }: GlossaryLeftPanelProps) => { const { t } = useTranslation(); const { permissions } = usePermissionProvider(); - const { glossaryName } = useParams<{ glossaryName: string }>(); + const { fqn: glossaryName } = useParams<{ fqn: string }>(); const glossaryFqn = glossaryName ? decodeURIComponent(glossaryName) : null; const history = useHistory(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryPage/GlossaryPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryPage/GlossaryPage.component.tsx index e05879f3c43..fee1eb021e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryPage/GlossaryPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/Glossary/GlossaryPage/GlossaryPage.component.tsx @@ -43,7 +43,7 @@ import { updateGlossaryVotes, } from 'rest/glossaryAPI'; import { checkPermission } from 'utils/PermissionsUtils'; -import { getGlossaryPath, getGlossaryTermsPath } from 'utils/RouterUtils'; +import { getGlossaryPath } from 'utils/RouterUtils'; import { showErrorToast, showSuccessToast } from 'utils/ToastUtils'; import Fqn from '../../../utils/Fqn'; import GlossaryLeftPanel from '../GlossaryLeftPanel/GlossaryLeftPanel.component'; @@ -51,7 +51,7 @@ import GlossaryLeftPanel from '../GlossaryLeftPanel/GlossaryLeftPanel.component' const GlossaryPage = () => { const { t } = useTranslation(); const { permissions } = usePermissionProvider(); - const { glossaryName } = useParams<{ glossaryName: string }>(); + const { fqn: glossaryName } = useParams<{ fqn: string }>(); const glossaryFqn = decodeURIComponent(glossaryName); const history = useHistory(); const [glossaries, setGlossaries] = useState([]); @@ -174,9 +174,7 @@ const GlossaryPage = () => { ); !glossaryFqn && glossaries[0].fullyQualifiedName && - history.replace( - getGlossaryTermsPath(glossaries[0].fullyQualifiedName) - ); + history.replace(getGlossaryPath(glossaries[0].fullyQualifiedName)); setIsRightPanelLoading(false); } } diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/MlModelPage/MlModelPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/MlModelPage/MlModelPage.component.tsx index c7fbe0db847..8329fbc8c8e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/MlModelPage/MlModelPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/MlModelPage/MlModelPage.component.tsx @@ -51,7 +51,7 @@ import { showErrorToast } from '../../utils/ToastUtils'; const MlModelPage = () => { const { t } = useTranslation(); const history = useHistory(); - const { mlModelFqn } = useParams<{ [key: string]: string }>(); + const { fqn: mlModelFqn } = useParams<{ fqn: string }>(); const [mlModelDetail, setMlModelDetail] = useState({} as Mlmodel); const [isDetailLoading, setIsDetailLoading] = useState(false); const USERId = getCurrentUserId(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/PipelineDetails/PipelineDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/PipelineDetails/PipelineDetailsPage.component.tsx index 96b45967d62..79790ef6b07 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/PipelineDetails/PipelineDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/PipelineDetails/PipelineDetailsPage.component.tsx @@ -54,7 +54,7 @@ const PipelineDetailsPage = () => { const USERId = getCurrentUserId(); const history = useHistory(); - const { pipelineFQN } = useParams<{ pipelineFQN: string }>(); + const { fqn: pipelineFQN } = useParams<{ fqn: string }>(); const [pipelineDetails, setPipelineDetails] = useState( {} as Pipeline ); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.component.tsx index 605a0a396e3..bc6674718e9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.component.tsx @@ -40,8 +40,8 @@ import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils'; import { showErrorToast } from 'utils/ToastUtils'; const QueryPage = () => { - const { datasetFQN, queryId } = - useParams<{ datasetFQN: string; queryId: string }>(); + const { fqn: datasetFQN, queryId } = + useParams<{ fqn: string; queryId: string }>(); const { t } = useTranslation(); const [titleBreadcrumb, setTitleBreadcrumb] = useState< diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.test.tsx index f10b175ce3b..6fd85784592 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/QueryPage/QueryPage.test.tsx @@ -20,7 +20,7 @@ import QueryPage from './QueryPage.component'; jest.mock('react-router-dom', () => ({ useLocation: jest.fn().mockImplementation(() => ({ search: '' })), useParams: jest.fn().mockImplementation(() => ({ - datasetFQN: 'testDatasetFQN', + fqn: 'testDatasetFQN', queryId: 'queryId', })), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.test.tsx index fefd25a403a..aefae1603dd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.test.tsx @@ -105,7 +105,7 @@ jest.mock( jest.mock('react-router-dom', () => ({ useParams: jest .fn() - .mockImplementation(() => ({ searchIndexFQN: 'fqn', tab: 'fields' })), + .mockImplementation(() => ({ fqn: 'fqn', tab: 'fields' })), useHistory: jest.fn().mockImplementation(() => ({})), })); @@ -146,7 +146,7 @@ describe('SearchIndexDetailsPage component', () => { expect(getSearchIndexDetailsByFQN).toHaveBeenCalledWith( 'fqn', - 'fields,extension,followers,tags,owner,domain' + 'fields,followers,tags,owner,domain' ); }); @@ -163,7 +163,7 @@ describe('SearchIndexDetailsPage component', () => { expect(getSearchIndexDetailsByFQN).toHaveBeenCalledWith( 'fqn', - 'fields,extension,followers,tags,owner,domain' + 'fields,followers,tags,owner,domain' ); expect(await screen.findByText('testDataAssetsHeader')).toBeInTheDocument(); @@ -194,7 +194,7 @@ describe('SearchIndexDetailsPage component', () => { expect(getSearchIndexDetailsByFQN).toHaveBeenCalledWith( 'fqn', - 'fields,extension,followers,tags,owner,domain' + 'fields,followers,tags,owner,domain' ); expect( diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.tsx index 4ad0741eeb8..24f9c4c58a1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.tsx @@ -19,7 +19,6 @@ import ActivityFeedProvider, { import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component'; import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import QueryViewer from 'components/common/QueryViewer/QueryViewer.component'; @@ -74,8 +73,8 @@ import SearchIndexFieldsTab from './SearchIndexFieldsTab/SearchIndexFieldsTab'; function SearchIndexDetailsPage() { const { postFeed, deleteFeed, updateFeed } = useActivityFeedProvider(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { searchIndexFQN, tab: activeTab = EntityTabs.FIELDS } = - useParams<{ searchIndexFQN: string; tab: string }>(); + const { fqn: searchIndexFQN, tab: activeTab = EntityTabs.FIELDS } = + useParams<{ fqn: string; tab: string }>(); const { t } = useTranslation(); const history = useHistory(); const USERId = getCurrentUserId(); @@ -312,9 +311,16 @@ function SearchIndexDetailsPage() { await handleTagsUpdate(updatedTags); }; - const onExtensionUpdate = async (updatedData: SearchIndex) => { - await onSearchIndexUpdate(updatedData, 'extension'); - }; + const onExtensionUpdate = useCallback( + async (updatedData: SearchIndex) => { + searchIndexDetails && + (await saveUpdatedSearchIndexData({ + ...searchIndexDetails, + extension: updatedData.extension, + })); + }, + [saveUpdatedSearchIndexData, searchIndexDetails] + ); const fieldsTab = useMemo( () => ( @@ -495,9 +501,6 @@ function SearchIndexDetailsPage() { key: EntityTabs.CUSTOM_PROPERTIES, children: ( { const { t } = useTranslation(); const { isAirflowAvailable } = useAirflowStatus(); - const { serviceFQN, serviceCategory, tab } = useParams<{ - serviceFQN: string; + const { + fqn: serviceFQN, + serviceCategory, + tab, + } = useParams<{ + fqn: string; serviceCategory: ServiceTypes; tab: string; }>(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx index 58ba1869642..8f8eac4f7a3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceMainTabContent.tsx @@ -65,8 +65,8 @@ function ServiceMainTabContent({ saveUpdatedServiceData, }: ServiceMainTabContentProps) { const { t } = useTranslation(); - const { serviceFQN, serviceCategory } = useParams<{ - serviceFQN: string; + const { fqn: serviceFQN, serviceCategory } = useParams<{ + fqn: string; serviceCategory: ServiceTypes; }>(); const [isEdit, setIsEdit] = useState(false); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionMainTabContent.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionMainTabContent.tsx index 53e998d068a..08cdde458c4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionMainTabContent.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionMainTabContent.tsx @@ -42,8 +42,8 @@ function ServiceVersionMainTabContent({ entityType, changeDescription, }: ServiceVersionMainTabContentProps) { - const { serviceFQN, serviceCategory } = useParams<{ - serviceFQN: string; + const { fqn: serviceFQN, serviceCategory } = useParams<{ + fqn: string; serviceCategory: ServiceTypes; }>(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.test.tsx index 74a9b63bd63..1037fd93b98 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.test.tsx @@ -22,7 +22,7 @@ import ServiceVersionPage from './ServiceVersionPage'; const mockParams = { serviceCategory: 'databaseServices', version: '1.2', - serviceFQN: 'sample_data', + fqn: 'sample_data', }; const mockPush = jest.fn(); const mockOtherData = { data: [], paging: {} }; @@ -243,7 +243,7 @@ describe('ServiceVersionPage tests', () => { it('Component should render properly for pipelineServices', async () => { (useParams as jest.Mock).mockImplementation(() => ({ version: '1.2', - serviceFQN: 'sample_data', + fqn: 'sample_data', serviceCategory: 'pipelineServices', })); await act(async () => { @@ -262,7 +262,7 @@ describe('ServiceVersionPage tests', () => { it('Component should render properly for storageServices', async () => { (useParams as jest.Mock).mockImplementation(() => ({ version: '1.2', - serviceFQN: 'sample_data', + fqn: 'sample_data', serviceCategory: 'storageServices', })); await act(async () => { @@ -281,7 +281,7 @@ describe('ServiceVersionPage tests', () => { it('Component should render properly for mlmodelServices', async () => { (useParams as jest.Mock).mockImplementation(() => ({ version: '1.2', - serviceFQN: 'sample_data', + fqn: 'sample_data', serviceCategory: 'mlmodelServices', })); await act(async () => { @@ -300,7 +300,7 @@ describe('ServiceVersionPage tests', () => { it('Only basic information should be rendered for metadataServices', async () => { (useParams as jest.Mock).mockImplementation(() => ({ version: '1.2', - serviceFQN: 'sample_data', + fqn: 'sample_data', serviceCategory: 'metadataServices', })); await act(async () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.tsx index ecbf8d709a3..f8f6935e61d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceVersionPage/ServiceVersionPage.tsx @@ -73,9 +73,13 @@ function ServiceVersionPage() { const { t } = useTranslation(); const history = useHistory(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { serviceCategory, serviceFQN, version } = useParams<{ + const { + serviceCategory, + fqn: serviceFQN, + version, + } = useParams<{ serviceCategory: ServiceTypes; - serviceFQN: string; + fqn: string; version: string; }>(); const [paging, setPaging] = useState(pagingObject); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.test.tsx index 89b49adc8fa..d225160d5e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.test.tsx @@ -23,7 +23,7 @@ const mockEntityPermissionByFqn = jest .mockImplementation(() => DEFAULT_ENTITY_PERMISSION); const API_FIELDS = `owner, followers, -tags, extension, domain, votes`; +tags, domain, votes`; jest.mock('components/PermissionProvider/PermissionProvider', () => ({ usePermissionProvider: jest.fn().mockImplementation(() => ({ @@ -121,9 +121,7 @@ jest.mock( ); jest.mock('react-router-dom', () => ({ - useParams: jest - .fn() - .mockImplementation(() => ({ storedProcedureFQN: 'fqn', tab: 'code' })), + useParams: jest.fn().mockImplementation(() => ({ fqn: 'fqn', tab: 'code' })), useHistory: jest.fn().mockImplementation(() => ({})), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.tsx index e1828da7384..d0bd1f999ce 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.tsx @@ -16,7 +16,6 @@ import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedPro import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component'; import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import PageLayoutV1 from 'components/containers/PageLayoutV1'; @@ -79,8 +78,8 @@ const StoredProcedurePage = () => { const { t } = useTranslation(); const USER_ID = getCurrentUserId(); const history = useHistory(); - const { storedProcedureFQN, tab: activeTab = EntityTabs.CODE } = - useParams<{ storedProcedureFQN: string; tab: string }>(); + const { fqn: storedProcedureFQN, tab: activeTab = EntityTabs.CODE } = + useParams<{ fqn: string; tab: string }>(); const { getEntityPermissionByFqn } = usePermissionProvider(); const { postFeed, deleteFeed, updateFeed } = useActivityFeedProvider(); @@ -201,7 +200,7 @@ const StoredProcedurePage = () => { return patchStoredProceduresDetails(storedProcedureId ?? '', jsonPatch); }, - [storedProcedure] + [storedProcedure, storedProcedureId] ); const handleStoreProcedureUpdate = async ( @@ -460,9 +459,16 @@ const StoredProcedurePage = () => { setThreadLink(''); }; - const onExtensionUpdate = async (updatedData: StoredProcedure) => { - await handleStoreProcedureUpdate(updatedData, 'extension'); - }; + const onExtensionUpdate = useCallback( + async (updatedData: StoredProcedure) => { + storedProcedure && + (await saveUpdatedStoredProceduresData({ + ...storedProcedure, + extension: updatedData.extension, + })); + }, + [saveUpdatedStoredProceduresData, storedProcedure] + ); const tabs = useMemo( () => [ @@ -595,9 +601,6 @@ const StoredProcedurePage = () => { key: EntityTabs.CUSTOM_PROPERTIES, children: ( DEFAULT_ENTITY_PERMISSION); const COMMON_API_FIELDS = - 'columns,followers,joins,tags,owner,dataModel,tableConstraints,extension,viewDefinition,domain,dataProducts,votes'; + 'columns,followers,joins,tags,owner,dataModel,tableConstraints,viewDefinition,domain,dataProducts,votes'; jest.mock('components/PermissionProvider/PermissionProvider', () => ({ usePermissionProvider: jest.fn().mockImplementation(() => ({ @@ -152,7 +152,7 @@ jest.mock( jest.mock('react-router-dom', () => ({ useParams: jest .fn() - .mockImplementation(() => ({ datasetFQN: 'fqn', tab: 'schema' })), + .mockImplementation(() => ({ fqn: 'fqn', tab: 'schema' })), useHistory: jest.fn().mockImplementation(() => ({})), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx index 1ba095e1611..627aac75bdb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableDetailsPageV1.tsx @@ -17,7 +17,6 @@ import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedPro import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component'; import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel'; import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable'; -import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import DescriptionV1 from 'components/common/description/DescriptionV1'; import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder'; import QueryViewer from 'components/common/QueryViewer/QueryViewer.component'; @@ -95,8 +94,8 @@ const TableDetailsPageV1 = () => { const { isTourOpen, activeTabForTourDatasetPage, isTourPage } = useTourProvider(); const [tableDetails, setTableDetails] = useState
(); - const { datasetFQN, tab: activeTab = EntityTabs.SCHEMA } = - useParams<{ datasetFQN: string; tab: string }>(); + const { fqn: datasetFQN, tab: activeTab = EntityTabs.SCHEMA } = + useParams<{ fqn: string; tab: EntityTabs }>(); const { t } = useTranslation(); const history = useHistory(); const USERId = getCurrentUserId(); @@ -419,7 +418,11 @@ const TableDetailsPageV1 = () => { }; const onExtensionUpdate = async (updatedData: Table) => { - await onTableUpdate(updatedData, 'extension'); + tableDetails && + (await saveUpdatedTableData({ + ...tableDetails, + extension: updatedData.extension, + })); }; const onDataProductsUpdate = async (updatedData: DataProduct[]) => { @@ -700,7 +703,6 @@ const TableDetailsPageV1 = () => { key: EntityTabs.CUSTOM_PROPERTIES, children: ( { const { getEntityPermission, permissions } = usePermissionProvider(); const history = useHistory(); - const { tagCategoryName } = useParams>(); + const { fqn: tagCategoryName } = useParams<{ fqn: string }>(); const [classifications, setClassifications] = useState>( [] ); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx index af0eab39f87..24c542e966c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx @@ -58,7 +58,8 @@ const RequestDescription = () => { const [form] = useForm(); const markdownRef = useRef(); - const { entityType, entityFQN } = useParams<{ [key: string]: string }>(); + const { entityType, fqn: entityFQN } = + useParams<{ fqn: string; entityType: EntityType }>(); const queryParams = new URLSearchParams(location.search); const field = queryParams.get('field'); @@ -125,7 +126,7 @@ const RequestDescription = () => { ); history.push( getEntityDetailLink( - entityType as EntityType, + entityType, entityType === EntityType.TABLE ? entityFQN : getDecodedFqn(entityFQN), @@ -141,11 +142,7 @@ const RequestDescription = () => { }; useEffect(() => { - fetchEntityDetail( - entityType as EntityType, - entityFQN as string, - setEntityData - ); + fetchEntityDetail(entityType, entityFQN, setEntityData); }, [entityFQN, entityType]); useEffect(() => { @@ -177,7 +174,7 @@ const RequestDescription = () => {
{ const location = useLocation(); const history = useHistory(); const [form] = useForm(); - const { entityType, entityFQN } = useParams<{ [key: string]: string }>(); + const { entityType, fqn: entityFQN } = + useParams<{ fqn: string; entityType: EntityType }>(); const queryParams = new URLSearchParams(location.search); const field = queryParams.get('field'); @@ -118,7 +119,7 @@ const RequestTag = () => { ); history.push( getEntityDetailLink( - entityType as EntityType, + entityType, entityType === EntityType.TABLE ? entityFQN : getDecodedFqn(entityFQN), @@ -131,11 +132,7 @@ const RequestTag = () => { }; useEffect(() => { - fetchEntityDetail( - entityType as EntityType, - entityFQN as string, - setEntityData - ); + fetchEntityDetail(entityType, entityFQN, setEntityData); }, [entityFQN, entityType]); useEffect(() => { @@ -167,7 +164,7 @@ const RequestTag = () => {
{ const history = useHistory(); const [form] = useForm(); - const { entityType, entityFQN } = useParams<{ [key: string]: string }>(); + const { entityType, fqn: entityFQN } = + useParams<{ fqn: string; entityType: EntityType }>(); const queryParams = new URLSearchParams(location.search); const field = queryParams.get('field'); @@ -90,7 +91,7 @@ const UpdateDescription = () => { return getColumnObject( column[0], getEntityColumnsDetails(entityType, entityData), - entityType as EntityType + entityType ); }, [field, entityData, entityType]); @@ -139,7 +140,7 @@ const UpdateDescription = () => { ); history.push( getEntityDetailLink( - entityType as EntityType, + entityType, entityType === EntityType.TABLE ? entityFQN : getDecodedFqn(entityFQN), @@ -152,11 +153,7 @@ const UpdateDescription = () => { }; useEffect(() => { - fetchEntityDetail( - entityType as EntityType, - entityFQN as string, - setEntityData - ); + fetchEntityDetail(entityType, entityFQN, setEntityData); }, [entityFQN, entityType]); useEffect(() => { @@ -193,7 +190,7 @@ const UpdateDescription = () => {
{ const history = useHistory(); const [form] = useForm(); - const { entityType, entityFQN } = useParams<{ [key: string]: string }>(); + const { entityType, fqn: entityFQN } = + useParams<{ fqn: string; entityType: EntityType }>(); const queryParams = new URLSearchParams(location.search); const field = queryParams.get('field'); @@ -96,7 +97,7 @@ const UpdateTag = () => { return getColumnObject( column[0], getEntityColumnsDetails(entityType, entityData), - entityType as EntityType, + entityType, chartData ); }, [field, entityData, chartData, entityType]); @@ -146,7 +147,7 @@ const UpdateTag = () => { ); history.push( getEntityDetailLink( - entityType as EntityType, + entityType, entityType === EntityType.TABLE ? entityFQN : getDecodedFqn(entityFQN), @@ -160,7 +161,7 @@ const UpdateTag = () => { useEffect(() => { fetchEntityDetail( - entityType as EntityType, + entityType, entityFQN as string, setEntityData, setChartData @@ -202,7 +203,7 @@ const UpdateTag = () => {
(); + const { fqn: testCaseFQN } = useParams<{ fqn: string }>(); const { t } = useTranslation(); const [testCaseData, setTestCaseData] = useState(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx index 1ec214755f2..718af69921b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx @@ -58,7 +58,7 @@ import './TestSuiteDetailsPage.styles.less'; const TestSuiteDetailsPage = () => { const { t } = useTranslation(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { testSuiteFQN } = useParams>(); + const { fqn: testSuiteFQN } = useParams<{ fqn: string }>(); const { isAdminUser } = useAuth(); const history = useHistory(); const { isAuthDisabled } = useAuthContext(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.test.tsx index 7ba7dd27a08..550e61798d9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.test.tsx @@ -67,9 +67,7 @@ jest.mock('hooks/authHooks', () => { jest.mock('react-router-dom', () => { return { useHistory: jest.fn().mockImplementation(() => ({ push: jest.fn() })), - useParams: jest - .fn() - .mockImplementation(() => ({ testSuiteFQN: 'testSuiteFQN' })), + useParams: jest.fn().mockImplementation(() => ({ fqn: 'testSuiteFQN' })), }; }); jest.mock('rest/testAPI', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx index 157f6e6c360..552f55cc3ac 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx @@ -34,7 +34,8 @@ import { getDataQualityPagePath } from '../../utils/RouterUtils'; import { showErrorToast } from '../../utils/ToastUtils'; const TestSuiteIngestionPage = () => { - const { testSuiteFQN, ingestionFQN } = useParams>(); + const { fqn: testSuiteFQN, ingestionFQN } = + useParams<{ fqn: string; ingestionFQN: string }>(); const { t } = useTranslation(); const history = useHistory(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TopicDetails/TopicDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TopicDetails/TopicDetailsPage.component.tsx index 48b01dba93e..39031173325 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TopicDetails/TopicDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TopicDetails/TopicDetailsPage.component.tsx @@ -61,7 +61,7 @@ const TopicDetailsPage: FunctionComponent = () => { const history = useHistory(); const { getEntityPermissionByFqn } = usePermissionProvider(); - const { topicFQN } = useParams<{ topicFQN: string }>(); + const { fqn: topicFQN } = useParams<{ fqn: string }>(); const [topicDetails, setTopicDetails] = useState({} as Topic); const [isLoading, setLoading] = useState(true); const [isError, setIsError] = useState(false); @@ -128,7 +128,6 @@ const TopicDetailsPage: FunctionComponent = () => { TabSpecificField.OWNER, TabSpecificField.FOLLOWERS, TabSpecificField.TAGS, - TabSpecificField.EXTENSION, TabSpecificField.DOMAIN, TabSpecificField.DATA_PRODUCTS, TabSpecificField.VOTES, @@ -237,7 +236,6 @@ const TopicDetailsPage: FunctionComponent = () => { TabSpecificField.OWNER, TabSpecificField.FOLLOWERS, TabSpecificField.TAGS, - TabSpecificField.EXTENSION, TabSpecificField.VOTES, ]); setTopicDetails(details); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx index 816c0676ec4..babbcd58a19 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx @@ -43,8 +43,8 @@ import { UserAssetsDataType } from './UserPage.interface'; const UserPage = () => { const history = useHistory(); const { t } = useTranslation(); - const { username, tab = UserProfileTab.ACTIVITY } = - useParams<{ [key: string]: string }>(); + const { fqn: username, tab = UserProfileTab.ACTIVITY } = + useParams<{ fqn: string; tab: UserProfileTab }>(); const [isLoading, setIsLoading] = useState(true); const [userData, setUserData] = useState({} as User); const [isError, setIsError] = useState(false); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/teams/TeamsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/teams/TeamsPage.tsx index 69ae4de7edb..e7bfcbf205b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/teams/TeamsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/teams/TeamsPage.tsx @@ -68,7 +68,7 @@ const TeamsPage = () => { const { getEntityPermissionByFqn } = usePermissionProvider(); const { isAdminUser } = useAuth(); const { isAuthDisabled } = useAuthContext(); - const { fqn } = useParams<{ [key: string]: string }>(); + const { fqn } = useParams<{ fqn: string }>(); const [currentFqn, setCurrentFqn] = useState(''); const [allTeam, setAllTeam] = useState([]); const [selectedTeam, setSelectedTeam] = useState({} as Team); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx index 1464d61e895..246e97415f9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx @@ -846,7 +846,7 @@ export const getEntityDetailLink = ( break; - case EntityType.USER_NAME: + case EntityType.USER: path = getUserPath(fqn, tab, subTab); break; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CustomProperties/CustomProperty.utils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/CustomProperties/CustomProperty.utils.ts new file mode 100644 index 00000000000..c376b35692c --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CustomProperties/CustomProperty.utils.ts @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { + ExtentionEntities, + ExtentionEntitiesKeys, +} from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; +import { EntityType, TabSpecificField } from 'enums/entity.enum'; +import { getDashboardByFqn } from 'rest/dashboardAPI'; +import { + getDatabaseDetailsByFQN, + getDatabaseSchemaDetailsByFQN, +} from 'rest/databaseAPI'; +import { getGlossaryTermByFQN } from 'rest/glossaryAPI'; +import { getMlModelByFQN } from 'rest/mlModelAPI'; +import { getPipelineByFqn } from 'rest/pipelineAPI'; +import { getSearchIndexDetailsByFQN } from 'rest/SearchIndexAPI'; +import { getContainerByFQN } from 'rest/storageAPI'; +import { getStoredProceduresDetailsByFQN } from 'rest/storedProceduresAPI'; +import { getTableDetailsByFQN } from 'rest/tableAPI'; +import { getTopicByFqn } from 'rest/topicsAPI'; + +export const getEntityExtentionDetailsFromEntityType = < + T extends ExtentionEntitiesKeys +>( + type: T, + fqn: string +): Promise | void => { + switch (type) { + case EntityType.TABLE: + return getTableDetailsByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.TOPIC: + return getTopicByFqn(fqn, TabSpecificField.EXTENSION); + case EntityType.DASHBOARD: + return getDashboardByFqn(fqn, TabSpecificField.EXTENSION); + case EntityType.PIPELINE: + return getPipelineByFqn(fqn, TabSpecificField.EXTENSION); + case EntityType.MLMODEL: + return getMlModelByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.CONTAINER: + return getContainerByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.SEARCH_INDEX: + return getSearchIndexDetailsByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.STORED_PROCEDURE: + return getStoredProceduresDetailsByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.GLOSSARY_TERM: + return getGlossaryTermByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.DATABASE: + return getDatabaseDetailsByFQN(fqn, TabSpecificField.EXTENSION); + case EntityType.DATABASE_SCHEMA: + return getDatabaseSchemaDetailsByFQN(fqn, TabSpecificField.EXTENSION); + default: + // eslint-disable-next-line no-console + console.error(`Custom properties for Entity: ${type} not supported yet.`); + } +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.ts index bae7c552509..db8ef499ec0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.ts @@ -18,7 +18,7 @@ import { TabSpecificField } from '../enums/entity.enum'; import { Dashboard } from '../generated/entity/data/dashboard'; import { sortTagsCaseInsensitive } from './CommonUtils'; -export const defaultFields = `${TabSpecificField.DOMAIN},${TabSpecificField.OWNER}, ${TabSpecificField.FOLLOWERS}, ${TabSpecificField.TAGS}, ${TabSpecificField.CHARTS},${TabSpecificField.EXTENSION}, +export const defaultFields = `${TabSpecificField.DOMAIN},${TabSpecificField.OWNER}, ${TabSpecificField.FOLLOWERS}, ${TabSpecificField.TAGS}, ${TabSpecificField.CHARTS}, ${TabSpecificField.VOTES},${TabSpecificField.DATA_PRODUCTS}`; export const sortTagsForCharts = (charts: ChartType[]) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DatasetDetailsUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/DatasetDetailsUtils.ts index 9411c271479..bfff6032ce7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/DatasetDetailsUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/DatasetDetailsUtils.ts @@ -14,4 +14,4 @@ import { TabSpecificField } from '../enums/entity.enum'; // eslint-disable-next-line max-len -export const defaultFields = `${TabSpecificField.COLUMNS},${TabSpecificField.FOLLOWERS},${TabSpecificField.JOINS},${TabSpecificField.TAGS},${TabSpecificField.OWNER},${TabSpecificField.DATAMODEL},${TabSpecificField.TABLE_CONSTRAINTS},${TabSpecificField.EXTENSION},${TabSpecificField.VIEW_DEFINITION},${TabSpecificField.DOMAIN},${TabSpecificField.DATA_PRODUCTS},${TabSpecificField.VOTES}`; +export const defaultFields = `${TabSpecificField.COLUMNS},${TabSpecificField.FOLLOWERS},${TabSpecificField.JOINS},${TabSpecificField.TAGS},${TabSpecificField.OWNER},${TabSpecificField.DATAMODEL},${TabSpecificField.TABLE_CONSTRAINTS},${TabSpecificField.VIEW_DEFINITION},${TabSpecificField.DOMAIN},${TabSpecificField.DATA_PRODUCTS},${TabSpecificField.VOTES}`; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.test.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.test.tsx index 818381ec0c6..256a6f6bec9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.test.tsx @@ -58,7 +58,6 @@ import { getEdgeStyle, getEdgeType, getEntityLineagePath, - getParamByEntityType, getRemovedNodeData, getUpdatedEdge, getUpdatedEdgeWithPipeline, @@ -68,7 +67,7 @@ import { isTracedEdge, } from './EntityLineageUtils'; -describe.skip('Test EntityLineageUtils utility', () => { +describe('Test EntityLineageUtils utility', () => { it('findUpstreamDownStreamEdge function should work properly', () => { const upstreamData = findUpstreamDownStreamEdge( MOCK_LINEAGE_DATA.upstreamEdges, @@ -313,22 +312,6 @@ describe.skip('Test EntityLineageUtils utility', () => { expect(isColumnTracedFalsy).toBeFalsy(); }); - it('returns the correct parameter for table entity types - getParamByEntityType', () => { - expect(getParamByEntityType(EntityType.TABLE)).toEqual('datasetFQN'); - }); - - it('returns the correct parameter for other entity types - getParamByEntityType', () => { - expect(getParamByEntityType(EntityType.TOPIC)).toEqual('topicFQN'); - expect(getParamByEntityType(EntityType.PIPELINE)).toEqual('pipelineFQN'); - expect(getParamByEntityType(EntityType.MLMODEL)).toEqual('mlModelFqn'); - expect(getParamByEntityType(EntityType.DASHBOARD)).toEqual('dashboardFQN'); - expect(getParamByEntityType(EntityType.DATABASE)).toEqual('databaseFQN'); - expect(getParamByEntityType(EntityType.DATABASE_SCHEMA)).toEqual( - 'databaseSchemaFQN' - ); - expect(getParamByEntityType(EntityType.ALERT)).toEqual('entityFQN'); - }); - it('should return the correct lineage path for the given entity type and FQN', () => { expect(getEntityLineagePath(EntityType.TABLE, 'myTable')).toEqual( getTableTabPath('myTable', 'lineage') @@ -345,7 +328,6 @@ describe.skip('Test EntityLineageUtils utility', () => { expect(getEntityLineagePath(EntityType.MLMODEL, 'myModel')).toEqual( getMlModelPath('myModel', 'lineage') ); - expect(getEntityLineagePath(EntityType.TABLE, 'myDataset')).toEqual(''); }); it('getChildMap should return valid map object', () => { @@ -356,7 +338,7 @@ describe.skip('Test EntityLineageUtils utility', () => { const expectedStyle = { opacity: 1, strokeWidth: 2, - stroke: '#B02AAC', + stroke: '#2196f3', }; expect(getEdgeStyle(true)).toEqual(expectedStyle); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx index 4afec2b2a94..3c89ac7c697 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx @@ -1313,33 +1313,6 @@ export const removeLineageHandler = async (data: EdgeData): Promise => { } }; -export const getParamByEntityType = (entityType: EntityType): string => { - switch (entityType) { - case EntityType.TABLE: - return 'datasetFQN'; - case EntityType.TOPIC: - return 'topicFQN'; - case EntityType.PIPELINE: - return 'pipelineFQN'; - case EntityType.MLMODEL: - return 'mlModelFqn'; - case EntityType.DASHBOARD: - return 'dashboardFQN'; - case EntityType.SEARCH_INDEX: - return 'searchIndexFQN'; - case EntityType.DATABASE: - return 'databaseFQN'; - case EntityType.DATABASE_SCHEMA: - return 'databaseSchemaFQN'; - case EntityType.DASHBOARD_DATA_MODEL: - return 'dashboardDataModelFQN'; - case EntityType.STORED_PROCEDURE: - return 'storedProcedureFQN'; - default: - return 'entityFQN'; - } -}; - export const getEntityLineagePath = ( entityType: EntityType, entityFQN: string diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx index 729366d7137..67ea7e1387b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx @@ -13,7 +13,10 @@ import { Space, Typography } from 'antd'; import { ReactComponent as IconTeamsGrey } from 'assets/svg/teams-grey.svg'; -import { EntityDetails } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; +import { + ExtentionEntities, + ExtentionEntitiesKeys, +} from 'components/common/CustomPropertyTable/CustomPropertyTable.interface'; import ProfilePicture from 'components/common/ProfilePicture/ProfilePicture'; import { FQN_SEPARATOR_CHAR } from 'constants/char.constants'; import { getTeamAndUserDetailsPath, getUserPath } from 'constants/constants'; @@ -719,7 +722,7 @@ export function getColumnsDataWithVersionChanges< } export const getUpdatedExtensionDiffFields = ( - entityDetails: EntityDetails, + entityDetails: ExtentionEntities[ExtentionEntitiesKeys], extensionDiff: EntityDiffProps ) => { const extensionObj = entityDetails.extension; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsUtils.tsx index d53c1703b72..4861a55ed12 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/GlobalSettingsUtils.tsx @@ -14,6 +14,30 @@ import { SearchOutlined } from '@ant-design/icons'; import { Badge } from 'antd'; import { ItemType } from 'antd/lib/menu/hooks/useItems'; +import { ReactComponent as AdminIcon } from 'assets/svg/admin.svg'; +import { ReactComponent as AllActivityIcon } from 'assets/svg/all-activity.svg'; +import { ReactComponent as BotIcon } from 'assets/svg/bot-profile.svg'; +import { ReactComponent as DashboardIcon } from 'assets/svg/dashboard-grey.svg'; +import { ReactComponent as DataInsightIcon } from 'assets/svg/data-insight.svg'; +import { ReactComponent as ElasticSearchIcon } from 'assets/svg/elasticsearch.svg'; +import { ReactComponent as EmailSettingsIcon } from 'assets/svg/email-settings.svg'; +import { ReactComponent as GlossaryIcon } from 'assets/svg/glossary.svg'; +import { ReactComponent as BellIcon } from 'assets/svg/ic-alert-bell.svg'; +import { ReactComponent as CustomLogoIcon } from 'assets/svg/ic-custom-logo.svg'; +import { ReactComponent as DataInsightReportIcon } from 'assets/svg/ic-data-insight-report.svg'; +import { ReactComponent as DatabaseIcon } from 'assets/svg/ic-database.svg'; +import { ReactComponent as SchemaIcon } from 'assets/svg/ic-schema.svg'; +import { ReactComponent as StorageIcon } from 'assets/svg/ic-storage.svg'; +import { ReactComponent as StoredProcedureIcon } from 'assets/svg/ic-stored-procedure.svg'; +import { ReactComponent as RolesIcon } from 'assets/svg/icon-role-grey.svg'; +import { ReactComponent as OMLogo } from 'assets/svg/metadata.svg'; +import { ReactComponent as MlModelIcon } from 'assets/svg/mlmodal.svg'; +import { ReactComponent as PipelineIcon } from 'assets/svg/pipeline-grey.svg'; +import { ReactComponent as PoliciesIcon } from 'assets/svg/policies.svg'; +import { ReactComponent as TableIcon } from 'assets/svg/table-grey.svg'; +import { ReactComponent as TeamsIcon } from 'assets/svg/teams-grey.svg'; +import { ReactComponent as TopicIcon } from 'assets/svg/topic-grey.svg'; +import { ReactComponent as UsersIcon } from 'assets/svg/user.svg'; import classNames from 'classnames'; import { ResourceEntity, @@ -23,28 +47,7 @@ import { GlobalSettingOptions } from 'constants/GlobalSettings.constants'; import { EntityType } from 'enums/entity.enum'; import i18next from 'i18next'; import React, { ReactNode } from 'react'; -import { ReactComponent as AdminIcon } from '../../src/assets/svg/admin.svg'; -import { ReactComponent as AllActivityIcon } from '../../src/assets/svg/all-activity.svg'; -import { ReactComponent as BotIcon } from '../../src/assets/svg/bot-profile.svg'; -import { ReactComponent as DashboardIcon } from '../../src/assets/svg/dashboard-grey.svg'; -import { ReactComponent as DataInsightIcon } from '../../src/assets/svg/data-insight.svg'; -import { ReactComponent as ElasticSearchIcon } from '../../src/assets/svg/elasticsearch.svg'; -import { ReactComponent as EmailSettingsIcon } from '../../src/assets/svg/email-settings.svg'; -import { ReactComponent as BellIcon } from '../../src/assets/svg/ic-alert-bell.svg'; -import { ReactComponent as DataInsightReportIcon } from '../../src/assets/svg/ic-data-insight-report.svg'; -import { ReactComponent as RolesIcon } from '../../src/assets/svg/icon-role-grey.svg'; -import { ReactComponent as OMLogo } from '../../src/assets/svg/metadata.svg'; -import { ReactComponent as MlModelIcon } from '../../src/assets/svg/mlmodal.svg'; -import { ReactComponent as PipelineIcon } from '../../src/assets/svg/pipeline-grey.svg'; -import { ReactComponent as PoliciesIcon } from '../../src/assets/svg/policies.svg'; -import { ReactComponent as TableIcon } from '../../src/assets/svg/table-grey.svg'; -import { ReactComponent as TeamsIcon } from '../../src/assets/svg/teams-grey.svg'; -import { ReactComponent as TopicIcon } from '../../src/assets/svg/topic-grey.svg'; -import { ReactComponent as UsersIcon } from '../../src/assets/svg/user.svg'; -import { ReactComponent as CustomLogoIcon } from '../assets/svg/ic-custom-logo.svg'; -import { ReactComponent as StorageIcon } from '../assets/svg/ic-storage.svg'; -import { ReactComponent as StoredProcedureIcon } from '../assets/svg/ic-stored-procedure.svg'; -import { userPermissions } from '../utils/PermissionsUtils'; +import { userPermissions } from 'utils/PermissionsUtils'; export interface MenuListItem { label: string; @@ -269,6 +272,24 @@ export const getGlobalSettingsMenuWithPermission = ( key: 'customAttributes.storedProcedure', icon: , }, + { + label: i18next.t('label.glossary-term'), + isProtected: Boolean(isAdminUser), + key: 'customAttributes.glossaryTerm', + icon: , + }, + { + label: i18next.t('label.database'), + isProtected: Boolean(isAdminUser), + key: 'customAttributes.database', + icon: , + }, + { + label: i18next.t('label.database-schema'), + isProtected: Boolean(isAdminUser), + key: 'customAttributes.databaseSchema', + icon: , + }, ], }, { @@ -388,6 +409,12 @@ export const getSettingOptionByEntityType = (entityType: EntityType) => { return GlobalSettingOptions.MLMODELS; case EntityType.CONTAINER: return GlobalSettingOptions.CONTAINERS; + case EntityType.DATABASE: + return GlobalSettingOptions.DATABASE; + case EntityType.DATABASE_SCHEMA: + return GlobalSettingOptions.DATABASE_SCHEMA; + case EntityType.GLOSSARY_TERM: + return GlobalSettingOptions.GLOSSARY_TERM; case EntityType.TABLE: default: diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/MlModelDetailsUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/MlModelDetailsUtils.ts index 1a2db588aec..2fa6ba71955 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/MlModelDetailsUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/MlModelDetailsUtils.ts @@ -14,4 +14,4 @@ import { TabSpecificField } from '../enums/entity.enum'; export const defaultFields = `${TabSpecificField.FOLLOWERS}, ${TabSpecificField.TAGS}, ${TabSpecificField.DOMAIN}, -${TabSpecificField.OWNER}, ${TabSpecificField.DASHBOARD} ,${TabSpecificField.EXTENSION},${TabSpecificField.VOTES}`; +${TabSpecificField.OWNER}, ${TabSpecificField.DASHBOARD} ,${TabSpecificField.VOTES}`; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.ts index 523aa56ab85..4509c18c671 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.ts @@ -22,7 +22,7 @@ import { sortTagsCaseInsensitive } from './CommonUtils'; import { Icons } from './SvgUtils'; export const defaultFields = `${TabSpecificField.FOLLOWERS}, ${TabSpecificField.TAGS}, ${TabSpecificField.OWNER}, -${TabSpecificField.TASKS}, ${TabSpecificField.PIPELINE_STATUS},${TabSpecificField.EXTENSION}, ${TabSpecificField.DOMAIN},${TabSpecificField.VOTES}`; +${TabSpecificField.TASKS}, ${TabSpecificField.PIPELINE_STATUS}, ${TabSpecificField.DOMAIN},${TabSpecificField.VOTES}`; export const getTaskExecStatus = (taskName: string, tasks: TaskStatus[]) => { return tasks.find((task) => task.name === taskName)?.executionStatus || ''; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts index f85dbe7cf06..8a1f2db8fc0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts @@ -23,24 +23,15 @@ import { PLACEHOLDER_ACTION, PLACEHOLDER_DASHBOARD_TYPE, PLACEHOLDER_ENTITY_TYPE_FQN, - PLACEHOLDER_GLOSSARY_NAME, - PLACEHOLDER_GLOSSARY_TERMS_FQN, - PLACEHOLDER_ROUTE_DATABASE_FQN, - PLACEHOLDER_ROUTE_DATABASE_SCHEMA_FQN, PLACEHOLDER_ROUTE_FQN, PLACEHOLDER_ROUTE_INGESTION_FQN, PLACEHOLDER_ROUTE_INGESTION_TYPE, PLACEHOLDER_ROUTE_QUERY_ID, PLACEHOLDER_ROUTE_SERVICE_CAT, - PLACEHOLDER_ROUTE_SERVICE_FQN, PLACEHOLDER_ROUTE_TAB, - PLACEHOLDER_ROUTE_TABLE_FQN, - PLACEHOLDER_ROUTE_TEST_CASE_FQN, PLACEHOLDER_ROUTE_VERSION, PLACEHOLDER_RULE_NAME, PLACEHOLDER_SETTING_CATEGORY, - PLACEHOLDER_TAG_NAME, - PLACEHOLDER_TEST_SUITE_FQN, ROUTES, } from '../constants/constants'; import { @@ -86,7 +77,7 @@ export const getEditConnectionPath = ( let path = ROUTES.EDIT_SERVICE_CONNECTION; path = path .replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCategory) - .replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN) + .replace(PLACEHOLDER_ROUTE_FQN, serviceFQN) .replace(PLACEHOLDER_ROUTE_TAB, 'connection'); return path; @@ -99,7 +90,7 @@ export const getPathByServiceFQN = ( let path = ROUTES.SERVICE_WITH_TAB; path = path .replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCategory) - .replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN) + .replace(PLACEHOLDER_ROUTE_FQN, serviceFQN) .replace(PLACEHOLDER_ROUTE_TAB, 'connection'); return path; @@ -113,7 +104,7 @@ export const getAddIngestionPath = ( let path = ROUTES.ADD_INGESTION; path = path .replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCategory) - .replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN) + .replace(PLACEHOLDER_ROUTE_FQN, serviceFQN) .replace(PLACEHOLDER_ROUTE_INGESTION_TYPE, ingestionType); return path; @@ -128,7 +119,7 @@ export const getEditIngestionPath = ( let path = ROUTES.EDIT_INGESTION; path = path .replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCategory) - .replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN) + .replace(PLACEHOLDER_ROUTE_FQN, serviceFQN) .replace(PLACEHOLDER_ROUTE_INGESTION_FQN, ingestionFQN) .replace(PLACEHOLDER_ROUTE_INGESTION_TYPE, ingestionType); @@ -173,21 +164,7 @@ export const getGlossaryPath = (fqn?: string) => { let path = ROUTES.GLOSSARY; if (fqn) { path = ROUTES.GLOSSARY_DETAILS; - path = path.replace(PLACEHOLDER_GLOSSARY_NAME, encodeURIComponent(fqn)); - } - - return path; -}; - -export const getGlossaryTermsPath = ( - glossaryName: string, - glossaryTerm = '' -) => { - let path = glossaryTerm ? ROUTES.GLOSSARY_TERMS : ROUTES.GLOSSARY_DETAILS; - path = path.replace(PLACEHOLDER_GLOSSARY_NAME, glossaryName); - - if (glossaryTerm) { - path = path.replace(PLACEHOLDER_GLOSSARY_TERMS_FQN, glossaryTerm); + path = path.replace(PLACEHOLDER_ROUTE_FQN, encodeURIComponent(fqn)); } return path; @@ -334,7 +311,7 @@ export const getTagPath = (fqn?: string) => { let path = ROUTES.TAGS; if (fqn) { path = ROUTES.TAG_DETAILS; - path = path.replace(PLACEHOLDER_TAG_NAME, getEncodedFqn(fqn)); + path = path.replace(PLACEHOLDER_ROUTE_FQN, getEncodedFqn(fqn)); } return path; @@ -355,7 +332,7 @@ export const getAddDataQualityTableTestPath = ( export const getTestSuitePath = (testSuiteName: string) => { let path = ROUTES.TEST_SUITES_WITH_FQN; - path = path.replace(PLACEHOLDER_TEST_SUITE_FQN, testSuiteName); + path = path.replace(PLACEHOLDER_ROUTE_FQN, testSuiteName); return path; }; @@ -367,7 +344,7 @@ export const getTestSuiteIngestionPath = ( let path = ingestionFQN ? ROUTES.TEST_SUITES_EDIT_INGESTION : ROUTES.TEST_SUITES_ADD_INGESTION; - path = path.replace(PLACEHOLDER_TEST_SUITE_FQN, testSuiteName); + path = path.replace(PLACEHOLDER_ROUTE_FQN, testSuiteName); if (ingestionFQN) { path = path.replace(PLACEHOLDER_ROUTE_INGESTION_FQN, ingestionFQN); @@ -436,7 +413,7 @@ export const getGlossaryPathWithAction = ( let path = ROUTES.GLOSSARY_DETAILS_WITH_ACTION; path = path - .replace(PLACEHOLDER_GLOSSARY_NAME, fqn) + .replace(PLACEHOLDER_ROUTE_FQN, fqn) .replace(PLACEHOLDER_ACTION, action); return path; @@ -446,7 +423,7 @@ export const getQueryPath = (entityFqn: string, queryId: string) => { let path = ROUTES.QUERY_FULL_SCREEN_VIEW; path = path - .replace(PLACEHOLDER_ROUTE_TABLE_FQN, entityFqn) + .replace(PLACEHOLDER_ROUTE_FQN, entityFqn) .replace(PLACEHOLDER_ROUTE_QUERY_ID, queryId); return path; @@ -454,7 +431,7 @@ export const getQueryPath = (entityFqn: string, queryId: string) => { export const getAddQueryPath = (entityFqn: string) => { let path = ROUTES.ADD_QUERY; - path = path.replace(PLACEHOLDER_ROUTE_TABLE_FQN, entityFqn); + path = path.replace(PLACEHOLDER_ROUTE_FQN, entityFqn); return path; }; @@ -486,7 +463,7 @@ export const getGlossaryVersionsPath = ( ) => { let path = ROUTES.GLOSSARY_VERSION; path = path - .replace(PLACEHOLDER_GLOSSARY_NAME, glossaryName) + .replace(PLACEHOLDER_ROUTE_FQN, glossaryName) .replace(PLACEHOLDER_ROUTE_VERSION, version); return path; @@ -501,7 +478,7 @@ export const getGlossaryTermsVersionsPath = ( ? ROUTES.GLOSSARY_TERMS_VERSION_TAB : ROUTES.GLOSSARY_TERMS_VERSION; path = path - .replace(PLACEHOLDER_GLOSSARY_NAME, encodeURIComponent(glossaryTermsFQN)) + .replace(PLACEHOLDER_ROUTE_FQN, encodeURIComponent(glossaryTermsFQN)) .replace(PLACEHOLDER_ROUTE_VERSION, version); if (tab) { @@ -514,7 +491,7 @@ export const getGlossaryTermsVersionsPath = ( export const getTestCaseDetailsPath = (testCaseFQN: string) => { let path = ROUTES.TEST_CASE_DETAILS; - path = path.replace(PLACEHOLDER_ROUTE_TEST_CASE_FQN, testCaseFQN); + path = path.replace(PLACEHOLDER_ROUTE_FQN, testCaseFQN); return path; }; @@ -538,7 +515,7 @@ export const getServiceVersionPath = ( path = path .replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCategory) - .replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN) + .replace(PLACEHOLDER_ROUTE_FQN, serviceFQN) .replace(PLACEHOLDER_ROUTE_VERSION, version); return path; @@ -551,7 +528,7 @@ export const getDatabaseVersionPath = ( let path = ROUTES.DATABASE_VERSION; path = path - .replace(PLACEHOLDER_ROUTE_DATABASE_FQN, databaseFQN) + .replace(PLACEHOLDER_ROUTE_FQN, databaseFQN) .replace(PLACEHOLDER_ROUTE_VERSION, version); return path; @@ -564,7 +541,7 @@ export const getDatabaseSchemaVersionPath = ( let path = ROUTES.SCHEMA_VERSION; path = path - .replace(PLACEHOLDER_ROUTE_DATABASE_SCHEMA_FQN, schemaFQN) + .replace(PLACEHOLDER_ROUTE_FQN, schemaFQN) .replace(PLACEHOLDER_ROUTE_VERSION, version); return path; @@ -572,7 +549,7 @@ export const getDatabaseSchemaVersionPath = ( export const getClassificationDetailsPath = (classificationFQN: string) => { let path = ROUTES.TAG_DETAILS; - path = path.replace(PLACEHOLDER_TAG_NAME, classificationFQN); + path = path.replace(PLACEHOLDER_ROUTE_FQN, classificationFQN); return path; }; @@ -583,7 +560,7 @@ export const getClassificationVersionsPath = ( ) => { let path = ROUTES.TAG_VERSION; path = path - .replace(PLACEHOLDER_TAG_NAME, classificationFQN) + .replace(PLACEHOLDER_ROUTE_FQN, classificationFQN) .replace(PLACEHOLDER_ROUTE_VERSION, version); return path; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SearchIndexUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/SearchIndexUtils.tsx index 56f0fa0e72f..42bcf407c0d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/SearchIndexUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/SearchIndexUtils.tsx @@ -12,7 +12,7 @@ */ import { - PLACEHOLDER_ROUTE_SEARCH_INDEX_FQN, + PLACEHOLDER_ROUTE_FQN, PLACEHOLDER_ROUTE_SUB_TAB, PLACEHOLDER_ROUTE_TAB, ROUTES, @@ -22,7 +22,7 @@ import { SearchIndexField } from 'generated/entity/data/searchIndex'; import { uniqueId } from 'lodash'; import { sortTagsCaseInsensitive } from './CommonUtils'; -export const defaultFields = `${TabSpecificField.FIELDS},${TabSpecificField.EXTENSION},${TabSpecificField.FOLLOWERS},${TabSpecificField.TAGS},${TabSpecificField.OWNER},${TabSpecificField.DOMAIN}`; +export const defaultFields = `${TabSpecificField.FIELDS},${TabSpecificField.FOLLOWERS},${TabSpecificField.TAGS},${TabSpecificField.OWNER},${TabSpecificField.DOMAIN}`; export const makeRow = (column: SearchIndexField) => { return { @@ -48,7 +48,7 @@ export const makeData = ( export const getSearchIndexDetailsPath = (searchIndexFQN: string) => { let path = ROUTES.SEARCH_INDEX_DETAILS; - path = path.replace(PLACEHOLDER_ROUTE_SEARCH_INDEX_FQN, searchIndexFQN); + path = path.replace(PLACEHOLDER_ROUTE_FQN, searchIndexFQN); return path; }; @@ -65,7 +65,7 @@ export const getSearchIndexTabPath = ( path = path.replace(PLACEHOLDER_ROUTE_SUB_TAB, subTab); } path = path - .replace(PLACEHOLDER_ROUTE_SEARCH_INDEX_FQN, searchIndexFQN) + .replace(PLACEHOLDER_ROUTE_FQN, searchIndexFQN) .replace(PLACEHOLDER_ROUTE_TAB, tab); return path; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/StoredProceduresUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/StoredProceduresUtils.tsx index 5bd80b669a1..d3f88b848a8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/StoredProceduresUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/StoredProceduresUtils.tsx @@ -13,4 +13,4 @@ import { TabSpecificField } from 'enums/entity.enum'; export const STORED_PROCEDURE_DEFAULT_FIELDS = `${TabSpecificField.OWNER}, ${TabSpecificField.FOLLOWERS}, -${TabSpecificField.TAGS}, ${TabSpecificField.EXTENSION}, ${TabSpecificField.DOMAIN}, ${TabSpecificField.VOTES}`; +${TabSpecificField.TAGS}, ${TabSpecificField.DOMAIN}, ${TabSpecificField.VOTES}`; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts index 8915cc9f1a9..574e30ac4a3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts @@ -48,8 +48,8 @@ import { getDatabaseDetailsPath, getDatabaseSchemaDetailsPath, getServiceDetailsPath, - PLACEHOLDER_ROUTE_ENTITY_FQN, PLACEHOLDER_ROUTE_ENTITY_TYPE, + PLACEHOLDER_ROUTE_FQN, ROUTES, } from '../constants/constants'; import { @@ -89,7 +89,7 @@ export const getRequestDescriptionPath = ( let pathname = ROUTES.REQUEST_DESCRIPTION; pathname = pathname .replace(PLACEHOLDER_ROUTE_ENTITY_TYPE, entityType) - .replace(PLACEHOLDER_ROUTE_ENTITY_FQN, entityFQN); + .replace(PLACEHOLDER_ROUTE_FQN, entityFQN); const searchParams = new URLSearchParams(); if (!isUndefined(field) && !isUndefined(value)) { @@ -109,7 +109,7 @@ export const getRequestTagsPath = ( let pathname = ROUTES.REQUEST_TAGS; pathname = pathname .replace(PLACEHOLDER_ROUTE_ENTITY_TYPE, entityType) - .replace(PLACEHOLDER_ROUTE_ENTITY_FQN, entityFQN); + .replace(PLACEHOLDER_ROUTE_FQN, entityFQN); const searchParams = new URLSearchParams(); if (!isUndefined(field) && !isUndefined(value)) { @@ -129,7 +129,7 @@ export const getUpdateDescriptionPath = ( let pathname = ROUTES.UPDATE_DESCRIPTION; pathname = pathname .replace(PLACEHOLDER_ROUTE_ENTITY_TYPE, entityType) - .replace(PLACEHOLDER_ROUTE_ENTITY_FQN, entityFQN); + .replace(PLACEHOLDER_ROUTE_FQN, entityFQN); const searchParams = new URLSearchParams(); if (!isUndefined(field) && !isUndefined(value)) { @@ -149,7 +149,7 @@ export const getUpdateTagsPath = ( let pathname = ROUTES.UPDATE_TAGS; pathname = pathname .replace(PLACEHOLDER_ROUTE_ENTITY_TYPE, entityType) - .replace(PLACEHOLDER_ROUTE_ENTITY_FQN, entityFQN); + .replace(PLACEHOLDER_ROUTE_FQN, entityFQN); const searchParams = new URLSearchParams(); if (!isUndefined(field) && !isUndefined(value)) {