pact_broker 2.15.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +7 -3
  3. data/CHANGELOG.md +53 -0
  4. data/DEVELOPER_DOCUMENTATION.md +28 -1
  5. data/DEVELOPER_SETUP.md +1 -1
  6. data/README.md +8 -5
  7. data/db/migrations/000004_create_tags_table.rb +1 -1
  8. data/db/migrations/000050_create_latest_matrix.rb +1 -0
  9. data/db/migrations/20180122_create_head_pact_publications.rb +21 -0
  10. data/db/migrations/20180123_create_tags_with_latest_flag.rb +28 -0
  11. data/db/migrations/20180129_create_latest_matrix_for_cv_and_pv.rb +91 -0
  12. data/db/migrations/20180130_create_materialized_matrix.rb +35 -0
  13. data/db/migrations/20180131_create_materialized_latest_matrix.rb +35 -0
  14. data/db/migrations/20180201_create_head_matrix.rb +33 -0
  15. data/db/migrations/20180202_create_materialized_head_matrix.rb +34 -0
  16. data/db/migrations/20180203_fix_head_matrix.rb +36 -0
  17. data/db/migrations/20180204_fix_latest_matrix_for_cv_and_pv.rb +57 -0
  18. data/db/migrations/20180205_drop_materialized_latest_matrix.rb +36 -0
  19. data/db/migrations/20180206_recreate_head_matrix_rename_consumer_tag_name.rb +68 -0
  20. data/db/migrations/20180207_recreate_head_matrix_union_all.rb +60 -0
  21. data/db/migrations/20180208_add_cv_tag_name_index_to_mat_head_matrix.rb +7 -0
  22. data/db/migrations/20180209_recreate_latest_matrix_for_cv_and_pv_union_all.rb +54 -0
  23. data/db/migrations/20180210_fix_latest_matrix_for_cv_and_pv_again.rb +53 -0
  24. data/db/migrations/migration_helper.rb +8 -0
  25. data/db/test/backwards_compatibility/Rakefile +1 -1
  26. data/example/pact_broker_database.sqlite3 +0 -0
  27. data/lib/pact_broker/api.rb +1 -0
  28. data/lib/pact_broker/api/decorators/dashboard_decorator.rb +163 -0
  29. data/lib/pact_broker/api/decorators/dashboard_text_decorator.rb +50 -0
  30. data/lib/pact_broker/api/decorators/matrix_decorator.rb +21 -16
  31. data/lib/pact_broker/api/decorators/pacticipant_decorator.rb +1 -0
  32. data/lib/pact_broker/api/pact_broker_urls.rb +29 -0
  33. data/lib/pact_broker/api/resources/base_resource.rb +3 -0
  34. data/lib/pact_broker/api/resources/dashboard.rb +38 -0
  35. data/lib/pact_broker/api/resources/label.rb +0 -1
  36. data/lib/pact_broker/api/resources/tag.rb +0 -1
  37. data/lib/pact_broker/dashboard/service.rb +0 -0
  38. data/lib/pact_broker/domain/index_item.rb +16 -5
  39. data/lib/pact_broker/index/service.rb +69 -4
  40. data/lib/pact_broker/matrix/head_row.rb +11 -0
  41. data/lib/pact_broker/matrix/latest_row.rb +2 -16
  42. data/lib/pact_broker/matrix/repository.rb +56 -11
  43. data/lib/pact_broker/matrix/row.rb +166 -6
  44. data/lib/pact_broker/matrix/service.rb +5 -0
  45. data/lib/pact_broker/tags/tag_with_latest_flag.rb +18 -0
  46. data/lib/pact_broker/ui/controllers/index.rb +5 -2
  47. data/lib/pact_broker/ui/controllers/matrix.rb +3 -3
  48. data/lib/pact_broker/ui/view_models/index_item.rb +13 -5
  49. data/lib/pact_broker/ui/view_models/matrix_line.rb +77 -8
  50. data/lib/pact_broker/ui/view_models/matrix_lines.rb +17 -0
  51. data/lib/pact_broker/ui/view_models/matrix_tag.rb +42 -0
  52. data/lib/pact_broker/ui/views/index/show-with-tags.haml +26 -14
  53. data/lib/pact_broker/ui/views/index/show.haml +9 -8
  54. data/lib/pact_broker/ui/views/matrix/show.haml +46 -15
  55. data/lib/pact_broker/verifications/latest_verifications_by_consumer_version.rb +1 -0
  56. data/lib/pact_broker/verifications/repository.rb +4 -4
  57. data/lib/pact_broker/version.rb +1 -1
  58. data/lib/pact_broker/versions/abbreviate_number.rb +14 -0
  59. data/pact_broker.gemspec +3 -2
  60. data/public/images/logo@2x.png +0 -0
  61. data/public/javascripts/matrix.js +5 -0
  62. data/public/stylesheets/index.css +33 -1
  63. data/public/stylesheets/matrix.css +9 -0
  64. data/script/db-spec.sh +1 -1
  65. data/spec/features/get_dashboard_spec.rb +29 -0
  66. data/spec/fixtures/dashboard.json +83 -0
  67. data/spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb +89 -0
  68. data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +30 -26
  69. data/spec/lib/pact_broker/api/resources/dashboard_spec.rb +16 -0
  70. data/spec/lib/pact_broker/api/resources/group_spec.rb +1 -0
  71. data/spec/lib/pact_broker/index/service_spec.rb +146 -32
  72. data/spec/lib/pact_broker/matrix/repository_spec.rb +48 -1
  73. data/spec/lib/pact_broker/matrix/row_spec.rb +59 -0
  74. data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +17 -12
  75. data/spec/lib/pact_broker/versions/abbreviate_number_spec.rb +22 -0
  76. data/spec/migrations/20180201_create_head_matrix_spec.rb +132 -0
  77. data/spec/migrations/23_pact_versions_spec.rb +2 -2
  78. data/spec/migrations/50_create_latest_matrix_spec.rb +84 -16
  79. data/spec/migrations/change_migration_strategy_spec.rb +1 -1
  80. data/spec/service_consumers/pact_helper.rb +4 -1
  81. data/spec/spec_helper.rb +1 -0
  82. data/spec/support/migration_helpers.rb +1 -1
  83. data/spec/support/rspec_match_hash.rb +6 -2
  84. data/spec/support/shared_examples_for_responses.rb +1 -1
  85. data/spec/support/test_data_builder.rb +61 -11
  86. metadata +57 -6
