Skip to content

Commit cdeb2cd

Browse files
committed
feat: add helper text on index page for getting started
1 parent 941371e commit cdeb2cd

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

lib/pact_broker/ui/view_models/index_items.rb

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ def size_label
2121
end
2222
end
2323

24+
def empty?
25+
index_items.empty?
26+
end
27+
2428
private
2529

2630
attr_reader :index_items
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
%div.getting-started
2+
%h3 Welcome!
3+
%p
4+
Just getting started? Confused as to why there's nothing "clicky clicky" to see here? The Pact workflow is a "code first" approach. Your pacts will be generated by your consumer tests and then published here, ready to be retrieved by your provider tests for verification.
5+
%p
6+
For step by step instructions on getting started, check out the <a href="https://docs.pact.io/best_practices/pact_nirvana">Effective Pact Setup Guide</a>.

lib/pact_broker/ui/views/index/show-with-tags.haml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
%script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
44
.container
55
= render :haml, :'index/_navbar', :layout => false, locals: {tag_toggle: false}
6+
- if index_items.empty?
7+
= render :haml, :'index/_getting-started', :layout => false
68
%h1.page-header
79
Pacts
810
%table.table.table-bordered.table-striped{ id: 'relationships' }

lib/pact_broker/ui/views/index/show.haml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
%script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
44
.container
55
= render :haml, :'index/_navbar', :layout => false, locals: {tag_toggle: true}
6+
- if index_items.empty?
7+
= render :haml, :'index/_getting-started', :layout => false
68
%h1.page-header
79
Pacts
810
%table.table.table-bordered.table-striped{ id: 'relationships' }

public/stylesheets/index.css

+5
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,9 @@ table#relationships .label {
113113

114114
div.tag {
115115
display: inline-block;
116+
}
117+
118+
div.getting-started {
119+
max-width: 600px;
120+
margin-bottom: 50px;
116121
}

0 commit comments

Comments
 (0)