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

feat(frontend): add additional tabs to glossary terms view #7392

Merged

Conversation

alexey-kravtsov
Copy link
Contributor

Add "Contained by" and "Inherited by" tabs to glossary related terms view as requested in feature request https://feature-requests.datahubproject.io/p/list-inbound-relationships-to-glossary-terms

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). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

add "contained by" and "inherited by" tabs to glossary related terms view
@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Feb 21, 2023
@anshbansal anshbansal added the community-contribution PR or Issue raised by member(s) of DataHub Community label Feb 21, 2023
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

This is great stuff @alexey-kravtsov ! thanks so much for this contribution.

I only have a few comments and all of the are real small changes for consistency and grammar. Once you get those up I believe we'll be ready to merge!

@@ -12,6 +12,8 @@ import RelatedTerm from './RelatedTerm';
export enum RelatedTermTypes {
hasRelatedTerms = 'Contains',
isRelatedTerms = 'Inherits',
containedBy = 'Contained by',
isAChildren = 'Inherited by',
Copy link
Collaborator

Choose a reason for hiding this comment

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

just to be a bit more consistent with containedBy what do you think about calling this enum entry inheritedBy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually keys of this enum are implicitly used to address entityData fields here https://github.com/datahub-project/datahub/blob/master/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedTerms.tsx#L61 , and isAChildren is a field of type GenericEntityProperties. I can change this enum to structure like this

export const RELATED_TERM_TYPES = {
    inheritedBy: {
        title: 'Inherited by',
        fieldName: 'isAChildren',
    },
...

How do you think, would that be better? Or maybe just leave it as is?

Copy link
Collaborator

Choose a reason for hiding this comment

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

hey great call! I think we can leave it as is in that case.

I wouldn't be opposed to updating glossaryTerm.graphql and changing isAChildren -> inheritedBy and then updating GenericEntityProperties and anywhere that references the field isAChildren, however I think that's out of scope here and i'm cool with moving forward with what you have.

? TermRelationshipType.HasA
: TermRelationshipType.IsA;
const relatedTermsMutable =
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe a rename to canEditRelatedTerms?

key={urn}
urn={urn}
relationshipType={relationshipType}
mutable={relatedTermsMutable}
Copy link
Collaborator

Choose a reason for hiding this comment

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

and similarly we could change this prop from mutable to isEditable (just cuz we usually use the verb "edit" instead of "mutate" for this type of thing and prefer descriptive booleans like isEditable instead of just editable)

@@ -57,6 +57,14 @@ export const EMPTY_MESSAGES = {
title: 'Does not inherit from any terms',
description: 'Terms can inherit from other terms to represent an "Is A" style relationship.',
},
'contained by': {
title: 'Does not contained by any terms',
Copy link
Collaborator

Choose a reason for hiding this comment

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

copy change: 'Does not contained by any terms' -> 'Is not contained by any terms'

@@ -57,6 +57,14 @@ export const EMPTY_MESSAGES = {
title: 'Does not inherit from any terms',
description: 'Terms can inherit from other terms to represent an "Is A" style relationship.',
},
'contained by': {
title: 'Does not contained by any terms',
description: 'Terms can be contained by other terms to represent an "Has A" style relationship.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can change the ...respresent an "Has A"... to ...represent a "Has A"...

also if you wouldn't mind making that "an" -> "a" change on line 54 as well that would be much appreciated :)

description: 'Terms can be contained by other terms to represent an "Has A" style relationship.',
},
'inherited by': {
title: 'Does not inherited by any terms',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to above -> Is not inherited by an terms

@chriscollins3456 chriscollins3456 self-assigned this Feb 21, 2023
changed variable name and tab labels according to PR comments
@alexey-kravtsov
Copy link
Contributor Author

Thanks a lot @chriscollins3456 for your review! I addressed all comments except one

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

one last little copy change that was my typo on a comment earlier! then I think this is ready to go.

description: 'Terms can be contained by other terms to represent a "Has A" style relationship.',
},
'inherited by': {
title: 'Is not inherited by an terms',
Copy link
Collaborator

Choose a reason for hiding this comment

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

shoot - you might have gotten this from my typo from a comment on this line, can we change "an" -> "any" here so it would be:

title: 'Is not inherited by any terms',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

amazing! thanks for this! once we get CI green i'll merge

@chriscollins3456 chriscollins3456 merged commit 79aa66a into datahub-project:master Feb 22, 2023
@alexey-kravtsov alexey-kravtsov deleted the glossary-terms-relations branch February 28, 2023 17:48
oleg-ruban pushed a commit to RChygir/datahub that referenced this pull request Feb 28, 2023
…roject#7392)

Adds tabs for "Contained by" and "Inherited by" on the Glossary Related Terms tab.
yoonhyejin pushed a commit that referenced this pull request Mar 3, 2023
Adds tabs for "Contained by" and "Inherited by" on the Glossary Related Terms tab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants