Bug 1293486 - Puppet class names are trunctated to 32 chars irrespective of cell width
Puppet class names are trunctated to 32 chars irrespective of cell width
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI (Show other bugs)
All All
unspecified Severity high (vote)
: Beta
: --
Assigned To: Katello Bug Bin
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2015-12-21 16:49 EST by Andrew Schofield
Modified: 2016-07-27 05:00 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1255182
Last Closed: 2016-07-27 05:00:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
puppet class with 81 characters name (85.26 KB, image/png)
2016-04-07 16:35 EDT, sthirugn@redhat.com
no flags Details
puppet class page (81.37 KB, image/png)
2016-04-07 16:38 EDT, sthirugn@redhat.com
no flags Details
How would the class names look when wrapping instead of ellipsis (27.07 KB, image/png)
2016-04-11 04:27 EDT, Ivan Necas
no flags Details

  None (edit)
Description Andrew Schofield 2015-12-21 16:49:38 EST
+++ This bug was initially created as a clone of Bug #1255182 +++

Description of problem:
Puppet class names in the web UI do not resize to the width of the cell (So if you have a <module>::<var> class name that approaches 32 chars this may not be fully visible).

Version-Release number of selected component (if applicable):

How reproducible:
Config -> Puppet classes

Steps to Reproduce:

This is generated by /usr/share/foreman/app/views/puppetclasses/index.html.erb 

<% for puppetclass in @puppetclasses %>
        <td><%=link_to_if_authorized trunc(puppetclass.name), hash_for_edit_puppetclass_path(:id => puppetclass).merge(:auth_object => puppetclass, :authorizer => authorizer) %></td>

And the trunc method (from : /usr/share/foreman/app/helpers/layout_helper.rb) says this:

def trunc(text, length = 32)
    text    = text.to_s
    options = text.size > length ? { :'data-original-title' => text, :rel => 'twipsy' } : {}
    content_tag(:span, truncate(text, :length => length), options).html_safe

Actual results:
Class name text is trucated to 32 chars

Expected results:
Class names should be fully visible

Additional info:
Comment 1 Bryan Kearney 2016-01-12 15:38:48 EST
Since i missed this earlier... 1255182  is about the capsule name, this is about the puppet class.
Comment 2 Brad Buckingham 2016-01-26 12:42:13 EST
Created redmine issue http://projects.theforeman.org/issues/13384 from this bug
Comment 4 Bryan Kearney 2016-01-26 14:10:13 EST
Upstream bug component is Provisioning
Comment 5 Bryan Kearney 2016-01-27 04:10:07 EST
Upstream bug component is WebUI
Comment 6 Brad Buckingham 2016-01-27 07:33:27 EST
Based on the comment in the upstream redmine, this has already been addressed.  Moving the bug to POST, since it should be included with the next rebase.
Comment 9 sthirugn@redhat.com 2016-04-07 16:35:11 EDT
Verified in satellite-6.2.0-6.2.beta.el7sat.noarch

I am able to hover over the class to see the full puppet class name - I tested a class with 81 characters and the screenshot is attached.
Comment 10 sthirugn@redhat.com 2016-04-07 16:35 EDT
Created attachment 1144879 [details]
puppet class with 81 characters name
Comment 11 sthirugn@redhat.com 2016-04-07 16:38 EDT
Created attachment 1144880 [details]
puppet class page
Comment 12 sthirugn@redhat.com 2016-04-07 16:43:29 EDT
Looking at the capsule bug, https://bugzilla.redhat.com/show_bug.cgi?id=1255182, I think the expectation is to wrap the name and not truncate it.
Comment 13 Brad Buckingham 2016-04-07 16:57:55 EDT
Hi Ivan,  Do you have any thoughts on this one? 

My assumption is that using ellipsis is the expected behavior for fields that may be long strings; however, it appears that the solution for this bug may be inconsistent with bug 1255182 (i.e. ellipsis vs wrapping).

In addition, looking at screenshot that Suresh attached for 'New Host Group' showing the 'Available Classes', it appears that we are not leveraging the space available before applying the ellipsis.
Comment 14 Ivan Necas 2016-04-08 08:55:05 EDT
This bug is about the puppet classes index page, which I understand from https://bugzilla.redhat.com/show_bug.cgi?id=1293486#c11 is handled properly now, and the case is with the puppet classes selector in host details. Since it's not part of the original bugzilla, that was already in verified state, I would suggest creating a separate bz redscribing this problem
Comment 15 sthirugn@redhat.com 2016-04-08 16:58:46 EDT
Let me rephrase my concerns:

1. Ignore comment 10
2. In comment 11, as per the screenshot, it is clear that we are not wrapping the long names - instead we are showing the full name in mouse hover.
3. Now this is contradicting https://bugzilla.redhat.com/show_bug.cgi?id=1255182#c8 which says that the longer names are wrapped and not ellipsized.
Comment 16 Ivan Necas 2016-04-11 04:26:10 EDT
The difference between the capsule names and class names is the class names contain only chars and ::, so there is not natural place for wrapping, unlike with capsule names, so we would need to allow to wrap in between of class names.

Is this desired behavior?

My understanding of the initial bug was we were always truncating to 32 chars (regardless of free space on the page). Honestly the ellipsis looks better to me than the artificial wrapping (see attachment when I tried that out)
Comment 17 Ivan Necas 2016-04-11 04:27 EDT
Created attachment 1145862 [details]
How would the class names look when wrapping instead of ellipsis
Comment 18 sthirugn@redhat.com 2016-04-11 09:24:17 EDT
As per Comment 16, if there is not a way to wrap puppet class names, I am okay with leaving it as ellipsis.

Verified in satellite-6.2.0-6.2.beta.el7sat.noarch
Comment 19 Bryan Kearney 2016-04-11 10:07:06 EDT
Script cleanup. This was fixed by
Comment 21 errata-xmlrpc 2016-07-27 05:00:50 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.