-
Notifications
You must be signed in to change notification settings - Fork 3k
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(ui): Changes to allow editable display name for datasets and editable business label for schema fields #6171
Conversation
…ness label for schema fields
Unit Test Results (metadata ingestion) 6 files - 2 6 suites - 2 50m 36s ⏱️ - 7m 58s For more details on these errors, see this check. Results for commit 33b8432. ± Comparison against base commit 95d1e01. This pull request removes 679 tests.
This pull request skips 1 test.
♻️ This comment has been updated with latest results. |
variables: { urn: mutationUrn, input: { editableProperties: { description: sanitizedDescription || '' } } }, | ||
variables: { | ||
urn: mutationUrn, | ||
input: { editableProperties: { name: editableName, description: sanitizedDescription || '' } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will actually update the name to be an empty string (" ") if one was not previously set. This is not what we want .. Instead, we should be able to leave editable name null if there is not one set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me and I will make the update.
@@ -37,10 +39,32 @@ function EntityName(props: Props) { | |||
|
|||
const [updateName] = useUpdateNameMutation(); | |||
|
|||
const updateEntity = useEntityUpdate<GenericEntityUpdate>(); | |||
|
|||
const updateEditableName = (entityNameUpdate, mutationUrn) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment here: Name is a very important concept. It's important that we keep the APIs standard across all entity types when manipulating this field. I would strongly request that we use the more structured "updateName" mutation to handle updates to any entity's name. This is similar to what we do with the updateDescription
mutation, which abstracts away description updates for each type of entity
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this was built this way is to support being able to allow updating the editableDatasetProperties' Name field (and keeping the non-editable Name field intact). The current updateName mutation does not support Dataset entity name updates as I can understand (/datahub/graphql/resolvers/mutate/UpdateNameResolver.java).
If this is agreeable, I can extend the existing UpdateNameResolver to support Dataset entity's EditableDatasetProperties' Name field. Please advise and I can update it accordingly and abstract it from the UI perspective by just calling "updateName" mutation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made this change with the latest commit. Please look into.
switch (entityType) { | ||
case EntityType.Dataset: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely think that we should avoid hardcoding in whether the current user is able to edit the name..
This requires a way to ask our backend whether the current user is able to change the name. Likely we'll need a new Metadata Privilege called "Update Entity Name" that will be able to represent this. Then we'll need to fetch those privileges from the frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a specific need that we have on our end wherein only the owners must be able to edit certain fields within the UI. I have added this as a new privilege similar to manageGlossaries and fetch and matched it in the frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jaykadambi are you still working on this PR?
@aditya-radhakrishnan - Yes. I had some questions/comments back to @jjoyce0510. Perhaps I can go ahead and commit the updated code and let @jjoyce0510 review when he gets a chance. Thanks!
@jjoyce0510 - I have made the next set of commits to address the PR comments. Please review and let me know your feedback. Thanks!
cc - @aditya-radhakrishnan.
|
||
const ABBREVIATED_LIMIT = 40; | ||
|
||
export default function LabelField({ label, onUpdate, isEdited = false, original }: Props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
""" | ||
An optional sub resource type | ||
""" | ||
subResourceType: SubResourceType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should have ! to be required, since this only applies to DatasetFieldLabels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's looking in the right direction! I have a couple actionable questions + pieces of feedback. Let me know what you think!
@jjoyce0510 - Thanks for reviewing the PR and providing your feedback. I have couple of items to your feedback. Please check and let me know your thoughts on those and I will work on updating the PR with the updated code asap. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
@@ -7106,6 +7131,31 @@ input DescriptionUpdateInput { | |||
subResource: String | |||
} | |||
|
|||
""" | |||
Updates the label of a resource. Currently supports DatasetField labels only | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Label is maybe a bit too generic of a name here. This is strictly restricted to Dataset Fields, and should be named as such.
Consider DatasetFieldLabelUpdateInput
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
""" | ||
Updates the label of a resource. Currently only supports Dataset Schema Fields | ||
""" | ||
updateLabel(input: LabelUpdateInput!): Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateDatasetFieldLabel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's looking in the right direction! I have a couple actionable questions + pieces of feedback. Let me know what you think!
Hey @jaykadambi are you still working on this PR? |
@aditya-radhakrishnan - Yes. I had some questions/comments back to @jjoyce0510. Perhaps I can go ahead and commit the updated code and let @jjoyce0510 review when he gets a chance. Thanks! |
@aditya-radhakrishnan @jjoyce0510 - please advise on the updated changes in this PR that I had made a few days ago. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jaykadambi ! Thank you for the amazing contribution.
I've had time to sync with my team on this contribution. They raised concerns about the addition of a new concept of "field label" into the main repository.
Folks were generally receptive above allowing users to update the name for an entity, but label was a point of contention, since it's a new concept that we'll need to support even though we have not received significant feedback to indicate that it's a widespread problem.
If you're willing, we'd like to propose an alternative: Split this PR into an initial PR which isolates the changes for updating the "name" of an asset. Clearly delineate which entities we support updating name for, and which we do not. Separately, we can discuss whether the field name label is a concept DataHub should natively support separately. One possibility is that DataHub is not currently ready to accept this contribution.
We really appreciate the tremendous amount of work you've already put into this PR, and apologies that I personally did not raise this issue earlier.
Thanks for being a great DataHub community member! Looking forward to hearing more.
Cheers
John
Thanks @jjoyce0510 for the detailed note. I will submit a new PR as you have suggested. Thanks! |
Going to close this PR for now then, will be eagerly awaiting to hear more from you! Thanks |
Summary: In reference to the discussion in Slack with @shirshanka and @gabe-lyons, creating this PR to allow for editable searchable name (aka display name) for datasets and to allow for presenting and being able to edit label (aka business label) at the schema field level. Please see example screenshots below.
Examples:
Checklist