diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyNew.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyNew.tsx index d036d921125a..d620f49a3c04 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyNew.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyNew.tsx @@ -149,7 +149,6 @@ const FeedCardBodyNew = ({ onEditCancel, showThread, isForFeedTab, - isFeedWidget, isThreadPanel, }: FeedCardBodyV1Props) => { const { t } = useTranslation(); @@ -267,10 +266,7 @@ const FeedCardBodyNew = ({ className={classNames( 'tw:overflow-y-auto', showThread - ? [ - 'tw:max-h-100', - isFeedWidget ? 'tw:mt-2.5 tw:px-4 tw:py-3' : 'tw:mt-5 tw:p-5', - ] + ? 'tw:mt-5 tw:max-h-100 tw:p-5' : 'tw:mt-0.5 tw:max-h-50 tw:p-5 tw:scrollbar-hide', // In the thread panels the card shares the drawer's surface, so the // message sits recessed into it, as the Inbox's does. Elsewhere it does diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyV1.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyV1.interface.ts index cefae46e43a6..2abf65bdff1f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyV1.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyV1.interface.ts @@ -17,15 +17,11 @@ export interface FeedCardBodyV1Props { feed?: Conversation; activity?: ActivityEvent; isEditPost: boolean; - className?: string; message: string; - isPost?: boolean; - isOpenInDrawer?: boolean; onUpdate?: (message: string) => void; onEditCancel?: () => void; showThread?: boolean; isForFeedTab?: boolean; - isFeedWidget?: boolean; /** In the activity thread panel, a message is edited in the comment edit form. */ isThreadPanel?: boolean; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx index e4e7e1ec1062..940d45ef4182 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx @@ -13,7 +13,6 @@ import { Box, Card, - Divider, Input, SkeletonParagraph, Tooltip, @@ -86,15 +85,11 @@ const POST_SKELETON_KEYS = ['first', 'second', 'third']; interface ActivityFeedCardNewProps { feed?: Conversation; activity?: ActivityEvent; - isPost?: boolean; isActive?: boolean; - post?: ConversationReply; showActivityFeedEditor?: boolean; showThread?: boolean; isForFeedTab?: boolean; isOpenInDrawer?: boolean; - isFeedWidget?: boolean; - isFullSizeWidget?: boolean; /** The activity thread panels' compact header, Inbox-style footer and replies. */ isThreadPanel?: boolean; /** Replaces the footer reply's default of opening the thread drawer. */ @@ -105,7 +100,6 @@ interface ActivityFeedCardNewProps { const getFeedCardWrapperClassName = ( baseClassName: string, showThread: boolean | undefined, - isPost: boolean, isOpenInDrawer: boolean, isActive: boolean | undefined ): string => @@ -113,9 +107,8 @@ const getFeedCardWrapperClassName = ( baseClassName, { 'activity-feed-card-new-right-panel m-0 gap-0': - showThread || isPost || isOpenInDrawer, + showThread || isOpenInDrawer, }, - { 'activity-feed-reply-card': isPost }, { 'active-card is-active': isActive } ); @@ -203,15 +196,11 @@ const computeShouldAddBottomMargin = ( const ActivityFeedCardNew = ({ feed, activity, - isPost = false, - post, showActivityFeedEditor, showThread, isActive, isForFeedTab, isOpenInDrawer = false, - isFeedWidget = false, - isFullSizeWidget = false, isThreadPanel, onReplyPress, onActivityClick, @@ -245,12 +234,11 @@ const ActivityFeedCardNew = ({ }, [feed?.about, activity?.about, entityRef]); const createdBy = useMemo(() => { - const postAuthor = post?.author.name ?? post?.author.fullyQualifiedName; const feedCreator = feed?.createdBy?.name ?? feed?.createdBy?.fullyQualifiedName; - return postAuthor ?? feedCreator ?? activity?.actor?.name ?? ''; - }, [feed?.createdBy, post?.author, activity?.actor?.name]); + return feedCreator ?? activity?.actor?.name ?? ''; + }, [feed?.createdBy, activity?.actor?.name]); const feedId = computeFeedId(feed, activity); const headerLayout = getHeaderLayout(isThreadPanel); @@ -296,9 +284,8 @@ const ActivityFeedCardNew = ({ if (!feed) { return; } - const target = isPost && post ? post : feed; - const patch = compare(target, { ...target, message }); - updateFeed(feed.id, post?.id ?? '', !isPost, patch); + const patch = compare(feed, { ...feed, message }); + updateFeed(feed.id, '', true, patch); setIsEditPost(!isEditPost); }; @@ -414,8 +401,7 @@ const ActivityFeedCardNew = ({ isThreadPanel, ]); - const timestampValue = - post?.createdAt ?? feed?.createdAt ?? activity?.timestamp; + const timestampValue = feed?.createdAt ?? activity?.timestamp; const timestamp = timestampValue ? ( ( @@ -569,108 +555,6 @@ const ActivityFeedCardNew = ({ [isPanelLayout, renderEntityLink, isThreadPanel, t] ); - const renderWidgetCard = () => ( - - - - - - - {/* flex-1 + min-h-0 so the 100%-height line fills only what the - avatar leaves; otherwise the column overflows and the card - body's overflow:hidden clips the avatar. mx-auto centres the - line under the avatar, as the vertical Divider's self-stretch - otherwise pins it to the column's left edge. */} - - - - - - -
- - - {getEntityName(user)} - - -
- {timestamp} -
- {!isPost && headerTags} -
- setIsEditPost(false)} - onUpdate={onUpdate} - /> - {isFullSizeWidget && !isActivityEvent && feed && ( -
- -
- )} - {isFullSizeWidget && isActivityEvent && activity && ( -
- -
- )} -
-
- {feedActions} -
-
- ); - - if (isFeedWidget) { - return renderWidgetCard(); - } - const hasNoReplies = computeHasNoReplies( isActivityEvent, activityReplies, @@ -741,7 +625,6 @@ const ActivityFeedCardNew = ({ className={getFeedCardWrapperClassName( getFullCardBaseClassName(isThreadPanel), showThread, - isPost, isOpenInDrawer, isActive )} @@ -782,18 +665,11 @@ const ActivityFeedCardNew = ({ itemClassName={headerLayout.authorRowItem}> - {!isPost && ( -
{headerTags}
- )} +
{headerTags}
@@ -819,7 +693,6 @@ const ActivityFeedCardNew = ({ feed={feed} isEditPost={isEditPost} isForFeedTab={isForFeedTab} - isPost={isPost} isThreadPanel={isThreadPanel} message={feedMessage} showThread={showThread} @@ -837,8 +710,6 @@ const ActivityFeedCardNew = ({ )} conversation={feed} conversationId={feed.id} - isReply={isPost} - reply={post} showReplyCount={isThreadPanel} onReplyPress={onReplyPress} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.utils.ts b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.utils.ts index c609947e6a19..af796a864d98 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.utils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.utils.ts @@ -21,33 +21,6 @@ import { PANEL_HEADER_LAYOUT, } from './ActivityFeedcardNew.constants'; -// Shared across both card variants: the top-level Card wrapper always mixes -// the same "showThread || isPost || isOpenInDrawer" right-panel state with -// the reply/active-card modifiers, only the base class differs. -export const getFeedCardClassName = ( - basePrefix: string, - { - showThread, - isPost, - isOpenInDrawer, - isActive, - }: { - showThread?: boolean; - isPost: boolean; - isOpenInDrawer: boolean; - isActive?: boolean; - } -) => - classNames( - basePrefix, - { - 'activity-feed-card-new-right-panel m-0 gap-0': - showThread || isPost || isOpenInDrawer, - }, - { 'activity-feed-reply-card': isPost }, - { 'active-card is-active': isActive } - ); - // The whole feed/task card is clickable but also contains its own links and // buttons, so it cannot be a - - - - {activityEvents.map((activity) => activity.summary).join(',')} - - - ); -}; - export const DummyActivityReactionComponent = () => { const { t } = useTranslation(); const { updateActivityReaction } = useActivityFeedProvider(); @@ -325,12 +245,15 @@ export const DummyActivityReactionSyncComponent = () => { selectedActivity, setActiveActivity, updateActivityReaction, - fetchMyActivityFeed, + fetchEntityActivity, } = useActivityFeedProvider(); useEffect(() => { - fetchMyActivityFeed({ days: 7, limit: 20 }); - }, [fetchMyActivityFeed]); + fetchEntityActivity(EntityType.TABLE, 'service.db.schema.table', { + days: 7, + limit: 20, + }); + }, [fetchEntityActivity]); return (
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TagPage/TagPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TagPage/TagPage.tsx index bebee9c9ced8..df88879b6c4f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TagPage/TagPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TagPage/TagPage.tsx @@ -707,8 +707,6 @@ const TagPage = () => { key: EntityTabs.ACTIVITY_FEED, children: ( { expect(APIClient.get).toHaveBeenCalledWith('/activity', { params }); }); - it('lists activity for an entity id', async () => { - const params = { days: 30 }; - - await getEntityActivityById('table', 'entity-1', params); - - expect(APIClient.get).toHaveBeenCalledWith( - '/activity/entity/table/entity-1', - { params } - ); - }); - it('encodes the entity FQN', async () => { await getEntityActivityByFqn('table', 'service.数据 表'); @@ -129,20 +116,14 @@ describe('activityAPI', () => { ); }); - it('lists activity by entity link and gets the count', async () => { + it('lists activity by entity link', async () => { const entityLink = '<#E::table::service.table>'; - await Promise.all([ - getActivityByEntityLink(entityLink, { days: 30 }), - getActivityCount({ days: 30 }), - ]); + await getActivityByEntityLink(entityLink, { days: 30 }); - expect(APIClient.get).toHaveBeenNthCalledWith(1, '/activity/about', { + expect(APIClient.get).toHaveBeenCalledWith('/activity/about', { params: { entityLink, days: 30 }, }); - expect(APIClient.get).toHaveBeenNthCalledWith(2, '/activity/count', { - params: { days: 30 }, - }); }); it('adds and removes an activity reaction', async () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/rest/activityAPI.ts b/openmetadata-ui/src/main/resources/ui/src/rest/activityAPI.ts index b2ba88a8b999..76bdc23bd5b8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/rest/activityAPI.ts +++ b/openmetadata-ui/src/main/resources/ui/src/rest/activityAPI.ts @@ -48,19 +48,6 @@ export const getActivityEvents = async (params?: ListActivityParams) => { return response.data; }; -export const getEntityActivityById = async ( - entityType: string, - entityId: string, - params?: { days?: number; limit?: number; domain?: string } -) => { - const response = await APIClient.get>( - `${BASE_URL}/entity/${entityType}/${entityId}`, - { params } - ); - - return response.data; -}; - export const getEntityActivityByFqn = async ( entityType: string, fqn: string, @@ -135,15 +122,6 @@ export const getActivityByEntityLink = async ( return response.data; }; -export const getActivityCount = async (params?: { - days?: number; - domain?: string; -}) => { - const response = await APIClient.get(`${BASE_URL}/count`, { params }); - - return response.data; -}; - export const addActivityReaction = async ( activityId: string, reactionType: ReactionType diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/APICollection/APICollectionUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/APICollection/APICollectionUtils.tsx index 111730226f2c..70db5c8bc968 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/APICollection/APICollectionUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/APICollection/APICollectionUtils.tsx @@ -125,8 +125,6 @@ export const getApiCollectionDetailsPageTabs = ({ key: EntityTabs.ACTIVITY_FEED, children: ( name > description - */ -export const getEntityFieldDisplay = (entityField: string) => { - if (entityField && entityField.length) { - const entityFields = entityField.split(ENTITY_LINK_SEPARATOR); - const separator = ( - - - - ); - - return entityFields.map((field, i) => { - return ( - - {t(`label.${field}`, { defaultValue: field })} - {i < entityFields.length - 1 ? separator : null} - - ); - }); - } - - return null; -}; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts b/openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts index c8c8cf347a7a..a89c803f514e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts @@ -30,8 +30,6 @@ import { teamsLinkRegEx, } from '../constants/Feeds.constants'; import { EntityType, FqnPart, TabSpecificField } from '../enums/entity.enum'; -import type { EntityTestResultSummaryObject } from '../generated/entity/feed/testCaseResult'; -import { TestCaseStatus } from '../generated/entity/feed/testCaseResult'; import type { FeedCounts } from '../interface/feed.interface'; import { getEntityActivityByFqn } from '../rest/activityAPI'; import { listConversations } from '../rest/conversationsAPI'; @@ -69,7 +67,7 @@ export const getEntityField = (entityLink: string) => { * Task entities have about as EntityReference: { id, type, fullyQualifiedName } * Conversations have about as string: <#E::table::fqn> */ -export const isEntityReferenceAbout = ( +const isEntityReferenceAbout = ( about: string | { type?: string; fullyQualifiedName?: string } | undefined ): about is { type?: string; fullyQualifiedName?: string } => { return typeof about === 'object' && about !== null; @@ -111,21 +109,6 @@ export const getEntityFQNFromAbout = ( return EntityLink.getEntityFqn(about); }; -export const getReplyText = ( - count: number, - singular?: string, - plural?: string -) => { - if (count === 0) { - return t('label.reply-in-conversation'); - } - if (count === 1) { - return `${count} ${singular ?? t('label.older-reply-lowercase')}`; - } - - return `${count} ${plural ?? t('label.older-reply-plural-lowercase')}`; -}; - export const buildMentionLink = (entityType: string, entityFqn: string) => { if (entityType === EntityType.GLOSSARY_TERM) { return `${document.location.protocol}//${ @@ -309,53 +292,6 @@ export const getFeedChangeFieldLabel = (fieldName?: EntityField) => { return isUndefined(fieldName) ? '' : fieldNameLabelMapping[fieldName]; }; -export const getTestCaseNameListForResult = ( - testResultSummary: Array, - status: TestCaseStatus -) => - testResultSummary.reduce((acc, curr) => { - if (curr.status === status) { - acc.push(curr.testCaseName ?? ''); - } - - return acc; - }, [] as Array); - -export const formatTestStatusData = ( - testResultSummary: Array -) => { - const successCases = getTestCaseNameListForResult( - testResultSummary, - TestCaseStatus.Success - ); - const failedCases = getTestCaseNameListForResult( - testResultSummary, - TestCaseStatus.Failed - ); - const abortedCases = getTestCaseNameListForResult( - testResultSummary, - TestCaseStatus.Aborted - ); - - return { - success: { - status: TestCaseStatus.Success, - count: successCases.length, - testCases: successCases, - }, - failed: { - status: TestCaseStatus.Failed, - count: failedCases.length, - testCases: failedCases, - }, - aborted: { - status: TestCaseStatus.Aborted, - count: abortedCases.length, - testCases: abortedCases, - }, - }; -}; - export const HTMLToMarkdown = new TurndownService({ bulletListMarker: '-', fence: '```', diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/MetricEntityUtils/MetricUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/MetricEntityUtils/MetricUtils.tsx index 9eadf87b2570..34856344f33f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/MetricEntityUtils/MetricUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/MetricEntityUtils/MetricUtils.tsx @@ -190,8 +190,6 @@ export const getMetricDetailsPageTabs = ({ key: EntityTabs.ACTIVITY_FEED, children: (