Project

General

Profile

Actions

Defect #7280

closed

Issues subjects wrap in Gantt

Added by Luis Serrano Aranda about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Gantt
Target version:
Start date:
2011-01-11
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When I see the Gantt chart the subject of the petition if you have more than one line in length is cut


Files

Capture.JPG (128 KB) Capture.JPG Luis Serrano Aranda, 2011-01-18 16:25
Capture.JPG (23.8 KB) Capture.JPG Luis Serrano Aranda, 2011-01-28 15:16
gantt_subjects_truncation.patch (5.19 KB) gantt_subjects_truncation.patch Etienne Massip, 2011-02-01 16:30
gantt.png (30.9 KB) gantt.png Matthias Neubert, 2011-02-09 17:09
gantt_subject_truncation_updated.patch (6.99 KB) gantt_subject_truncation_updated.patch Anonymous, 2011-02-17 14:28
gantt_truncate_subjects_add_tooltip.diff (7.15 KB) gantt_truncate_subjects_add_tooltip.diff Anonymous, 2011-02-21 15:56

Related issues

Related to Redmine - Defect #7807: Gantt subjects rendering is broken with IE6/IE7Closed2011-03-08

Actions
Has duplicate Redmine - Defect #7514: Gantt: Issues names not diplayed properly when wrapped to second lineClosed2011-02-01

Actions
Actions #1

Updated by Luis Serrano Aranda about 13 years ago

Hello, no one does this happen?

Thanks

I attach a capture.

Actions #2

Updated by Dirk Schmidt about 13 years ago

Same happens in our Redmine.
Exactly like in the Screencapture of Luis Serrano Aranda

Actions #3

Updated by Will Vanderpol about 13 years ago

Happens in ours as well.

Actions #4

Updated by Siegfried Vogel about 13 years ago

+1

Actions #5

Updated by Luis Serrano Aranda about 13 years ago

I have worked, if not quite right and looks good also in internet explorer

Change in /redmine/lib/redmine/helpers/gantt.rb

Older line 183
options[:top_increment] = 20 unless options.key? :top_increment

New line 183
options[:top_increment] = 30 unless options.key? :top_increment

Old line 711
output= "<div class='......line-height:1.2;height:16px....>

New line 711
output= "<div class='......line-height:1.6;height:28px....>

And in the file /redmine/app/views/gantts/show.html.erb

Old line 65

