-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(matrix ui): don't show potentially confusing links for overwritt…
…en pact revisions
- Loading branch information
Showing
4 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'pact_broker/ui/view_models/matrix_line' | ||
|
||
module PactBroker | ||
module UI | ||
module ViewDomain | ||
class MatrixLines < Array | ||
|
||
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, line.provider_version_number] | ||
if line_group_ids.include?(line_group_id) | ||
line.overwritten = true | ||
else | ||
line_group_ids << line_group_id | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters