From c00e93ca77406f769d347f90d396c56814108865 Mon Sep 17 00:00:00 2001 From: ShubhamThakre Date: Thu, 21 Apr 2022 01:24:15 +0200 Subject: [PATCH 1/4] addOwnerModal-> by default type is set to first value of dropdown --- .../profile/sidebar/Ownership/AddOwnerModal.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx index cf01b97675109..fd4fdb7a786fc 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx @@ -1,5 +1,5 @@ import { Button, Form, message, Modal, Select, Tag, Typography } from 'antd'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; import { Link } from 'react-router-dom'; import { useAddOwnerMutation } from '../../../../../../../graphql/mutations.generated'; @@ -50,6 +50,7 @@ type SelectedActor = { }; export const AddOwnerModal = ({ urn, type, visible, hideOwnerType, defaultOwnerType, onClose, refetch }: Props) => { + console.log('defaultOwnerType', defaultOwnerType); const entityRegistry = useEntityRegistry(); const [selectedActor, setSelectedActor] = useState(undefined); const [selectedOwnerType, setSelectedOwnerType] = useState(defaultOwnerType || OwnershipType.None); @@ -189,6 +190,12 @@ export const AddOwnerModal = ({ urn, type, visible, hideOwnerType, defaultOwnerT const selectValue = (selectedActor && [selectedActor.displayName]) || []; const ownershipTypes = OWNERSHIP_DISPLAY_TYPES; + useEffect(() => { + if (ownershipTypes) { + setSelectedOwnerType(ownershipTypes[0].type); + } + }, [ownershipTypes]); + // Handle the Enter press // TODO: Allow user to be selected prior to executed the save. // useEnterKeyListener({ @@ -240,7 +247,11 @@ export const AddOwnerModal = ({ urn, type, visible, hideOwnerType, defaultOwnerT Type}> Choose an owner type - {ownershipTypes.map((ownerType) => ( {ownerType.name} From 9fe883db49acb78af52800fa85fe771712f42a90 Mon Sep 17 00:00:00 2001 From: ShubhamThakre Date: Thu, 21 Apr 2022 18:22:22 +0200 Subject: [PATCH 2/4] Group header section fixed --- .../src/app/entity/group/GroupInfoSideBar.tsx | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/datahub-web-react/src/app/entity/group/GroupInfoSideBar.tsx b/datahub-web-react/src/app/entity/group/GroupInfoSideBar.tsx index ffcd9b9e8345c..59209a51a6688 100644 --- a/datahub-web-react/src/app/entity/group/GroupInfoSideBar.tsx +++ b/datahub-web-react/src/app/entity/group/GroupInfoSideBar.tsx @@ -1,4 +1,4 @@ -import { Divider, message, Space, Button, Typography } from 'antd'; +import { Divider, message, Space, Button, Typography, Row, Col } from 'antd'; import React, { useState } from 'react'; import styled from 'styled-components'; import { EditOutlined, MailOutlined, SlackOutlined } from '@ant-design/icons'; @@ -48,20 +48,21 @@ const TITLES = { editGroup: 'Edit Group', }; -const GroupNameHeader = styled.div` +const GroupNameHeader = styled(Row)` font-size: 20px; line-height: 28px; color: #262626; margin: 16px 16px 8px 8px; display: flex; align-items: center; - justify-content: left; + justify-content: center; min-height: 100px; `; const GroupName = styled.div` - margin-left: 12px; max-width: 260px; + word-wrap: break-word; + width: 140px; `; /** @@ -120,14 +121,18 @@ export default function GroupInfoSidebar({ sideBarData, refetch }: Props) { - - {name} + + + + + {name} + From 30354b65ee6e0ace723d1aa104ad589f97059ac4 Mon Sep 17 00:00:00 2001 From: ShubhamThakre Date: Mon, 25 Apr 2022 19:58:25 +0200 Subject: [PATCH 3/4] Groups -> member section scroll removed by limiting the characters in the member tags and showing full name on hover --- .../src/app/entity/group/GroupMembersSideBarSection.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/datahub-web-react/src/app/entity/group/GroupMembersSideBarSection.tsx b/datahub-web-react/src/app/entity/group/GroupMembersSideBarSection.tsx index df9f1defa4203..173f191042bf6 100644 --- a/datahub-web-react/src/app/entity/group/GroupMembersSideBarSection.tsx +++ b/datahub-web-react/src/app/entity/group/GroupMembersSideBarSection.tsx @@ -1,4 +1,4 @@ -import { Tag } from 'antd'; +import { Tag, Tooltip } from 'antd'; import React from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; @@ -53,7 +53,11 @@ export default function GroupMembersSideBarSection({ total, relationships, onSee photoUrl={user.editableProperties?.pictureLink || undefined} useDefaultAvatar={false} /> - {name} + {name.length > 15 ? ( + {`${name.substring(0, 15)}..`} + ) : ( + {name} + )} ); From ac652ae88d0acf5dd050ed36db72f0d76ed10b07 Mon Sep 17 00:00:00 2001 From: John Joyce Date: Tue, 26 Apr 2022 13:58:13 -0700 Subject: [PATCH 4/4] Update AddOwnerModal.tsx removing console.log --- .../containers/profile/sidebar/Ownership/AddOwnerModal.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx index fd4fdb7a786fc..df3aff2563c4e 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/AddOwnerModal.tsx @@ -50,7 +50,6 @@ type SelectedActor = { }; export const AddOwnerModal = ({ urn, type, visible, hideOwnerType, defaultOwnerType, onClose, refetch }: Props) => { - console.log('defaultOwnerType', defaultOwnerType); const entityRegistry = useEntityRegistry(); const [selectedActor, setSelectedActor] = useState(undefined); const [selectedOwnerType, setSelectedOwnerType] = useState(defaultOwnerType || OwnershipType.None);