Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Drawer to show the tag profile data #4132

Merged

Conversation

Ankit-Keshari-Vituity
Copy link
Contributor

Side-drawer to show tag profile
* Added color-picker to change the color of the tag
* Added option to edit the description of the tag
* Added a button to add Owner's
* Added a link to redirect the datasets page
* Added a link to redirect the charts page
* Added a button at the bottom to close the side drawer

Tag_Profile_Drawer.mp4

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

@@ -75,7 +76,7 @@ export const AddOwnerModal = ({ visible, onClose, refetch }: Props) => {
type: EventType.EntityActionEvent,
actionType: EntityActionType.UpdateOwnership,
entityType,
entityUrn: urn,
entityUrn: urn || '',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would entityUrn be empty in Add Owner Modal? You are always adding owners to an entity. If this is for adding owners to tag as shown in the videos then should we not send tag URN in here? For all UI interactions we do want analytics. Does the analytics should up correctly?

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and committed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e a separate tag page altogether. We also need to change how the Tag Profile is rendered from the Search page! (It should still be a simple slide out. This would be inside of Tag.tsx.

Fixed and committed.
edit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small additional thing - Can we attempt to use an in place editing box instead of the update description modal. As shown here: https://ant.design/components/typography/ We can use the "editable" property to make the box in-place editable

Fixed and committed
edit

footer={
<>
<Button onClick={onClose}>Cancel</Button>
<Button onClick={() => onSubmit(updatedDescription)} disabled={updatedDescription === description}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add analytics for this like in AddOwnerModal.tsx

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and Committed.

@github-actions
Copy link

github-actions bot commented Feb 14, 2022

Unit Test Results (build & test)

  70 files  ±0    70 suites  ±0   15m 36s ⏱️ + 5m 28s
611 tests ±0  552 ✔️ ±0  59 💤 ±0  0 ±0 

Results for commit eae5951. ± Comparison against base commit ec9084a.

♻️ This comment has been updated with latest results.

const entityRegistry = useEntityRegistry();
const { urn, entityType } = useEntityData();
const { entityType } = useEntityData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entity type needs to be provided as well since it may be a Tag and in other cases will be the main entity of the page

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and committed.

Comment on lines 21 to 30
export default function EditDescriptionModal({ title, description, onClose, onSubmit, isAddDesc }: Props) {
const [updatedDescription, setUpdatedDescription] = useState(description || '');

return (
<Modal
title={title}
visible
width={900}
onCancel={onClose}
okText={isAddDesc ? 'Submit' : 'Update'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is already the src/app/entity/shared/components/legacy/DescriptionModal.tsx Can we use that instead? if not, can we refactor it so it can be used by both schemas and tags?

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and committed.

Comment on lines 210 to 212
<EditIcon twoToneColor="#52c41a" onClick={() => setShowEditModal(true)} />
<EditDescriptionText> Edit Description</EditDescriptionText>
</>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets make the text clickable as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the text as suggested

Comment on lines 148 to 152
useEffect(() => {
setUpdatedDescription(description);
// Manual Color Set-Up, Need to set once it will come from backend
setColorValue(hexColor);
}, [description, hexColor]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two actions should be in their own useEffects or I think some strange behavior may occur.

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and committed.

Comment on lines 154 to 168
const allSearchResultsByType = useGetAllEntitySearchResults({
query: entityAndSchemaQuery,
start: 0,
count: 1,
filters: [],
});

const statsLoading = Object.keys(allSearchResultsByType).some((type) => {
return allSearchResultsByType[type].loading;
});

const someStats =
!statsLoading &&
Object.keys(allSearchResultsByType).some((type) => {
return allSearchResultsByType[type]?.data?.search.total > 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you're at it, can you switch this to using the all entities search? For example of usage: https://github.com/linkedin/datahub/blob/master/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearch.tsx#L77. This only has 1 API call total while this deprecated approach has many.

{description.length === 0 ? (
<>
<NoDescriptionText>No Description</NoDescriptionText>
{EditButton}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the spacing on this edit button looks a bit off from the video. Can you give it a bit more space between description and edit button?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

)}
<Divider />
{/* Tag Charts, Datasets and Owners */}
<HeaderLayout>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really a header since its at the bottom of the pane? Maybe DetailsLayout?

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and Committed.

`;

const ColorPickerButton = styled.div`
width: 20px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this slightly smaller. Maybe 16x16px?

<StyledTag
style={{ cursor: 'pointer' }}
onClick={() => showTagProfileDrawer(tag.tag.urn)}
$colorHash={tag.tag.urn}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The color should now come from whatever was chosen :)

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small additional thing - Can we attempt to use an in place editing box instead of the update description modal. As shown here: https://ant.design/components/typography/ We can use the "editable" property to make the box in-place editable

@jjoyce0510
Copy link
Collaborator

We will need to make changes to mutations.js to edit the test for adding a tag. It assumes that there will be a separate tag page altogether. We also need to change how the Tag Profile is rendered from the Search page! (It should still be a simple slide out. This would be inside of Tag.tsx.

@Ankit-Keshari-Vituity
Copy link
Contributor Author

Modify the Tag Profile Page
Tag profile

@shirshanka shirshanka added the ui label Feb 21, 2022
@@ -6,7 +6,7 @@ const generateColor = new ColorHash({
saturation: 0.9,
});

export const StyledTag = styled(Tag)<{ $colorHash?: string }>`
export const StyledTag = styled(Tag)<{ $colorHash?: string | null }>`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that colorHash is what we want here - We need the styled tag to have the exact same color as what is the field of colorHex inside of the properties object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the style tag issue

Styletag_issue

@shirshanka shirshanka merged commit 826abb8 into datahub-project:master Feb 24, 2022
RyanHolstien pushed a commit to RyanHolstien/datahub that referenced this pull request Feb 25, 2022
maggiehays pushed a commit to maggiehays/datahub that referenced this pull request Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants