From fcff302d555adf8ca59fe8235c35e06c9e5368b7 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Mon, 17 Jun 2019 15:30:37 +1000 Subject: [PATCH] =?UTF-8?q?Bring=20back=20=E2=80=98Shop=20for=20X=20produc?= =?UTF-8?q?ts=20at:=E2=80=99=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2112 It looks like this bug was accidentally introduced during a refactor in e5ca494db83e067f6f6863619561d5e7e8206bbd. The `bo-html` attribute was replaced with `ng-html`, but it appears that it should actually have used `ng-bind-html` (https://docs.angularjs.org/api/ng/directive/ngBindHtml) because the former is not a valid AngularJS directive. It was also necessary to bubble up the `.cta-container` class in order to get the appropriate styling on the title. --- .../templates/partials/producer_details.html.haml | 6 +++--- spec/features/consumer/shops_spec.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/templates/partials/producer_details.html.haml b/app/assets/javascripts/templates/partials/producer_details.html.haml index bca20e44b7..a617598433 100644 --- a/app/assets/javascripts/templates/partials/producer_details.html.haml +++ b/app/assets/javascripts/templates/partials/producer_details.html.haml @@ -2,14 +2,14 @@ -# Do not show this for producer shops selling only their own produce, -# Since a shopping link will already have been displayed in hub_details.html.haml .row.active_table_row.pad-top{ "ng-if" => "enterprise.is_primary_producer && enterprise.hubs.length > 0 && !(enterprise.hubs.length == 1 && enterprise.hubs[0] == enterprise)"} - .columns.small-12 + .columns.small-12.cta-container .row .columns.small-12.fat %div{"ng-if" => "::enterprise.name"} - %label{"ng-html" => "::'shop_for_products_html' | t:{enterprise: enterprise.name}"} + %label{"ng-bind-html" => "::'shop_for_products_html' | t:{enterprise: enterprise.name}"} %div.show-for-medium-up{"ng-if" => "::!enterprise.name"}   - .row.cta-container + .row .columns.small-12 %a.cta-hub{"ng-repeat" => "hub in enterprise.hubs | filter:{id: '!'+enterprise.id} | orderBy:'-active'", "ng-href" => "{{::hub.path}}", "ofn-empties-cart" => "hub", diff --git a/spec/features/consumer/shops_spec.rb b/spec/features/consumer/shops_spec.rb index ea919341eb..2fc17abb13 100644 --- a/spec/features/consumer/shops_spec.rb +++ b/spec/features/consumer/shops_spec.rb @@ -186,6 +186,7 @@ feature 'Shops', js: true do within ".reveal-modal" do expect(page).to have_content 'Fruit' # Taxon expect(page).to have_content 'Organic' # Producer property + expect(page).to have_content "Shop for #{producer.name} products at:".upcase end end end