-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[52127] Project list: Truncate long text fields and disable expand action #14777
[52127] Project list: Truncate long text fields and disable expand action #14777
Conversation
…hould be truncated with a class named long-text-truncation
…th the whole text inside it
…on' of https://github.com/opf/openproject into 52127-truncate-long-text-fields-and-disable-expand-action
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 @bsatarnejad ,
it is good to see , that we can remove a bunch of code by this change. However, there are a couple of issues with this PR:
- The text of the status description, descriptionText not displayed in only a single line.
With tables and images possible being part of the text, this might become quite hard to achieve. I believe there are two options:
- Remove all tags from the output/render the text without tags
- Limit the height to a single line
Of the two options, I would go with the first because it promises to be simpler to implement and does not run into edge cases like having only an image or a table in the text which might lead to the whole text being removed in case the first option is taken.
- The "Expand" is not on the same height as the shortened text:
- The "Expand" is not always displayed:
For this, the height would also have to be taken into account when calculating whether to add the "Expand" element. This problem is of course strongly coupled to the first mentioned problem and might be affected by the solution to it.
- Formatting (newlines) not applied in modal:
When clicking on "Expand" becomes:
Additionally, the modal does not have a header. The need for a header on the modal is not specified but I would think that the user would have an easier time understanding the behaviour if the modal would have a header consisting of the project name and the attribute. But ultimately, that is for product to decide, so better check with @psatyal.
return nil unless user_can_view_project? | ||
|
||
if project.description | ||
content_tag :div, helpers.format_text(project.description), class: 'wiki' |
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 think the class: 'wiki'
part should be removed. The fact that the other methods in this class also use it is a relic of the past we should fix.
@@ -381,3 +381,10 @@ thead.-sticky th | |||
|
|||
p:last-child | |||
margin-bottom: 0 | |||
|
|||
.long-text-truncation | |||
display: flex |
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'm closing this PR because this feature is implemented in another PR. |
https://community.openproject.org/projects/openproject/work_packages/52127/activity