From 222d8965a79cf9910a88dd31d1c662e371dd8dfb Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 29 Mar 2019 08:51:45 +1100 Subject: [PATCH] feat: add helper text on index page for getting started --- lib/pact_broker/ui/view_models/index_items.rb | 4 ++++ lib/pact_broker/ui/views/index/_getting-started.haml | 6 ++++++ lib/pact_broker/ui/views/index/show-with-tags.haml | 2 ++ lib/pact_broker/ui/views/index/show.haml | 2 ++ public/stylesheets/index.css | 5 +++++ 5 files changed, 19 insertions(+) create mode 100644 lib/pact_broker/ui/views/index/_getting-started.haml diff --git a/lib/pact_broker/ui/view_models/index_items.rb b/lib/pact_broker/ui/view_models/index_items.rb index 0d536f8cf..7aae3794e 100644 --- a/lib/pact_broker/ui/view_models/index_items.rb +++ b/lib/pact_broker/ui/view_models/index_items.rb @@ -21,6 +21,10 @@ def size_label end end + def empty? + index_items.empty? + end + private attr_reader :index_items diff --git a/lib/pact_broker/ui/views/index/_getting-started.haml b/lib/pact_broker/ui/views/index/_getting-started.haml new file mode 100644 index 000000000..3a0f1e5bd --- /dev/null +++ b/lib/pact_broker/ui/views/index/_getting-started.haml @@ -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 Effective Pact Setup Guide. \ No newline at end of file diff --git a/lib/pact_broker/ui/views/index/show-with-tags.haml b/lib/pact_broker/ui/views/index/show-with-tags.haml index 53fd93561..88f88b096 100644 --- a/lib/pact_broker/ui/views/index/show-with-tags.haml +++ b/lib/pact_broker/ui/views/index/show-with-tags.haml @@ -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' } diff --git a/lib/pact_broker/ui/views/index/show.haml b/lib/pact_broker/ui/views/index/show.haml index ff1544dd0..03b89d454 100644 --- a/lib/pact_broker/ui/views/index/show.haml +++ b/lib/pact_broker/ui/views/index/show.haml @@ -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' } diff --git a/public/stylesheets/index.css b/public/stylesheets/index.css index 189dbd6a8..de70ee559 100644 --- a/public/stylesheets/index.css +++ b/public/stylesheets/index.css @@ -113,4 +113,9 @@ table#relationships .label { div.tag { display: inline-block; +} + +div.getting-started { + max-width: 600px; + margin-bottom: 50px; } \ No newline at end of file