From 0ba5eda3f1b9884b5440652e4bc4f209f379bc34 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 10 Sep 2021 19:28:14 +1000 Subject: [PATCH] feat: update UI --- .../markdown/consumer_contract_renderer.rb | 6 +- lib/pact_broker/api/pact_broker_urls.rb | 2 +- .../api/renderers/html_pact_renderer.rb | 26 ++-- lib/pact_broker/locale/en.yml | 2 + lib/pact_broker/ui/app.rb | 8 +- lib/pact_broker/ui/controllers/dashboard.rb | 63 ++++++++ lib/pact_broker/ui/controllers/groups.rb | 28 +++- lib/pact_broker/ui/helpers/url_helper.rb | 2 +- lib/pact_broker/ui/views/dashboard/show.haml | 139 ++++++++++++++++++ lib/pact_broker/ui/views/groups/show.html.erb | 74 ++++++++-- .../ui/views/index/_dashboard_navbar.haml | 7 + lib/pact_broker/ui/views/index/_navbar.haml | 7 - lib/pact_broker/ui/views/index/show.haml | 31 ++-- lib/pact_broker/ui/views/matrix/show.haml | 10 +- public/javascripts/index.js | 45 ++---- public/javascripts/pact.js | 28 ++-- public/stylesheets/index.css | 3 +- public/stylesheets/pact.css | 11 ++ script/data/environments.rb | 0 19 files changed, 388 insertions(+), 104 deletions(-) create mode 100644 lib/pact_broker/ui/controllers/dashboard.rb create mode 100644 lib/pact_broker/ui/views/dashboard/show.haml create mode 100644 lib/pact_broker/ui/views/index/_dashboard_navbar.haml mode change 100644 => 100755 script/data/environments.rb diff --git a/lib/pact/doc/markdown/consumer_contract_renderer.rb b/lib/pact/doc/markdown/consumer_contract_renderer.rb index d344c2879..48e269ebf 100644 --- a/lib/pact/doc/markdown/consumer_contract_renderer.rb +++ b/lib/pact/doc/markdown/consumer_contract_renderer.rb @@ -24,7 +24,7 @@ def call attr_reader :consumer_contract def title - "### A pact between #{consumer_name} and #{provider_name}\n\n" + "# A pact between #{consumer_name} and #{provider_name}\n\n" end def interaction_renderers @@ -32,11 +32,11 @@ def interaction_renderers end def summaries_title - "#### Requests from #{consumer_name} to #{provider_name}\n\n" + "### Requests from #{consumer_name} to #{provider_name}\n\n" end def interactions_title - "#### Interactions\n\n" + "### Interactions\n\n" end def summaries diff --git a/lib/pact_broker/api/pact_broker_urls.rb b/lib/pact_broker/api/pact_broker_urls.rb index 3a06f4567..09221e2c5 100644 --- a/lib/pact_broker/api/pact_broker_urls.rb +++ b/lib/pact_broker/api/pact_broker_urls.rb @@ -311,7 +311,7 @@ def matrix_url_from_params params, base_url = "" end def group_url(pacticipant_name, base_url = "") - "#{base_url}/groups/#{url_encode(pacticipant_name)}" + "#{base_url}/pacticipants/#{url_encode(pacticipant_name)}" end def environments_url(base_url = "") diff --git a/lib/pact_broker/api/renderers/html_pact_renderer.rb b/lib/pact_broker/api/renderers/html_pact_renderer.rb index 5bfb0f71a..6d8607cee 100644 --- a/lib/pact_broker/api/renderers/html_pact_renderer.rb +++ b/lib/pact_broker/api/renderers/html_pact_renderer.rb @@ -29,7 +29,7 @@ def call " #{head} - #{pact_metadata}#{html} + #{breadcrumbs}#{pact_metadata}#{html} " end @@ -39,10 +39,10 @@ def call def head "#{title} - + @@ -53,6 +53,17 @@ def head " end + def breadcrumbs + " + + " + end + def pact_metadata "