Skip to content

Commit

Permalink
feat(integration dashboard): add copy buttons next to the branch, tag…
Browse files Browse the repository at this point in the history
… and environment labels
  • Loading branch information
bethesque committed Feb 21, 2022
1 parent 94bbf91 commit 5b86ac8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
3 changes: 3 additions & 0 deletions lib/pact_broker/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ en:
datetime:
distance_in_words:
half_a_minute: "half a minute"
less_than_x_minutes:
one: "less than 1 minute"
other: "less than %{count} minutes"
less_than_x_seconds:
one: "less than 1 second"
other: "less than %{count} seconds"
Expand Down
42 changes: 30 additions & 12 deletions lib/pact_broker/ui/views/dashboard/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,25 @@
%span.copy-icon
- if view == "branch" || view == "all"
- index_item.consumer_version_branch_heads.each do | branch_head |
%div{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
= "branch: " + ellipsisize(branch_head.branch_name)
%div.clippable{"data-clippable": branch_head.branch_name}
%div{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
= "branch: " + ellipsisize(branch_head.branch_name)
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.copy-icon
- if view == "tag" || view == "all"
- index_item.consumer_version_latest_tag_names.each do | tag_name |
.tag.badge.badge-primary
= "tag: " + ellipsisize(tag_name)
%div.clippable{"data-clippable": tag_name}
.tag.badge.badge-primary
= "tag: " + ellipsisize(tag_name)
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.copy-icon
- if view == "environment" || view == "all"
- index_item.consumer_version_environment_names.each do | environment_name |
.tag.badge.badge-success
= "env: " + ellipsisize(environment_name)
%div.clippable{"data-clippable": environment_name}
.tag.badge.badge-success
= "env: " + ellipsisize(environment_name)
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.copy-icon
- if view == "all" && index_item.display_latest_label? && index_item.latest?
.tag.badge.bg-light
latest
Expand All @@ -107,16 +116,25 @@
%span.copy-icon
- if view == "branch" || view == "all"
- index_item.provider_version_branch_heads.each do | branch_head |
%div{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
= "branch: " + ellipsisize(branch_head.branch_name)
%div.clippable{"data-clippable": branch_head.branch_name}
%div{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
= "branch: " + ellipsisize(branch_head.branch_name)
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.copy-icon
- if view == "tag" || view == "all"
- index_item.provider_version_latest_tag_names.each do | tag_name |
.tag.badge.badge-primary
= "tag: " + ellipsisize(tag_name)
%div.clippable{"data-clippable": tag_name}
.tag.badge.badge-primary
= "tag: " + ellipsisize(tag_name)
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.copy-icon
- if view == "environment" || view == "all"
- index_item.provider_version_environment_names.each do | environment_name |
.tag.badge.badge-success
= "env: " + ellipsisize(environment_name)
%div.clippable{"data-clippable": environment_name}
.tag.badge.badge-success
= "env: " + ellipsisize(environment_name)
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.copy-icon
%td.pact
%span.pact
%a{ href: index_item.pact_url, title: "View pact" }
Expand Down

0 comments on commit 5b86ac8

Please sign in to comment.