From 80966087cb906e339fc1b95c6b351275d3129657 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Wed, 20 Mar 2024 13:14:23 +0530 Subject: [PATCH 1/2] Fix(#15296): Issue with the same service name (#15618) * Fix(#15296): Issue with the same service name * add serviceType parameter in cypress test interceptURL for pipelines --- .../src/main/resources/ui/cypress/constants/constants.ts | 1 + .../main/resources/ui/cypress/e2e/Pages/LoginConfiguration.ts | 2 +- .../src/main/resources/ui/cypress/e2e/Pages/Service.spec.ts | 2 +- .../ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.ts b/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.ts index e9ab6794b0d..c18a5ff0bae 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.ts @@ -465,6 +465,7 @@ export const service = { description: 'This is a Glue service', newDescription: 'This is updated Glue service description', Owner: 'Aaron Johnson', + serviceType: 'databaseService', }; export const SERVICE_TYPE = { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/LoginConfiguration.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/LoginConfiguration.ts index 6a9cac3b03f..7e63515c919 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/LoginConfiguration.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/LoginConfiguration.ts @@ -34,7 +34,7 @@ describe('Login configuration', { tags: 'Settings' }, () => { cy.get('[data-testid="access-block-time"]').should('have.text', '500'); cy.get('[data-testid="jwt-token-expiry-time"]').should( 'have.text', - '5000 Milliseconds' + '5000 Seconds' ); /* ==== End Cypress Studio ==== */ }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.ts index 6f59cee7287..39e98a0dfd7 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Service.spec.ts @@ -34,7 +34,7 @@ describe('Services page should work properly', { tags: 'Integration' }, () => { ); interceptURL( 'GET', - `/api/v1/services/ingestionPipelines?fields=*&service=${service.name}*`, + `/api/v1/services/ingestionPipelines?fields=*&service=${service.name}*&serviceType=${service.serviceType}`, 'ingestionPipelines' ); cy.login(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx index c695b0be96e..b814ab28e0f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx @@ -266,6 +266,7 @@ const ServiceDetailsPage: FunctionComponent = () => { const response = await getIngestionPipelines({ arrQueryFields: ['owner', 'pipelineStatuses'], serviceFilter: decodedServiceFQN, + serviceType: getEntityTypeFromServiceCategory(serviceCategory), paging, pipelineType: [ PipelineType.Metadata, From f33521399ebbb2e703cfe4c9c4c37385b8e32a94 Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:51:46 +0530 Subject: [PATCH 2/2] support extra options for manage button (#15564) * support extra options for manage button * revert Icon to icon as prop name should be lower only * address comments * fix type --- .../DataProductsDetailsPage.component.tsx | 6 +- .../SampleDataTable.component.tsx | 9 +- .../DomainDetailsPage.component.tsx | 6 +- .../GlossaryHeader.component.tsx | 19 +-- .../tabs/AssetsTabs.component.tsx | 143 +++++++++--------- .../AppDetails/AppDetails.component.tsx | 24 +-- .../Team/TeamDetails/TeamDetailsV1.tsx | 16 +- .../TeamDetails/UserTab/UserTab.component.tsx | 4 +- .../ManageButton/ManageButton.tsx | 35 +---- .../ManageButtonContentItem.component.tsx | 5 +- .../ManageButtonContentItem.test.tsx | 15 +- .../ManageButtonItemLabel.interface.ts | 2 +- .../DatabaseDetailsPage.tsx | 7 + .../DatabaseSchemaPage.component.tsx | 7 + .../ui/src/pages/LoginPage/SignInPage.tsx | 3 +- .../TableDetailsPageV1/TableDetailsPageV1.tsx | 7 + .../ui/src/utils/ClassificationUtils.tsx | 4 +- .../ui/src/utils/EntityUtilClassBase.ts | 9 ++ 18 files changed, 151 insertions(+), 170 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx index 0a3edd6449b..130e568c708 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx @@ -249,7 +249,7 @@ const DataProductsDetailsPage = ({ description={t('message.rename-entity', { entity: t('label.data-product'), })} - icon={} + icon={EditIcon} id="rename-button" name={t('label.rename')} /> @@ -271,7 +271,7 @@ const DataProductsDetailsPage = ({ description={t('message.edit-entity-style-description', { entity: t('label.data-product'), })} - icon={} + icon={StyleIcon} id="rename-button" name={t('label.style')} /> @@ -296,7 +296,7 @@ const DataProductsDetailsPage = ({ entityType: t('label.data-product'), } )} - icon={} + icon={DeleteIcon} id="delete-button" name={t('label.delete')} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx index eb133503a61..76620de74f8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx @@ -28,7 +28,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { ReactComponent as IconDelete } from '../../../assets/svg/ic-delete.svg'; import { ReactComponent as IconDropdown } from '../../../assets/svg/menu.svg'; import { WORKFLOWS_PROFILER_DOCS } from '../../../constants/docs.constants'; -import { DROPDOWN_ICON_SIZE_PROPS } from '../../../constants/ManageButton.constants'; import { mockDatasetData } from '../../../constants/mockTourData.constants'; import { useTourProvider } from '../../../context/TourProvider/TourProvider'; import { EntityType } from '../../../enums/entity.enum'; @@ -157,13 +156,7 @@ const SampleDataTable = ({ description={t('message.delete-entity-type-action-description', { entityType: t('label.sample-data'), })} - icon={ - - } + icon={IconDelete} id="delete-button" name={t('label.delete')} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetailsPage/DomainDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetailsPage/DomainDetailsPage.component.tsx index 83846e9a700..68e239cd91a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetailsPage/DomainDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetailsPage/DomainDetailsPage.component.tsx @@ -361,7 +361,7 @@ const DomainDetailsPage = ({ description={t('message.rename-entity', { entity: t('label.domain'), })} - icon={} + icon={EditIcon} id="rename-button" name={t('label.rename')} /> @@ -383,7 +383,7 @@ const DomainDetailsPage = ({ description={t('message.edit-entity-style-description', { entity: t('label.domain'), })} - icon={} + icon={StyleIcon} id="edit-style-button" name={t('label.style')} /> @@ -408,7 +408,7 @@ const DomainDetailsPage = ({ entityType: t('label.domain'), } )} - icon={} + icon={DeleteIcon} id="delete-button" name={t('label.delete')} /> 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 848e6df619c..c741d6e5367 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,6 +54,7 @@ import { Status, } from '../../../generated/entity/data/glossaryTerm'; import { Style } from '../../../generated/type/tagLabel'; +import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { useFqn } from '../../../hooks/useFqn'; import { exportGlossaryInCSVFormat, @@ -71,8 +72,6 @@ import { getGlossaryVersionsPath, } from '../../../utils/RouterUtils'; import { showErrorToast } from '../../../utils/ToastUtils'; - -import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { TitleBreadcrumbProps } from '../../common/TitleBreadcrumb/TitleBreadcrumb.interface'; import Voting from '../../Entity/Voting/Voting.component'; import StyleModal from '../../Modals/StyleModal/StyleModal.component'; @@ -274,7 +273,7 @@ const GlossaryHeader = ({ description={t('message.export-entity-help', { entity: t('label.glossary-term-lowercase-plural'), })} - icon={} + icon={ExportIcon} id="export-button" name={t('label.export')} /> @@ -292,7 +291,7 @@ const GlossaryHeader = ({ description={t('message.import-entity-help', { entity: t('label.glossary-term-lowercase'), })} - icon={} + icon={ImportIcon} id="import-button" name={t('label.import')} /> @@ -316,7 +315,7 @@ const GlossaryHeader = ({ ? t('label.glossary') : t('label.glossary-term'), })} - icon={} + icon={EditIcon} id="rename-button" name={t('label.rename')} /> @@ -338,7 +337,7 @@ const GlossaryHeader = ({ description={t('message.edit-entity-style-description', { entity: t('label.glossary-term'), })} - icon={} + icon={StyleIcon} id="rename-button" name={t('label.style')} /> @@ -365,13 +364,7 @@ const GlossaryHeader = ({ : t('label.glossary-term'), } )} - icon={ - - } + icon={IconDelete} id="delete-button" name={t('label.delete')} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx index 1434c4e9d2d..0e111ce6360 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx @@ -47,10 +47,7 @@ import { AssetsFilterOptions, ASSET_MENU_KEYS, } from '../../../../constants/Assets.constants'; -import { - DE_ACTIVE_COLOR, - ES_UPDATE_DELAY, -} from '../../../../constants/constants'; +import { ES_UPDATE_DELAY } from '../../../../constants/constants'; import { GLOSSARIES_DOCS } from '../../../../constants/docs.constants'; import { ERROR_PLACEHOLDER_TYPE } from '../../../../enums/common.enum'; import { EntityType } from '../../../../enums/entity.enum'; @@ -288,6 +285,11 @@ const AssetsTabs = forwardRef( } }; + const onExploreCardDelete = useCallback((source: SourceType) => { + setAssetToDelete(source); + setShowDeleteModal(true); + }, []); + const handleAssetButtonVisibleChange = (newVisible: boolean) => setVisible(newVisible); @@ -321,7 +323,7 @@ const AssetsTabs = forwardRef( description={t('message.delete-asset-from-entity-type', { entityType: entityTypeString, })} - icon={} + icon={DeleteIcon} id="delete-button" name={t('label.delete')} /> @@ -335,11 +337,6 @@ const AssetsTabs = forwardRef( }, ]; - const onExploreCardDelete = useCallback((source: SourceType) => { - setAssetToDelete(source); - setShowDeleteModal(true); - }, []); - const handleCheckboxChange = ( selected: boolean, source: EntityDetailUnion @@ -384,6 +381,69 @@ const AssetsTabs = forwardRef( } }; + const onAssetRemove = useCallback( + async (assetsData: SourceType[]) => { + if (!activeEntity) { + return; + } + + setAssetRemoving(true); + + try { + const entities = [...(assetsData?.values() ?? [])].map((item) => { + return getEntityReferenceFromEntity( + item as EntityDetailUnion, + (item as EntityDetailUnion).entityType + ); + }); + + switch (type) { + case AssetsOfEntity.DATA_PRODUCT: + await removeAssetsFromDataProduct( + activeEntity.fullyQualifiedName ?? '', + entities + ); + + break; + + case AssetsOfEntity.GLOSSARY: + await removeAssetsFromGlossaryTerm( + activeEntity as GlossaryTerm, + entities + ); + + break; + + case AssetsOfEntity.DOMAIN: + await removeAssetsFromDomain( + activeEntity.fullyQualifiedName ?? '', + entities + ); + + break; + default: + // Handle other entity types here + break; + } + + await new Promise((resolve) => { + setTimeout(() => { + resolve(''); + }, ES_UPDATE_DELAY); + }); + } catch (err) { + showErrorToast(err as AxiosError); + } finally { + setShowDeleteModal(false); + onRemoveAsset?.(); + setAssetRemoving(false); + hideNotification(); + setSelectedItems(new Map()); // Reset selected items + } + }, + [type, activeEntity, entityFqn] + ); + const deleteSelectedItems = useCallback(() => { if (selectedItems) { onAssetRemove(Array.from(selectedItems.values())); @@ -655,69 +715,6 @@ const AssetsTabs = forwardRef( ); }, [assetsHeader, assetListing, selectedCard]); - const onAssetRemove = useCallback( - async (assetsData: SourceType[]) => { - if (!activeEntity) { - return; - } - - setAssetRemoving(true); - - try { - const entities = [...(assetsData?.values() ?? [])].map((item) => { - return getEntityReferenceFromEntity( - item as EntityDetailUnion, - (item as EntityDetailUnion).entityType - ); - }); - - switch (type) { - case AssetsOfEntity.DATA_PRODUCT: - await removeAssetsFromDataProduct( - activeEntity.fullyQualifiedName ?? '', - entities - ); - - break; - - case AssetsOfEntity.GLOSSARY: - await removeAssetsFromGlossaryTerm( - activeEntity as GlossaryTerm, - entities - ); - - break; - - case AssetsOfEntity.DOMAIN: - await removeAssetsFromDomain( - activeEntity.fullyQualifiedName ?? '', - entities - ); - - break; - default: - // Handle other entity types here - break; - } - - await new Promise((resolve) => { - setTimeout(() => { - resolve(''); - }, ES_UPDATE_DELAY); - }); - } catch (err) { - showErrorToast(err as AxiosError); - } finally { - setShowDeleteModal(false); - onRemoveAsset?.(); - setAssetRemoving(false); - hideNotification(); - setSelectedItems(new Map()); // Reset selected items - } - }, - [type, activeEntity, entityFqn] - ); - const clearFilters = useCallback(() => { setQuickFilterQuery(undefined); setSelectedQuickFilters((pre) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/AppDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/AppDetails.component.tsx index 80fa23e44ce..0204b596cbf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/AppDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/AppDetails.component.tsx @@ -16,6 +16,7 @@ import { StopOutlined, UserOutlined, } from '@ant-design/icons'; +import Icon from '@ant-design/icons/lib/components/Icon'; import { IChangeEvent } from '@rjsf/core'; import { RJSFSchema } from '@rjsf/utils'; import validator from '@rjsf/validator-ajv8'; @@ -40,12 +41,7 @@ import { ReactComponent as IconExternalLink } from '../../../../assets/svg/exter import { ReactComponent as DeleteIcon } from '../../../../assets/svg/ic-delete.svg'; import { ReactComponent as IconRestore } from '../../../../assets/svg/ic-restore.svg'; import { ReactComponent as IconDropdown } from '../../../../assets/svg/menu.svg'; - -import Icon from '@ant-design/icons/lib/components/Icon'; -import { - DE_ACTIVE_COLOR, - ICON_DIMENSION, -} from '../../../../constants/constants'; +import { ICON_DIMENSION } from '../../../../constants/constants'; import { GlobalSettingOptions } from '../../../../constants/GlobalSettings.constants'; import { ServiceCategory } from '../../../../enums/service.enum'; import { @@ -175,13 +171,7 @@ const AppDetails = () => { description={t('message.restore-action-description', { entityType: getEntityName(appData), })} - icon={ - - } + icon={IconRestore} id="restore-button" name={t('label.restore')} /> @@ -202,11 +192,7 @@ const AppDetails = () => { description={t('message.disable-app', { app: getEntityName(appData), })} - icon={ - - } + icon={StopOutlined as SvgComponent} id="disable-button" name={t('label.disable')} /> @@ -225,7 +211,7 @@ const AppDetails = () => { description={t('message.uninstall-app', { app: getEntityName(appData), })} - icon={} + icon={DeleteIcon} id="uninstall-button" name={t('label.uninstall')} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx index e4e1427a513..ccfa865c71b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx @@ -51,7 +51,6 @@ import { GlobalSettingOptions, GlobalSettingsMenuCategory, } from '../../../../constants/GlobalSettings.constants'; -import { DROPDOWN_ICON_SIZE_PROPS } from '../../../../constants/ManageButton.constants'; import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; import { ResourceEntity } from '../../../../context/PermissionProvider/PermissionProvider.interface'; import { ERROR_PLACEHOLDER_TYPE } from '../../../../enums/common.enum'; @@ -464,13 +463,6 @@ const TeamDetailsV1 = ({ return t('message.are-you-sure-want-to-text', { text }); }; - const restoreIcon = useMemo( - () => ( - - ), - [currentTeam.isJoinable] - ); - const handleTeamExportClick = useCallback(async () => { if (currentTeam?.name) { showModal({ @@ -499,7 +491,7 @@ const TeamDetailsV1 = ({ description={t('message.export-entity-help', { entity: t('label.team-lowercase'), })} - icon={} + icon={ExportIcon} id="export" name={t('label.export')} /> @@ -517,7 +509,7 @@ const TeamDetailsV1 = ({ description={t('message.import-entity-help', { entity: t('label.team-lowercase'), })} - icon={} + icon={ImportIcon} id="import-button" name={t('label.import')} /> @@ -539,7 +531,7 @@ const TeamDetailsV1 = ({ label: ( } + icon={IconOpenLock} id="open-group-dropdown" name={ diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/UserTab/UserTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/UserTab/UserTab.component.tsx index 9079e61c3a5..88abb14994a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/UserTab/UserTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/UserTab/UserTab.component.tsx @@ -248,7 +248,7 @@ export const UserTab = ({ description={t('message.export-entity-help', { entity: t('label.user-lowercase'), })} - icon={} + icon={ExportIcon} id="export" name={t('label.export')} /> @@ -265,7 +265,7 @@ export const UserTab = ({ description={t('message.import-entity-help', { entity: t('label.team-lowercase'), })} - icon={} + icon={ImportIcon} id="import-button" name={t('label.import')} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx index 915df91c175..d54714c62e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/ManageButton/ManageButton.tsx @@ -25,7 +25,6 @@ import { ReactComponent as IconRestore } from '../../../../assets/svg/ic-restore import { ReactComponent as IconSetting } from '../../../../assets/svg/ic-settings-gray.svg'; import { ReactComponent as IconDropdown } from '../../../../assets/svg/menu.svg'; import { NO_PERMISSION_FOR_ACTION } from '../../../../constants/HelperTextUtil'; -import { DROPDOWN_ICON_SIZE_PROPS } from '../../../../constants/ManageButton.constants'; import { EntityType } from '../../../../enums/entity.enum'; import { ANNOUNCEMENT_ENTITIES } from '../../../../utils/AnnouncementsUtils'; import { showErrorToast } from '../../../../utils/ToastUtils'; @@ -127,13 +126,7 @@ const ManageButton: FC = ({ description={t('message.restore-action-description', { entityType, })} - icon={ - - } + icon={IconRestore} id="restore-button" name={t('label.restore')} /> @@ -156,13 +149,7 @@ const ManageButton: FC = ({ label: ( - } + icon={IconAnnouncementsBlack} id="announcement-button" name={t('label.announcement-plural')} /> @@ -184,7 +171,7 @@ const ManageButton: FC = ({ description={t('message.update-displayName-entity', { entity: entityName, })} - icon={} + icon={EditIcon} id="rename-button" name={t('label.rename')} /> @@ -207,13 +194,7 @@ const ManageButton: FC = ({ deleteButtonDescription ?? t('message.update-profiler-settings') } - icon={ - - } + icon={IconSetting} id="profiler-setting-button" name={t('label.profiler-setting-plural')} /> @@ -237,13 +218,7 @@ const ManageButton: FC = ({ entityType, }) } - icon={ - - } + icon={IconDelete} id="delete-button" name={t('label.delete')} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonContentItem.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonContentItem.component.tsx index 1155b036b89..7b9cb2b40da 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonContentItem.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonContentItem.component.tsx @@ -10,6 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Col, Row, Typography } from 'antd'; import React from 'react'; import { MangeButtonItemLabelProps } from './ManageButtonItemLabel.interface'; @@ -21,10 +22,12 @@ export const ManageButtonItemLabel = ({ description, id, }: MangeButtonItemLabelProps) => { + const Icon = icon; + return ( - {icon} + { await screen.findByTestId(`${mockProps.id}-description`) ).toBeInTheDocument(); }); + + it('should call onClick for clicking on item', async () => { + const mockClick = jest.fn(); + render(); + + await act(async () => { + screen.getByTestId(`${mockProps.id}`).click(); + }); + + expect(mockClick).toHaveBeenCalled(); + }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonItemLabel.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonItemLabel.interface.ts index ab9fdda3b5f..e2b9032607c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonItemLabel.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/ManageButtonContentItem/ManageButtonItemLabel.interface.ts @@ -15,7 +15,7 @@ import { ReactNode } from 'react'; export interface MangeButtonItemLabelProps { name: ReactNode; onClick?: React.MouseEventHandler; - icon: ReactNode; + icon: SvgComponent; description: string; id: string; } 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 13b8fa029be..45590ed6410 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 @@ -77,6 +77,7 @@ import { sortTagsCaseInsensitive, } from '../../utils/CommonUtils'; import { getQueryFilterForDatabase } from '../../utils/Database/Database.util'; +import entityUtilClassBase from '../../utils/EntityUtilClassBase'; import { getEntityName } from '../../utils/EntityUtils'; import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils'; import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils'; @@ -118,6 +119,11 @@ const DatabaseDetails: FunctionComponent = () => { const [updateProfilerSetting, setUpdateProfilerSetting] = useState(false); + const extraDropdownContent = entityUtilClassBase.getManageExtraOptions( + EntityType.DATABASE, + decodedDatabaseFQN + ); + const history = useHistory(); const isMounting = useRef(true); @@ -645,6 +651,7 @@ const DatabaseDetails: FunctionComponent = () => { afterDomainUpdateAction={afterDomainUpdateAction} dataAsset={database} entityType={EntityType.DATABASE} + extraDropdownContent={extraDropdownContent} openTaskCount={feedCount.openTaskCount} permissions={databasePermission} onDisplayNameUpdate={handleUpdateDisplayName} 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 dbc85e08427..9d600fd8e02 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 @@ -79,6 +79,7 @@ import { getFeedCounts, sortTagsCaseInsensitive, } from '../../utils/CommonUtils'; +import entityUtilClassBase from '../../utils/EntityUtilClassBase'; import { getEntityName } from '../../utils/EntityUtils'; import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils'; import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils'; @@ -126,6 +127,11 @@ const DatabaseSchemaPage: FunctionComponent = () => { const [updateProfilerSetting, setUpdateProfilerSetting] = useState(false); + const extraDropdownContent = entityUtilClassBase.getManageExtraOptions( + EntityType.DATABASE_SCHEMA, + decodedDatabaseSchemaFQN + ); + const handleShowDeletedTables = (value: boolean) => { setShowDeletedTables(value); setCurrentTablesPage(INITIAL_PAGING_VALUE); @@ -717,6 +723,7 @@ const DatabaseSchemaPage: FunctionComponent = () => { afterDomainUpdateAction={afterDomainUpdateAction} dataAsset={databaseSchema} entityType={EntityType.DATABASE_SCHEMA} + extraDropdownContent={extraDropdownContent} permissions={databaseSchemaPermission} onDisplayNameUpdate={handleUpdateDisplayName} onOwnerUpdate={handleUpdateOwner} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/LoginPage/SignInPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/LoginPage/SignInPage.tsx index 3eef30ec734..758c23032e5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/LoginPage/SignInPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/LoginPage/SignInPage.tsx @@ -25,7 +25,6 @@ import IconGoogle from '../../assets/img/icon-google.png'; import IconOkta from '../../assets/img/icon-okta.png'; import loginBG from '../../assets/img/login-bg.png'; import { ReactComponent as IconFailBadge } from '../../assets/svg/fail-badge.svg'; - import { useBasicAuth } from '../../components/Auth/AuthProviders/BasicAuthProvider'; import BrandImage from '../../components/common/BrandImage/BrandImage'; import Loader from '../../components/common/Loader/Loader'; @@ -308,7 +307,7 @@ const SignInPage = () => {
bg-image { DEFAULT_ENTITY_PERMISSION ); + const extraDropdownContent = entityUtilClassBase.getManageExtraOptions( + EntityType.TABLE, + datasetFQN + ); + const viewUsagePermission = useMemo( () => tablePermissions.ViewAll || tablePermissions.ViewUsage, [tablePermissions] @@ -1025,6 +1031,7 @@ const TableDetailsPageV1: React.FC = () => { afterDomainUpdateAction={updateTableDetailsState} dataAsset={tableDetails} entityType={EntityType.TABLE} + extraDropdownContent={extraDropdownContent} openTaskCount={feedCount.openTaskCount} permissions={tablePermissions} onDisplayNameUpdate={handleDisplayNameUpdate} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/ClassificationUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/ClassificationUtils.tsx index f997affc8c7..26859364f7c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/ClassificationUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/ClassificationUtils.tsx @@ -20,7 +20,7 @@ import { ReactComponent as IconDisableTag } from '../assets/svg/disable-tag.svg' import { ReactComponent as EditIcon } from '../assets/svg/edit-new.svg'; import { ManageButtonItemLabel } from '../components/common/ManageButtonContentItem/ManageButtonContentItem.component'; import RichTextEditorPreviewer from '../components/common/RichTextEditor/RichTextEditorPreviewer'; -import { DE_ACTIVE_COLOR, NO_DATA_PLACEHOLDER } from '../constants/constants'; +import { NO_DATA_PLACEHOLDER } from '../constants/constants'; import { OperationPermission } from '../context/PermissionProvider/PermissionProvider.interface'; import { ProviderType } from '../generated/entity/bot'; import { Tag } from '../generated/entity/classification/tag'; @@ -228,7 +228,7 @@ export const getClassificationExtraDropdownContent = ( ? t('message.enable-classification-description') : t('message.disable-classification-description') } - icon={} + icon={IconDisableTag} id="enable-disable" name={ isClassificationDisabled diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts index d6bd43ba25c..4bd61a6020c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtilClassBase.ts @@ -10,6 +10,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { ItemType } from 'antd/lib/menu/hooks/useItems'; import DataProductsPage from '../components/DataProducts/DataProductsPage/DataProductsPage.component'; import { getEditWebhookPath, @@ -281,6 +283,13 @@ class EntityUtilClassBase { } } } + + public getManageExtraOptions( + _entityType?: EntityType, + _fqn?: string + ): ItemType[] { + return []; + } } const entityUtilClassBase = new EntityUtilClassBase();