From 107fca2583bebf6e82fba157e0fc5efcc522d672 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 5 Feb 2018 11:16:33 +1100 Subject: [PATCH] feat(matrix ui): remove logic for hiding links until I can get it right --- lib/pact_broker/ui/view_models/matrix_line.rb | 6 +++++- lib/pact_broker/ui/view_models/matrix_lines.rb | 12 ------------ lib/pact_broker/ui/views/matrix/show.haml | 9 +++++---- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/pact_broker/ui/view_models/matrix_line.rb b/lib/pact_broker/ui/view_models/matrix_line.rb index fe6ad4411..d90115ff1 100644 --- a/lib/pact_broker/ui/view_models/matrix_line.rb +++ b/lib/pact_broker/ui/view_models/matrix_line.rb @@ -40,6 +40,10 @@ def number @line[:verification_number] end + def pact_revision_number + @line[:pact_revision_number] + end + def consumer_name @line[:consumer_name] end @@ -107,7 +111,7 @@ def other_provider_version_tags end def orderable_fields - [consumer_name, consumer_version_order, @line[:pact_revision_number], provider_name, @line[:verification_id]] + [consumer_name, consumer_version_order, pact_revision_number, provider_name, @line[:verification_id]] end def <=> other diff --git a/lib/pact_broker/ui/view_models/matrix_lines.rb b/lib/pact_broker/ui/view_models/matrix_lines.rb index a6b339856..f08285adb 100644 --- a/lib/pact_broker/ui/view_models/matrix_lines.rb +++ b/lib/pact_broker/ui/view_models/matrix_lines.rb @@ -9,19 +9,7 @@ def initialize rows lines = rows.collect do | row | PactBroker::UI::ViewDomain::MatrixLine.new(row) end - super(lines.sort) - - # Don't have a URL to view ovewritten pact revisions, so don't show a link for them until we do - line_group_ids = [] - each do | line | - line_group_id = [line.consumer_name, line.consumer_version_number, line.provider_name] - if line_group_ids.include?(line_group_id) - line.overwritten = true - else - line_group_ids << line_group_id - 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 584e6bd61..c7987740b 100644 --- a/lib/pact_broker/ui/views/matrix/show.haml +++ b/lib/pact_broker/ui/views/matrix/show.haml @@ -114,11 +114,12 @@ .tag.label.label-default = tag.name %td.pact-published{'data-sort-value' => line.pact_published_order} - - if !line.overwritten? - %a{href: line.pact_publication_date_url} + %a{href: line.pact_publication_date_url} + - if options.all_rows_checked + = "#{line.pact_publication_date} (revision #{line.pact_revision_number})" + - else = line.pact_publication_date - - else - = "#{line.pact_publication_date} (overwritten)" + %td.provider{'data-sort-value' => line.provider_name} %a{href: line.provider_name_url} = line.provider_name