From 74d90c401f75d92a183eeeef53875036d56ab48d Mon Sep 17 00:00:00 2001 From: yug-shah0106 <57866661+yug-shah0106@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:18:34 +0530 Subject: [PATCH] [issues-5643] Profile page updated as per new layout. (#5644) * [issues-5643] Profile page updated as per new layout. * Css issue fixed. * minor issue --- .../components/Explore/Explore.component.tsx | 63 +-- .../src/components/Users/Users.component.tsx | 440 ++++++++++-------- .../CardListItem/CardWithListItem.style.ts | 2 +- .../common/ProfilePicture/ProfilePicture.tsx | 10 +- .../src/components/common/avatar/Avatar.tsx | 4 +- .../main/resources/ui/src/styles/x-master.css | 5 + 6 files changed, 300 insertions(+), 224 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx index dfe545487a2..06dc9ebd6be 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx @@ -657,37 +657,38 @@ const Explore: React.FC = ({ const fetchLeftPanel = () => { return ( - - -
- -
-
- {!error && ( - - )} - - +
+ + +
+ +
+
+ {!error && ( + + )} + + +
); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx index bcf4f73e20c..61b5a3d744b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx @@ -12,6 +12,7 @@ */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { Card } from 'antd'; import { AxiosError, AxiosResponse } from 'axios'; import { isNil, toLower } from 'lodash'; import { observer } from 'mobx-react'; @@ -50,7 +51,7 @@ import Description from '../common/description/Description'; import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; import { reactSingleSelectCustomStyle } from '../common/react-select-component/reactSelectCustomStyle'; import TabsPane from '../common/TabsPane/TabsPane'; -import PageLayout from '../containers/PageLayout'; +import PageLayout, { leftPanelAntCardStyle } from '../containers/PageLayout'; import Loader from '../Loader/Loader'; import { Option, Props } from './Users.interface'; const tabs = [ @@ -213,9 +214,9 @@ const Users = ({ const getDisplayNameComponent = () => { if (isAdminUser || isLoggedinUser || isAuthDisabled) { return ( -
+
{isDisplayNameEdit ? ( -
+
{ if (isAdminUser || isLoggedinUser || isAuthDisabled) { return ( -
+
-
-
Teams
-
-
{teamsElement}
- + +
Teams
+
+ }> +
{teamsElement}
+ ); } else { return ( - -
-
Teams
- {!isTeamsEdit && ( - - )} -
-
- {isTeamsEdit ? ( - - ({ + label: getEntityName(team as unknown as EntityReference), + value: team.id, + }))} + placeholder="Teams..." + styles={reactSingleSelectCustomStyle} + value={selectedTeams} + onChange={handleOnTeamsChange} + /> +
+ + +
+
+ ) : ( + teamsElement + )} +
+
+ ); } }; @@ -434,82 +453,102 @@ const Users = ({ if (!isAdminUser && !isAuthDisabled) { return ( - -
-
Roles
+ +
Roles
+
+ }> +
+ {rolesElement}
-
{rolesElement}
-
+ ); } else { return ( - -
-
Roles
- {!isRolesEdit && ( - - )} -
-
- {isRolesEdit ? ( - - +
+ + +
+
+ ) : ( + rolesElement + )} +
+
+ ); } }; @@ -517,21 +556,33 @@ const Users = ({ const getInheritedRolesComponent = () => { if (userData.inheritedRoles?.length) { return ( - -
-
- Inherited Roles -
-
-
- {userData.inheritedRoles?.map((inheritedRole, i) => ( -
- - {getEntityName(inheritedRole)} -
- ))} -
-
+ +
+ Inherited Roles +
+
+ }> + +
+ {userData.inheritedRoles?.map((inheritedRole, i) => ( +
+ + {getEntityName(inheritedRole)} +
+ ))} +
+
+ ); } else { return null; @@ -540,30 +591,41 @@ const Users = ({ const fetchLeftPanel = () => { return ( -
-
- {userData.profile?.images?.image ? ( -
- profile + +
+ {userData.profile?.images?.image ? ( +
+ profile +
+ ) : ( + -
- ) : ( - - )} - {getDisplayNameComponent()} -

{userData.email}

- {getDescriptionComponent()} -
+ )} + {getDisplayNameComponent()} +

{userData.email}

+ {getDescriptionComponent()} +
+ {getTeamsComponent()} {getRolesComponent()} {getInheritedRolesComponent()} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/cardlist/CardListItem/CardWithListItem.style.ts b/openmetadata-ui/src/main/resources/ui/src/components/cardlist/CardListItem/CardWithListItem.style.ts index 3720d02c77d..eefc080d258 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/cardlist/CardListItem/CardWithListItem.style.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/cardlist/CardListItem/CardWithListItem.style.ts @@ -17,7 +17,7 @@ export const cardStyle = { active: 'tw-border-primary', selected: 'tw-border-primary', header: { - base: 'tw-flex tw-px-5 tw-py-3 tw-cursor-pointer tw-justify-between tw-items-center', + base: 'tw-flex tw-px-5 tw-py-3 tw-cursor-pointer tw-justify-between tw-items-center tw-rounded-t-md', default: '', active: 'tw-bg-primary-lite tw-border-b tw-border-primary', selected: 'tw-bg-primary tw-text-white', diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/ProfilePicture/ProfilePicture.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/ProfilePicture/ProfilePicture.tsx index a9bb941da1e..104297a6484 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/ProfilePicture/ProfilePicture.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/ProfilePicture/ProfilePicture.tsx @@ -29,6 +29,7 @@ interface Props extends UserData { type?: ImageShape; textClass?: string; className?: string; + height?: string; } const ProfilePicture = ({ @@ -39,6 +40,7 @@ const ProfilePicture = ({ textClass = '', type = 'square', width = '36', + height, }: Props) => { const profilePic = useMemo(() => { return getUserProfilePic(id, name); @@ -52,6 +54,7 @@ const ProfilePicture = ({ return ( + style={{ + height: `${height || width}px`, + width: `${width}px`, + }}> {getAvatarByName()}
+ style={{ height: `${height || width}px`, width: `${width}px` }}> user { const { color, character } = getRandomColor(name); @@ -39,7 +41,7 @@ const Avatar = ({ )} data-testid="avatar" style={{ - height: `${width}px`, + height: `${height || width}px`, width: `${width}px`, borderRadius: type === 'circle' ? '50%' : '4px', background: color, diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css b/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css index 4cf76278f0c..235e242e6ce 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css +++ b/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css @@ -1298,6 +1298,11 @@ div.ant-typography-ellipsis-custom { margin-bottom: 0px; } +.user-profile-antd-card .ant-card-body:first-child { + padding: 0px; + overflow: hidden; +} + .ant-input:hover, .ant-input:focus { border-color: #7147e8;