Skip to content

Commit

Permalink
feat: add helper text on index page for getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Mar 28, 2019
1 parent b43e60e commit 222d896
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/pact_broker/ui/view_models/index_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def size_label
end
end

def empty?
index_items.empty?
end

private

attr_reader :index_items
Expand Down
6 changes: 6 additions & 0 deletions lib/pact_broker/ui/views/index/_getting-started.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
%div.getting-started
%h3 Welcome!
%p
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.
%p
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>.
2 changes: 2 additions & 0 deletions lib/pact_broker/ui/views/index/show-with-tags.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
%script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
.container
= render :haml, :'index/_navbar', :layout => false, locals: {tag_toggle: false}
- if index_items.empty?
= render :haml, :'index/_getting-started', :layout => false
%h1.page-header
Pacts
%table.table.table-bordered.table-striped{ id: 'relationships' }
Expand Down
2 changes: 2 additions & 0 deletions lib/pact_broker/ui/views/index/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
%script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
.container
= render :haml, :'index/_navbar', :layout => false, locals: {tag_toggle: true}
- if index_items.empty?
= render :haml, :'index/_getting-started', :layout => false
%h1.page-header
Pacts
%table.table.table-bordered.table-striped{ id: 'relationships' }
Expand Down
5 changes: 5 additions & 0 deletions public/stylesheets/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,9 @@ table#relationships .label {

div.tag {
display: inline-block;
}

div.getting-started {
max-width: 600px;
margin-bottom: 50px;
}

0 comments on commit 222d896

Please sign in to comment.