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: Use type metadata description get/update apis #1876

Merged

Conversation

kristenarmes
Copy link
Contributor

Signed-off-by: Kristen Armes karmes@lyft.com

Summary of Changes

  • Use the new type metadata description get and update APIs to allow users to view and add/edit descriptions for nested columns from the UI
  • The column description APIs were changed on the frontend side only to take a column key instead of column name to be consistent with the type metadata APIs
  • The logic to decide whether the badges column should be displayed was updated to check if any type metadata values have any badges as well instead of checking only the top level columns

Tests

  • Added tests for get/update type metadata description APIs
  • Added tests for ColumnDescEditableText to test when it is used by a top level column or a nested column

Documentation

N/A

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does

Signed-off-by: Kristen Armes <karmes@lyft.com>
@boring-cyborg boring-cyborg bot added area:frontend From the Frontend folder category:api labels May 27, 2022
Signed-off-by: Kristen Armes <karmes@lyft.com>
def _set_type_metadata_is_editable(type_metadata: TypeMetadata, is_editable: bool) -> None:
type_metadata['is_editable'] = is_editable
for tm in type_metadata['children']:
_set_type_metadata_is_editable(tm, is_editable)
Copy link
Contributor

Choose a reason for hiding this comment

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

so right now editability is only controlled down to the parent level? Lets say we want to set a nested column to be have an editable description we can't then set one of it's sub column's to not have an editable description right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true as of now, I followed how the columns are handled as well, since it appears that as of now it only has table level configurations to determine whether columns are editable or not. I think this could be adjusted in the future pretty easily if that were to change

Signed-off-by: Kristen Armes <karmes@lyft.com>
Copy link
Member

@Golodhros Golodhros left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +130 to +131
typeConstant, // eslint-disable-line @typescript-eslint/no-unused-vars
topLevelTmName, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Member

Choose a reason for hiding this comment

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

I think you can do:

const [ columnName, _, _, ...tmNames] ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case I was getting the error Cannot redeclare block-scoped variable '_' since there are two, but in any case I seem to remember from a previous PR where I had I tried the underscore for one unused var, the checks still required the no unused var disable

Copy link
Member

Choose a reason for hiding this comment

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

I see, makes sense to complain with two of those.
Whatever works will be fine.

[109, 6, 22, "Must use destructuring props assignment", "2225424112"],
[116, 4, 24, "Must use destructuring props assignment", "3049746099"],
[134, 19, 20, "Script URL is a form of eval.", "3373049033"],
[146, 8, 207, "A control must be associated with a text label.", "2914986446"]
Copy link
Member

Choose a reason for hiding this comment

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

Thanks a lot!

Signed-off-by: Kristen Armes <karmes@lyft.com>
@Golodhros Golodhros merged commit 08bea6c into amundsen-io:main Jun 1, 2022
@kristenarmes kristenarmes deleted the use-type-metadata-description-apis branch June 1, 2022 18:28
allisonsuarez added a commit that referenced this pull request Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend From the Frontend folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants