From 5e2866dd1b04557ceb2b10013fa0cd64e6428ed9 Mon Sep 17 00:00:00 2001 From: karanh37 <33024356+karanh37@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:22:26 +0530 Subject: [PATCH] feat: show all entities related to user (#12112) * feat: show all entities related to user * fix: layout issues * fix: review comments --- .../ActivityFeedTab/activity-feed-tab.less | 2 +- .../src/components/Users/Users.component.tsx | 2 +- .../ui/src/components/Users/Users.style.less | 18 ++++++++++++++++++ .../src/pages/UserPage/UserPage.component.tsx | 19 ++++++++++++++++--- .../ui/src/styles/components/drawer.less | 4 ++++ .../resources/ui/src/styles/variables.less | 3 +++ 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/activity-feed-tab.less b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/activity-feed-tab.less index 276eba00e9e5..00cfe6c462bc 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/activity-feed-tab.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedTab/activity-feed-tab.less @@ -32,7 +32,7 @@ } .left-container { flex: 0 0 @left-side-panel-width; - border-right: @global-border; + border-right: @global-border !important; } } 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 8becd5d01f08..d7ec9995412d 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 @@ -748,7 +748,7 @@ const Users = ({ return (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.style.less b/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.style.less index df8a48906d7d..6f8f62cc9d55 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.style.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.style.less @@ -29,6 +29,7 @@ } .user-page-layout { + height: @users-page-tabs-height; .page-layout-rightpanel { padding-right: 0 !important; background-color: @white; @@ -38,3 +39,20 @@ border-top: 0; } } + +.user-layout { + .activity-feed-tab { + .center-container { + height: @users-page-tabs-height; + } + .right-container { + height: @users-page-tabs-height; + } + } + .summary-panel-container { + height: @users-page-tabs-height; + } + .explore-search-card { + margin: 0 12px; + } +} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx index 306402f78cb7..a3bb819bb811 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/UserPage/UserPage.component.tsx @@ -79,11 +79,26 @@ const UserPage = () => { .finally(() => setIsLoading(false)); }; + const getQueryFilters = (fetchOwnedEntities: boolean) => { + if (fetchOwnedEntities) { + const teamsIds = (userData.teams ?? []).map((team) => team.id); + const mergedIds = [ + ...teamsIds.map((id) => `owner.id:${id}`), + `owner.id:${userData.id}`, + ].join(' OR '); + + return `(${mergedIds})`; + } else { + return `followers:${userData.id}`; + } + }; + const fetchEntities = async ( fetchOwnedEntities = false, handleEntity: Dispatch> ) => { const entity = fetchOwnedEntities ? ownedEntities : followingEntities; + if (userData.id) { setIsUserEntitiesLoading(true); try { @@ -91,9 +106,7 @@ const UserPage = () => { '', entity.currPage, PAGE_SIZE, - fetchOwnedEntities - ? `owner.id:${userData.id}` - : `followers:${userData.id}`, + getQueryFilters(fetchOwnedEntities), '', '', myDataSearchIndex diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/components/drawer.less b/openmetadata-ui/src/main/resources/ui/src/styles/components/drawer.less index 1d29b3687935..d68e2ced2fa0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/components/drawer.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/components/drawer.less @@ -27,3 +27,7 @@ overflow-x: hidden; } } + +.ant-drawer-header { + border-bottom: none; +} diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/variables.less b/openmetadata-ui/src/main/resources/ui/src/styles/variables.less index 268e603b4c04..f7764c26e2d4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/variables.less +++ b/openmetadata-ui/src/main/resources/ui/src/styles/variables.less @@ -81,3 +81,6 @@ // Sizing @left-side-panel-width: 230px; @entity-details-tab-height: calc(100vh - 236px); +@users-page-tabs-height: calc( + 100vh - 122px +); /* navbar+tab_height+padding = 64+46+12 */