@@ -1,4 +1,5 @@
1
1
  require 'pact_broker/repositories'
2
+ require 'pact_broker/matrix/row'
2
3
 
3
4
  module PactBroker
4
5
  module Matrix
@@ -8,6 +9,10 @@ module PactBroker
8
9
  extend PactBroker::Repositories
9
10
  extend PactBroker::Services
10
11
 
12
+ def refresh params
13
+ matrix_repository.refresh params
14
+ end
15
+
11
16
  def find criteria, options = {}
12
17
  matrix_repository.find criteria, options
13
18
  end
@@ -0,0 +1,18 @@
1
+ require 'pact_broker/db'
2
+ require 'pact_broker/repositories/helpers'
3
+
4
+ module PactBroker
5
+ module Tags
6
+ # The tag associated with the latest verification for a given tag
7
+ class TagWithLatestFlag < Sequel::Model(:tags_with_latest_flag)
8
+
9
+ dataset_module do
10
+ include PactBroker::Repositories::Helpers
11
+ end
12
+
13
+ def latest?
14
+ !values[:latest].nil?
15
+ end
16
+ end
17
+ end
18
+ end
@@ -10,9 +10,12 @@ module PactBroker
10
10
  include PactBroker::Services
11
11
 
12
12
  get "/" do
13
- tags = params[:tags] == 'true' ? true : [*params[:tags]].compact
13
+ tags = nil
14
+ if params[:tags]
15
+ tags = params[:tags] == 'true' ? true : [*params[:tags]].compact
16
+ end
14
17
  view_model = ViewDomain::IndexItems.new(index_service.find_index_items(tags: tags))
