Skip to content

Commit 36948fe

Browse files
tancnlebethesque
authored andcommitted
fix: do not show clipboard icon if version is blank (pact-foundation#297)
1 parent c0d1ac7 commit 36948fe

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/pact_broker/ui/views/index/show-with-tags.haml

+6-4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
%td.consumer-version-number
4242
%div.clippable
4343
= escape_html(index_item.consumer_version_number)
44-
%button.clippy.invisible{ title: "Copy to clipboard" }
45-
%span.glyphicon.glyphicon-copy
44+
- if index_item.consumer_version_number
45+
%button.clippy.invisible{ title: "Copy to clipboard" }
46+
%span.glyphicon.glyphicon-copy
4647
- if index_item.latest?
4748
.tag.label.label-success
4849
latest
@@ -60,8 +61,9 @@
6061
%td.provider-version-number
6162
%div.clippable
6263
= escape_html(index_item.provider_version_number)
63-
%button.clippy.invisible{ title: "Copy to clipboard" }
64-
%span.glyphicon.glyphicon-copy
64+
- if index_item.provider_version_number
65+
%button.clippy.invisible{ title: "Copy to clipboard" }
66+
%span.glyphicon.glyphicon-copy
6567
- index_item.provider_version_latest_tag_names.each do | tag_name |
6668
.tag.label.label-primary
6769
= escape_html(tag_name)

lib/pact_broker/ui/views/matrix/show.haml

+6-4
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@
106106
%div.clippable
107107
%a{href: line.consumer_version_number_url}
108108
= line.display_consumer_version_number
109-
%button.clippy.invisible{ title: "Copy to clipboard" }
110-
%span.glyphicon.glyphicon-copy
109+
- if line.display_consumer_version_number
110+
%button.clippy.invisible{ title: "Copy to clipboard" }
111+
%span.glyphicon.glyphicon-copy
111112
- line.latest_consumer_version_tags.each do | tag |
112113
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
113114
%a{href: tag.url}
@@ -132,8 +133,9 @@
132133
%div.clippable
133134
%a{href: line.provider_version_number_url}
134135
= line.display_provider_version_number
135-
%button.clippy.invisible{ title: "Copy to clipboard" }
136-
%span.glyphicon.glyphicon-copy
136+
- if line.display_provider_version_number
137+
%button.clippy.invisible{ title: "Copy to clipboard" }
138+
%span.glyphicon.glyphicon-copy
137139
- line.latest_provider_version_tags.each do | tag |
138140
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
139141
%a{href: tag.url}

0 commit comments

Comments
 (0)