diff --git a/openmetadata-ui/src/main/resources/ui/playwright/browser-tests/reactions.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/browser-tests/reactions.spec.ts index c5eb62b066c8..a94e9187b31c 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/browser-tests/reactions.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/browser-tests/reactions.spec.ts @@ -15,6 +15,17 @@ import { build } from 'esbuild'; import { resolve } from 'path'; import { reactOnFeedCard } from '../utils/activityFeed'; +const PILL_ALIASES = [ + '+1', + '-1', + 'smile', + 'tada', + 'thinking_face', + 'heart', + 'eyes', + 'rocket', +]; + const bundle = build({ stdin: { contents: `import React, { useState } from 'react'; @@ -69,7 +80,7 @@ const bundle = build({ ], }).then((result) => result.outputFiles[0].text); -test('every reaction can be selected and removed through the animated product popover', async ({ +test('every reaction can be selected through the animated popover and taken back through its pill', async ({ page, }) => { test.setTimeout(60_000); @@ -102,9 +113,17 @@ test('every reaction can be selected and removed through the animated product po await page.addScriptTag({ content: await bundle }); const card = page.getByTestId('card'); await reactOnFeedCard(page, card); - await expect(card.getByTestId('emoji-button')).toHaveCount(8); - await reactOnFeedCard(page, card); - await expect(card.getByTestId('emoji-button')).toHaveCount(0); + const pills = card.getByTestId('emoji-button'); + await expect(pills).toHaveCount(8); + await expect(card.getByTestId('add-reactions')).toBeHidden(); + for (const alias of PILL_ALIASES) { + const pill = pills.filter({ + has: page.locator(`g-emoji[alias="${alias}"]`), + }); + await pill.click(); + await expect(pill).toBeHidden(); + } + await expect(pills).toHaveCount(0); expect(operations).toEqual([ ...[ 'thumbsUp', diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx index b88a3f479ff6..ac8dc4a90972 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/CommentCard.component.tsx @@ -15,10 +15,7 @@ import classNames from 'classnames'; import { lazy, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { Link } from 'react-router-dom'; import withSuspenseFallback from '../../../components/AppRouter/withSuspenseFallback'; -import { - ReactionOperation, - ReactionsVariant, -} from '../../../enums/reactions.enum'; +import { ReactionOperation } from '../../../enums/reactions.enum'; import { EntityReference } from '../../../generated/entity/type'; import { Reaction, ReactionType } from '../../../generated/type/reaction'; import { useUserProfile } from '../../../hooks/user-profile/useUserProfile'; @@ -276,7 +273,6 @@ const CommentCard = ({
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/ActivityEventFooter.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/ActivityEventFooter.tsx index 0ca2151e4cca..545feaef8366 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/ActivityEventFooter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/ActivityEventFooter.tsx @@ -18,10 +18,7 @@ import { noop } from 'lodash'; import { useCallback } from 'react'; import { PressEvent } from 'react-aria-components'; import { useTranslation } from 'react-i18next'; -import { - ReactionOperation, - ReactionsVariant, -} from '../../../../enums/reactions.enum'; +import { ReactionOperation } from '../../../../enums/reactions.enum'; import { ActivityEvent } from '../../../../generated/entity/activity/activityEvent'; import { ReactionType } from '../../../../generated/type/reaction'; import { useActivityFeedProvider } from '../../ActivityFeedProvider/ActivityFeedProvider'; @@ -86,7 +83,6 @@ function ActivityEventFooter({ /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/FeedCardFooterNew.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/FeedCardFooterNew.tsx index 5737f4c5b231..1d60c6fa7478 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/FeedCardFooterNew.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardFooter/FeedCardFooterNew.tsx @@ -24,10 +24,7 @@ import { } from 'react-aria-components'; import { useTranslation } from 'react-i18next'; import { FEED_FOOTER_AVATAR_SIZE } from '../../../../constants/Feeds.constants'; -import { - ReactionOperation, - ReactionsVariant, -} from '../../../../enums/reactions.enum'; +import { ReactionOperation } from '../../../../enums/reactions.enum'; import { ReactionType } from '../../../../generated/type/reaction'; import UserPopOverCard from '../../../common/PopOverCard/UserPopOverCard'; import ProfilePicture from '../../../common/ProfilePicture/ProfilePicture'; @@ -157,7 +154,6 @@ function FeedCardFooterNew({ )} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.test.tsx index 32ed7ea61cab..3fcb0ded9d08 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.test.tsx @@ -12,7 +12,6 @@ */ import { fireEvent, render, waitFor } from '@testing-library/react'; -import { ReactionsVariant } from '../../../enums/reactions.enum'; import { User } from '../../../generated/entity/teams/user'; import { ReactionType } from '../../../generated/type/reaction'; import Emoji from './Emoji'; @@ -105,9 +104,7 @@ describe('Test Emoji Component', () => { // The Inbox's pill marks the viewer's own reaction with the brand tint. it('Should tint the pill the viewer reacted with, and not another', async () => { - const { findByTestId, rerender } = render( - - ); + const { findByTestId, rerender } = render(); expect(await findByTestId('emoji-button')).toHaveClass( 'tw:rounded-full!', @@ -123,7 +120,6 @@ describe('Test Emoji Component', () => { user: { ...mockProps.reactionList[0].user, id: 'someone-else' }, }, ]} - variant={ReactionsVariant.Pill} /> ); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.tsx index 324e66e1b4fc..c983f8f3b05d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/Reactions/Emoji.tsx @@ -17,47 +17,28 @@ import classNames from 'classnames'; import { createElement, FC, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { REACTION_LIST } from '../../../constants/reactions.constant'; -import { - ReactionOperation, - ReactionsVariant, -} from '../../../enums/reactions.enum'; +import { ReactionOperation } from '../../../enums/reactions.enum'; import { Reaction, ReactionType } from '../../../generated/type/reaction'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import useImage from '../../../hooks/useImage'; import { getEntityName } from '../../../utils/EntityNameUtils'; -// How a chip is drawn in each variant: its shape, its colors once the viewer -// has reacted with it, its colors otherwise, and its count. -interface ChipClasses { - shape: string; - reacted: string; - idle: string; - count: string; -} - -const CHIP_CLASSES: Record = { - [ReactionsVariant.Default]: { - shape: 'tw:h-[22px] tw:rounded-md! tw:px-2! tw:py-0!', - reacted: 'tw:text-brand-secondary tw:after:outline-brand', - idle: 'tw:text-secondary', - count: 'tw:ml-1 tw:text-xs', - }, - [ReactionsVariant.Pill]: { - shape: - 'tw:h-6.5 tw:rounded-full! tw:px-2! tw:py-0! tw:shadow-none tw:font-semibold tw:hover:after:outline-primary tw:[&_g-emoji]:text-sm', - reacted: - 'tw:bg-utility-brand-50 tw:hover:bg-utility-brand-50 tw:text-utility-brand-700 tw:hover:text-utility-brand-700 tw:after:outline-utility-brand-300', - idle: 'tw:bg-primary tw:text-tertiary tw:hover:text-tertiary tw:after:outline-secondary', - // The chip wraps emoji and count in one text span, so its gap never - // reaches between them. - count: 'tw:ml-1.25 tw:text-xs', - }, +// How a chip is drawn: its shape, its colors once the viewer has reacted with +// it, its colors otherwise, and its count. +const CHIP_CLASSES = { + shape: + 'tw:h-6.5 tw:rounded-full! tw:px-2! tw:py-0! tw:shadow-none tw:font-semibold tw:hover:after:outline-primary tw:[&_g-emoji]:text-sm', + reacted: + 'tw:bg-utility-brand-50 tw:hover:bg-utility-brand-50 tw:text-utility-brand-700 tw:hover:text-utility-brand-700 tw:after:outline-utility-brand-300', + idle: 'tw:bg-primary tw:text-tertiary tw:hover:text-tertiary tw:after:outline-secondary', + // The chip wraps emoji and count in one text span, so its gap never + // reaches between them. + count: 'tw:ml-1.25 tw:text-xs', }; interface EmojiProps { reaction: ReactionType; reactionList: Reaction[]; - variant?: ReactionsVariant; onReactionSelect: ( reaction: ReactionType, operation: ReactionOperation @@ -67,7 +48,6 @@ interface EmojiProps { const Emoji: FC = ({ reaction, reactionList, - variant = ReactionsVariant.Default, onReactionSelect, }) => { const { t } = useTranslation(); @@ -143,8 +123,8 @@ const Emoji: FC = ({ + ) ) ); @@ -1551,6 +1560,23 @@ describe('DataAssetsHeader component', () => { }); }); + it('reloads the announcement banner when the announcement drawer closes', async () => { + (getActiveAnnouncements as jest.Mock) + .mockResolvedValueOnce({ data: [{ id: 'announcement-1' }] }) + .mockResolvedValue({ data: [] }); + + render(); + + fireEvent.click(await screen.findByTestId('announcements-widget-item')); + fireEvent.click(await screen.findByTestId('close-announcement-drawer')); + + await waitFor(() => + expect( + screen.queryByTestId('announcements-widget-item') + ).not.toBeInTheDocument() + ); + }); + // Behavior parity with base commit 9cf866cd23: editDisplayNamePermission (ManageButton's // rename affordance) was NOT deleted-gated in the pre-refactor code (`permissions?.EditAll // || permissions?.EditDisplayName`, unconditional) — same as createPermission/ 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 10a57a25ced8..902f614b38f7 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 @@ -50,6 +50,7 @@ import { PageType } from '../../../generated/system/ui/page'; import { ContractExecutionStatus } from '../../../generated/type/contractExecutionStatus'; import { Style } from '../../../generated/type/tagLabel'; import { useEntityDataContract } from '../../../hooks/governance/dataContract/useEntityDataContract'; +import { useActiveAnnouncements } from '../../../hooks/useActiveAnnouncements'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { useCustomPages } from '../../../hooks/useCustomPages'; import { useEntityPermissions } from '../../../hooks/useEntityPermissions/useEntityPermissions'; @@ -61,10 +62,6 @@ import { VotingDataProps, } from '../../../interface/entity/vote.interface'; import { FeedCounts } from '../../../interface/feed.interface'; -import { - AnnouncementEntity, - getActiveAnnouncements, -} from '../../../rest/announcementsAPI'; import { exportDataProductToODPSYaml, getDataProductPortsView, @@ -79,7 +76,6 @@ import { import dataProductClassBase from '../../../utils/DataProduct/DataProductClassBase'; import { getQueryFilterToIncludeDomain } from '../../../utils/DomainFilterUtils'; import { getEntityName } from '../../../utils/EntityNameUtils'; -import { getEntityFeedLink } from '../../../utils/EntityPureUtils'; import entityUtilClassBase from '../../../utils/EntityUtilClassBase'; import { getEntityVersionByField } from '../../../utils/EntityVersionUtilsPure'; import { getEntityVoteStatus } from '../../../utils/EntityVoteUtils'; @@ -523,9 +519,13 @@ const DataProductsDetailsPage = ({ ); const [isAnnouncementDrawerOpen, setIsAnnouncementDrawerOpen] = useState(false); - const [activeAnnouncements, setActiveAnnouncements] = useState< - AnnouncementEntity[] - >([]); + const { + announcements: activeAnnouncements, + refetch: refetchActiveAnnouncements, + } = useActiveAnnouncements( + EntityType.DATA_PRODUCT, + dataProduct.fullyQualifiedName + ); const { data: dataContract } = useEntityDataContract( dataProduct.id, EntityType.DATA_PRODUCT @@ -566,27 +566,13 @@ const DataProductsDetailsPage = ({ setIsAssetDrawerOpen(false); }, []); - const fetchActiveAnnouncement = async () => { - try { - const announcements = await getActiveAnnouncements( - getEntityFeedLink( - EntityType.DATA_PRODUCT, - dataProduct.fullyQualifiedName ?? '' - ) - ); - setActiveAnnouncements(announcements.data ?? []); - } catch (error) { - showErrorToast(error as AxiosError); - } - }; - const handleOpenAnnouncementDrawer = () => { setIsAnnouncementDrawerOpen(true); }; const handleCloseAnnouncementDrawer = () => { setIsAnnouncementDrawerOpen(false); - fetchActiveAnnouncement(); + void refetchActiveAnnouncements(); }; const breadcrumbItems = useMemo(() => { @@ -913,7 +899,6 @@ const DataProductsDetailsPage = ({ fetchDataProductAssets(); fetchTaskCounts(); fetchActivityCount(); - fetchActiveAnnouncement(); fetchPortCounts(); }, [dataProductFqn, fetchPortCounts]); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetails/DomainDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetails/DomainDetails.component.tsx index 5473fa9b49c3..80c82ef80f13 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetails/DomainDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Domain/DomainDetails/DomainDetails.component.tsx @@ -57,16 +57,13 @@ import { Domain } from '../../../generated/entity/domains/domain'; import { ChangeDescription } from '../../../generated/entity/type'; import { PageType } from '../../../generated/system/ui/page'; import { Style } from '../../../generated/type/tagLabel'; +import { useActiveAnnouncements } from '../../../hooks/useActiveAnnouncements'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { useCustomPages } from '../../../hooks/useCustomPages'; import { useEntityPermissions } from '../../../hooks/useEntityPermissions/useEntityPermissions'; import { useMarketplaceStore } from '../../../hooks/useMarketplaceStore'; import { VotingDataProps } from '../../../interface/entity/vote.interface'; import { FeedCounts } from '../../../interface/feed.interface'; -import { - AnnouncementEntity, - getActiveAnnouncements, -} from '../../../rest/announcementsAPI'; import { addDataProducts, patchDataProduct, @@ -89,7 +86,6 @@ import { getQueryFilterToExcludeDomainTerms, } from '../../../utils/DomainFilterUtils'; import { getEntityName } from '../../../utils/EntityNameUtils'; -import { getEntityFeedLink } from '../../../utils/EntityPureUtils'; import entityUtilClassBase from '../../../utils/EntityUtilClassBase'; import { getEntityVersionByField } from '../../../utils/EntityVersionUtilsPure'; import { getEntityVoteStatus } from '../../../utils/EntityVoteUtils'; @@ -260,9 +256,10 @@ const DomainDetails = ({ ); const [isAnnouncementDrawerOpen, setIsAnnouncementDrawerOpen] = useState(false); - const [activeAnnouncements, setActiveAnnouncements] = useState< - AnnouncementEntity[] - >([]); + const { + announcements: activeAnnouncements, + refetch: refetchActiveAnnouncements, + } = useActiveAnnouncements(EntityType.DOMAIN, domain.fullyQualifiedName); const encodedFqn = getEncodedFqn( escapeESReservedCharacters(domain.fullyQualifiedName) ); @@ -555,24 +552,13 @@ const DomainDetails = ({ setIsAssetDrawerOpen(false); }, []); - const fetchActiveAnnouncement = async () => { - try { - const announcements = await getActiveAnnouncements( - getEntityFeedLink(EntityType.DOMAIN, domain.fullyQualifiedName ?? '') - ); - setActiveAnnouncements(announcements.data ?? []); - } catch (error) { - showErrorToast(error as AxiosError); - } - }; - const handleOpenAnnouncementDrawer = () => { setIsAnnouncementDrawerOpen(true); }; const handleCloseAnnouncementDrawer = () => { setIsAnnouncementDrawerOpen(false); - fetchActiveAnnouncement(); + void refetchActiveAnnouncements(); }; const [name, displayName] = useMemo(() => { @@ -989,7 +975,6 @@ const DomainDetails = ({ fetchDataProducts(); fetchTaskCounts(); fetchActivityCount(); - fetchActiveAnnouncement(); }, [domain.fullyQualifiedName]); useEffect(() => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx index a961a0860160..d71da16e4d6c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx @@ -11,16 +11,10 @@ * limitations under the License. */ -import { Box, Typography } from '@openmetadata/ui-core-components'; - import { startCase } from 'lodash'; import { FC, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useNavigate } from 'react-router-dom'; -import { - formatDateTime, - getRelativeTime, -} from '../../utils/date-time/DateTimeUtils'; import { getEntityName } from '../../utils/EntityNameUtils'; import { entityDisplayName, prepareFeedLink } from '../../utils/FeedUtilsPure'; import { @@ -28,9 +22,9 @@ import { getTaskDisplayId, } from '../../utils/TaskNavigationUtils'; import { ActivityFeedTabs } from '../ActivityFeed/ActivityFeedTab/ActivityFeedTab.interface'; -import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; import { SourceType } from '../SearchedData/SearchedData.interface'; import { NotificationFeedProp } from './NotificationFeedCard.interface'; +import { NotificationRow } from './NotificationRow'; const NotificationFeedCard: FC = ({ createdBy, @@ -112,30 +106,13 @@ const NotificationFeedCard: FC = ({ className="no-underline" to={isMentionNotification ? mentionLink : taskLink} onClick={!isMentionNotification ? handleTaskLinkClick : undefined}> - - - - - <>{createdBy} - {isMentionNotification ? mentionContent : taskContent} - - - {getRelativeTime(timestamp)} - - - + + {createdBy} + {isMentionNotification ? mentionContent : taskContent} + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationRow.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationRow.tsx new file mode 100644 index 000000000000..6577e4564d0d --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationRow.tsx @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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 { Box, Typography } from '@openmetadata/ui-core-components'; +import { ReactNode } from 'react'; +import { + formatDateTime, + getRelativeTime, +} from '../../utils/date-time/DateTimeUtils'; +import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; + +interface NotificationRowProps { + actorName: string; + timestamp?: number; + children: ReactNode; + testId?: string; +} + +export const NotificationRow = ({ + actorName, + timestamp, + children, + testId, +}: NotificationRowProps) => ( + + + + {children} + + {getRelativeTime(timestamp)} + + + +); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/TaskMentionCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/TaskMentionCard.tsx index a7c20fe08c64..b0b06416464a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/TaskMentionCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/TaskMentionCard.tsx @@ -11,16 +11,14 @@ * limitations under the License. */ -import { Box, Typography } from '@openmetadata/ui-core-components'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { INCIDENT_TASK_TYPES } from '../../constants/Task.constant'; -import { getRelativeTime } from '../../utils/date-time/DateTimeUtils'; import { getEntityName } from '../../utils/EntityNameUtils'; import observabilityRouterClassBase from '../../utils/ObservabilityRouterClassBase'; import { TaskCommentMention } from '../../utils/tasks/TaskMentions.utils'; import { getTaskDetailPath } from '../../utils/TaskUtils'; -import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; +import { NotificationRow } from './NotificationRow'; export const TaskMentionCard = ({ mention, @@ -36,19 +34,13 @@ export const TaskMentionCard = ({ return ( - - - - - {authorName}{' '} - {t('message.mentioned-you-on-the-lowercase')}{' '} - {t('label.task-lowercase')} {getEntityName(task.about) || task.name} - - - {getRelativeTime(comment.createdAt)} - - - + + {authorName}{' '} + {t('message.mentioned-you-on-the-lowercase')}{' '} + {t('label.task-lowercase')} {getEntityName(task.about) || task.name} + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/ActivityFeedItem.tsx b/openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/ActivityFeedItem.tsx index 472ff3d69783..adde67949807 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/ActivityFeedItem.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/ActivityFeedItem.tsx @@ -43,10 +43,7 @@ import Reactions from '../../../../../components/ActivityFeed/Reactions/Reaction import FeedFieldPath from '../../../../../components/ActivityFeed/Shared/FeedFieldPath/FeedFieldPath'; import ProfilePicture from '../../../../../components/common/ProfilePicture/ProfilePicture'; import RichTextEditorPreviewerV1 from '../../../../../components/common/RichTextEditor/RichTextEditorPreviewerV1'; -import { - ReactionOperation, - ReactionsVariant, -} from '../../../../../enums/reactions.enum'; +import { ReactionOperation } from '../../../../../enums/reactions.enum'; import { ActivityEvent, ActivityEventType, @@ -629,7 +626,6 @@ const ActivityFeedItem: React.FC = ({ // Like is the tray's thumbs up: picked there once liked. pickedReactions={reactions} reactions={otherReactions} - variant={ReactionsVariant.Pill} onReactionSelect={handleReactionSelect} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.test.tsx index 7668961fec9f..f0390681c0f4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.test.tsx @@ -377,7 +377,7 @@ const mockUseActiveAnnouncements = jest.fn((..._args: unknown[]) => ({ announcements: mockAnnouncements, refetch: mockRefetchAnnouncements, })); -jest.mock('./useActiveAnnouncements', () => ({ +jest.mock('../../../hooks/useActiveAnnouncements', () => ({ useActiveAnnouncements: (...args: unknown[]) => mockUseActiveAnnouncements(...args), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.tsx index 9112342b8521..a7b612458c4a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/ConnectionServiceDetailsPage.tsx @@ -61,6 +61,7 @@ import { Include } from '../../../generated/type/include'; import { LabelType, State, TagSource } from '../../../generated/type/tagLabel'; import { useAuth } from '../../../hooks/authHooks'; import { usePaging } from '../../../hooks/paging/usePaging'; +import { useActiveAnnouncements } from '../../../hooks/useActiveAnnouncements'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { useTableFilters } from '../../../hooks/useTableFilters'; import { ServicePageData } from '../../../interface/platform/service.interface'; @@ -125,7 +126,6 @@ import DataAssetHeaderDetailsRow from './DataAssetHeaderDetailsRow/DataAssetHead import DataAssetsTab from './DataAssetsTab'; import ServiceAutoPilotButton from './ServiceAutoPilotButton'; import { ServiceFollowButton } from './ServiceFollowButton'; -import { useActiveAnnouncements } from './useActiveAnnouncements'; import { useServiceAgents } from './useServiceAgents'; import { DATA_ASSETS_TAB_KEY, diff --git a/openmetadata-ui/src/main/resources/ui/src/enums/reactions.enum.ts b/openmetadata-ui/src/main/resources/ui/src/enums/reactions.enum.ts index 085609c91220..af7677206d5e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/enums/reactions.enum.ts +++ b/openmetadata-ui/src/main/resources/ui/src/enums/reactions.enum.ts @@ -15,10 +15,3 @@ export enum ReactionOperation { ADD = 'add', REMOVE = 'remove', } - -// How a reaction row is drawn: the classic feed's square chips, or the Inbox's -// rounded pills with a plain smiley to add one. -export enum ReactionsVariant { - Default = 'default', - Pill = 'pill', -} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/useActiveAnnouncements.test.ts b/openmetadata-ui/src/main/resources/ui/src/hooks/useActiveAnnouncements.test.ts similarity index 91% rename from openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/useActiveAnnouncements.test.ts rename to openmetadata-ui/src/main/resources/ui/src/hooks/useActiveAnnouncements.test.ts index 49fb3d1f7d5e..4484b5eae571 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/useActiveAnnouncements.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/hooks/useActiveAnnouncements.test.ts @@ -11,16 +11,16 @@ * limitations under the License. */ import { act, renderHook, waitFor } from '@testing-library/react'; -import { EntityType } from '../../../enums/entity.enum'; -import { getActiveAnnouncements } from '../../../rest/announcementsAPI'; -import { showErrorToast } from '../../../utils/ToastUtils'; +import { EntityType } from '../enums/entity.enum'; +import { getActiveAnnouncements } from '../rest/announcementsAPI'; +import { showErrorToast } from '../utils/ToastUtils'; import { useActiveAnnouncements } from './useActiveAnnouncements'; -jest.mock('../../../rest/announcementsAPI', () => ({ +jest.mock('../rest/announcementsAPI', () => ({ getActiveAnnouncements: jest.fn(), })); -jest.mock('../../../utils/ToastUtils', () => ({ +jest.mock('../utils/ToastUtils', () => ({ showErrorToast: jest.fn(), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/useActiveAnnouncements.ts b/openmetadata-ui/src/main/resources/ui/src/hooks/useActiveAnnouncements.ts similarity index 83% rename from openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/useActiveAnnouncements.ts rename to openmetadata-ui/src/main/resources/ui/src/hooks/useActiveAnnouncements.ts index 93de9c5c9eec..fa632670c131 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/integration/ConnectionServiceDetailsPage/useActiveAnnouncements.ts +++ b/openmetadata-ui/src/main/resources/ui/src/hooks/useActiveAnnouncements.ts @@ -12,21 +12,24 @@ */ import { AxiosError } from 'axios'; import { useCallback, useEffect, useRef, useState } from 'react'; -import { EntityType } from '../../../enums/entity.enum'; +import { EntityType } from '../enums/entity.enum'; import { AnnouncementEntity, getActiveAnnouncements, -} from '../../../rest/announcementsAPI'; -import { getEntityFeedLink } from '../../../utils/EntityPureUtils'; -import { showErrorToast } from '../../../utils/ToastUtils'; +} from '../rest/announcementsAPI'; +import { getEntityFeedLink } from '../utils/EntityPureUtils'; +import { showErrorToast } from '../utils/ToastUtils'; /** * The entity's announcements that are active now, for the banner under its header. `refetch` * reloads them, e.g. once the announcement drawer has closed after an edit. */ -export const useActiveAnnouncements = (entityType: EntityType, fqn: string) => { +export const useActiveAnnouncements = ( + entityType: EntityType, + fqn?: string +) => { const [announcements, setAnnouncements] = useState([]); - // Only the latest request may write: a slower one for the previous service would replace it. + // Only the latest request may write: a slower one for the previous entity would replace it. const latestRequestRef = useRef(0); const refetch = useCallback(async () => {