From 464181f074a33308f1186f1a2de92497f7125c49 Mon Sep 17 00:00:00 2001 From: darth-coder00 <86726556+darth-coder00@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:09:05 +0530 Subject: [PATCH] Fix: Flashy Popover, uneven UI for Tags, Teams and Services page (#2132) --- .../src/components/common/popover/PopOver.tsx | 4 + .../components/common/popover/PopOverTypes.ts | 2 + .../resources/ui/src/pages/services/index.tsx | 326 +++++++++--------- .../resources/ui/src/pages/tags/index.tsx | 35 +- .../resources/ui/src/pages/teams/index.tsx | 28 +- .../main/resources/ui/src/styles/tailwind.css | 4 +- .../resources/ui/src/utils/CommonUtils.tsx | 4 + 7 files changed, 201 insertions(+), 202 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/popover/PopOver.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/popover/PopOver.tsx index f3cb75a0e6b..043e025cf4a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/popover/PopOver.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/popover/PopOver.tsx @@ -21,6 +21,8 @@ const PopOver: React.FC = ({ arrow = true, children, className = '', + delay = 500, + hideDelay = 0, html, position, size = 'regular', @@ -32,6 +34,8 @@ const PopOver: React.FC = ({ { setServiceList(services[tabName] as unknown as Array); }; + const fetchLeftPanel = () => { + return ( + <> +
+
Services
+
+ + {getServiceTabs()?.map((tab, index) => { + return ( +
{ + handleTabChange(tab.name); + }}> +

+ {tab.displayName} +

+ + {getCountBadge( + servicesCount[tab.name], + '', + tab.name === serviceName + )} +
+ ); + })} + + ); + }; + const getOptionalFields = (service: ServiceDataObj): JSX.Element => { switch (serviceName) { case ServiceCategory.DATABASE_SERVICES: { @@ -452,174 +487,135 @@ const ServicesPage = () => { return ( <> {!isLoading ? ( - - + +
-
- -
- {/*
-
- {serviceList.length > 0 ? ( - - - - ) : null} -
-
*/} {serviceList.length ? ( -
- {serviceList.map((service, index) => ( + <> +
-
- - - -
- {service.description ? ( - - ) : ( - - No description added - - )} -
- {getOptionalFields(service)} -
- - - {service.ingestionSchedule?.repeatFrequency - ? getFrequencyTime( - service.ingestionSchedule.repeatFrequency - ) - : '--'} - -
-
- - - {service.serviceType} - -
-
-
-
- - - - - - -
-
- {/* {!isNull(serviceTypeLogo(service.serviceType)) && ( - - )} */} - {getServiceLogo(service.serviceType || '')} -
-
+ className="tw-heading tw-text-link tw-text-base" + data-testid="service-name"> + {servicesDisplayName[serviceName]}
- ))} -
+ + + +
+
+ {serviceList.map((service, index) => ( +
+
+ + + +
+ {service.description ? ( + + ) : ( + + No description added + + )} +
+ {getOptionalFields(service)} +
+ + + {service.ingestionSchedule?.repeatFrequency + ? getFrequencyTime( + service.ingestionSchedule.repeatFrequency + ) + : '--'} + +
+
+ + + {service.serviceType} + +
+
+
+
+ + + + + + +
+
+ {getServiceLogo(service.serviceType || '')} +
+
+
+ ))} +
+ ) : (
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx index d7c4b1c4b23..a7ad9e794e9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx @@ -44,7 +44,11 @@ import { } from '../../generated/api/tags/createTagCategory'; import { TagCategory, TagClass } from '../../generated/entity/tags/tagCategory'; import { useAuth } from '../../hooks/authHooks'; -import { getCountBadge, isEven } from '../../utils/CommonUtils'; +import { + getActiveCatClass, + getCountBadge, + isEven, +} from '../../utils/CommonUtils'; import SVGIcons from '../../utils/SvgUtils'; import { getTagCategories, getTaglist } from '../../utils/TagsUtils'; import Form from './Form'; @@ -93,14 +97,6 @@ const TagsPage = () => { } }; - const currentCategoryTab = (name: string) => { - if (currentCategory?.name === name) { - return 'activeCategory'; - } else { - return ''; - } - }; - const createCategory = (data: CreateTagCategory) => { createTagCategory(data).then((res: AxiosResponse) => { if (res.data) { @@ -180,11 +176,11 @@ const TagsPage = () => { const fetchLeftPanel = () => { return ( <> -
-
Tag Categories
+
+
Tag Categories
)} -
+
{ }); }; - const getCurrentTeamClass = (name: string) => { - if (currentTeam?.name === name) { - return 'activeCategory'; - } else { - return ''; - } - }; const getActiveTabClass = (tab: number) => { return tab === currentTab ? 'active' : ''; }; @@ -276,11 +269,11 @@ const TeamsPage = () => { const fetchLeftPanel = () => { return ( <> -
-
Teams
+
+
Teams
{ + return activeName === name ? 'activeCategory' : ''; +};