Skip to content

Commit

Permalink
feat: elegantly handle long service names in index.
Browse files Browse the repository at this point in the history
  • Loading branch information
bangn committed Jan 15, 2018
1 parent d3217c8 commit ad8da50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/pact_broker/ui/view_models/index_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -145,4 +145,4 @@ def short_version_number version_number
end
end
end
end
end
8 changes: 4 additions & 4 deletions lib/pact_broker/ui/views/index/show-with-tags.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 ", "")
Expand Down
6 changes: 6 additions & 0 deletions public/stylesheets/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
}

.table-striped>tbody>tr>td.consumer, .table-striped>thead>tr>th.consumer {
padding: 2px;
border-right: none;
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ad8da50

Please sign in to comment.