Skip to content

Commit

Permalink
feat(matrix ui): remove logic for hiding links until I can get it right
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Feb 5, 2018
1 parent 2b71355 commit 107fca2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
6 changes: 5 additions & 1 deletion lib/pact_broker/ui/view_models/matrix_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions lib/pact_broker/ui/view_models/matrix_lines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions lib/pact_broker/ui/views/matrix/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 107fca2

Please sign in to comment.