g_height = [(25.....

New line 65

g_height = [(30.....

I think this great and improves the gantt visualization

Thanks for your attention and sorry for my english

Actions #6

Updated by Dirk Schmidt about 13 years ago

Nearly perfect solution, but if you have a lot of Tickets there is not enough place if you scroll down the Gantt

Actions #7

Updated by Luis Serrano Aranda about 13 years ago

You have changed the file /redmine/app/views/gantts/show.html.erb ?

Put a bigger number I think is this parameter

Actions #8

Updated by Dirk Schmidt about 13 years ago

Your Solution works perfect. Thanks :) Good Work!
I think the Problem that i had after was caused of the Browsers Cache.

Actions #9

Updated by Stefan Langenmaier about 13 years ago

+1

The fix from Luis Serrano Aranda works, but now every row has the additional height. This can be used to work but it's not ideal yet. What happens if a title takes up the space for three lines? The best thing would be that it grows depending on the text.

Never the less, thank you very much for your work.

Actions #10

Updated by Etienne Massip about 13 years ago

  • File gantt_subjects_truncation.patch added

What about truncating the subjects in the subjects column, as the full issue subject is displayed by the tooltip in the diagram part ?

Here's a patch.

We could also add a tooltip on subject if truncated...

Actions #11

Updated by Luis Serrano Aranda about 13 years ago

I make changes to the files without my modification?

With Internet Explorer if the subject is truncated fails to calculate the position.

Actions #12

Updated by Luis Serrano Aranda about 13 years ago

What do you have changed in the line 360 (file gantt.rb) ?

Thanks

Actions #13

Updated by Etienne Massip about 13 years ago

Just " for ' (single quotes), absolutely useless.

Actions #14

Updated by Luis Serrano Aranda about 13 years ago

Ups is true sorry

Actions #15

Updated by Stefan Langenmaier about 13 years ago

Very nice solution! It working here.

Actions #16

Updated by Etienne Massip about 13 years ago

Luis Serrano Aranda wrote:

I make changes to the files without my modification?

With Internet Explorer if the subject is truncated fails to calculate the position.

Yep, damn IE6.

Actions #17

Updated by Etienne Massip about 13 years ago

  • Subject changed from Problems in Gantt to Issues subjects are truncated in Gantt
Actions #18

Updated by Etienne Massip about 13 years ago

  • File gantt_subjects_truncation.patch added

Should work with IE6 too now.

Actions #19

Updated by Etienne Massip about 13 years ago

  • File deleted (gantt_subjects_truncation.patch)
Actions #20

Updated by Jean-Philippe Lang about 13 years ago

  • Status changed from New to Closed
  • Target version set to 1.1.1
  • Resolution set to Fixed

Etienne, thanks for the patch. Committed in r4780 and merged in 1.1-stable.

Actions #21

Updated by Jean-Philippe Lang about 13 years ago

  • Status changed from Closed to Reopened
  • Target version deleted (1.1.1)
  • Resolution deleted (Fixed)

The patch broke gantt unit tests and was reverted in r4782 (http://www.redmine.org/builds/index.html).

Actions #22

Updated by Etienne Massip about 13 years ago

  • File gantt_subjects_truncation.patch added

Yes, I knew it, sorry.

This one should pass test.

Actions #23

Updated by Etienne Massip about 13 years ago

  • File deleted (gantt_subjects_truncation.patch)
Actions #24

Updated by Etienne Massip about 13 years ago

  • File deleted (gantt_subjects_truncation.patch)
Actions #25

Updated by Etienne Massip about 13 years ago

This one should pass test and be compatible with IE6.

Actions #26

Updated by Luis Serrano Aranda about 13 years ago

Perfect but when I put the title in all caps, when exporting to pdf gives problems

Thanks

Actions #27

Updated by Etienne Massip about 13 years ago

Luis Serrano Aranda wrote:

Perfect but when I put the title in all caps, when exporting to pdf gives problems

Thanks

What kind of problem ? This patch is not supposed to have any impact on PDF export, are you sure that your problem was not present before you applied the patch ?

Actions #28

Updated by Matthias Neubert about 13 years ago

This patch seems to just cut of the long names of issues.
This is not very usefull when the gantt chart is printed (hence no mouseover)
-> Why not have 2 lines or more when name is soo long, but displayed proper an not
shown als little dots under the first line.

btw: no hard problems with Redmine 1.11 and patch applied.
-> but when last word before truncation is too long, the word it self and "(..)" overlaps with
the bar in diagram of this issue.

Actions #29

Updated by Etienne Massip about 13 years ago

Yes, this patch is not nearly a perfect solution, it just enhances the Gantt visual aspect by removing subject overlapping.

Subject length mostly overstep default width of the subjects div (at least on my redmine) so there would be almost half the issues eventually listed on the screen, that could be a problem.

This is not very usefull when the gantt chart is printed (hence no mouseover)

Gantt tab is not very well suited for direct screen printing, is it ? PDF should be a better choice ?

but when last word before truncation is too long, the word it self and "(..)" overlaps with

the bar in diagram of this issue.

Could you post a screenshot ? What browser are you using ?

Actions #30

Updated by Matthias Neubert about 13 years ago

I use Firefox 3.6, screen shot of th pdf is attached

Actions #31

Updated by Etienne Massip about 13 years ago

As I said before :

This patch is not supposed to have any impact on PDF export, are you sure that your problem was not present before you applied the patch ?

Actions #32

Updated by Anonymous about 13 years ago

Entienne, thanks for the patch. It solves the issue, however, your new patch still breaks 3 unit tests.

  1) Failure:
test: #subject_for_issue :html format should add an absolute positioned div. (Redmine::Helpers::GanttTest)
    [/test/unit/lib/redmine/helpers/gantt_test.rb:620:in `__bind_1297945857_987240'
     shoulda (2.10.3) lib/shoulda/context.rb:362:in `call'
     shoulda (2.10.3) lib/shoulda/context.rb:362:in `test: #subject_for_issue :html format should add an absolute positioned div. ']:
Expected at least 1 element matching "div[style*='absolute']", found 0.
<false> is not true.

  2) Failure:
test: #subject_for_project :html format should add an absolute positioned div. (Redmine::Helpers::GanttTest)
    [/test/unit/lib/redmine/helpers/gantt_test.rb:288:in `__bind_1297945862_896580'
     shoulda (2.10.3) lib/shoulda/context.rb:362:in `call'
     shoulda (2.10.3) lib/shoulda/context.rb:362:in `test: #subject_for_project :html format should add an absolute positioned div. ']:
Expected at least 1 element matching "div[style*='absolute']", found 0.
<false> is not true.

  3) Failure:
test: #subject_for_version :html format should add an absolute positioned div. (Redmine::Helpers::GanttTest)
    [/test/unit/lib/redmine/helpers/gantt_test.rb:454:in `__bind_1297945867_486670'
     shoulda (2.10.3) lib/shoulda/context.rb:362:in `call'
     shoulda (2.10.3) lib/shoulda/context.rb:362:in `test: #subject_for_version :html format should add an absolute positioned div. ']:
Expected at least 1 element matching "div[style*='absolute']", found 0.
<false> is not true.

946 tests, 3639 assertions, 3 failures, 0 errors

This happens because you moved this css to application.css, making these tests unnecessary:

+.gantt_subject { position: absolute; height: 16px; line-height: 1.2em; }
+.gantt_subject-text { position: absolute; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

I removed these tests and made an updated patch.

Actions #33

Updated by Etienne Massip about 13 years ago

Thanks.

BTW, this patch does not really solve the problem, it only prevents the actual ugly vertical override.

Maybe we could try some other way like adding a horizontal moving separator between subjects and lines in addition to this truncation, thus one could resize at will the subject bar to whatever he needs if the default width does not fit his need.

Actions #34

Updated by Etienne Massip about 13 years ago

There are leads here or here.

Actions #35

Updated by Anonymous about 13 years ago

Well the patch does makes the html view consistent with the pdf view.

A moving separator seems a bit over the top solution to only show the issue name. Actually, I like your previous suggestion of showing a tooltip with the full issue name.

Actions #36

Updated by Etienne Massip about 13 years ago

Pieter Nicolai wrote:

A moving separator seems a bit over the top solution to only show the issue name.

I was also thinking about the possibility later on to add columns to the subjects bar.

Actions #37

Updated by Anonymous about 13 years ago

I added tooltips for each gantt subject which show the full title. See attached patch.

All tests pass. Hope this can get included in 1.1.2 since this issue is what is holding us back updating Redmine to 1.1.x at our company.

Actions #38

Updated by Etienne Massip about 13 years ago

Nice.

You should replace the to_s_with_project in source:/trunk/lib/redmine/helpers/gantt.rb with something like the result of format_version_name() in source:/trunk/app/helpers/application_helper.rb#L176

Actions #39

Updated by Jean-Philippe Lang about 13 years ago

  • Subject changed from Issues subjects are truncated in Gantt to Issues subjects wrap in Gantt

I've fixed text wraping issue in r4913 based on Etienne's patch.
Full issue subject added as title in r4914.

Actions #40

Updated by Jean-Philippe Lang about 13 years ago

  • Target version set to 1.1.2
  • Resolution set to Fixed
Actions #41

Updated by Etienne Massip about 13 years ago

I'd test it with IE6 as applying style directly to div instead of span (white-space and text-overflow) didn't work previously (see note 16).

Actions #42

Updated by Etienne Massip about 13 years ago

As feared, new rendering of the Gantt with IE6 is very ugly :
  • no subject text for truncated subjects when the issue is assigned and using gravatar
  • else, subject text for truncated subjects is displayed over the issue icon

I think that CSS should be move out from the page to the stylesheet, firstly because it's bad habit to repeat style with the style attribute and secondly because that would lighten the html when rendering a lot of issues in the Gantt.

Plus : why not truncate the version and project subjects too ?

Actions #43

Updated by Etienne Massip about 13 years ago

  • Status changed from Reopened to 7
Actions #44

Updated by Etienne Massip about 13 years ago

Sorry, couldn't reopen the issue (#7678) :/

Actions #45

Updated by Jean-Philippe Lang about 13 years ago

Etienne Massip wrote:

As feared, new rendering of the Gantt with IE6 is very ugly :

Maybe replacing the div in #html_subject with a span would make IE6 happy? Can you give a try?

I think that CSS should be move out from the page to the stylesheet, firstly because it's bad habit to repeat style with the style attribute and secondly because that would lighten the html when rendering a lot of issues in the Gantt.

Done in r4916.

Plus : why not truncate the version and project subjects too ?

They are truncated. Do you mean adding a title to the div?

Actions #46

Updated by Etienne Massip about 13 years ago

Jean-Philippe Lang wrote:

Etienne Massip wrote:

As feared, new rendering of the Gantt with IE6 is very ugly :

Maybe replacing the div in #html_subject with a span would make IE6 happy? Can you give a try?

Plus : why not truncate the version and project subjects too ?

IE6 is very thought to satisfy, I think I've already try this trick ; I'll try again and tell you back.

They are truncated. Do you mean adding a title to the div?

Ok, maybe should I put my glasses on...adding the title would be nice also.

Actions #47

Updated by Etienne Massip about 13 years ago

Still ugly.

You should be able to reproduce this behavior with IE by switching document mode to IE7.

I made a LOT of tries with css / html and the only configuration finally doing fine is the one I included with the patch.

Actions #48

Updated by Chris Darts about 13 years ago

I've just applied this patch with v1.1.1 and it works fine. I also use the patch from #2024 and there seems to be no conflict with regards to the layout.

I've tested it in FireFox 3.6 and Chrome 9.0.597.9 on Ubuntu 10.10. Not tried IE I'm afraid.

Thanks for this great patch.

Actions #49

Updated by Jean-Philippe Lang about 13 years ago

  • Status changed from 7 to Closed

r4913, r4914, r4916 merged in 1.1-stable.
We may open a specific issue for IE6 behaviour.

Actions #50

Updated by Etienne Massip about 13 years ago

Are you sure ?

This is pretty regressive for IE6 users (and they are still numerous) if they use Gantt+avatars.

That would be nice to have it fixed too as we know there is a solution (at least one).

Actions #51

Updated by Anonymous about 13 years ago

Now that Microsoft is even trying to kill IE6, see http://ie6countdown.com/ , I wonder if it still worth the effort to provide workarounds specific for IE6. Fact is that it is a 10 year old browser which doesn't follow web standards.

Actions #52

Updated by Etienne Massip about 13 years ago

IE6 is far from being dead ; about 3.6 % as for Jan. 2011, which is more than Opera.

My company switched to IE8 only 2 months ago.

I think we should suport it.

Actions #53

Updated by Ruben Kruiswijk about 13 years ago

Why are the gantt fixes made in the application.css and not in a separate css file? Custom themes/stylesheets are not getting updated this way. This doesn't apply to this issue only of course.

Actions

Also available in: Atom PDF