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

[52127] Project list: Truncate long text fields and disable expand action #14777

Conversation

bsatarnejad
Copy link
Contributor

@bsatarnejad bsatarnejad commented Feb 13, 2024

  • Limit displaying (project description, project status description, project custom fields/attributes of the type long text) inside the table to one line, truncate with ellipses (...) when necessary
  • Add "Expand" link at the end of the truncated text
  • Clicking "Expand" will display the full contents of the long text field in a modal
  • Disable the expand/collapse action that displays project description
  • Remove the last column that contains the action
  • Write a test for the changes

https://community.openproject.org/projects/openproject/work_packages/52127/activity

@bsatarnejad bsatarnejad self-assigned this Feb 15, 2024
@bsatarnejad bsatarnejad marked this pull request as ready for review February 15, 2024 13:34
Copy link
Contributor

@ulferts ulferts left a 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.
image

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:
image
  •  The "Expand" is not always displayed:
image

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:
image

When clicking on "Expand" becomes:

image

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'
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks the layout in some cases where multi line custom fields are now displayed in one line with each of them shortened:
image

@bsatarnejad
Copy link
Contributor Author

I'm closing this PR because this feature is implemented in another PR.

@MayaBerd MayaBerd deleted the 52127-truncate-long-text-fields-and-disable-expand-action branch May 14, 2024 08:38
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.

2 participants