From 02d2390afc0a8db84cfdf7862c980b671c86d437 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Wed, 22 Feb 2023 18:53:18 +0530 Subject: [PATCH] Fix : UI Improvements (#10259) * UI Improvements * unit test fixes --- .../main/resources/ui/src/assets/svg/menu.svg | 6 ++ .../ActivityThreadPanelBody.tsx | 9 +- .../components/TeamDetails/TeamDetailsV1.tsx | 20 ++-- .../ManageButton/ManageButton.tsx | 39 +++---- .../RequestDescriptionPage.tsx | 101 ++++++++--------- .../RequestTagPage/RequestTagPage.tsx | 100 ++++++++--------- .../TaskDetailPage/TaskDetailPage.tsx | 11 +- .../UpdateDescriptionPage.tsx | 102 +++++++++--------- .../TasksPage/UpdateTagPage/UpdateTagPage.tsx | 100 ++++++++--------- .../TasksPage/shared/TaskPageLayout.test.tsx | 5 - .../pages/TasksPage/shared/TaskPageLayout.tsx | 14 +-- .../src/main/resources/ui/src/styles/app.less | 3 + .../ui/src/styles/components/size.less | 3 + 13 files changed, 260 insertions(+), 253 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/menu.svg diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/menu.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/menu.svg new file mode 100644 index 00000000000..7245904d0a6 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/menu.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanelBody.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanelBody.tsx index a5abc759445..f7bc7002a9f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanelBody.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanelBody.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ -import { Button, Switch } from 'antd'; +import { Button, Space, Switch } from 'antd'; import { AxiosError } from 'axios'; import classNames from 'classnames'; import { Operation } from 'fast-json-patch'; @@ -251,10 +251,13 @@ const ActivityThreadPanelBody: FC = ({ /> )} {isTaskType && ( -
+ {t('label.closed-task-plural')} -
+ )} {!isUndefined(selectedThread) ? ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TeamDetails/TeamDetailsV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TeamDetails/TeamDetailsV1.tsx index a36694a2060..cbd52e0bd67 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TeamDetails/TeamDetailsV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TeamDetails/TeamDetailsV1.tsx @@ -11,11 +11,7 @@ * limitations under the License. */ -import { - CheckOutlined, - CloseOutlined, - EllipsisOutlined, -} from '@ant-design/icons'; +import { CheckOutlined, CloseOutlined } from '@ant-design/icons'; import { Button, Col, @@ -42,6 +38,7 @@ import { Link } from 'react-router-dom'; import { restoreTeam } from 'rest/teamsAPI'; import AppState from '../../AppState'; import { ReactComponent as IconEdit } from '../../assets/svg/ic-edit.svg'; +import { ReactComponent as IconDropdown } from '../../assets/svg/menu.svg'; import { getTeamAndUserDetailsPath, getUserPath, @@ -1089,14 +1086,13 @@ const TeamDetailsV1 = ({ trigger={['click']} onOpenChange={setShowActions}> + icon={ + + } + size="small" + /> )} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.tsx index 277b0a7a9de..39db53e81c9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.tsx @@ -11,16 +11,19 @@ * limitations under the License. */ -import { EllipsisOutlined } from '@ant-design/icons'; import { Button, Col, Dropdown, Modal, Row, Tooltip, Typography } from 'antd'; import { ItemType } from 'antd/lib/menu/hooks/useItems'; import classNames from 'classnames'; import React, { FC, useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { ReactComponent as IconAnnouncementsBlack } from '../../../../assets/svg/announcements-black.svg'; +import { ReactComponent as IconDelete } 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 { NO_PERMISSION_FOR_ACTION } from '../../../../constants/HelperTextUtil'; import { EntityType } from '../../../../enums/entity.enum'; import { ANNOUNCEMENT_ENTITIES } from '../../../../utils/AnnouncementsUtils'; -import SVGIcons, { Icons } from '../../../../utils/SvgUtils'; import DeleteWidgetModal from '../../DeleteWidget/DeleteWidgetModal'; import './ManageButton.less'; @@ -70,8 +73,8 @@ const ManageButton: FC = ({ label: ( { if (canDelete) { @@ -81,7 +84,7 @@ const ManageButton: FC = ({ } }}> - + @@ -112,8 +115,8 @@ const ManageButton: FC = ({ label: ( { if (canDelete) { @@ -123,8 +126,11 @@ const ManageButton: FC = ({ } }}> - {' '} - + @@ -157,17 +163,17 @@ const ManageButton: FC = ({ { label: ( { e.stopPropagation(); setShowActions(false); onAnnouncementClick && onAnnouncementClick(); }}> - @@ -213,10 +219,7 @@ const ManageButton: FC = ({ title="Manage" type="default" onClick={() => setShowActions(true)}> - + {isDelete && ( 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 9d4f5f15004..ffbd641d304 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 @@ -202,21 +202,22 @@ const RequestDescription = () => { return ( - -
+ + + { + -
-
- {capitalize(entityType)} {t('label.detail-plural')} -
-
- {`${t('label.owner')}:`}{' '} - - {entityData.owner ? ( - - - - {getEntityName(entityData.owner)} - +
+
+ {capitalize(entityType)} {t('label.detail-plural')} +
+
+ {`${t('label.owner')}:`}{' '} + + {entityData.owner ? ( + + + + {getEntityName(entityData.owner)} - ) : ( - - {t('label.no-entity', { entity: t('label.owner') })} - - )} - -
- -

- {entityTier ? ( - entityTier + ) : ( - - {t('label.no-entity', { entity: t('label.tier') })} + + {t('label.no-entity', { entity: t('label.owner') })} )} -

- -

{entityTags}

- - {getColumnDetails()} +
+ +

+ {entityTier ? ( + entityTier + ) : ( + + {t('label.no-entity', { entity: t('label.tier') })} + + )} +

+ +

{entityTags}

+ + {getColumnDetails()}
); 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 32781d9d7c9..ab4a328412d 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 @@ -190,21 +190,21 @@ const RequestTag = () => { return ( - -
+ + { + -
-
- {capitalize(entityType)} {t('label.detail-plural')} -
-
- {`${t('label.owner')}:`}{' '} - - {entityData.owner ? ( - - - - {getEntityName(entityData.owner)} - +
+
+ {capitalize(entityType)} {t('label.detail-plural')} +
+
+ {`${t('label.owner')}:`}{' '} + + {entityData.owner ? ( + + + + {getEntityName(entityData.owner)} - ) : ( - - {t('label.no-entity', { entity: t('label.owner') })} - - )} - -
- -

- {entityTier ? ( - entityTier + ) : ( - - {t('label.no-entity', { entity: t('label.tier') })} + + {t('label.no-entity', { entity: t('label.owner') })} )} -

- -

{entityTags}

- - {getColumnDetails()} +
+ +

+ {entityTier ? ( + entityTier + ) : ( + + {t('label.no-entity', { entity: t('label.tier') })} + + )} +

+ +

{entityTags}

+ + {getColumnDetails()}
); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/TaskDetailPage/TaskDetailPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/TaskDetailPage/TaskDetailPage.tsx index f8dc0986044..2f795c05897 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/TaskDetailPage/TaskDetailPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/TaskDetailPage/TaskDetailPage.tsx @@ -12,7 +12,7 @@ */ import { CheckOutlined, CloseOutlined, DownOutlined } from '@ant-design/icons'; -import { Button, Card, Dropdown, Layout, MenuProps, Tabs } from 'antd'; +import { Button, Card, Dropdown, Layout, MenuProps, Space, Tabs } from 'antd'; import { AxiosError } from 'axios'; import classNames from 'classnames'; import ActivityFeedEditor from 'components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditor'; @@ -668,9 +668,10 @@ const TaskDetailPage = () => { /> )} -
+ {(hasEditAccess() || isCreator) && !isTaskClosed && (
+ {isTaskClosed && } 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 bc7778dd6a5..ac8c4fc6399 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 @@ -208,21 +208,22 @@ const UpdateDescription = () => { return ( - -
+ + + { - -
-
- {capitalize(entityType)} {t('label.detail-plural')} -
-
- {`${t('label.owner')}:`}{' '} - - {entityData.owner ? ( - - - - {getEntityName(entityData.owner)} - + +
+
+ {capitalize(entityType)} {t('label.detail-plural')} +
+
+ {`${t('label.owner')}:`}{' '} + + {entityData.owner ? ( + + + + {getEntityName(entityData.owner)} - ) : ( - - {t('label.no-entity', { entity: t('label.owner') })} - - )} - -
- -

- {entityTier ? ( - entityTier + ) : ( - - {t('label.no-entity', { entity: t('label.tier') })} + + {t('label.no-entity', { entity: t('label.owner') })} )} -

- -

{entityTags}

- - {getColumnDetails()} +
+ +

+ {entityTier ? ( + entityTier + ) : ( + + {t('label.no-entity', { entity: t('label.tier') })} + + )} +

+ +

{entityTags}

+ + {getColumnDetails()}
); 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 c6766e0befa..5a51e0ad6e2 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 @@ -208,21 +208,21 @@ const UpdateTag = () => { return ( - -
+ + { + -
-
- {capitalize(entityType)} {t('label.detail-plural')} -
-
- {`${t('label.owner')}:`}{' '} - - {entityData.owner ? ( - - - - {getEntityName(entityData.owner)} - +
+
+ {capitalize(entityType)} {t('label.detail-plural')} +
+
+ {`${t('label.owner')}:`}{' '} + + {entityData.owner ? ( + + + + {getEntityName(entityData.owner)} - ) : ( - - {t('label.no-entity', { entity: t('label.owner') })} - - )} - -
- -

- {entityTier ? ( - entityTier + ) : ( - - {t('label.no-entity', { entity: t('label.tier') })} + + {t('label.no-entity', { entity: t('label.owner') })} )} -

- -

{entityTags}

- - {getColumnDetails()} +
+ +

+ {entityTier ? ( + entityTier + ) : ( + + {t('label.no-entity', { entity: t('label.tier') })} + + )} +

+ +

{entityTags}

+ + {getColumnDetails()}
); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.test.tsx index 2a3d05282b0..36a34d82ab4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.test.tsx @@ -22,13 +22,8 @@ describe('Test TaskPageLayout Component', () => { it('Should render the component', async () => { render(); - const leftSider = await screen.findByTestId('left-sider'); - const rightSider = await screen.findByTestId('right-sider'); - const children = await screen.findByTestId('children'); - expect(leftSider).toBeInTheDocument(); - expect(rightSider).toBeInTheDocument(); expect(children).toBeInTheDocument(); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.tsx index 485c6482ade..771383b2783 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPageLayout.tsx @@ -11,22 +11,18 @@ * limitations under the License. */ -import { Layout } from 'antd'; +import PageContainerV1 from 'components/containers/PageContainerV1'; +import PageLayoutV1 from 'components/containers/PageLayoutV1'; import React, { FC, HTMLAttributes } from 'react'; -import { background, contentStyles } from '../TaskPage.styles'; // eslint-disable-next-line @typescript-eslint/no-empty-interface interface Props extends HTMLAttributes {} const TaskPageLayout: FC = ({ children }) => { - const { Content, Sider } = Layout; - return ( - - - {children} - - + + {children} + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/app.less b/openmetadata-ui/src/main/resources/ui/src/styles/app.less index a8477a08e46..4622620953f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/app.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/app.less @@ -276,6 +276,9 @@ .opacity-0 { opacity: 0; } +.opacity-50 { + opacity: 0.5; +} .opacity-100 { opacity: 1; } diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less b/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less index 46912a3910b..55bf0c26bee 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less @@ -50,6 +50,9 @@ .w-48 { width: 12rem; } +.w-500 { + width: 500px; +} .w-800 { width: 800px; }