From ad8da5024473ba47b5bda4baf3587fed97985157 Mon Sep 17 00:00:00 2001 From: bangn Date: Fri, 12 Jan 2018 21:46:11 +1100 Subject: [PATCH] feat: elegantly handle long service names in index. --- lib/pact_broker/ui/view_models/index_item.rb | 6 +++--- lib/pact_broker/ui/views/index/show-with-tags.haml | 8 ++++---- public/stylesheets/index.css | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/pact_broker/ui/view_models/index_item.rb b/lib/pact_broker/ui/view_models/index_item.rb index 30a8806f1..26fcee6e4 100644 --- a/lib/pact_broker/ui/view_models/index_item.rb +++ b/lib/pact_broker/ui/view_models/index_item.rb @@ -22,11 +22,11 @@ def provider_name end def consumer_version_number - short_version_number(@relationship.consumer_version_number) + @relationship.consumer_version_number end def provider_version_number - short_version_number(@relationship.provider_version_number) + @relationship.provider_version_number end def tag_names @@ -145,4 +145,4 @@ def short_version_number version_number end end end -end \ No newline at end of file +end diff --git a/lib/pact_broker/ui/views/index/show-with-tags.haml b/lib/pact_broker/ui/views/index/show-with-tags.haml index 682a347a8..296222a9c 100644 --- a/lib/pact_broker/ui/views/index/show-with-tags.haml +++ b/lib/pact_broker/ui/views/index/show-with-tags.haml @@ -18,14 +18,14 @@ %th.consumer Consumer %span.glyphicon.glyphicon-sort.relationships-sort - %th.tag + %th.consumer-version-number Version %span.glyphicon.glyphicon-sort.relationships-sort %th.pact{ style: 'width: 40px' } %th.provider Provider %span.glyphicon.glyphicon-sort.relationships-sort - %th.tag + %th.provider-version-number Version %span.glyphicon.glyphicon-sort.relationships-sort %th @@ -41,7 +41,7 @@ %td.consumer %a{:href => index_item.consumer_group_url } = index_item.consumer_name - %td + %td.consumer-version-number = index_item.consumer_version_number %span{style: 'color:gray'} = index_item.tag_names @@ -51,7 +51,7 @@ %td.provider %a{ href: index_item.provider_group_url } = index_item.provider_name - %td + %td.provider-version-number = index_item.provider_version_number %td = index_item.publication_date_of_latest_pact.gsub("about ", "") diff --git a/public/stylesheets/index.css b/public/stylesheets/index.css index 7d585b08a..2498ad6b6 100644 --- a/public/stylesheets/index.css +++ b/public/stylesheets/index.css @@ -4,6 +4,7 @@ } .table-striped>tbody>tr>td.consumer, .table-striped>thead>tr>th.consumer { + padding: 2px; border-right: none; } @@ -49,6 +50,11 @@ body { padding-top: 10px; } .consumer, .provider { text-align: center; + word-wrap: break-word; +} + +.consumer-version-number, .provider-version-number { + word-wrap: break-word; } span.pact {