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

Datahub: Fix cutoff expanded abstract #986

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Datahub: Fix cutoff expanded abstract #986

merged 2 commits into from
Sep 9, 2024

Conversation

tkohr
Copy link
Collaborator

@tkohr tkohr commented Sep 5, 2024

Description

This PR replaces a margin with a padding in the max-lines ng-content to prevent cutoffs on expanded abstracts that may occur with markup since margins are not taken into account when calculating the expanded max height via getBoundingClientRect.

The bug was detected on camptocamp/mel-dataplatform#102

Screenshots

image

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

This work is sponsored by MEL.

Copy link
Contributor

github-actions bot commented Sep 5, 2024

Affected libs: ui-elements, feature-notifications, feature-editor, feature-search, feature-router, feature-map, feature-dataviz, feature-record, feature-catalog, ui-catalog, ui-search,
Affected apps: metadata-editor, datahub, demo, webcomponents, search, datafeeder, map-viewer,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Sep 5, 2024

📷 Screenshots are here!

@coveralls
Copy link

coveralls commented Sep 5, 2024

Coverage Status

coverage: 83.629% (+2.2%) from 81.448%
when pulling f4dd051 on fix-abstract-cutoff
into 8b395cf on main.

Copy link
Collaborator

@jahow jahow left a comment

Choose a reason for hiding this comment

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

I'm not sure this is the right approach: adding padding to the block will make the "read more" button appear without a need for it.

On main:
image

On this PR:
image

@tkohr
Copy link
Collaborator Author

tkohr commented Sep 6, 2024

Oh thanks, I completely missed that. I'll have a look how to handle this.

@jahow
Copy link
Collaborator

jahow commented Sep 6, 2024

Is it possible that the size computation is incorrect because of fonts loading or something like that?

@tkohr tkohr force-pushed the fix-abstract-cutoff branch from 35679d3 to 51d00b0 Compare September 9, 2024 09:46
@tkohr tkohr force-pushed the fix-abstract-cutoff branch from 51d00b0 to f4dd051 Compare September 9, 2024 09:59
@tkohr
Copy link
Collaborator Author

tkohr commented Sep 9, 2024

So as it turned out it was the margin-top from the first markdown heading that caused the issue calculating the height via getBoundingClientRect. Thanks @jahow !

@tkohr tkohr merged commit 80a79ec into main Sep 9, 2024
14 checks passed
@tkohr tkohr deleted the fix-abstract-cutoff branch September 9, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants