msjit / testcasedb

TestCaseDB - Web based test case management
MIT License
40 stars 18 forks source link

[Feature Request] Display partial string when names are too long #45

Open agramian opened 9 years ago

agramian commented 9 years ago

In the test case Tree View as an example, if a test case name or description is too long the table cell is made extremely wide instead of shortening the strings and keeping the cell a reasonable width.

agramian commented 9 years ago

This is especially an issue in the test plan overview if categories are used with one or more sub-categories. The text from the category column tries to go to a second line and then just overlaps the name column. The overflow for the columns can at least be set to hide the extra text. Ideally ellipses are added to a shortened version of the column text.

harshith30 commented 9 years ago

@agramian Hi, I'm currenly working on it , can we use text-overflow: ellipsis property of CSS .

I'm Still learning and came across this property while trying to solve this issue.

agramian commented 9 years ago

@harshith30
I wasn't aware that an ellipsis property existed but that sounds like a good solution if it's compatible with all the modern browsers and works. This is pretty crucial because right now there are some serious display issues with long item names and descriptions.

joffems commented 9 years ago

@harshith30 I've also never used that feature, but it should work.

As an alternative, we can use the ruby helper 'truncate' to do this in the view. We a globally configured text size. We could make our own helper to do this that will also include a tool tip for truncated fields.

harshith30 commented 9 years ago

@agramian

yes , Also ellipsis property can only be used on div and p tags . currently i'm trying to verify its compatibility with other browsers , hope i will figure out how to implement them,.

@joffems yes i have also looked at it, i will try to implement atleast of them.

agramian commented 9 years ago

@harshith30 what is the status on this?

harshith30 commented 9 years ago

Hi, Sorry i could not work for couple of weeks.

I tried using ellipsis property but did not show any changes , so i'm using the truncate method. right now i have wrote the following code in the helper file


def trancate(string, length = 15) string.size > length+5 ? [string[0,length],string[-5,5]].join("...") : string end


I dont know how to use this file properly , when i searched in net i got These helper methods extend Action View making them callable within your template files.

In some places they have also said to include ActionView::Helpers::TextHelper , if yes where should i add this.

can you help me please.

Thanks.

joffems commented 9 years ago

Rails has a built in truncate function. Details are here. Unless you're doing something special, you shouldn't need to recreate it.

http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate

harshith30 commented 9 years ago

Hi, I was able to do it thanks for the info. I will send a pull request as early as i can. I will add these changes for both Test Cases and Test Plans Module.

This is how it looks like before and after truncating

Before Truncating

truncate_before


After Truncating

truncating

joffems commented 9 years ago

A fix has been deployed for this. Descriptions are now truncated.

agramian commented 9 years ago

This has not been fully resolved or tested. Please see attached image below. The truncation needs to be implemented wherever long strings are permitted which is more than just the main Test Plans tree view and not just for descriptions.

testcasedb-long-string-render-issues

harshith30 commented 9 years ago

Hi, Sorry about that i will fix them in as early as possible.

Thanks

agramian commented 9 years ago

@harshith30 have you had a chance to address this?

harshith30 commented 9 years ago

Hi,

I was able to do it partly, right now i'm stuck with some network

issues , which is not allowing me to access Hithub, as soon as it gets resolved ,i will add more details to it.

Harshith

On Tue, Jan 6, 2015 at 12:54 AM, Abtin Gramian notifications@github.com wrote:

@harshith30 https://github.com/harshith30 have you had a chance to address this?

— Reply to this email directly or view it on GitHub https://github.com/msjit/testcasedb/issues/45#issuecomment-68761031.

agramian commented 9 years ago

@harshith30 any updates?

harshith30 commented 9 years ago

Hi,

I'm sorry i was busy with personal problems, i will update it and report in few days.

Thanks

On Tue, Jan 27, 2015 at 5:33 AM, Abtin Gramian notifications@github.com wrote:

@harshith30 https://github.com/harshith30 any updates?

— Reply to this email directly or view it on GitHub https://github.com/msjit/testcasedb/issues/45#issuecomment-71565021.