From 1fd5cc23ba6f491cffda17304c9714f08a0de14b Mon Sep 17 00:00:00 2001 From: Satender Date: Thu, 14 May 2026 19:31:09 +0530 Subject: [PATCH] added task navigation changes --- .../service/resources/feeds/FeedMapper.java | 2 +- .../service/resources/feeds/PostMapper.java | 2 +- .../json/schema/api/feed/createPost.json | 6 +- .../json/schema/api/feed/createThread.json | 6 +- .../ActivityFeedProvider.tsx | 1 - .../ActivityFeedTab.component.tsx | 82 +++++++++++++++---- .../ActivityThreadPanelBody.tsx | 15 ++-- .../AddAnnouncementModal.tsx | 19 +++-- .../NotificationFeedCard.component.tsx | 47 ++++++++--- .../AnnouncementDrawer/AnnouncementDrawer.tsx | 15 ++-- .../ui/src/generated/api/feed/createPost.ts | 4 - .../ui/src/generated/api/feed/createThread.ts | 4 - .../RequestDescriptionPage.tsx | 27 +++--- .../RequestTagPage/RequestTagPage.tsx | 24 +++--- .../UpdateDescriptionPage.tsx | 24 +++--- .../TasksPage/UpdateTagPage/UpdateTagPage.tsx | 24 +++--- 16 files changed, 192 insertions(+), 110 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/FeedMapper.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/FeedMapper.java index 09eb37956164..5df34c782592 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/FeedMapper.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/FeedMapper.java @@ -19,7 +19,7 @@ public Thread createToEntity(CreateThread create, String user) { .withId(randomUUID) .withThreadTs(System.currentTimeMillis()) .withMessage(create.getMessage()) - .withCreatedBy(create.getFrom()) + .withCreatedBy(user) .withAbout(create.getAbout()) .withAddressedTo(create.getAddressedTo()) .withReactions(Collections.emptyList()) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/PostMapper.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/PostMapper.java index 2e281168f9d8..dd65fd163c94 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/PostMapper.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/feeds/PostMapper.java @@ -10,7 +10,7 @@ public Post createToEntity(CreatePost create, String user) { return new Post() .withId(UUID.randomUUID()) .withMessage(create.getMessage()) - .withFrom(create.getFrom()) + .withFrom(user) .withReactions(Collections.emptyList()) .withPostTs(System.currentTimeMillis()); } diff --git a/openmetadata-spec/src/main/resources/json/schema/api/feed/createPost.json b/openmetadata-spec/src/main/resources/json/schema/api/feed/createPost.json index 207663384292..c063a956561b 100644 --- a/openmetadata-spec/src/main/resources/json/schema/api/feed/createPost.json +++ b/openmetadata-spec/src/main/resources/json/schema/api/feed/createPost.json @@ -9,11 +9,7 @@ "description": "Message in Markdown format. See markdown support for more details.", "type": "string" }, - "from": { - "description": "Name of the User posting the message", - "type": "string" - } }, - "required": ["message", "from"], + "required": ["message"], "additionalProperties": false } diff --git a/openmetadata-spec/src/main/resources/json/schema/api/feed/createThread.json b/openmetadata-spec/src/main/resources/json/schema/api/feed/createThread.json index 31e75c59435e..71051acc16ba 100644 --- a/openmetadata-spec/src/main/resources/json/schema/api/feed/createThread.json +++ b/openmetadata-spec/src/main/resources/json/schema/api/feed/createThread.json @@ -35,10 +35,6 @@ "description": "Message", "type": "string" }, - "from": { - "description": "Name of the User (regular user or bot) posting the message", - "type": "string" - }, "addressedTo": { "description": "User or team this thread is addressed to in format <#E::{entities}::{entityName}::{field}::{fieldValue}.", "$ref": "../../type/basic.json#/definitions/entityLink" @@ -69,6 +65,6 @@ "default": null } }, - "required": ["message", "from", "about"], + "required": ["message", "about"], "additionalProperties": false } 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 fb2065b9c942..aee30d9849ec 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 @@ -210,7 +210,6 @@ const ActivityFeedProvider = ({ children, user }: Props) => { const data = { message: value, - from: currentUser.name, } as Post; try { 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 aa15e29f8d07..2a4684afde0b 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 @@ -14,9 +14,16 @@ import { Button, Dropdown, Menu, Segmented, Space, Typography } from 'antd'; import { AxiosError } from 'axios'; import classNames from 'classnames'; import { isEmpty } from 'lodash'; -import { RefObject, useCallback, useEffect, useMemo, useState } from 'react'; +import { + RefObject, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import { ReactComponent as AllActivityIcon } from '../../../assets/svg/all-activity-v2.svg'; import { ReactComponent as TaskCloseIcon } from '../../../assets/svg/ic-check-circle-new.svg'; import { ReactComponent as TaskCloseIconBlue } from '../../../assets/svg/ic-close-task.svg'; @@ -89,6 +96,7 @@ export const ActivityFeedTab = ({ urlFqn = '', }: ActivityFeedTabProps) => { const navigate = useNavigate(); + const location = useLocation(); const { t } = useTranslation(); const { currentUser } = useApplicationStore(); const { isAdminUser } = useAuth(); @@ -99,8 +107,10 @@ export const ActivityFeedTab = ({ root: document.querySelector('#center-container'), rootMargin: '0px 0px 2px 0px', }); - const { subTab: activeTab = subTab } = - useRequiredParams<{ tab: EntityTabs; subTab: ActivityFeedTabs }>(); + const { subTab: activeTab = subTab } = useRequiredParams<{ + tab: EntityTabs; + subTab: ActivityFeedTabs; + }>(); const [taskFilter, setTaskFilter] = useState( ThreadTaskStatus.Open ); @@ -113,6 +123,7 @@ export const ActivityFeedTab = ({ data: FEED_COUNT_INITIAL_DATA, }); const [isFirstLoad, setIsFirstLoad] = useState(true); + const processedRefreshKeyRef = useRef(undefined); const { selectedThread, @@ -278,6 +289,39 @@ export const ActivityFeedTab = ({ } }, [feedFilter, threadType, fqn]); + useEffect(() => { + const refreshKey = (location.state as { tasksRefreshKey?: number } | null) + ?.tasksRefreshKey; + if ( + refreshKey !== undefined && + refreshKey !== processedRefreshKeyRef.current && + fqn && + isTaskActiveTab + ) { + processedRefreshKeyRef.current = refreshKey; + getFeedData( + feedFilter, + undefined, + threadType, + entityType, + fqn, + taskFilter + ); + navigate('.', { replace: true, state: {} }); + } + }, [ + entityType, + feedFilter, + fqn, + getFeedData, + isTaskActiveTab, + location.key, + location.state, + navigate, + taskFilter, + threadType, + ]); + useEffect(() => { if (feedCount) { setCountData((prev) => ({ ...prev, data: feedCount })); @@ -328,7 +372,8 @@ export const ActivityFeedTab = ({ 'flex items-center justify-between px-4 py-2 gap-2', { active: taskFilter === ThreadTaskStatus.Open } )} - data-testid="open-tasks"> + data-testid="open-tasks" + >
{taskFilter === ThreadTaskStatus.Open ? ( + })} + > {t('label.open')}
+ })} + > {countData?.data?.openTaskCount} @@ -368,7 +415,8 @@ export const ActivityFeedTab = ({ 'flex items-center justify-between px-4 py-2 gap-2', { active: taskFilter === ThreadTaskStatus.Closed } )} - data-testid="closed-tasks"> + data-testid="closed-tasks" + >
{taskFilter === ThreadTaskStatus.Closed ? ( + })} + > {t('label.closed')}
+ })} + > {countData?.data?.closedTaskCount} @@ -585,7 +635,8 @@ export const ActivityFeedTab = ({ 'three-panel-layout': layoutType === ActivityFeedLayoutType.THREE_PANEL, })} - id="center-container"> + id="center-container" + > {(isTaskActiveTab || isMentionTabSelected) && (
+ trigger={['click']} + > = ({ {isTaskType && !isThreadLoading && ( + type={ERROR_PLACEHOLDER_TYPE.CUSTOM} + > {isTaskClosed ? t('message.no-closed-task') @@ -317,7 +317,8 @@ const ActivityThreadPanelBody: FC = ({
}> + ref={elementRef as RefObject} + > {getLoader()}
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Modals/AnnouncementModal/AddAnnouncementModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Modals/AnnouncementModal/AddAnnouncementModal.tsx index 836fb831b953..9da85b4b8288 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Modals/AnnouncementModal/AddAnnouncementModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Modals/AnnouncementModal/AddAnnouncementModal.tsx @@ -27,7 +27,6 @@ import { getEntityFeedLink } from '../../../utils/EntityUtils'; import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils'; import { useSnackbar } from 'notistack'; -import { useApplicationStore } from '../../../hooks/useApplicationStore'; import { FieldProp, FieldTypes } from '../../../interface/FormUtils.interface'; import { getField } from '../../../utils/formUtils'; import { @@ -61,8 +60,6 @@ const AddAnnouncementModal: FC = ({ entityFQN, showToastInSnackbar = false, }) => { - const { currentUser } = useApplicationStore(); - const [isLoading, setIsLoading] = useState(false); const { enqueueSnackbar } = useSnackbar(); const { t } = useTranslation(); @@ -85,7 +82,6 @@ const AddAnnouncementModal: FC = ({ : showErrorToast(t('message.announcement-invalid-start-time')); } else { const announcementData: CreateThread = { - from: currentUser?.name as string, message: title, about: getEntityFeedLink(entityType, entityFQN), announcementDetails: { @@ -151,13 +147,15 @@ const AddAnnouncementModal: FC = ({ open={open} title={t('message.make-an-announcement')} width={720} - onCancel={onCancel}> + onCancel={onCancel} + > data-testid="announcement-form" id="announcement-form" layout="vertical" validateMessages={VALIDATION_MESSAGES} - onFinish={handleCreateAnnouncement}> + onFinish={handleCreateAnnouncement} + > = ({ max: 124, min: 5, }, - ]}> + ]} + > @@ -182,7 +181,8 @@ const AddAnnouncementModal: FC = ({ { required: true, }, - ]}> + ]} + > = ({ { required: true, }, - ]}> + ]} + > 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 5bd8cba3d47a..4ab72b29b057 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 @@ -12,9 +12,9 @@ */ import { List, Space, Typography } from 'antd'; -import { FC, useMemo } from 'react'; +import { FC, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import { Link } from 'react-router-dom'; +import { Link, useNavigate } from 'react-router-dom'; import { EntityType } from '../../enums/entity.enum'; import { TaskType, ThreadType } from '../../generated/entity/feed/thread'; import { @@ -40,8 +40,19 @@ const NotificationFeedCard: FC = ({ isConversationFeed = false, }) => { const { t } = useTranslation(); + const navigate = useNavigate(); const { task: taskDetails } = task ?? {}; + const handleTaskLinkClick = useCallback( + (e: React.MouseEvent) => { + e.preventDefault(); + navigate(getTaskDetailPath(task), { + state: { tasksRefreshKey: Date.now() }, + }); + }, + [navigate, task] + ); + const taskContent = useMemo(() => { if (task.task?.type === TaskType.RequestApproval) { return ( @@ -57,7 +68,8 @@ const NotificationFeedCard: FC = ({ task?.entityRef?.fullyQualifiedName ?? '', task?.entityRef?.type as EntityType, task?.entityRef as SourceType - )}> + )} + > {task?.entityRef?.displayName} {t('label.of-lowercase')} @@ -66,7 +78,8 @@ const NotificationFeedCard: FC = ({ Fqn.split(task?.entityRef?.fullyQualifiedName ?? '')[0], task?.entityRef?.type as EntityType, task?.entityRef as SourceType - )}> + )} + > {Fqn.split(task?.entityRef?.fullyQualifiedName ?? '')[0]} @@ -80,12 +93,18 @@ const NotificationFeedCard: FC = ({ {t('message.assigned-you-a-new-task-lowercase')} - + { + e.stopPropagation(); + handleTaskLinkClick(e); + }} + > {`#${taskDetails?.id}`} {taskDetails?.type} ); - }, [entityType, task, taskDetails]); + }, [entityType, task, taskDetails, handleTaskLinkClick]); const entityName = useMemo(() => { return task?.entityRef @@ -100,7 +119,9 @@ const NotificationFeedCard: FC = ({ isConversationFeed ? prepareFeedLink(entityType, entityFQN, ActivityFeedTabs.ALL) : getTaskDetailPath(task) - }> + } + onClick={!isConversationFeed ? handleTaskLinkClick : undefined} + > } className="m-0" @@ -108,10 +129,12 @@ const NotificationFeedCard: FC = ({ + size={0} + > + style={{ color: '#37352F', marginBottom: 0 }} + > <>{createdBy} {feedType === ThreadType.Conversation ? ( <> @@ -124,7 +147,8 @@ const NotificationFeedCard: FC = ({ entityType, entityFQN, ActivityFeedTabs.ALL - )}> + )} + > {entityName} @@ -134,7 +158,8 @@ const NotificationFeedCard: FC = ({ + title={formatDateTime(timestamp)} + > {getRelativeTime(timestamp)} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/AnnouncementDrawer/AnnouncementDrawer.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/AnnouncementDrawer/AnnouncementDrawer.tsx index cc43822791e6..906daf26773a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/AnnouncementDrawer/AnnouncementDrawer.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityPageInfos/AnnouncementDrawer/AnnouncementDrawer.tsx @@ -18,7 +18,6 @@ import { Operation } from 'fast-json-patch'; import { FC, useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Post } from '../../../../generated/entity/feed/thread'; -import { useApplicationStore } from '../../../../hooks/useApplicationStore'; import { postFeedById } from '../../../../rest/feedsAPI'; import { getEntityFeedLink } from '../../../../utils/EntityUtils'; import { deletePost, updateThreadData } from '../../../../utils/FeedUtils'; @@ -44,7 +43,6 @@ const AnnouncementDrawer: FC = ({ showToastInSnackbar = false, }) => { const { t } = useTranslation(); - const { currentUser } = useApplicationStore(); const [isAddAnnouncementOpen, setIsAddAnnouncementOpen] = useState(false); const [refetchThread, setRefetchThread] = useState(false); @@ -54,7 +52,8 @@ const AnnouncementDrawer: FC = ({ align="start" className="justify-between" data-testid="title" - style={{ width: '100%' }}> + style={{ width: '100%' }} + > {t('label.announcement-plural')} @@ -73,7 +72,6 @@ const AnnouncementDrawer: FC = ({ const postFeedHandler = async (value: string, id: string): Promise => { const data = { message: value, - from: currentUser?.name, } as Post; try { @@ -118,15 +116,18 @@ const AnnouncementDrawer: FC = ({ placement="right" title={title} width={576} - onClose={onClose}> + onClose={onClose} + >
+ title={!createPermission && t('message.no-permission-to-view')} + > diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createPost.ts b/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createPost.ts index 5893bdcebdff..8ef57ecaf0ab 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createPost.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createPost.ts @@ -14,10 +14,6 @@ * Create post request */ export interface CreatePost { - /** - * Name of the User posting the message - */ - from: string; /** * Message in Markdown format. See markdown support for more details. */ diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createThread.ts b/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createThread.ts index 480677447fae..1af33489dac5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createThread.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/api/feed/createThread.ts @@ -34,10 +34,6 @@ export interface CreateThread { * Domain the entity belongs to. */ domains?: string[]; - /** - * Name of the User (regular user or bot) posting the message - */ - from: string; /** * Message */ 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 269dcc390194..8f87507ed4df 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 @@ -35,7 +35,6 @@ import { import { Glossary } from '../../../generated/entity/data/glossary'; import { ThreadType } from '../../../generated/entity/feed/thread'; import { withPageLayout } from '../../../hoc/withPageLayout'; -import { useApplicationStore } from '../../../hooks/useApplicationStore'; import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation'; import { useFqn } from '../../../hooks/useFqn'; import { postThread } from '../../../rest/feedsAPI'; @@ -60,7 +59,6 @@ import '../task-page.style.less'; import { EntityData, Option } from '../TasksPage.interface'; const RequestDescription = () => { - const { currentUser } = useApplicationStore(); const { t } = useTranslation(); const location = useCustomLocation(); const navigate = useNavigate(); @@ -125,7 +123,6 @@ const RequestDescription = () => { if (assignees.length) { const suggestion = markdownRef.current?.getEditorContent?.(); const data: CreateThread = { - from: currentUser?.name as string, message: value.title || taskMessage, about: getEntityFeedLink(entityType, entityFQN, getTaskAbout()), taskDetails: { @@ -212,10 +209,12 @@ const RequestDescription = () => {
+ key="request-description" + > + data-testid="form-title" + > {t('label.create-entity', { entity: t('label.task'), })} @@ -224,13 +223,15 @@ const RequestDescription = () => { data-testid="form-container" form={form} layout="vertical" - onFinish={onCreateTask}> + onFinish={onCreateTask} + > + name="title" + > { fieldText: t('label.assignee-plural'), }), }, - ]}> + ]} + > { label={`${t('label.suggest-entity', { entity: t('label.description'), })}:`} - name="SuggestDescription"> + name="SuggestDescription" + > { + size={16} + > @@ -286,7 +290,8 @@ const RequestDescription = () => { data-testid="submit-btn" htmlType="submit" loading={isLoading} - type="primary"> + type="primary" + > {suggestion ? t('label.suggest') : t('label.save')} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx index 55004158d168..1e9cd71f8d2c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx @@ -34,7 +34,6 @@ import { Glossary } from '../../../generated/entity/data/glossary'; import { ThreadType } from '../../../generated/entity/feed/thread'; import { TagLabel } from '../../../generated/type/tagLabel'; import { withPageLayout } from '../../../hoc/withPageLayout'; -import { useApplicationStore } from '../../../hooks/useApplicationStore'; import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation'; import { useFqn } from '../../../hooks/useFqn'; import { postThread } from '../../../rest/feedsAPI'; @@ -59,7 +58,6 @@ import '../task-page.style.less'; import { EntityData, Option } from '../TasksPage.interface'; const RequestTag = () => { - const { currentUser } = useApplicationStore(); const { t } = useTranslation(); const location = useCustomLocation(); const navigate = useNavigate(); @@ -115,7 +113,6 @@ const RequestTag = () => { const onCreateTask: FormProps['onFinish'] = (value) => { setIsLoading(true); const data: CreateThread = { - from: currentUser?.name as string, message: value.title || taskMessage, about: getEntityFeedLink(entityType, entityFQN, getTaskAbout()), taskDetails: { @@ -196,7 +193,8 @@ const RequestTag = () => {
+ data-testid="form-title" + > {t('label.create-entity', { entity: t('label.task'), })} @@ -208,13 +206,15 @@ const RequestTag = () => { suggestTags: [], }} layout="vertical" - onFinish={onCreateTask}> + onFinish={onCreateTask} + > + name="title" + > { fieldText: t('label.assignee-plural'), }), }, - ]}> + ]} + > { label={`${t('label.suggest-entity', { entity: t('label.tag-plural'), })}:`} - name="suggestTags"> + name="suggestTags" + > @@ -254,7 +256,8 @@ const RequestTag = () => { + size={16} + > @@ -262,7 +265,8 @@ const RequestTag = () => { data-testid="submit-tag-request" htmlType="submit" loading={isLoading} - type="primary"> + type="primary" + > {suggestion ? t('label.suggest') : t('label.save')} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx index 238bf0c4f95d..b9beed8881c8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx @@ -36,7 +36,6 @@ import { } from '../../../generated/api/feed/createThread'; import { Glossary } from '../../../generated/entity/data/glossary'; import { withPageLayout } from '../../../hoc/withPageLayout'; -import { useApplicationStore } from '../../../hooks/useApplicationStore'; import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation'; import { useFqn } from '../../../hooks/useFqn'; import { postThread } from '../../../rest/feedsAPI'; @@ -64,7 +63,6 @@ import '../task-page.style.less'; import { EntityData, Option } from '../TasksPage.interface'; const UpdateDescription = () => { - const { currentUser } = useApplicationStore(); const location = useCustomLocation(); const navigate = useNavigate(); const [form] = useForm(); @@ -144,7 +142,6 @@ const UpdateDescription = () => { const onCreateTask: FormProps['onFinish'] = (value) => { setIsLoading(true); const data: CreateThread = { - from: currentUser?.name as string, message: value.title || taskMessage, about: getEntityFeedLink(entityType, entityFQN, getTaskAbout()), taskDetails: { @@ -233,7 +230,8 @@ const UpdateDescription = () => {
+ data-testid="form-title" + > {t('label.create-entity', { entity: t('label.task'), })} @@ -243,11 +241,13 @@ const UpdateDescription = () => { form={form} layout="vertical" validateMessages={VALIDATION_MESSAGES} - onFinish={onCreateTask}> + onFinish={onCreateTask} + > + name="title" + > { data-testid="assignees" label={`${t('label.assignee-plural')}:`} name="assignees" - rules={[{ required: true }]}> + rules={[{ required: true }]} + > { data-testid="description-tabs" label={`${t('label.description')}:`} name="description" - rules={[{ required: true }]}> + rules={[{ required: true }]} + > { + size={16} + > @@ -293,7 +296,8 @@ const UpdateDescription = () => { data-testid="submit-btn" htmlType="submit" loading={isLoading} - type="primary"> + type="primary" + > {t('label.save')} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx index d30170d0d1c0..e008d5e75042 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx @@ -37,7 +37,6 @@ import { Glossary } from '../../../generated/entity/data/glossary'; import { ThreadType } from '../../../generated/entity/feed/thread'; import { TagLabel } from '../../../generated/type/tagLabel'; import { withPageLayout } from '../../../hoc/withPageLayout'; -import { useApplicationStore } from '../../../hooks/useApplicationStore'; import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation'; import { useFqn } from '../../../hooks/useFqn'; import { postThread } from '../../../rest/feedsAPI'; @@ -69,7 +68,6 @@ const UpdateTag = () => { const { t } = useTranslation(); const navigate = useNavigate(); const [form] = useForm(); - const { currentUser } = useApplicationStore(); const { entityType } = useRequiredParams<{ entityType: EntityType }>(); @@ -150,7 +148,6 @@ const UpdateTag = () => { const onCreateTask: FormProps['onFinish'] = (value) => { setIsLoading(true); const data: CreateThread = { - from: currentUser?.name as string, message: value.title || taskMessage, about: getEntityFeedLink(entityType, entityFQN, getTaskAbout()), taskDetails: { @@ -242,7 +239,8 @@ const UpdateTag = () => {
+ data-testid="form-title" + > {t('label.create-entity', { entity: t('label.task'), })} @@ -251,11 +249,13 @@ const UpdateTag = () => { data-testid="form-container" form={form} layout="vertical" - onFinish={onCreateTask}> + onFinish={onCreateTask} + > + name="title" + > { fieldText: t('label.assignee-plural'), }), }, - ]}> + ]} + > { fieldText: t('label.tag-plural'), }), }, - ]}> + ]} + > { + size={16} + > @@ -318,7 +321,8 @@ const UpdateTag = () => { data-testid="submit-tag-request" htmlType="submit" loading={isLoading} - type="primary"> + type="primary" + > {t('label.save')}