15
- page = tags == true || tags.any? ? :'index/show-with-tags' : :'index/show'
18
+ page = tags ? :'index/show-with-tags' : :'index/show'
16
19
  haml page, {locals: {index_items: view_model, title: "Pacts"}, layout: :'layouts/main'}
17
20
  end
18
21
 
@@ -1,5 +1,5 @@
1
1
  require 'pact_broker/ui/controllers/base_controller'
2
- require 'pact_broker/ui/view_models/matrix_line'
2
+ require 'pact_broker/ui/view_models/matrix_lines'
3
3
  require 'pact_broker/matrix/parse_query'
4
4
  require 'pact_broker/logging'
5
5
  require 'haml'
@@ -29,7 +29,7 @@ module PactBroker
29
29
  errors = matrix_service.validate_selectors(selectors)
30
30
  if errors.empty?
31
31
  lines = matrix_service.find(selectors, options)
32
- locals[:lines] = lines.collect{ |line| PactBroker::UI::ViewDomain::MatrixLine.new(line) }
32
+ locals[:lines] = PactBroker::UI::ViewDomain::MatrixLines.new(lines)
33
33
  else
34
34
  locals[:errors] = errors
35
35
  end
@@ -45,7 +45,7 @@ module PactBroker
45
45
  selectors = [{ pacticipant_name: params[:consumer_name] }, { pacticipant_name: params[:provider_name] } ]
46
46
  options = {latestby: 'cvpv', limit: 100}
47
47
  lines = matrix_service.find(selectors, options)
