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

[Discover] support description in data-structures #9296

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joshuali925
Copy link
Member

Description

Sometimes a data structure contains other metadata, it would be helpful to display them as descriptions to the user. Examples can be user defined descriptions, tags, or associated resources.

This PR adds a optional description field for data structures, and it is displayed in the dataset table. Currently it does not add it to dataset selector but can be done in the future.

Issues Resolved

Screenshot

image

Testing the changes

unit tests added

Changelog

  • skip

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.70%. Comparing base (d227bc5) to head (f601b5d).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9296      +/-   ##
==========================================
- Coverage   61.71%   61.70%   -0.02%     
==========================================
  Files        3816     3816              
  Lines       91822    91831       +9     
  Branches    14542    14544       +2     
==========================================
- Hits        56672    56668       -4     
- Misses      31495    31507      +12     
- Partials     3655     3656       +1     
Flag Coverage Δ
Linux_1 28.99% <0.00%> (-0.01%) ⬇️
Linux_2 56.46% <ø> (ø)
Linux_3 39.18% <100.00%> (+<0.01%) ⬆️
Linux_4 28.90% <0.00%> (-0.01%) ⬇️
Windows_1 29.00% <0.00%> (-0.03%) ⬇️
Windows_2 56.41% <ø> (ø)
Windows_3 39.19% <100.00%> (+<0.01%) ⬆️
Windows_4 28.90% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kavilla kavilla added the discover for discover reinvent label Jan 30, 2025
{title}
</EuiText>
{item.description && (
<EuiText size="s" color="subdued" className="datasetTable__itemDescription">
Copy link
Member

Choose a reason for hiding this comment

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

should the title and description have the same size? can imagine if each structure has a description it can get lengthy

Copy link
Member Author

@joshuali925 joshuali925 Feb 3, 2025

Choose a reason for hiding this comment

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

they are the same size?

<EuiText size="s" className="datasetTable__itemTitle">
{title}

i can use extra small if it's what you mean. currently there's no way for user to set description, it needs the dataset type config to define what description is

Copy link
Collaborator

Choose a reason for hiding this comment

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

title and description are both small size text <EuiText size="s", maybe use xs for description?

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, added truncation
image

</EuiText>
{item.description && (
<EuiText size="s" color="subdued" className="datasetTable__itemDescription">
{item.description}
Copy link
Member

Choose a reason for hiding this comment

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

May be add ellipsis and truncation to support longer descriptions? or it is that dataset type config would have this logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hailong-am
Hailong-am previously approved these changes Feb 7, 2025
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding custom css, could the utility css class from oui work? .oui-textTruncate

Copy link
Member Author

Choose a reason for hiding this comment

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

Signed-off-by: Joshua Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all-star-contributor backport 2.x discover for discover reinvent Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants