From fd6e1c990fa9bf42fb336de0d0f27945e2634a79 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 15 Mar 2018 15:11:40 +1100 Subject: [PATCH] feat(matrix ui): add tooltip explaining the situation when verification date is before pact publication date --- lib/pact_broker/ui/view_models/matrix_line.rb | 6 ++++++ lib/pact_broker/ui/views/matrix/show.haml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/ui/view_models/matrix_line.rb b/lib/pact_broker/ui/view_models/matrix_line.rb index 26f7b927a..719c3dfcd 100644 --- a/lib/pact_broker/ui/view_models/matrix_line.rb +++ b/lib/pact_broker/ui/view_models/matrix_line.rb @@ -175,6 +175,12 @@ def overwritten? def overwritten= overwritten @overwritten = overwritten end + + def inherited_verification_message + if @line[:verification_executed_at] && @line[:pact_created_at] > @line[:verification_executed_at] + "The verification date is before the pact publication date because this verification has been inherited from a previously verified pact with identical content." + end + end end end end diff --git a/lib/pact_broker/ui/views/matrix/show.haml b/lib/pact_broker/ui/views/matrix/show.haml index 02b9c9960..7042959e8 100644 --- a/lib/pact_broker/ui/views/matrix/show.haml +++ b/lib/pact_broker/ui/views/matrix/show.haml @@ -118,7 +118,7 @@ %a{href: tag.url} .tag.label.label-default = tag.name - %td.pact-published{'data-sort-value' => line.pact_published_order} + %td.pact-published{'data-sort-value' => line.pact_published_order, "title": line.inherited_verification_message, "data-toggle": "tooltip"} %a{href: line.pact_publication_date_url} - if options.all_rows_checked = "#{line.pact_publication_date} (revision #{line.pact_revision_number})" @@ -142,7 +142,7 @@ %a{href: tag.url} .tag.label.label-default = tag.name - %td.verification-result{class: line.verification_status_class} + %td.verification-result{class: line.verification_status_class, "title": line.inherited_verification_message, "data-toggle": "tooltip"} %a{href: line.verification_status_url} - if options.all_rows_checked = "#{line.verification_status} (number #{line.number})"