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

Apply text attribute component to overview page - using text expander #15130

Conversation

ulferts
Copy link
Contributor

@ulferts ulferts commented Mar 27, 2024

Acceptance criteria

  • Apply truncation to custom field attributes displayed in project overview page
    • On that page, the height is supposed to be up to three times the line height. Required adaptations in the component.
      • Still only display the first p element.
      • To make for a nicer behaviour, the text expander item is placed over the text. This allows the text in the lines before to go till the end of the line which reads more nicely. But this required some technical quirks since the color chosen for the text expander has an alpha value. So without any tricks, the text would shine through. To prevent this, another DOM element is placed below the text expander. That element needs to have the background color of the text. In most cases this is the color of #content. This part is rather hacky but works.
  • Use HiddenTextExpander instead of "Expand" link
    • Using the text expander, especially since it is placed over the text, leads to the text being cut off abruptly. No way around this could be identified.
  • Remove braces from "Preview not available"
  • The code used to have some reference to qa_selector when test_selector should have been used.

On the overview page, this looks e.g. like this:

image

On the list page, this looks e.g. like this:

image

https://community.openproject.org/wp/53373

@ulferts ulferts force-pushed the feature/53373-fine-tuning-of-truncation-feature-in-project-list-and-project-overview branch from 6913e67 to 0e90e05 Compare March 28, 2024 06:14
@ulferts ulferts force-pushed the feature/53373-fine-tuning-of-truncation-feature-in-project-list-and-project-overview branch from 0e90e05 to 99b1ac1 Compare March 28, 2024 07:34
@ulferts ulferts marked this pull request as ready for review March 28, 2024 13:51
@dombesz dombesz self-requested a review April 2, 2024 13:08
dombesz added 3 commits April 3, 2024 13:47
…y "Preview not available" correctly.

When the custom field's content is just a single macro table, the
"Preview not available" text is not being shown, nor the "more" icon.
The root cause is that the custom value's value is being formatted twice
on the project's list rendering.
Copy link
Contributor

@dombesz dombesz left a comment

Choose a reason for hiding this comment

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

LGMT, thanks Jens! 👍

I found 2 bugs and fixed them:

  1. The "Preview not available" text wasn't displayed on the projects table, when the content of the custom field was just a table macro.
  2. The "Preview not available" text overflowing the ellipsis on the projects table, the calculation needed to take the hider element's width into account.

@dombesz dombesz merged commit 1925b64 into dev Apr 3, 2024
12 checks passed
@dombesz dombesz deleted the feature/53373-fine-tuning-of-truncation-feature-in-project-list-and-project-overview branch April 3, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants