From f7bea07fde9974d79f2680611eca3dd48abdb003 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 15 Mar 2018 14:37:46 +1100 Subject: [PATCH] feat(matrix ui): change default to show all results --- lib/pact_broker/ui/controllers/matrix.rb | 4 ++-- lib/pact_broker/ui/views/matrix/show.haml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pact_broker/ui/controllers/matrix.rb b/lib/pact_broker/ui/controllers/matrix.rb index c9b0de588..0e364cc20 100644 --- a/lib/pact_broker/ui/controllers/matrix.rb +++ b/lib/pact_broker/ui/controllers/matrix.rb @@ -13,7 +13,7 @@ class Matrix < Base get "/" do selectors = [OpenStruct.new, OpenStruct.new] - options = { limit: 100, latestby: 'cvpv' } + options = { limit: 100, latestby: nil } locals = { lines: [], title: "The Matrix", @@ -42,7 +42,7 @@ class Matrix < Base get "/provider/:provider_name/consumer/:consumer_name" do selectors = [{ pacticipant_name: params[:consumer_name] }, { pacticipant_name: params[:provider_name] } ] - options = {latestby: 'cvpv', limit: 100} + options = {latestby: nil, limit: 100} lines = matrix_service.find(selectors, options) lines = PactBroker::UI::ViewDomain::MatrixLines.new(lines) locals = { diff --git a/lib/pact_broker/ui/views/matrix/show.haml b/lib/pact_broker/ui/views/matrix/show.haml index 50c657cf1..02b9c9960 100644 --- a/lib/pact_broker/ui/views/matrix/show.haml +++ b/lib/pact_broker/ui/views/matrix/show.haml @@ -53,6 +53,11 @@ %input{name: 'q[]latest', value: 'true', hidden: true, class: 'latest-flag'} %div.top-of-group + .input-group + %input{type: 'radio', name: "latestby", class: '', value: '', id: 'all_rows', checked: options.all_rows_checked} + %label{for: 'all_rows'} + Show all results + %div .input-group %input{type: 'radio', name: "latestby", class: '', value: 'cvpv', id: 'cvpv', checked: options.cvpv_checked} %label{for: 'cvpv'} @@ -62,11 +67,6 @@ %input{type: 'radio', name: "latestby", class: '', value: 'cvp', id: 'cvp', checked: options.cvp_checked} %label{for: 'cvp'} Show latest result for each consumer version/provider - %div - .input-group - %input{type: 'radio', name: "latestby", class: '', value: '', id: 'all_rows', checked: options.all_rows_checked} - %label{for: 'all_rows'} - Show all results %div.top-of-group - limit_text = "Note that the 'Show latest...' options are summaries of the 'Show all results' query, and that the limit applies to the underlying query, rather than the number of rows returned in the summary." %label{for: "limit", "title": limit_text, "data-toggle": "tooltip", "data-placement": "right"}