From c1c185321cda44f0835fe7c5330283df7c2760f6 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 28 Feb 2023 13:15:51 +0530 Subject: [PATCH] chore(ui): UI improvements (#10331) * chore(ui): UI improvements * fix table css which was causing cypress issue * fix cypress issue * remove required from alerts filters --- .../ui/cypress/e2e/Pages/Glossary.spec.js | 1 + .../ui/src/assets/svg/paper-plane-primary.svg | 2 +- .../ActivityFeedEditor/SendButton.tsx | 76 +++++-------------- .../Glossary/GlossaryV1.component.tsx | 26 +++---- .../components/Glossary/GlossaryV1.style.less | 5 -- .../TableProfiler/TableProfilerV1.tsx | 2 +- .../components/TeamDetails/TeamDetailsV1.tsx | 2 +- .../common/CronEditor/CronEditor.constant.ts | 10 +-- .../ManageButton/ManageButton.less | 12 ++- .../resources/ui/src/constants/constants.ts | 6 ++ .../ui/src/locale/languages/en-us.json | 8 +- .../src/pages/AddAlertPage/AddAlertPage.tsx | 24 ++---- .../ui/src/pages/AlertsPage/AlertsPage.tsx | 6 +- .../ui/src/styles/components/table.less | 21 ++++- 14 files changed, 90 insertions(+), 111 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js index be17f79518e..e807bac62cf 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js @@ -991,6 +991,7 @@ describe('Glossary page should work properly', () => { it('Delete glossary should work properly', () => { [NEW_GLOSSARY.name, NEW_GLOSSARY_1.name].forEach((glossary) => { verifyResponseStatusCode('@fetchGlossaries', 200); + cy.wait(200); cy.get('[data-testid="header"]') .should('be.visible') .contains(glossary) diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/paper-plane-primary.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/paper-plane-primary.svg index 0751a00b20b..a1d2c9b9b6e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/assets/svg/paper-plane-primary.svg +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/paper-plane-primary.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/SendButton.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/SendButton.tsx index 5a0753a8050..d330b7e5b71 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/SendButton.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/SendButton.tsx @@ -11,13 +11,11 @@ * limitations under the License. */ -import { Popover } from 'antd'; +import { Button } from 'antd'; import classNames from 'classnames'; -import React, { FC, Fragment } from 'react'; -import { useTranslation } from 'react-i18next'; -import { Transi18next } from '../../../utils/CommonUtils'; -import SVGIcons, { Icons } from '../../../utils/SvgUtils'; -import { Button } from '../../buttons/Button/Button'; +import React, { FC } from 'react'; + +import { ReactComponent as IconPaperPlanePrimary } from '../../../assets/svg/paper-plane-primary.svg'; interface SendButtonProp { editorValue: string; @@ -25,58 +23,22 @@ interface SendButtonProp { onSaveHandler: () => void; } -const getIcon = (editorValue: string) => { - return editorValue.length > 0 ? Icons.PAPER_PLANE_PRIMARY : Icons.PAPER_PLANE; -}; - export const SendButton: FC = ({ editorValue, buttonClass, onSaveHandler, -}) => { - const { t } = useTranslation(); - - return ( -
e.stopPropagation()}> - - {t('label.send-now')} -

- {t('label.press')} - - } - values={{ - text: t('label.return'), - }} - /> -

- - } - placement="top" - trigger="hover"> - -
-
- ); -}; +}) => ( +
e.stopPropagation()}> + +
+); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx index 47c4c23f979..1e251642422 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx @@ -11,8 +11,7 @@ * limitations under the License. */ -import { EllipsisOutlined } from '@ant-design/icons'; -import { Col, Dropdown, Row, Tooltip, Typography } from 'antd'; +import { Button, Col, Dropdown, Row, Tooltip, Typography } from 'antd'; import { ReactComponent as ExportIcon } from 'assets/svg/ic-export.svg'; import { ReactComponent as ImportIcon } from 'assets/svg/ic-import.svg'; import { AxiosError } from 'axios'; @@ -20,6 +19,7 @@ import { isEmpty } from 'lodash'; import React, { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useHistory, useParams } from 'react-router-dom'; +import { ReactComponent as IconDropdown } from '../../assets/svg/menu.svg'; import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants'; import { NO_PERMISSION_FOR_ACTION } from '../../constants/HelperTextUtil'; import { Glossary } from '../../generated/entity/data/glossary'; @@ -33,7 +33,7 @@ import { } from '../../utils/RouterUtils'; import SVGIcons, { Icons } from '../../utils/SvgUtils'; import { showErrorToast } from '../../utils/ToastUtils'; -import { Button } from '../buttons/Button/Button'; +import '../common/entityPageInfo/ManageButton/ManageButton.less'; import TitleBreadcrumb from '../common/title-breadcrumb/title-breadcrumb.component'; import { TitleBreadcrumbProps } from '../common/title-breadcrumb/title-breadcrumb.interface'; import GlossaryDetails from '../GlossaryDetails/GlossaryDetails.component'; @@ -107,6 +107,11 @@ const GlossaryV1 = ({ [action] ); + const isGlossaryDeletePermission = useMemo( + () => glossaryPermission.Delete || glossaryTermPermission.Delete, + [glossaryPermission, glossaryTermPermission] + ); + const fetchGlossaryPermission = async () => { try { const response = await getEntityPermission( @@ -322,8 +327,9 @@ const GlossaryV1 = ({ trigger={['click']} onOpenChange={setShowActions}> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.style.less b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.style.less index 6c2dc742254..8f66b12f89d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.style.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.style.less @@ -40,11 +40,6 @@ margin-right: 0.3rem; } -.glossary-manage-button { - border: none; - background-color: @manage-dropdown-bg-primary; -} - .manage-button { .ant-space-item:first-child { width: 40px; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx index 1902942e4b6..a12f2458655 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx @@ -437,7 +437,7 @@ const TableProfilerV1: FC = ({ : t('message.no-permission-for-action') }>