48
- lines = lines.collect{ |line| PactBroker::UI::ViewDomain::MatrixLine.new(line) }.sort
48
+ lines = PactBroker::UI::ViewDomain::MatrixLines.new(lines)
49
49
  locals = {
50
50
  lines: lines,
51
51
  title: "The Matrix",
@@ -1,6 +1,7 @@
1
1
  require 'pact_broker/api/pact_broker_urls'
2
2
  require 'pact_broker/ui/helpers/url_helper'
3
3
  require 'pact_broker/date_helper'
4
+ require 'pact_broker/versions/abbreviate_number'
4
5
 
5
6
  module PactBroker
6
7
  module UI
@@ -22,16 +23,23 @@ module PactBroker
22
23
  end
23
24
 
24
25
  def consumer_version_number
25
- @relationship.consumer_version_number
26
+ PactBroker::Versions::AbbreviateNumber.call(@relationship.consumer_version_number)
26
27
  end
27
28
 
28
29
  def provider_version_number
29
- @relationship.provider_version_number
30
+ PactBroker::Versions::AbbreviateNumber.call(@relationship.provider_version_number)
30
31
  end
31
32
 
32
- def tag_names
33
- latest_overall = @relationship.latest? ? "latest & " : ""
34
- @relationship.tag_names.any? ? " (#{latest_overall}latest #{@relationship.tag_names.join(', ')}) ": " (latest) "
33
+ def latest?
34
+ @relationship.latest?
35
+ end
36
+
37
+ def consumer_version_latest_tag_names
38
+ @relationship.tag_names
39
+ end
40
+
41
+ def provider_version_latest_tag_names
42
+ @relationship.latest_verification_latest_tags.collect(&:name)
35
43
  end
36
44
 
37
45
  def consumer_group_url
@@ -1,6 +1,8 @@
1
1
  require 'pact_broker/api/pact_broker_urls'
2
2
  require 'pact_broker/ui/helpers/url_helper'
3
3
  require 'pact_broker/date_helper'
4
+ require 'pact_broker/ui/view_models/matrix_tag'
5
+ require 'pact_broker/versions/abbreviate_number'
4
6
 
5
7
  module PactBroker
6
8
  module UI
@@ -11,23 +13,36 @@ module PactBroker
11
13
 
12
14
  def initialize line
13
15
  @line = line
16
+ @overwritten = false # true if the pact was revised and this revision is no longer the latest
14
17
  end
15
18
 
16
19
  def provider_name
17
20
  @line[:provider_name]
18
21
  end
19
22
 
23
+ def provider_name_url
24
+ hal_browser_url(pacticipant_url_from_params(pacticipant_name: provider_name))
25
+ end
26
+
20
27
  def consumer_name
21
28
  @line[:consumer_name]
22
29
  end
23
30
 
31
+ def consumer_name_url
32
+ hal_browser_url(pacticipant_url_from_params(pacticipant_name: consumer_name))
33
+ end
34
+
24
35
  def pact_version_sha
25
36
  @line[:pact_version_sha]
26
37
  end
27
38
 
28
- # verification number
39
+ # verification number, used in verification_url method
29
40
  def number
30
- @line[:number]
41
+ @line[:verification_number]
42
+ end
43
+
44
+ def pact_revision_number
45
+ @line[:pact_revision_number]
31
46
  end
32
47
 
33
48
  def consumer_name
@@ -38,8 +53,13 @@ module PactBroker
38
53
  @line[:consumer_version_number]
39
54
  end
40
55
 
56
+ def display_consumer_version_number
57
+ PactBroker::Versions::AbbreviateNumber.call(consumer_version_number)
58
+ end
59
+
41
60
  def consumer_version_number_url
42
- pact_url_from_params('', @line)
61
+ params = { pacticipant_name: consumer_name, version_number: consumer_version_number }
62
+ hal_browser_url(version_url_from_params(params))
43
63
  end
44
64
 
45
65
  def consumer_version_order
@@ -54,24 +74,53 @@ module PactBroker
54
74
  @line[:provider_version_number]
55
75
  end
56
76
 
77
+ def display_provider_version_number
78
+ PactBroker::Versions::AbbreviateNumber.call(provider_version_number)
79
+ end
80
+
57
81
  def provider_version_order
58
82
  @line[:provider_version_order]
59
83
  end
60
84
 
61
85
  def provider_version_number_url
62
- hal_browser_url(verification_url(self))
86
+ params = { pacticipant_name: provider_name, version_number: provider_version_number }
87
+ hal_browser_url(version_url_from_params(params))
63
88
  end
64
89
 
65
90
  def provider_version_order
66
- if @line[:execution_date]
67
- @line[:execution_date].to_time.to_i
91
+ if @line[:verification_executed_at]
92
+ @line[:verification_executed_at].to_time.to_i
68
93
  else
69
94
  0
70
95
  end
71
96
  end
72
97
 
98
+ def latest_consumer_version_tags
99
+ @line[:consumer_version_tags]
100
+ .select{ | tag | tag[:latest] }
101
+ .collect{ | tag | MatrixTag.new(tag.to_hash.merge(pacticipant_name: consumer_name, version_number: consumer_version_number)) }
102
+ end
103
+
104
+ def other_consumer_version_tags
105
+ @line[:consumer_version_tags]
106
+ .select{ | tag | !tag[:latest] }
107
+ .collect{ | tag | MatrixTag.new(tag.to_hash.merge(pacticipant_name: consumer_name, version_number: consumer_version_number)) }
108
+ end
109
+
110
+ def latest_provider_version_tags
111
+ @line[:provider_version_tags]
112
+ .select{ | tag | tag[:latest] }
113
+ .collect{ | tag | MatrixTag.new(tag.to_hash.merge(pacticipant_name: provider_name, version_number: provider_version_number)) }
114
+ end
115
+
116
+ def other_provider_version_tags
117
+ @line[:provider_version_tags]
118
+ .select{ | tag | !tag[:latest] }
119
+ .collect{ | tag | MatrixTag.new(tag.to_hash.merge(pacticipant_name: provider_name, version_number: provider_version_number)) }
120
+ end
121
+
73
122
  def orderable_fields
74
- [consumer_name, consumer_version_order, @line[:pact_revision_number], provider_name, @line[:verification_id]]
123
+ [consumer_name, consumer_version_order, pact_revision_number, provider_name, @line[:verification_id]]
75
124
  end
76
125
 
77
126
  def <=> other
@@ -91,8 +140,20 @@ module PactBroker
91
140
  # end
92
141
  end
93
142
 
143
+ def verification_status_url
144
+ hal_browser_url(verification_url(self))
145
+ end
146
+
94
147
  def pact_publication_date
95
- DateHelper.distance_of_time_in_words(@line[:pact_created_at], DateTime.now) + " ago"
148
+ relative_date(@line[:pact_created_at])
149
+ end
150
+
151
+ def pact_publication_date_url
152
+ pact_url_from_params('', @line)
153
+ end
154
+
155
+ def relative_date date
156
+ DateHelper.distance_of_time_in_words(date, DateTime.now) + " ago"
96
157
  end
97
158
 
98
159
  def pact_published_order
@@ -106,6 +167,14 @@ module PactBroker
106
167
  else ''
107
168
  end
108
169
  end
170
+
171
+ def overwritten?
172
+ @overwritten
173
+ end
174
+
175
+ def overwritten= overwritten
176
+ @overwritten = overwritten
177
+ end
109
178
  end
110
179
  end
111
180
  end
@@ -0,0 +1,17 @@
1
+ require 'pact_broker/ui/view_models/matrix_line'
2
+
3
+ module PactBroker
4
+ module UI
5
+ module ViewDomain
6
+ class MatrixLines < Array
7
+
8
+ def initialize rows
9
+ lines = rows.collect do | row |
10
+ PactBroker::UI::ViewDomain::MatrixLine.new(row)
11
+ end
12
+ super(lines.sort)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,42 @@
1
+ require 'pact_broker/api/pact_broker_urls'
2
+ require 'pact_broker/ui/helpers/url_helper'
3
+ require 'pact_broker/date_helper'
4
+
5
+ module PactBroker
6
+ module UI
7
+ module ViewDomain
8
+ class MatrixTag
9
+
10
+ include PactBroker::Api::PactBrokerUrls
11
+
12
+ def initialize params
13
+ @params = params
14
+ @name = params[:name]
15
+ @version_number = params[:version_number]
16
+ @created_at = params[:created_at]
17
+ @latest = !!params[:latest]
18
+ end
19
+
20
+ def name
21
+ @params[:name]
22
+ end
23
+
24
+ def tooltip
25
+ if @latest
26
+ "Version #{@version_number} is the latest version with tag #{@name}. Tag created #{relative_date(@created_at)}."
27
+ else
28
+ "Tag created #{relative_date(@created_at)}."
29
+ end
30
+ end
31
+
32
+ def url
33
+ hal_browser_url("/pacticipants/#{ERB::Util.url_encode(@params[:pacticipant_name])}/versions/#{@params[:version_number]}/tags/#{@params[:name]}")
34
+ end
35
+
36
+ def relative_date date
37
+ DateHelper.distance_of_time_in_words(date, DateTime.now) + " ago"
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -4,15 +4,16 @@
4
4
  %script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'}
5
5
  %script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
6
6
  %script{type: 'text/javascript', src:'/js/bootstrap.min.js'}
7
- %nav.navbase-default.navbar-right{role: "navigation"}
8
- .container
9
- %ul.navbar-right#top-left-menu
10
- %li
11
- %a{href: './'}
12
- Hide latest tags
13
- %a{ href: '/hal-browser/browser.html' }
14
- API Browser
15
7
  .container
8
+ %nav.navbase-default{role: "navigation", id: "navigation"}
9
+ .container-fluid
10
+ .navbar-header
11
+ %ul.navbar-right#top-left-menu
12
+ %li
13
+ %a{href: './'}
14
+ Hide latest tags
15
+ %a{href: '/hal-browser/browser.html'}
16
+ API Browser
16
17
  %h1.page-header
17
18
  Pacts
18
19
  %table.table.table-bordered.table-striped{ id: 'relationships' }
@@ -21,21 +22,23 @@
21
22
  Consumer
22
23
  %span.glyphicon.glyphicon-sort.relationships-sort
23
24
  %th.consumer-version-number
24
- Version
25
+ Consumer<br>Version
25
26
  %span.glyphicon.glyphicon-sort.relationships-sort
26
27
  %th.pact{ style: 'width: 40px' }
27
28
  %th.provider
28
29
  Provider
29
30
  %span.glyphicon.glyphicon-sort.relationships-sort
30
31
  %th.provider-version-number
31
- Version
32
+ Provider<br>Version
32
33
  %span.glyphicon.glyphicon-sort.relationships-sort
33
34
  %th
34
35
  Published
36
+ %span.glyphicon.glyphicon-sort.relationships-sort
35
37
  %th
36
38
  Webhook<br>status
37
39
  %th
38
40
  Last<br>verified
41
+ %span.glyphicon.glyphicon-sort.relationships-sort
39
42
  %tbody
40
43
 
41
44
  - index_items.each do | index_item |
@@ -44,9 +47,14 @@
44
47
  %a{:href => index_item.consumer_group_url }
45
48
  = index_item.consumer_name
46
49
  %td.consumer-version-number
47
- = index_item.consumer_version_number
48
- %span{style: 'color:gray'}
49
- = index_item.tag_names
50
+ %div
51
+ = index_item.consumer_version_number
52
+ - if index_item.latest?
53
+ .tag.label.label-success
54
+ latest
55
+ - index_item.consumer_version_latest_tag_names.each do | tag_name |
56
+ .tag.label.label-primary
57
+ = tag_name
50
58
  %td.pact
51
59
  %span.pact
52
60
  %a{ href: index_item.pact_url, title: "View pact" }
@@ -56,7 +64,11 @@
56
64
  %a{ href: index_item.provider_group_url }
57
65
  = index_item.provider_name
58
66
  %td.provider-version-number
59
- = index_item.provider_version_number
67
+ %div
68
+ = index_item.provider_version_number
69
+ - index_item.provider_version_latest_tag_names.each do | tag_name |
70
+ .tag.label.label-primary
71
+ = tag_name
60
72
  %td
61
73
  = index_item.publication_date_of_latest_pact.gsub("about ", "")
62
74
  %td{ class: index_item.webhook_status }
@@ -4,15 +4,16 @@
4
4
  %script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'}
5
5
  %script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
6
6
  %script{type: 'text/javascript', src:'/js/bootstrap.min.js'}
7
- %nav.navbase-default.navbar-right{role: "navigation"}
8
- .container
9
- %ul#top-left-menu
10
- %li.navbar-right
11
- %a{href: './?tags=true'}
12
- Show latest tags
13
- %a{ href: '/hal-browser/browser.html' }
14
- API Browser
15
7
  .container
8
+ %nav.navbase-default{role: "navigation", id: "navigation"}
9
+ .container-fluid
10
+ .navbar-header
11
+ %ul.navbar-right#top-left-menu
12
+ %li
13
+ %a{href: './?tags=true'}
14
+ Show latest tags
15
+ %a{href: '/hal-browser/browser.html'}
16
+ API Browser
16
17
  %h1.page-header
17
18
  Pacts
18
19
  %table.table.table-bordered.table-striped{ id: 'relationships' }
@@ -56,17 +56,17 @@
56
56
  .input-group
57
57
  %input{type: 'radio', name: "latestby", class: '', value: 'cvpv', id: 'cvpv', checked: options.cvpv_checked}
58
58
  %label{for: 'cvpv'}
59
- Show latest row for each consumer version/provider version
59
+ Show latest result for each consumer version/provider version
60
60
  %div
61
61
  .input-group
62
62
  %input{type: 'radio', name: "latestby", class: '', value: 'cvp', id: 'cvp', checked: options.cvp_checked}
63
63
  %label{for: 'cvp'}
64
- Show latest row for each consumer version/provider
64
+ Show latest result for each consumer version/provider
65
65
  %div
66
66
  .input-group
67
67
  %input{type: 'radio', name: "latestby", class: '', value: '', id: 'all_rows', checked: options.all_rows_checked}
68
68
  %label{for: 'all_rows'}
69
- Show all rows
69
+ Show all results
70
70
  %div.top-of-group
71
71
  %label{for: "limit"}
72
72
  Limit
@@ -75,14 +75,15 @@
75
75
  %input{type: 'submit'}
76
76
 
77
77
 
78
-
78
+ %p{style: 'text-align:right'}
79
+ = "#{lines.size} rows"
79
80
  %table.table.table-bordered.table-striped{id: 'matrix'}
80
81
  %thead
81
82
  %th.consumer
82
83
  = "Consumer"
83
84
  %span.glyphicon.glyphicon-sort.sort
84
85
  %th.consumer-version
85
- = "Version"
86
+ = "Consumer Version"
86
87
  %span.glyphicon.glyphicon-sort.sort
87
88
  %th.pact-published
88
89
  = "Pact Published"
@@ -91,7 +92,7 @@
91
92
  = "Provider"
92
93
  %span.glyphicon.glyphicon-sort.sort
93
94
  %th.provider-version
94
- = "Version"
95
+ = "Provider Version"
95
96
  %span.glyphicon.glyphicon-sort.sort
96
97
  %th.verification-result
97
98
  Pact verified
@@ -100,16 +101,46 @@
100
101
  - lines.each do | line |
101
102
  %tr
102
103
  %td.consumer{'data-sort-value' => line.consumer_name}
103
- = line.consumer_name
104
+ %a{href: line.consumer_name_url}
105
+ = line.consumer_name
104
106
  %td.consumer-version{'data-sort-value' => line.consumer_version_order}
105
- %a{href: line.consumer_version_number_url}
106
- = line.consumer_version_number
107
+ %div
108
+ %a{href: line.consumer_version_number_url}
109
+ = line.display_consumer_version_number
110
+ - line.latest_consumer_version_tags.each do | tag |
111
+ .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
112
+ %a{href: tag.url}
113
+ .tag.label.label-primary
114
+ = tag.name
115
+ - line.other_consumer_version_tags.each do | tag |
116
+ .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
117
+ %a{href: tag.url}
118
+ .tag.label.label-default
119
+ = tag.name
107
120
  %td.pact-published{'data-sort-value' => line.pact_published_order}
108
- = line.pact_publication_date
109
- %td.provider{'data-sort-value' => line.provider_version_order}
110
- = line.provider_name
121
+ %a{href: line.pact_publication_date_url}
122
+ - if options.all_rows_checked
123
+ = "#{line.pact_publication_date} (revision #{line.pact_revision_number})"
124
+ - else
125
+ = line.pact_publication_date
126
+
127
+ %td.provider{'data-sort-value' => line.provider_name}
128
+ %a{href: line.provider_name_url}
129
+ = line.provider_name
111
130
  %td.provider-version{'data-sort-value' => line.provider_version_order}
112
- %a{href: line.provider_version_number_url}
113
- = line.provider_version_number
131
+ %div
132
+ %a{href: line.provider_version_number_url}
133
+ = line.display_provider_version_number
134
+ - line.latest_provider_version_tags.each do | tag |
135
+ .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
136
+ %a{href: tag.url}
137
+ .tag.label.label-primary
138
+ = tag.name
139
+ - line.other_provider_version_tags.each do | tag |
140
+ .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
141
+ %a{href: tag.url}
142
+ .tag.label.label-default
143
+ = tag.name
114
144
  %td.verification-result{class: line.verification_status_class}
115
- = line.verification_status
145
+ %a{href: line.verification_status_url}
146
+ = line.verification_status